cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI_SALES_ORDER_CREATEFROMDAT2

former_member196064
Active Participant
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

prabhu_s2
Active Contributor
0 Kudos

inside the bpm use BLOCK step. it will have access from a mutliline container and inside the block one send step for rfc call !!! ....u need a ParForEach block to implement a loop.

http://help.sap.com/saphelp_nw04/helpdata/en/ce/bb2c421f3fda2ce10000000a1550b0/content.htm

You can have a lokk at BpmPatternMulticastParallel in http://sap.com/xi/XI/System/Patterns name sapce under SAP basis 6.40. for using parforeach block.

Message was edited by:

Prabhu S

Answers (1)

Answers (1)

former_member196064
Active Participant
0 Kudos

Thanks Prabhu,

Works like a charm using the parfor each... once I straightened out my mappings prior to and on the way into the block.

Is there a faster way to do this?

Any ideas... I know I have to wait on the response from the RFC... but I've heard that the block is a little resource intensive.

Thanks again for your help,

Doug -