Skip to Content

Post IDoc to SAP ERP over HTTP from any application

Many times have I been wondering: are RFC calls and IDoc flat files the only way to deliver IDoc messages to an SAP system? Is there really no possibility to post an IDoc in XML form over HTTP? And it was not only me to think about that – there are also many questions about that in SDN. Finally, I am happy to announce you that the solution you have been looking for does exist. Moreover, this can be achieved in only a few simple steps, that I will show you below.

Now, before you judge me: I do know the functionality of SAP PI and other integration platforms. I do appreciate their role in system landscape. I do enjoy their functionality. And I finally I do prefer implementing integration scenarios using them. But sometimes it just happens that you need to work without them. Do not say never. Never do you know what might the future bring. And if I still did not convince you – just agree that it is worth knowing that this is all possible.

Step 1

Create inbound IDoc configuration in your system as normally. Define a new logical system if required, create a partner profile entry for inbound messages of the desired type, assigning the related process code.

Step 2

Check the configuration of the Internet Communication Framework (t-code SICF) in your system. What is really important is the Information on Port and Host (Ctrl+Shift+F12) button:


In my case, the configuration looked like that:


If you need further assistance in SICF configuration, check this link:

Step 3

You can make a connection test from SICF. Find the sap\\public\\ping service on the list, right-click on it and choose “Test service”. In the popup window that appears, choose to allow connection (for instante, “Always allow”). Your internet browser’s window will be called with the following path:


The [server] and [port] will be  equal to what you’ve seen in Step 2, and [client] will be your system’s client. As a result, you should see a simple HTML page saying: “Server reached successfully”.

Performing this step is not required, but can help you verify that your configuration is really working and you most probably will not experience problems in further steps.

Step 4

Prepare your application that will post the IDocs to the SAP system. Use the path:


to pass the data from your application to SAP. Here is an example of an IDoc XML data that I used to send IDoc message to SAP:

<?xml version=”1.0″ encoding=”UTF-8″?>














          <E1KNA1M segment=”1″>


               <NAME1>Test Customer</NAME1>











Step 5

If your connection was successfull, you will receive the following HTML document as a response to your call:



          <title>IDoc-XML-inbound ok</title>

          <h1>IDoc-XML-inbound ok</h1>





You can now see your IDoc message in SAP. Here is the IDoc that I posted:


This is it, we made it!

Make sure to follow these rules when sending IDoc data:

  1. Do not use any white spaces or carriage return characters in your XML data. I only used them in the example above to ensure the data readability. But if you use them when sending data, they will be replaced with the hash mark (#), causing errors in IDoc processing in SAP.
  2. You will need to use the Unicode (UTF-8) enconding while sending data.
  3. You will have to comply with some rules while creating your IDoc’s XML. In particular, use the root tag named like your IDoc type (DEBMAS06 in my exmaple), then the <IDOC> tag, followed by <EDI_DC40> Control Record. Provide Control Record details as usually. Finally, build the IDoc structure according to your IDoc type definition. You might need to create a complex, deeply nested structure, depending on your requirements.
  4. Each segment node you send has to be marked with segment=”1″ attribute. Otherwise, it will be interpreted as a field, which will cause an error in IDoc processing.
  5. You will have to use unique IDoc numbers in the DOCNUM field of IDoc control record. Otherwise, your IDoc will be rejected as a duplicate. The DOCNUM given will not become the IDoc number in SAP.
  6. You might want to use an XML Schema for a particular IDoc type to help you generate the correct message. Use we60 t-code in your ECC system for this purpose, type the desired message, then from the top menu choose Documentation -> XML Schema.

Alternative – IDoc over SOAP

Alternatively, it is also possible to send IDocs to SAP over SOAP protocol. You can even receive synchronous technical response. If you are interested, you might want to check these links:

“SOAP for IDOC demystified” blog by Martin Dejl

“Connecting a third party to SAP ECC using HTTP XML format” wiki by Jonathan Eaton and Ricardo Poeta

You must be Logged on to comment or reply to a post.