The following is a step by step tutorial on how to create IDoc in SAP ABAP. For those who might perhaps not be familiar with SAP systems in this case, SAP ABAP, IDocs happen to be data containers that facilitate for effective and convenient exchange of pertinent information between business partners. Their functionality ideally necessitates both systems to comprehend the syntax and semantics of the given message.
There are two critical things to understand about IDocs, which are these messages are stored in the SAP database and they are independent of both the sending and receiving systems. As well as the exact direction which the data is sent and received. With this in mind, let us now take a look at how to create idocs (both outbound and inbound) in SAP ABAP.
How to Create IDoc in SAP ABAP
Creating the Logical System
In this part you will be first obliged to create the necessary logical systems. To do this go to Tcode sale segment, click on sending and receiving systems and navigate to logical systems where you can define them. The system name for the sending partner can be log1 and the receiving partner log2, after inputting this data press enter and save it. The abap system will ask you whether you wish to create a new request , you can then click on create new request to continue transferring the object.
You will be required to go to the segment Tocode SM59 and select R/3 connects before hitting the create button. The RFC destination name will have to be similar the receiver’s logical system name and also case sensitive to enable the system to automatically generate the exact profile of your partner. Input the required data for all the fields, which basically are the RFC destination (log2), connection type, target host, system number, client, username, and password. You should save this information and test it. While also try to login remotely.
Defining the Message Type
Go to the Tcode BD64, hit on the change button and navigate to create model view. In this part you will be necessitated to input the model’s technical name and short text which creates the new model view. Proceed to add message type and fill in the required data, which are model view name, sender, receiver and message type. Save and hit the enter button.
Assigning Message Type to IDoc Type Code
Go to Tcode BD82 where you should enter the model view name and your partner’s system. Execute this block of code by hitting F. This will make the abap system to give you the sending system’s port number. Go to Tcode BD 64 and select the model view, before navigating to edit/model view/ distribute press ok and enter. Run the Zprogram.
Verify Transfer of IDocs Tcode we05, we 42 (inbound)
You should finally verify whether your message has been successfully transferred to your partner or you have received a message from him/her. The status code include whether the application document has been posted(inbound) or idocs have been dispatched (outbound).
These are the steps on how to create IDoc in SAP ABAP, which are used for transfer of message from SAP to other systems.