Beginner’s Guide to ALE and IDocs - a 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.
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.
Create three tables as shown below.

Creating Custom IDoc type and Message type
All the objects created should be present on both source as well as target system(s).
1. Create segments – Transaction WE31
- Create a segment ZRZSEG1
- Add all fields of table ZCUSTOMERS to it
- Save the segment
- Release it using the menu path Edit -> Set Release
- Similarly create two more segments given below
- Seg. ZRZSEG2 – to hold all fields of table ZSOHEADERS
- Seg. ZRZSEG3 – to hold all fields of table ZSOITEMS
2. Create Basic IDoc type – Transaction WE30
- Create a Basic type ZRZORDER
- Add the created segments in the hierarchy shown
- Maintain attributes for each of the segments
- Save the object and go back
- Release the object using the menu path Edit -> Set Release
3. Create/Assign Message type – Transactions WE81/WE82
- 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. In the next part of the article we will understand the outbound settings, i.e. the settings to be done in the source system.


sameer says:
March 5th, 2008 at 2:38 pm
Hi,
I found this very useful but I have few doubts
I am creating IDOC in CRM-IDES and sending it to Solution Manager IDES. I have defined two logical systems CRMCLNT800 and SMCLNT800. The problem is on both the systems the client no is 800. How to assign client 800 (already present in the list of clients) to both the logical systems. OR Is it that these clients which we are assigning to the logical systems have no relation with the SAP system client.
Please help.
Sameer
Riyaz says:
March 5th, 2008 at 9:27 pm
Hi Sameer,
You need to assign client to logical system in their respective systems only (see the next part of this article series).
In your case, in CRM system, create entries for both logical systems (CRMCLNT800 and SMCLNT800), but assign client 800 to CRMCLNT800 only. Similarly, in SM system, create entries for both logical systems (CRMCLNT800 and SMCLNT800), but assign client 800 only to SMCLNT800.
Assigning a client to a logical system simply tells SAP that this particular client will be referred to while communicating using this logical system name.
I hope this answers your query. If not, please revert. I will be more than happy to help you out.
Thanks.
Regards,
Riyaz
Madan Ullasa says:
March 12th, 2008 at 8:22 pm
Your step by step guide is really good.
Riyaz says:
March 13th, 2008 at 11:35 am
Thanks Madan for your compliements
Krishna says:
March 22nd, 2008 at 3:27 am
HI Riyaz,
you are the BEST. KEEP IT UP.
thanks very much for the SOAP ADAPTER ARTICLE.
Please try to explain other concepts of SAP like BAPI, WEBSERVICES, SAP XI JMS ADAPTER, etc…
we have so many material for these but dont know getting much knowledge from your blogs.
there is some magic in your blogs. they are simple and easy to implement. very well explained and formatted.
thank you very much for your time.
Riyaz says:
March 22nd, 2008 at 8:41 pm
Thanks a lot Krishna for your compliments
I am happy to know that you liked the content and it helps you.
I will be posting the articles on the content you suggested. You can find all SAP articles at this link.
There is also a series of posts about creating web services in XI, consuming them in Web Dynpro, and designing UI for the same. Do check them out.
Thanks again!
Regards,
Riyaz
sudheerraja says:
April 15th, 2008 at 9:16 pm
Hi Riaz,
I am from a java background recently moved to XI. I found out your site while searching for blogs for good Xi stuff. I found it is the best blog, I have ever seen. it is very simple and more meaningful. I would be happy if you can post more posts regarding the part of java role in realtime projects. like mapping java mapping , xslt mapping . I found many articles explaining bits and pieces, I could not find any article which gives clear idea of parsers like SAX AND DOM and thier participation while doing complex Idoc scenarios. It would be greate if you can write some article covering with screenshots and coding.
Ultimately i want to tell you. You are the best blogger….. Keep it up.
Thanks
sudheer
Riyaz says:
April 15th, 2008 at 9:29 pm
Hi Sudheer,
Thanks a ton for your compliments. I will soon be adding articles on mappings including Java mapping.
Its good to know that articles are useful to you
Regards,
Riyaz
Hemanth Kumar says:
April 30th, 2008 at 12:35 pm
Please tell me if there are any institues in bangalore for XI coaching…
Riyaz says:
April 30th, 2008 at 2:05 pm
You can go for SAP Education training (SAP Education), or any authorized SAP training institute like Genovate, Siemens. Details here.
Srinivas says:
July 2nd, 2008 at 12:28 am
Does any of the idoc have these tables:
VBRK
VBRP
VBAK
VBPA
VBKD
Riyaz says:
July 2nd, 2008 at 9:36 am
Hi Srinivas,
For sales order you can use ORDERS or ORDCHG IDoc and for Invoice/Billing document you can use INVOIC01 or INVOIC02 IDoc.
Hope this helps.
Regards,
Riyaz
Ray says:
July 15th, 2008 at 4:42 pm
Hi experts,
I need to convert data from legacy system to SAP CRM 6.0 using a txt file as input. I need to convert data of “opportunity”.
My concern is: Looking to the transaction, I know what fields are required, in the screen. Nevertheless I’m don’t know what tables are internaly filled out.
If I create a segment, I will map just the fields I can see through the screen. Does the process of loading fill all tables that are used when I enter data through the screen?
Ps: I intend to use LSMW to call the IDOC.
Tks in advance,
Ray.
Riyaz says:
July 16th, 2008 at 10:22 am
Hi Ray,
This very much depends on the IDoc posting program that you use in LSMW. May be going thru the program documentation or code would help.
Hope this helps.
Regards,
Riyaz
Vamshi says:
August 1st, 2008 at 12:39 am
Hi Riyaz,
You have any kind of documentation for creating a IDoc for SAP HR Benefits. As we are implementing EDI 834 for the new health carrier.
Thanks & Regards,
Vams
Riyaz says:
August 1st, 2008 at 11:03 am
Hi Vams,
Apologies…I dont have the relevant documentation.
Regards,
Riyaz
Julie says:
August 20th, 2008 at 1:42 pm
Hi Riyaz,
i have a question
am i have to creat the 3 new tables ZCUSTOMERS etc.
how about using the transp.table KNA1 ?
Thank u
best wishes:)
Riyaz says:
August 21st, 2008 at 12:54 pm
Hi Julie,
This is just an example. You can use any tables you wish. I have described using custom tables so that you dont change any standard table data inadvertently.
Regards,
Riyaz
Venkat says:
August 24th, 2008 at 5:57 am
Hi Riyaz,
Our client is using both SAP 4.7 and SAP ECC 6.0, and the Corporate account is in SAP ECC 6.0, so the Liability on SAP 4.7 is to be posted in SAP ECC 6.0 Corporate Account. We are using BizTalk as our middleware tool which is converting flat file into an IDOC, FIDCCP01 for SAP 4.7 and FIDCCP02 for SAP 6.0.
Now the Liability on SAP 4.7 system needs to be posted on SAP 6.0 Corporate account, for that our initial thought was to use ALE between SAP 4.7 and SAP ECC 6.0, but the business is now saying we dont want to use ALE, we want the IDOC to be posted into SAP 4.7 and SAP ECC 6.0 as well for posting the Affiliate Corporate J/E into SAP 6.0.
Adnan Maqbool says:
August 27th, 2008 at 10:31 pm
Dear Riyaz
It was really a very nice tutorial which I have ever read on IDOCs. All steps were clearly defined and self explanatory..
I need a little more help from your end , I had made all configurations and IDOC is creating and sending successfully at sender end. But I am not able to read them at receiver end. I have made correct entry for sender and receiver port and partners number but Idoc are not receiving at receiver end.
Will you please give some tips to troubleshoot the receiver end. Will be regretful to you.
Thanks
Riyaz says:
August 28th, 2008 at 10:45 am
Hi Adnan,
Try using transaction SM58 and check if the IDoc is stuck there. You can use this transaction in both the systems. You will find the error details/network connection failure details there.
Regards,
Riyaz
Sri says:
September 16th, 2008 at 6:19 pm
Hi Riaz,
Thank u very much for ur deep explanation on the idocs.It very easy to understand and implement. u have done a grate job.Thank u once again for providing this on the website.
thanks & regrds,
Sri.
Pranjal says:
October 22nd, 2008 at 5:45 pm
Hi Riyaz,
Your blogs are just a boon for we beginners.
rgrds,
Pranjal
Tarun says:
November 13th, 2008 at 5:00 pm
Hi Riaz,
I want to configure an Outbound IDOC for Creation of material master. I dont have any logical system to which this IDOC can be transmitted to. I want to set up the system to use an RFC call to itself.
Please advice, it is urgent requirement for us. Also share code which we need to change so that IDOC gets triggered when we save material master.
Regards
Tarun Jain
Atulya says:
November 13th, 2008 at 9:38 pm
Hi Riaz,
we use a Java (JCo connection) application to receive CREMAS IDocs from SAP. After upgrading SAP from 4.7 to ECC 6.0 the documentList delivered to the handleRequest-Handler remains empty. I have checked all relevant entries in the upgraded system (Distribution Model, Ports, Partner profiles) but I can’t find any incosistences. The sender side seems to be ok (Status 03 in WE02, no entry in SM58).
Our java application is able to receive IDOCs from 4.7 system, but with ECC 6.0 we are getting an empty list.
can you please help me in this.
varunwalia says:
November 20th, 2008 at 11:09 am
Respected riaz …i need some help from u .
i need a program code for the inbound process when any four fields comes out in xml file comes out pos into sap , then the data which comes from pos , i need a idoc no for a single xml file. and now wen i processed the idoc by bd20 , then the xml file data gets updated into ztables during bd20 .
pls let me ur mail id or ur mob no , i rely sir need help to implement idoc for inbound .
thnxs,
varun walia ,
nahar group.
Naveed Ansari says:
November 21st, 2008 at 5:19 pm
Hello Riyaz,
I want to know difference between ALE & EDI. I will be good if you explain me with example.
Regards,
Naveed Ansari
Riyaz says:
November 21st, 2008 at 6:26 pm
ALE is meant for communication between SAP systems while EDI is a global standard for electronic data interchange. ALE works by means of IDoc which is a messaging format specific to SAP systems, whereas EDI uses predefined message formats like EDIFACT and messages are sent in the form of text files. SAP also supports EDI message interchange for SAP to non-SAP communication.
Sagar says:
December 8th, 2008 at 6:28 pm
What is significance of release number generated after set release
Naveed Ansari says:
December 19th, 2008 at 8:03 pm
Hi Riyaz,
I have seen there are some numbers in EDI processingl ike 850, 810, 865. what is the significance of these numbers & where are I will get all these numbers.
Regards,
Naveed Ansari.
Sun says:
December 26th, 2008 at 1:14 pm
Hi Riyaz,
thanks a lot for your information.
when i create a custermized outbound program,the WE05 status is :29 Entry in outbound table not found,How to solve it?
Thanks
Riyaz says:
December 28th, 2008 at 12:44 pm
Sun,
You might need to add entry to outbound table in WE20 for your partner profile.
Riaz says:
January 3rd, 2009 at 9:29 am
Hi RiYaz,
Your answers provide a lot of support for people like us, thanks for taking time and providing the answer,
Here is my Scenaario, with the same client i have two different company codes and i am seding a billing document from one company code to other Company code so that out bound idoc uses INVOIC01 IDOC type and incoming idoc is INVOIC Receipt FI, iam using INVF in the process code at receiving end. I have configured the Inboound and outbound parameters for LS (as i am using ALE to move this idoc) out going IDOC has no issues but i am getting an error in the incoming IDOC which says as ” Conventional invoice verification no longer maintained as of Release 4.6C” not sure what is Wrong. Please help me on this.
Appreciate your help.
Thanks & Regards,
Mohammed Riaz.