Show TOC

Sending IDocs to an External SystemLocate this document in the navigation structure

Use
Process

The following graphic highlights the program structure logic:

IDocs are sent from the SAP system by calling one of the two following function modules with a destination:

  • IDOC_INBOUND_ASYNCHRONOUS

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

  • INBOUND_IDOC_PROCESS

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

The IN BACKGROUND TASK addition for the function call identifies the transactional RFC.

As for synchronous calls, parameter DESTINATION defines the target machine and target program using a table in the SAP system with a path (program context) in the remote system.

Note also the ABAP test program SRFCTEST.

The target program maintained in SM59 must exist in the external system which in turn contains a function with the name of the function module call.

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

You can find more information in the documentation: Writing RFC Programs in ABAP.

You can find examples for tRFC programs in RFC Software Development Kit (RFC SDK):

  • trfctest.c (client program)

  • trfcserv.c (server program)

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

    To interpret the use data in the IDoc you also need the data structures of the IDocs at C program level. If you have an SAP system available, then you can generate a header file of the IDoc directly from transaction WE60 ( Documentation on IDoc Types).