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: 
MichalKrawczyk
Active Contributor
0 Kudos
Did you ever wanted to put XML IDOC into R3, ERP? The very first thing that comes to your mind
was probably Exchange Infrastructure, Business Connector or any other middleware tool
that allows receiving XML files and has a standard IDOC adapter to post them in R3,ERP.
But what if this is not enough?

When can this be not enough?

a) security - if you get an signed, or encrypted XML IDOC and you'd like to encrypt it inside XI
then the message would go decrypted all the way from XI to R3 (which can be very far in terms of security constraints...).
You can still use XI to pass signed files via XI but the XML decryption process would happen in the R3/ERP itself.

b) simplicity - you have no middleware platform but you still want to use IDOCs for processing your XML files
(no need to parse xml files youself and you get the IDOC monitoring for free)

c) performance - you receive an XML file with many XML IDOCs and want to post all of them at once
(without XI - XI: IDOC bundling - the "trick" with the occurance change

What can SAP do to help us in those cases? Fortunately quite a lot...
Did you ever hear about IDOC_XML_FROM_FILE function module? It allows processing IDOC XML files
and posting as standard IDOCs. The only drawback of this module is that you need to specify a direct file name.
That is why we need to use another module to get all file names from a specified directory as per simplified listing below.



As you've probably noticed IDOC_XML_FROM_FILE module requires not only a file name but also a port
(which needs to be of type XML). XML port is created as a standard IDOC port (via transaction WE21)
and all you need to supply is a path to application server's directory and filename as presented below.



But how to get an XML IDOC easily (if you don't have XI, or you don't want to build a new XI scenario just for this test).
If you already have an IDOC all you need to do is to use the XML port that you've just created in transaction WE19.



then just choose - "Outbound processing" option and your XML IDOC will get created.
Now you can use this XML IDOC to create an inbound scenario.

The best think is of course that you can also post one XML file with many IDOCs and they will get posted as many IDOCs.

More info:

To learn about different types of IDOC ports:
XI: New book: Mastering IDoc Business Scenarios with SAP XI

7 Comments
Labels in this area