How to get data from multiple data in AX 2012

Dear Master 

I had a data in table excel like below :

I want insert into only one data (for SO no: 1)  to header and then item into line. How to create logic in ax 2012 (x++) ? 

After data inserted, I want to do post each SO (for SO no : 1 )

please give your suggestion