Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
lpodile
Participant
25,570
This blog post will give you the overview to use IDOC as XML.

Introduction:


IDOC is a standard data structure used in SAP applications to transfer data to and from SAP system applications and external systems.

More details about IDOCs can be found here:

https://wiki.scn.sap.com/wiki/display/ABAPConn/IDoc+Overview

https://wiki.scn.sap.com/wiki/display/Community/Inbound%20and%20Outbound%20Idoc%20Configuration%20St...

https://wiki.scn.sap.com/wiki/display/Community/Inbound%20and%20Outbound%20Idoc%20Configuration%20St...

Now we are going to see how IDOC can be sent as XML over HTTP to external systems.



Procedure:



The below are the steps to be followed:

  1. Create the RFC destination to send the outbound IDOC.

  2. Maintain the Outbound Port.

  3. Create Partner Profile.

  4. Generate  the IDOC.


1. Create the RFC destination:



  1. Transaction Code to create RFC destination is SM59

  2. Select the connection type as G (HTTP Connection to External Server)

  3. In order to send the outbound IDOC to we need to maintain the RFC destination in S4.

  4. RFC destination will going to contain the external system endpoint including Host, Path Prefix. Also maintain the basic authentication.


The below is the RFC destination created.


 

2. Maintain the Outbound Port



  1. Transaction Code to create PORT is WE21.

  2. XML HTTP port is required in order to convert the IDOC into XML

  3. Create the XML HTTP Port in S4 and maintain the RFC destination as below.



 

3. Create Partner Profile



  1. Transaction Code to create Partner Profile  is WE20

  2. Partner profile need to be maintained in S4 with the outbound port which we have created in WE21.




4. Generate the IDOC.


Now Create a sample program to populate the control record and IDOC segments and call the function modules 'MASTER_IDOC_DISTRIBUTE' and 'DB_COMMIT'.

Please refer to the below blog to get the sample code.

https://wiki.scn.sap.com/wiki/display/ABAP/Outbound+Idocs+by+ALE

Now execute the program to send the data to external systems using IDOC as XML.

Once the IDOC is triggered, the  system will convert the IDOC data into XML file and post to end-point URL maintained in RFC destination of IDOC port.



Conclusion:


By following these steps, we can send the IDOC as XML over HTTP protocol.

 

 

 

 
12 Comments
Labels in this area