Show TOC

  Sending IDocs to an External System

The following figure illustrates the program flow logic:

IDocs are transmitted from the SAP system by calling one of the following function modules with a destination.

  • IDOC_INBOUND_ASYNCHRONOUS

    You must use this function module as of release 4.0. It processes IDocs in record types that are valid for 4.x. This means that longer IDoc segment names are supported.

  • INBOUND_IDOC_PROCESS

    You must use this function module in releases before 4.0. It processes IDocs in record types that were valid for 3.x. For compatibility reasons, it must also be possible to use this function module in 4.x. External programs must also support this function module.

The additional statement IN BACKGROUND TASK for the function call indicates the transaction RFC.

As with synchronous calls, the parameter DESTINATION defines the destination system and the destination program with the path (program context) in the remote system via a table in the SAP system.

Note also the ABAP test program SRFCTEST.

The destination program maintained in SM59 must exist in the external system. This program must contain the name of the function module call.

In the SAP system, the application data in the internal table of the structure EDI_DD40 (EDI_DD before 4.0) is transferred. In addition, a control record from structure EDI_DC40 (EDI_DC before 4.0) that contains administration data is also transferred for each IDoc. In the example, this data is transferred in the form of internal tables.

For more information, see the documentation RFC Programming in ABAP .

For examples of tRFC programs, see the RFC Software Development Kit (RFC-SDK):

  • trfctest.c (client program)

  • trfcserv.c (server program)

For details about the functions required, see the documentation The RFC API or the documentation for RFC-SDK.

You can use these programs as templates for your own programs.

In order to interpret the data in the IDoc, you also need the data structures of the IDocs at C Program level. If you have an SAP system, you can generate a header file for the IDoc directly from transaction WE60 ( Documentation for IDoc Types ).