05-15-2013 4:08 AM
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
05-15-2013 7:51 AM
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.
05-16-2013 3:58 AM
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
05-16-2013 9:06 AM
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).