Skip to Content
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.

image

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.

image

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

To report this post you need to login first.

7 Comments

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

  1. David Halitsky
    I think this is a great post for several reasons, and have forwarded the link to relevant staff at my current customer site.

    (0) 
    1. Michal Krawczyk Post author
      hi David,

      I’m only kidding with the heresy of course 🙂
      (as I like XI development)
      but the fact is that the reason for this blog
      was also initiated by a customer’s need

      Regards,
      michal

      (0) 
      1. David Halitsky
        … your approach might be useful for development/testing of XML—>IDOC scenarios without the overhead of XI set-up … (add in the XI mechanics after the thing has been debugged/thrashed-out using your approach.)

        … also, as I always say, it’s always good for folks to go from what they know to what they don’t know (like workflow —>CAF/GP), and your approach might also be useful for folks who are new to XI and would like to see it all happen in a framework that’s more familiar to them …

        … finally, there’s the security issues … XI tends to make the “Preventors of Information Technology”** very nervous, at least initially.

        regards
        djh

        *** credit to “Dilbert” and “Mordred”, of course.

        Regards
        djh

        (0) 
        1. Michal Krawczyk Post author
          Hi,

          if they use IDOCs with XI you can also let them
          know about my book:
          Mastering IDoc Business Scenarios with SAP XI

          it can be very helpful with IDOC XI scenarios
          (I hope) as it’s an essentials series
          (meaning it has a lot of configuration shown)

          Regards,
          michal 

          (0) 
          1. David Halitsky
            Sorry to bother you, but could provide a link to the title at the SAP Press site or wherever it’s being sold on-line. I meant to capture this the other day but forgot.

            Thanks
            djh

            (0) 
  2. Tony Van Der Linden
    Michal,
    I’m a couple of days late on this, catching up on some blogs. As another alternative you could fire IDoc-XML straight into an ICF service (sap/bc/idoc_xml) from a little HTML page, see some links below. Apologies if you’ve seen this already.

    The option you present would be more “familiar” to those unused to the newer WAS technologies, as David suggests, though stuff like XML and HTTP has been around outside of SAP for years now … contemporise people! 😉

    Techniques like this are very useful even during XI implementations.

    This blog was hidden under ABAP/BW ?! https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/1827

    SAP Help for NW04s
    http://help.sap.com/saphelp_nw2004s/helpdata/en/90/4f3c2ec3c511d6b2b400508b6b8a93/frameset.htm
    I think that this is available from ECC5, in 4.7 though I think you need to code the ICF handler yourself.

    Cheers,
    Tony.

    (0) 

Leave a Reply