Sending IDocs to an External System 

The following diagram illustrates the program logic.

You transmit IDocs from the R/3 System by calling one of the two following functions modules with a destination:

You use this function module from release 4.0 upwards. It processes IDocs in record types that are valid for 4.x releases. Longer IDoc segment names are thus supported.

You use this function module for releases up to 4.0. It processes Idocs in record types that ware valid for 3.x releases. For compatibility reasons, it should also be possible to use this function module in 4.x. External programs, too, should be able to 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 through a table in R/3.

Refer also to the ABAP test program SRFCTEST.

In the remote system, the destination program maintained in SM59 must exist. This program must also contain a function with the name of the function module call.

In R/3, the application data in the internal table is transmitted to the structure EDI_DD40 (EDI_DD before 4.0). For each IDoc, a control record of the structure EDI_DC40 (EDI_DC before 4.0) is also transmitted with the administrative data of the IDoc. In the example given, this data is transmitted in the form of internal tables.

For further information on this topic, refer to the documentation RFC Programming in ABAP.

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

For details on the required functions, refer to the documentation The RFC API or to the documentation of the RFC-SDK.

You can use these programs as examples for your own.

To interpret the useful data in the IDoc, you also need the data structures of the IDoc at the C program level. If you have an R/3 System available, you can generate a header file of the IDoc directly from the transaction WE60 (Documentation for IDoc types).