‎2010 Feb 11 12:10 PM
Hi all,
I am getting an IDoc from PI server. I need to process that IDoc in SAP for which I have created a function module.
I need to read that IDoc in the FM.
Please give me sample code / procedure of coding step by step to validate the data from Idoc structure and creating sales order from the IDoc data.
Also tell me which BAPI / FM should I use to create sales order.
Thanks,
~Sachin
‎2010 Feb 11 12:55 PM
Actually I have additional fields for sales order at header and item level.
So I have extended order type ORDERS05 to ZFRORDERS05 with additional fields.
I am creating new FM now. I see that FM IDOC_INPUT_ORDERS is using BDC but I need to go for some FM to create sales order.
Please give me sample code for this FM.
Thanks,
~Sachin
‎2010 Feb 11 12:38 PM
Hi,
Use this FM IDOC_READ_COMPLETELY to read idoc data.
Use this BAPI SALESORDER_CREATEFROMDAT2 to create sales order.
Regards,
Shanmugavel Chandrasekaran
‎2010 Feb 11 12:50 PM
why are you not using the standard IDOC_OUTPUT_ORDERS function module, and reading in the IDOCS by attaching the port/message type/process code combination to this function module ?
Then the orders will be created by standard SAP.
‎2010 Feb 11 12:55 PM
Actually I have additional fields for sales order at header and item level.
So I have extended order type ORDERS05 to ZFRORDERS05 with additional fields.
I am creating new FM now. I see that FM IDOC_INPUT_ORDERS is using BDC but I need to go for some FM to create sales order.
Please give me sample code for this FM.
Thanks,
~Sachin
‎2010 Feb 11 8:35 PM
Hi Sachin
Extended order type ORDERS05 to ZFRORDERS05 with additional fields is goodu2026
But you can write user exits to populate the additional field to sale order fieldsu2026.
And FM IDOC_INPUT_ORDERS will post the data and create the SALES ORDERu2026
This is standard function every industry will followu2026. And this is recommended.
If you want to create custom FM then call (BAPI_SALESORDER_CREATEFROMDAT2 Sales order: Create Sales Order) in you custom FM.
Thanks
Ramesh