Skip to Content
avatar image
Former Member

Import XML format IDOC to SAP

Hi guys. Please, does anyone know how to set up PORT for receiving an xml idco file and process the inbound idoc in SAP ? I know how to send an idoc in XML : IN WE21 I created a XML PORT (type XML FILE), have configured the RFC destination and I can clearly see the xml idoc files I have created that are store in a particular path of the system. Now I must receive xml idocs from legacy systems....Do I have to create a PORT to receive IDOCS ? In partner profiles (WE20 I see that for an inbound idoc I do not have to specefy a port, just a process code for the function module that process the idoc...So I do not know how to set up inbound xml idoc files. Can you help me on this one ? Also I found a function module called "IDOCS_XML_FROM_FILE" but how do I implement this with WE20/WE21 ? thanks !!!!!!

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Aug 07, 2008 at 06:46 PM

    You need to look into the function module EDI_DATA_INCOMING

    Here is the function module documentation


    The function module EDI_DATA_INCOMING executes IDoc inbound processing for transferred IDocs which were imported from a file. That is, the IDocs are stored in the IDoc database and then inbound processing is triggered for every IDoc corresponding to the control configured. The control is essentially derived from the EDI partner profile.

    The transfer of IDocs is made via a file, the name of which the function module determines from the parameters transferred.

    Teamwork of both parameters for the determination of a file name:

    If the parameter 'PATHNAME' has been transferred, this is used as the file name. If this is not the case, the name of the file to be used is determined from the port definition of the file port transferred in parameter 'PATHNAME'. The parameter 'PATHNAME' therefore overrides the parameter 'PORT' regarding the name of the file to be used. Also, when parameter 'PATHNAME' has been transferred, a valid port must always be transferred.


    The function module is used in the test program for IDoc inbound processing.

    Usage example:

    data: complete_filename like edi_path-pthnam,

    portname like edipo-port.

    • Assign values to an actual parameter

    complete_filename = '/usr/sap/C11/SYS/idoc/idocs.inb'.

    portname = 'EDIPORT'.

    • Call FM

    call function 'EDI_DATA_INCOMING'


    pathname = complete_filename

    port = portname


    others = 1.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Eduardo,

      I am sorry to pick up a thread which is clearly quite old now but I am having a similar issue and wondered if you could help clarify.

      Unfortunately I am not so technical at the Function Module side.

      For an Inbound XML, do you have to create a normal "File" port and set the inbound directory in that? .. for the XML File port you can only set an Outbound file path

      And regarding the FM mentioned "IDOC XML to IDOC" .. where do you place this FM moduel name so that it is run?

      Many thanks for any tips


  • avatar image
    Former Member
    Aug 07, 2008 at 06:48 PM

    I am inclined to believe that the function module IDX_XML_TO_IDOC linked to the process code will enable receipt of an XML IDOC.

    Add comment
    10|10000 characters needed characters exceeded