Académique Documents
Professionnel Documents
Culture Documents
step-by-step approach
This article will help you understand the basics of ALE and IDocs via a simple do-it-
yourself example. We will create a custom IDoc in one SAP system and then post some
business data through it to another SAP system. Business data will be picked up from
custom data dictionary tables.
The messages that are exchanged are in the form of IDocs or Intermediate Documents.
IDocs act like a container or envelope for the application data. An IDOC is created as a
result of execution of an Outbound ALE. In an Inbound ALE an IDOC serves as an input
to create application document. In the SAP system IDocs are stored in the database
tables. They can be used for SAP to SAP and SAP to non-SAP process communication as
long as the participating processes can understand the syntax and semantics of the data.
Complete documentation on IDOC is obtained by using transaction WE60.
Every IDoc has exactly one control record along with a number of data records and status
records. Control record has the details of sender/receiver and other control information.
Data records contain the actual business data to be exchanged while the status records are
attached to IDoc throughout the process as the IDoc moves from one step to other.
Now, let us understand the ALE Configuration by means of an example scenario below:
The Scenario
Data from custom tables (created in customer namespace) is to be formatted into an IDoc
and sent from one SAP R/3 system to another using ALE service. We need to have two
instances of SAP R/3 systems or we can simulate this on two clients of the same SAP R/3
system.
All the objects created should be present on both source as well as target system(s).
Part 1:
Go to WE81
Create a new Message type ZRZSO_MT
Save the object
Go to WE82 and create new entry
Assign the message type ZRZSO_MT to the basic type ZRZORDER
Also specify the Release Version
Save the object
Thus we have defined the IDoc structure which will hold the data to be transferred.
Part 2:
This Part of the article we will understand the outbound settings, i.e. the settings to be
done in the source system.
In the previous part we created an IDoc structure which can carry our data from source
system to target system(s). In this part we will understand how to setup the source system
to be able to generate and send an outbound IDoc..
Outbound Settings
Define Logical Systems and Assign Client to Logical System – Transaction SALE
Click on Change
Create a new model view
Provide a Short text and Technical name to the model view
Add message type
Specify sender and receiver systems
Also, specify the message type that we created previously
Save the Distribution model
Generate/Create Partner Profile – Transactions BD82/WE20
To generate Partner profiles automatically you may use BD82 or go to BD64 and
use the menu path Environment -> Generate partner profiles
o Otherwise, you may use transaction WE20 to create a partner profile
On selection screen, specify the model view, target system and execute
The result log will be displayed on the next screen
To verify the partner profile go to WE20
Check the partner profile for the target system
Fetch the data from the DDic tables ZCUSTOMERS, ZSOHEADERS and
ZSOITEMS as per the selection criteria
Fill the control record structure of type EDIDC
o Specify message type, Basic IDoc type, tRFC Port, Partner number and
Partner type of the receiver
Fill the data records
o Define structures like the IDoc segments
o Fill the structures with fetched data
o Pass the segment name and the above structure to the appropriate fields of
EDIDD type structure
o Append the EDIDD structure to the EDIDD type internal table
Now, call the function module MASTER_IDOC_DISTRIBUTE and pass the
IDoc control record structure and data record table
Commit work if return code is zero
Function module returns a table of type EDIDC to provide the details about
generated IDoc
Display appropriate log
E:\Documents and
Settings\abc\Desktop\ZRZ_ORDER_IDOC.txt
Part 3:
In this part we will see how to configure the receiving system to be able to receive and
post the inbound IDoc.
In the previous parts we learned how to create a custom IDoc and set up the source
system to send an outbound IDoc. In this part we will learn how to configure the
receiving SAP R/3 system to be able to receive and post the inbound IDoc.
E:\Documents and
Settings\abc\Desktop\Z_IDOC_INPUT_ZRZSO_MT.txt
Inbound Settings
On the sender system, execute the IDoc Generation Program. Check the status of IDoc
using transaction WE02.
Check the status of the IDoc in the receiver system using transaction WE02. You can also
check the contents of DDic tables to make sure that the records have been created in the
receiver system.
Thus to summarize we have learned how to: