Beginner'S Guide To Ale and Idocs - A Step-By-Step Approach
Beginner'S Guide To Ale and Idocs - A Step-By-Step Approach
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.
ALE Application Link Enabling is a mechanism by which SAP systems communicate with
each other and with non-SAP EDI subsystems. Thus it helps integration of distributed systems. It
supports fail-safe delivery which implies that sender system does not have to worry about
message not reaching the source due to unavoidable situations. ALE can be used for migration
and maintenance of master data as well as for exchanging transactional data.
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.
Release the object using the menu path Edit -> Set Release
Thus we have defined the IDoc structure which will hold the data to be transferred.
Outbound Settings
Define Logical Systems and Assign Client to Logical System Transaction SALE
Specify the client, previously created logical system and other attributes
Define a new logical system to identify the partner system and save it
Maintain RFC Destinations Transaction SM59
Provide a description
Click on Change
On selection screen, specify the model view, target system and execute
o Specify message type, Basic IDoc type, tRFC Port, Partner number and Partner
type of the receiver
o Pass the segment name and the above structure to the appropriate fields of
EDIDD type structure
Now, call the function module MASTER_IDOC_DISTRIBUTE and pass the IDoc
control record structure and data record table
Function module returns a table of type EDIDC to provide the details about generated
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.
o For example: append data from ZRZSEG1 segment to the internal table of type
ZCUSTOMERS
Depending on the result of the update, fill the IDoc status record (type BDIDOCSTAT)
and append it to the corresponding table.
You can download the sample ABAP code for the above function module here.
Inbound Settings
Assign Client to Logical System Transaction SALE (Please refer to Outbound Settings
discussed in previous part)
o On the next screen, select your function module from the list
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.
Configure and test ALE scenario to transmit data between systems distributed across the
network