Quantcast
Channel: ERP Fundamentals - Technical - Functional
Viewing all articles
Browse latest Browse all 81

IDOC Scenario in SAP PI

$
0
0
This blog is intended for all those who are familiar with the basics of XI. it will cover the basic concepts of IDOC, RFC, baps and proxies (java & abap).It  will give good understanding about basic steps required for configuration settings, end-to-end testing of interfaces.
 IDOC
 Introduction to ALE technology
 ALE ((Application link enabling) is a SAP proprietary technology. It is used for communication between SAP to SAP systems or from SAP to non-SAP systems like FTP, web services, etc. It is used to exchange business messages between these distributed systems.
The distributed systems are coupled in two ways:
Narrow coupling- It is used for synchronous communication and it wants the systems involved to be available at the time of communication. Remote function calls works with narrow coupling.
Loose coupling-It is used for asynchronous communication. The calling system and called system need not to be available at the time of communication. If the called system is not available then only communication error will occur.IDOC (Intermediate document) uses loose coupling for message exchange.
Basic concepts
Definition
IDOC stores data hierarically in some specific format. IDOC are used for exchanging data between SAP systems and non-SAP systems
IDOC type- It is the structure of the data which is associated with message type. It is having data of one particular message type. Every IDOC represents only one business type. Examples of IDOC type is MATMAS01 (It contains material master structure).
Message type-The message type is having the data being exchanged between SAP and non-SAP systems. It relates to the structure of the data: an IDOC type for example, MATMAS is a message type for Material Master.
Extended IDOC- These are customized IDOC. The new segments are added to    standard IDOC. The additional segments added starts with Z. These are customer        extensions, the additional segments are added to basic segments supplied by SAP, so that additional business information can be transferred depending on customer requirements
IDOC Structure
The figure below shows the basic structure of an IDOC and which parts are transferred to and from the external system. The segment hierarchy is shown here. A total of 3 hierarchy levels are there.
IDOC data is stored in three database tables in SAP. These are for control record, data record and status record.
Control Record- It is identical for all IDOC. It contains the administration information, for example sender information, receiver information, message, etc. The control record structure refers to standard structure EDI_DC40.We can view the structure in transaction se11.
Mapping of control record in XI/PI
If the IDOC is used on sender side then we are getting values from SAP system, But if the IDOC is on receiver side, and we are getting its values at runtime then  we can simply disable it in mapping. But if we want the values to be filled from payload then we have to check “apply control record values from payload” in   communication channel.
If we check this box, and fill all the values from payload but IDOC adapter won’t take all values, it changes them and uses the standard values. There are only few fields which we can change in control record (EDI_DC40) by providing  mapping logic at design time, those fields are:
             MESCOD, MESCFT, TEST, EXPRSS, STD, STDVRS, STDMES, SNDSAD,
             SNDLAD, RCVSAD, RCVLAD, REFINT, REFGRP .
Data Record-They contains the segments which is having business  Information and data is stored hierarchal like parent segment is having some Fields and then child segment as shown in figure. Standard sap segment names starts with E1.
Status Record-The status records contain all of the processing status, as well as             the administration information. The status record will tell whether the IDOC is posted to XI or if it has been added to SAP system successfully without errors. The status segment is not sent as part of IDOC structure when IDOC is posted to external system but we can check the status of the IDOC in we02 transaction (outbound/inbound)All the status information is stored in EDI_DS40 structure in SAP.
Note: IDOC are identified by a unique IDOC number (IDOCNUM) which is             Assigned by SAP; we can also manually assign a number range of IDOC.
Partner profile
 It plays an important role in EDI (Electronic data interchange) communications. It       defines the type of data and the communication flow of data to be exchanged between partners.
Transaction we20 is used to set the details for partner profile.
The following information is defined with the partner profile.
 IDOC type and message type are key identifier of the partner profile, names of sender and receiver to exchange the IDOC information for the respective  IDOC and message type. Logical port name via which the sender and receiver, resp. will communicate
Partner profile configuration is done in we20.
Partner details are added with Inbound and outbound relationships. Double clicking on any of the outbound or inbound message type, it will take to another screen which will be having different details for inbound and outbound. This is shown in the below screen shots.
Outbound message type
 Inbound message type
Configuration settings for IDOC adapter
RFC Destination-They are the means with which IDOC’s are posted to and from XI. We need to create them when we are dealing with IDOC. Transaction sm59
Outbound (When IDOC is used at sender side)-No configuration for IDOC adapter to be done as partner profile is being created for sending IDOC, no sender agreement is required for the IDOC. RFC destination will be maintained in SAP system which points to XI system.
Inbound (When IDOC is used at receiver side)-The receiver communication channel  is configured for IDOC adapter and RFC destination will be created in XI system  which points to SAP system. Partner profile must be configured for IDOC on sap side, otherwise error will come that partner profile is not configured for IDOC.
Testing of IDOC
Important transactions used for testing
WEDI- SAP Easy Access
 IDOC Menu
This is the user menu for the IDOC version, similar to the standard SAP menu when we first enter on
WE19- Test tool for IDOC processing
This transaction is used to post outbound IDOC data to XI. Similarly this TCODE is used for processing inbound IDOC inside XI. Steps to be followed for posting IDOC from sap system.
When we select existing IDOC number from message type we want and execute it, it will take to another screen. By clicking on the “Standard outbound processing”. One pop-up window will come. If we check this, new IDOC will be generated and it will be posted to XI .It will display IDOC number down in the screen.
WE02/WE05-IDOC Listing
This transaction will list all the IDOC both for inbound and outbound process, In the IDOC list we will find the status, segments and data inside the IDOC.
 Call transaction we02/we05, we have to set proper time or enter the IDOC number to see if the IDOC was sent.
Initial screen of transaction we02/we05
Transaction we02/we05 search results

Outbound IDOC: If status is green it says that the IDOC was successfully passed to SAP system or external program (status 03).Then we can check IDOC in XI, but If status is red it means errors are there and IDOC is not  posted to XI.
Inbound IDOC: We can check in inbound IDOC status whether the IDOC sent from XI to SAP are added with errors or success.
IDX5- SAP PI Adapter – Monitoring
We have to check in IDX5 whether the IDOC is received in XI. We have to enter the IDOC number or we can check within particular time frame that whether IDOC is posted successfully and we also check for inbound IDOC to SAP whether they are generated. In the figure below shown the output of transaction IDX5.
Message ID is the GUID of the XI system for this particular IDOC. The IDOC number is the IDOC number as stored by the Integration Server. Transaction ID is the transaction ID which is used in the sending process of the IDOC. When you double click the entry in IDX5, we come to SXMB_MONI where the details of the message we can check.
Other useful IDOC transactions
WE60- Documentation for IDOC types
WE09- Search for IDOC by Content
IDX1- Port Maintenance in IDOC Adapter
IDX2-MetaData Overview in IDOC Adapter

Viewing all articles
Browse latest Browse all 81

Trending Articles