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 !!!!!!
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.
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 function 'EDI_DATA_INCOMING'
pathname = complete_filename
port = portname
others = 1.