Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Regarding Creation of Multiple SO base on Single Incoming PO Idoc

Former Member
0 Kudos

Hi All,

I have the below requirement:-

When we receive an incoming Idoc with PO data we have to create the sales order based on the

items material group in the PO i.e, if the line items have different material group then we have to create

different sales order for those items.

E.g.) If Incoming PO Idoc is having 3 items with all of them having different material group then we have to create 3 sales order

         by splitting the data from this single incoming Idoc.

        If Incoming PO Idoc is having 3 item out of which 2 have same material group then we have to create 2 sales order, 1 that will

        have the 2 items that have same material group and the other sales order that is having different material group.

How can we achieve this of splitting the incoming PO Idoc data and post the documents.

Any suggestion / reply in this regards would be of great help.

Regards

Jitendra

3 REPLIES 3

former_member198275
Active Contributor
0 Kudos

Hi Jitendra,

One PO idoc will contain only One PO information and segments will be there as line Items.For example Segment header will be there in E1PORDCR1 , and for that you will have one/many item details in E1BPMEPOITEM, where MATL_GROUP will contain the material group. Now while processing the PO idoc, after PO is saved, take all the MATL_GROUP into one internal table and by looping you can achieve that.

0 Kudos

Hi Kaushik,

Could you please elaborate in more detail how we can achieve this ?

Do you mean to say we should write the code in exit ??

Again since PO data is in 1 Idoc we need to split the data based on item material group

and then post the SO which seems to be bit complex.

Appreciate detailed explanication from your end .

Regards

Jitendra

Hi Jitendra ..

"Do you mean to say we should write the code in exit ??"

If you are using standard IDOC PO functional module then user exists will be there to write the code(search the forum for the same) , if custom then u can write in end of that function module.

Again since PO data is in 1 Idoc we need to split the data based on item material group and then post the SO which seems to be bit complex.

If you see any inbound IDOC processing Function module, there will be a header LOOP at IDOC_CONTRL and in that there will be CASE statement to read every segment. So while reading E1BPMEPOITEM segment , collect all material group data and save it in internal table. After the header loop ends, you will have all the material group details with you , and you can call bapi_salesorder_createfromdat2 to create SO ( use ATNEW  ENDAT in loop).