Skip to Content
0
Former Member
Mar 09, 2007 at 08:59 PM

BAPI_SALES_ORDER_CREATEFROMDAT2

28 Views

Greetings,

I'm having a little difficulty with my BPM for my call to a wrapper RFC that eventually calls the sales order BAPI mentioned in my subject. I'm not sure what type of loop I need to loop through my incoming file.

I'm currently mapping the incoming file to a subsequent data structure to add an order count and a total order count to each line... so I can identify where I need to split. I can also map individual orders with their line items into another subsequent structure... grouped together... although I'm not sure I want this.

Can someone point me towards the right blog... or give me a general set of steps I'd need to loop through each set of orders and individually call the RFC....

Here is an example of my data structure after inbound file content conversion and the addition of the counters

<Item>

<Line>BH Order One Header</Line>

<Order_Count>1</Order_Count>

<Total_Orders>3</Total_Orders>

</Item>

<Item>

<Line>DL Order One Item One</Line>

<Order_Count>1</Order_Count>

<Total_Orders>3</Total_Orders>

</Item>

<Item>

<Line>BH Order Two Header</Line>

<Order_Count>2</Order_Count>

<Total_Orders>3</Total_Orders>

</Item>

<Item>

<Line>DL Order Two Item One</Line>

<Order_Count>2</Order_Count>

<Total_Orders>3</Total_Orders>

</Item>

<Item>

<Line>DL Order Two Item Two</Line>

<Order_Count>2</Order_Count>

<Total_Orders>3</Total_Orders>

</Item>

<Item>

<Line>BH Order Three Header</Line>

<Order_Count>3</Order_Count>

<Total_Orders>3</Total_Orders>

</Item>

<Item>

<Line>DL Order Three Item One</Line>

<Order_Count>3</Order_Count>

<Total_Orders>3</Total_Orders>

</Item>

<Item>

<Line>DL Order Three Item Two</Line>

<Order_Count>3</Order_Count>

<Total_Orders>3</Total_Orders>

</Item>

<Item>

<Line>DL Order Three Item Three</Line>

<Order_Count>3</Order_Count>

<Total_Orders>3</Total_Orders>

</Item>

I can map into the following structure... which is how I want to call the BAPI... but I can't seem to loop through my data... and I'm not really sure I want to do this grouping inside my message mapping... or inside my BPM...

<ns1:MT_IPO_Merge xmlns:ns1="http://IPO/G51">

<Line>BH001 Order One Header</Line>

<Line>DL Order One Item One</Line>

<Id>1</Id>

</ns1:MT_IPO_Merge>

<ns1:MT_IPO_Merge xmlns:ns1="http://IPO/G51">

<Line>BH002 Order Two Header</Line>

<Line>DL Order Two Item One</Line>

<Line>DL Order Two Item Two</Line>

<Id>2</Id>

</ns1:MT_IPO_Merge>

<ns1:MT_IPO_Merge xmlns:ns1="http://IPO/G51">

<Line>BH003 Order Three Header</Line>

<Line>DL Order Three Item One</Line>

<Line>DL Order Three Item Two</Line>

<Line>DL Order Three Item Three</Line>

<Id>3</Id>

</ns1:MT_IPO_Merge>

Please advise...

Doug -

File structure looks like this.

BH Header line 1

DL line item detail.

DL line item detail

BH Header line 2

DL line item detail

DL line item detail