Sending Inbound IDocs from SAP Program

Idoc from SAP to SAP
Share on Facebook19Share on LinkedIn0Tweet about this on TwitterShare on Google+0
Please Share!!

In most cases, the inbound IDoc to SAP is generated by an external system (say XI) and passed on to SAP. The inbound IDoc is then processed using the process code / corresponding function module. But in certain cases, due to the client requirements, the interface program needs to be designed in such a way that the Inbound IDoc originates from within the same SAP system i.e. both the sending and receiving system are the same.

Now mostly in such requirements, we generally generate the IDoc after reading data from a flat file. The file is passed to the application server by a middleware (say XI). The SAP interface program reads the file from the application server and then starts processing the data. To create the inbound IDoc, we need to use the Function Module ‘IDOC_INBOUND_WRITE_TO_DB’. This creates and saves the IDoc to the database.

The control record information for the inbound IDoc is passed to pc_control_record (Similar to EDIDC – IDoc control record). In the control records, all relevant information like status (53); receiver port, receiver partner no.; sender port; sender partner no etc are populated. All the IDoc data is passed to internal table t_data_records (Similar to EDIDD – IDoc control record). The IDoc data is read from the incoming file and processed and then populated to internal table itab_data_records_db with segment name etc.

[adToAppearHere]

The inbound process data is passed to the function module.

Now if the inbound IDoc has been successfully created and we want to process the same, the function module ‘IDOC_START_INBOUND’ can be used. Here we pass the inbound process data containing the IDoc process code and event code to wa_inbound_process_data_in. The status and release are added to the control records internal table i_control_records.

If we have no exception, then the IDoc will be successfully processed and have status ‘53’.

Also Read : You’ve got an IDoc

If you want to get practical issues and resolutions straight to your inbox, please SUBSCRIBE. We respect your privacy and take protecting it seriously.

If you liked this post, please hit the share button at the left side of your screen.

Thank you very much for your time!!

 

Image source: india.emc.com (modified)

Share on Facebook19Share on LinkedIn0Tweet about this on TwitterShare on Google+0
Please Share!!

About the Author

Biswadeep Roy
Biswadeep Roy
Qualification: B.Tech, M.Tech from IIT Kharagpur, India. SAP ABAP Experience since 2006. Find more about him on LinkedIn.

2 Comments on "Sending Inbound IDocs from SAP Program"

  1. I found its really very meaning ful DOC. tanks dear

    Arun Kayal

  2. Biswa,

    There was this exact requirement in my current project..

    This tip was very helpful..

    Thanks

    Raju

Comments are closed.