Skip to Content
author's profile photo Former Member
Former Member

how to automatically trigger XML file port inbound processing ( iDocs)

hi,

i have defined a XML file port in SAP R3 with transaction we21.

In XML file port definition the inbound folder is set to ...\inbound\. When i put a file in the inbound folder, the file is imported into SAP after i manualy run the command startrfc.

what can i do so that the file to be imported automaticaly?

thx

Add comment
10|10000 characters needed characters exceeded

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 26, 2009 at 12:37 PM

    Sorry but the XML FILE PORT (WE21) is only used for outbound processing.

    Regards,

    Gordon

    Add comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 26, 2009 at 01:39 PM

    Hello Irina

    The SAP standard provides the following fm's and reports:

    IDOC_INBOUND_FROM_FILE => called within report RSEINB00
    IDOC_XML_FROM_FILE         => not called by any report (on release 4.6c)

    I have used fm IDOC_XML_FROM_FILE already many times to manually transfer XML-IDocs from one SAP system to another.

    Given the fact that report RSEINB00 is quite simple (see below) you could create your ZRSEINB00 for processing XML IDocs.

    The reports can be scheduled in background to process the inbound IDocs continuously.

    REPORT RSEINB00 MESSAGE-ID E0.
    *----------------------------------------------------------------------*
    * EDI inbound processing (main program to be scheduled)
    *----------------------------------------------------------------------*
    * This program processes one file with one ore more intermediate
    * documents.  When an error occurs, a message will be send via workflow
    * processing.
    * The index of the last successfully processed record of the file is
    * always written to the table EDFI2.
    * If the program is startet again for this file, the table EDFI2 will
    * be interpreted and the processing will start at the next record.
    *----------------------------------------------------------------------*
    ************************************************************************
    * PARAMETERS
    ************************************************************************
    PARAMETERS:
    * directory + name of file that has to be processed
      P_FILE  LIKE  EDI_PATH-PTHNAM  DEFAULT '/usr/sap/.../SYS/global/...'.
    ************************************************************************
    * DATA
    ************************************************************************
    DATA:
      G_MESSAGE_FIELDS LIKE EDIMESSAGE.
    ************************************************************************
    * MAIN PROGRAM
    ************************************************************************
    START-OF-SELECTION.
    
    * do inbound processing from file
      CALL FUNCTION 'IDOC_INBOUND_FROM_FILE'
           EXPORTING
                FILE_NAME            = P_FILE
           EXCEPTIONS
                FILE_OPEN_FAILED     = 1
                MARKER_TO_BE_DELETED = 2
                READ_FILE_FAILED     = 3
                IDOC_NOT_STORED      = 4
                FILE_DELETE_FAILED   = 5
                MARKER_MODIFY_FAILED = 6
                EVENT_CREATE_FAILED  = 7
                FIRST_RECORD_INVALID = 8
                INVALID_RECORD       = 9
                OTHERS               = 10.
    
      IF SY-SUBRC <> 0.
    * fill message fields for exception handling from system fields
        MOVE-CORRESPONDING SY TO G_MESSAGE_FIELDS.
    * error handling using the 3.0 business workflow
        CALL FUNCTION 'IDOC_ERROR_WORKFLOW_START'
             EXPORTING
                  DOCNUM                  = 0
                  EVENTCODE               = 'EDIM'
                  MESS                    = G_MESSAGE_FIELDS
             EXCEPTIONS
                  NO_ENTRY_IN_TEDE5       = 0
                  ERROR_IN_START_WORKFLOW = 0
                  OTHERS                  = 0.
    * do not care for exceptions here
    
        COMMIT WORK.
    * abend message for RFC
        MESSAGE ID     G_MESSAGE_FIELDS-MSGID
                TYPE   'A'
                NUMBER G_MESSAGE_FIELDS-MSGNO
                WITH   G_MESSAGE_FIELDS-MSGV1 G_MESSAGE_FIELDS-MSGV2
                       G_MESSAGE_FIELDS-MSGV3 G_MESSAGE_FIELDS-MSGV4.
      ENDIF.
    ************************************************************************
    * end of report
    ************************************************************************
    
    

    Regards

    Uwe

    Add comment
    10|10000 characters needed characters exceeded