IDocs are usually created in a four step process:
a.retrieving the data
b. converting it to IDoc
c.format, adding a control record
d. delivering the IDoc to a port.
1. This is the single most important task in outbound processing. You have to identify
the database tables and data dependencies which are needed in the IDoc to be sent.2.The collected data must be transformed into ASCII data and filled into the
predefined IDoc segment structures. The segment definitions are done with
transaction WE31 and the segments allowed in an IDoc type are set up in transaction
WE30. Segments defined with WE31 are automatically created as SAP DDIC
structures. They can be viewed with SE11, however, they cannot be edited.
3.Every IDoc must be accompanied by a control record which must contain at least
the Idoc type to identify the syntactical structure of the data and the name and role
of the sender and the receiver. This header information is checked against the
partner definitions for outbound. Only if a matching partner definition exists, can the
IDoc be sent. Partner definitions are set up with transaction WE20.
4.When the partner profile check matches, the IDoc is forwarded to a logical port,
which is also assigned in the partner profile. This port is set up with transaction
WE21 and defines the medium to transport the IDoc, e.g. file or RFC. The RFC
destinations are set up with transaction SM57 and must also be entered in table
TBDLS with an SM31 view. Directories for outbound locations of files are set up
with transaction FILE and directly in WE21. It also allows the use of a function
module which generates file names.