Home SAP ABAP Unlocking the Secrets of ALE IDOC in SAP: Comprehensive Guide with Best...

Unlocking the Secrets of ALE IDOC in SAP: Comprehensive Guide with Best Practices

0
SAP IDoc tutorial ALE IDoc in SAP SAP IDoc configuration SAP IDoc monitoring SAP IDoc vs EDI SAP IDoc structure How to create custom IDoc in SA
SAP IDoc tutorial
Cross Application in SAP ABAP

Cross Application in SAP ABAP

Cross application functionality in SAP ABAP is essential for achieving seamless communication and integration between different SAP modules such as Material Management (MM), Sales and Distribution (SD), Financial Accounting (FI), and Controlling (CO), as well as with external systems. This capability ensures cohesive operation across various enterprise functions.

Irrespective of the receivers, the ABAPER's job in the sender system is to generate the IDoc.

The process of generating the IDoc is known as the outbound process.

Irrespective of the senders, the ABAPER's job in the receiver system is to collect the data from the IDoc.

The process of collecting the data from the IDoc is known as the inbound process.

Irrespective of the receivers, the ABAPER's job in the sender system is to generate the IDoc.

The process of generating the IDoc is known as the outbound process.

Irrespective of the senders, the ABAPER's job in the receiver system is to collect the data from the IDoc.

The process of collecting the data from the IDoc is known as the inbound process.

Distributing the data :-

What is IDoc in SAP?

Within SAP environments, IDocs (Intermediate Documents) serve as the foundational framework for system-to-system data transfers. These standardized data containers facilitate seamless information exchange across both SAP and external platforms through structured document sharing.

SAP IDoc Runtime Environment

i. Control records
ii. Data records
iii. Status records

What is control record in idoc in sap

The control record serves as the foundational header component of every IDoc (Intermediate Document) in SAP.
i. Control record specifies the sender as well as receiver information.
ii. It generates only one control record.
iii. This information will be saved on EDIDC table in SAP.

What is Data record in idoc in sap

Data Records form the core content of an IDoc, carrying the actual business data being exchanged between systems. These records work alongside the Control Record (header) and Status Records (processing history) to complete the IDoc structure.
              i. It specify the data which is send by the senders system.
             ii. It generates any number of data records.
             iii. This information will be saved on EDIDD table in SAP.

What is Status record in idoc in sap

Status Records in an IDoc (Intermediate Document) track the processing lifecycle of the document as it moves through SAP systems. These records provide a step-by-step audit trail, capturing success, failures, and system actions at each stage.
            i.It generates status codes for each and every stage of transferring the data.
           ii. It generates any number of status records.
          iii. This information will be saved on EDIDS table.
Status codes are : 
                a. Outbound status codes (0-49)

               b.Inbound status (50-75)

Note: – The linking between EDIC, EDIDD and EDIDS is the IDOC number.

SAP IDoc structure

Types of IDOCS in SAP

Standard Idoc
1. BASIC type :  Standard Idoc and Custom Idoc

2. Extension > Standard Idoc + Custom Idoc

Standard Idoc

If you want to send as well as receives the standard data base table information then we go for standard idoc.
KNA1
——–
KUNNR
NAME1
ORT01

Custom Idoc

If you want to send as well as receives the custom table information then we go for custom item.
ZBBS
——–
EID
ENAME
ESAL

Extension Idoc

If you want to send as well as receives the additional fields information of standard data base table along with standard fields information then we go for extension Idoc.
KNA1
=====
KUNNR
NAME1
ORT01
| |
+
ZBBS_additionla_fileds CGST
SGST

Note: – IDOC is the collection of segments. Each segment is the collection of fields.

Characteristics of an IDOC

Communication between one system to another system is nothing but communication between one client of sender system to another client of receiving system. Each participated system is called one logical system.

Steps to establish the communication settings

1. Define logical system (SALE)
2. Assign client to logical system (SCC4)
3. Maintain RFC destination details (SM59)
Note: – In the real time communication settings are established by BASIS people.
Object : If the receiver is available in following address & he wants customer K7788 details.

Sender details are:
                      Client 800
                      User : SAPUSER
                      Password : welcome123
                      Logical system : LS800.

Receiver details are:
                      Client 810
                      User : SAPUSER
                      Password : india123
                     Logical system : LS810.
Note : Before sending any data from sender to receiver system, first we need to establish the communication settings from sender to receiver system.

Steps to define logical system: -

Steps to Define Logical System

Steps to Define Logical System

Execute SALE.
Expand Basic Settings.
Expand Logical Systems, then execute Define Logical System.
Press Enter. Click on New Entries in the application toolbar.
Provide Sender and Receiver logical system names and a short description. Click Save.
Click on Create Request, provide a short description, and press Enter.
System Code Description
LS800 Sender logical system
LS810 Receiver logical system

Steps to assign client to logical system: -

1
Execute transaction code 'SCC4' in the SAP command field
2
Click on 'Change' button to enter change mode
3
Select the appropriate client from the list
4
Click on 'Details' button
5
Provide the logical system name: LS800
6
Click 'Save' to confirm your changes

Steps to maintain RFC destination details: -

1
Execute transaction code 'SM59'
2
Select the ABAP Connections
3
Click on Create
4
Provide RFC destination: LS810
5
Provide short description: "Sender to receiver"
6
Click on Logon & Security tab
7
Provide receiver logon details:
  • Client: 810
  • User: SAPUSER
  • Password: india123
8
Click on Save
9
Click on Connection Test
10
Click on Back
11
Click on Remote Logon in the application toolbar
12
System will connect to the receiver system
Based on the given input, one outbound program will be triggered, fetch the application data from the database, and generate the master IDoc.
This is data in an internal table. It won’t be stored anywhere in SAP.
The ALE service layer reads the distribution model and identifies interested receivers. It then generates the communication IDoc.
A collection of senders, receivers, and message types.
Used to identify the type of application, such as vendor, customer, material, etc.
This is the physical IDoc and is specific to each receiver.
The ALE communication layer sends these communication IDocs to the relevant receiver systems.
All communication IDocs are now routed and processed by target systems as per the ALE configuration.
Note: If you get the zero master IDOCs, the reason is that the given input has no data in the database.
Note: If you get zero communication IDOCs, the reasons are:
  • There are no interested receivers available in the distribution model.
  • There is a communication settings problem.
Some of the Standard message types

Some of the Standard message types

TCODE MESSAGE TYPE IDOC TYPE SHORT DESCRIPTION
BD10 MATMAS MATMAS01 Get Material
MATMAS02 Get Material
MATMAS03 Get Material
MATMAS04 Get Material
MATMAS05 Get Material
BD11 MATMAS MATMAS05 Get Material
BD12 DEBMAS DEBMAS01 Get Customer
DEBMAS02 Get Customer
DEBMAS03 Get Customer
DEBMAS04 Get Customer
DEBMAS05 Get Customer
DEBMAS06 Get Customer
BD14 CREMAS CREMAS01 Send Vendor
CREMAS02 Send Vendor
CREMAS03 Send Vendor
CREMAS04 Send Vendor
CREMAS05 Send Vendor
BD15 CREMAS CREMAS05 Get Vendor

SAP ALE IDOC configuration steps

Distribution Model Creation Steps

Steps to Create Distribution Model

  1. Execute BD64.
  2. Click on change mode.
  3. Click on create model view in the application toolbar.
  4. Provide the short description (distribution) and technical name (DBCM1), then press Enter.
  5. Select the distribution model which is listed last.
  6. Click on add message type in the application toolbar.
  7. Provide sender (LS800), receiver (LS810), and message type (DEBMAS), then press Enter.
  8. Repeat the same step for all additional receivers and click Save.

Port number: –
                         Port number is used to specify the way of transferring the data.

Types of ports in IDOC :-

Port Types
  • TRFC port > ALE/IDOC
  • File port > LSMW, EDI/IDOC
  • Internet port > Web Apps
  • XML port > Java
Steps to Create Port Number

Steps to Create the Port Number

  1. Execute WE21.
  2. Select the Transactional RFC.
  3. Click on Create (F7) and press Enter.
  4. The system automatically generates a port number (e.g., A000000055).
  5. Provide a short description (e.g., port number) and the RFC destination (e.g., LS810), then click Save.
Outbound Partner Profile Creation

Steps to Create Outbound Partner Profile

  1. Execute WE20.
  2. Select the partner type LS. Click on Create and provide the partner number (e.g., LS810).
  3. Click on Save. Then click on the Create Outbound Parameter ( + ) button.
  4. Provide the message type (e.g., DEBMAS).
  5. Provide the port number (e.g., A000000055).
  6. Select the radio button Transfer IDOC Immediately. Then select the basic type (e.g., DEBMAS06).
  7. Click on Save.
Steps to Create Customer

Steps to Create Customer

  1. Execute XD01.
  2. Select the account group (e.g., Bill to Party).
  3. Provide the customer number (e.g., 57688).
  4. Press Enter.
  5. Provide the following details:
    • Name:BBSR Tech
    • Search Term: BB
    • Street: London
    • Country: UK
  6. Click on Save.
Steps to Send Customer Details

Steps to Send Customer Details

  1. Execute BD12.
  2. Provide the customer number (e.g., 57788).
  3. Provide the message type/output type (e.g., DEBMAS).
  4. Specify the target system/logical system (e.g., LS810).
  5. Click on Execute.
  6. The system generates 1 master IDoc and 1 communication IDoc.
Steps to Check or Test the IDoc

Steps to Check or Test the IDoc

  1. Execute WE02 or WE05 or WE09.
  2. Provide the logical message type (e.g., DEBMAS).
  3. Enter the partner number (e.g., LS810) and click Execute.
  4. Observe the runtime components: Control Record, Data Record, and Status Record.
  5. Expand the status records and check for status code 03 (Success).
Note:
After receiving status code 03, execute the standard program RBDMOIND.

  • If status code changes from 03 to 12, the IDoc has successfully reached the destination.
  • If status code remains 03, the IDoc is still in the tRFC queue.
  • If status code turns to 11, the IDoc is damaged in the queue.

What is Inbound IDoc Process in SAP

After the IDoc reaches the receiver system, it is processed through the inbound partner profile (Transaction WE20). The system checks for the corresponding message type. If the message type is available, it proceeds to the defined process code. Against this process code, the related inbound program (function module) is triggered.

The inbound program reads the data from the IDoc and places it into an internal table. From this internal table, data is transferred to the relevant application layer, and then the application posts the data into the appropriate database tables.

Note: Outbound programs can be developed either as executable programs or as function modules.
However, inbound programs must be developed as function modules because the interface parameters (such as IMPORT, EXPORT, CHANGING, etc.) are standardized across all message types.

ALE Configuration for Inbound IDoc in SAP: Step-by-Step Guide

Pre-requisites for Inbound Partner Profile

Before creating the inbound partner profile for the first time, ensure the following steps are completed:

  1. Define logical systems (This is not required if you are working within the same server).
  2. Assign the client to the logical system.
Note: The process code is used to identify the relevant function module that will process the inbound IDoc.
Assign Client to Logical System

In the receiver system 810 client: - Steps to assign client to logical system:

  1. Execute SCC4.
  2. Click on Change Mode.
  3. Press Enter and select the client 810.
  4. Click on Details.
  5. Provide the logical system name (e.g., LS810) and click Save.
Create Inbound Partner Profile

Steps to Create Inbound Partner Profile

  1. Execute WE20.
  2. Select the partner type LS.
  3. Click on Create (F5).
  4. Provide the partner number (e.g., LS800) and click Save.
  5. Click on Create Inbound Parameter.
  6. Provide the message type (e.g., DEBMAS).
  7. Select the process code (e.g., DEBM) and click Save.
Test or Check IDoc

Steps to Test / Check the IDoc

  1. Execute transaction WE02 or WE05.
  2. Provide the message type: DEBMAS.
  3. Enter the partner number: LS800 and click Execute.
Reprocess IDoc

Steps to Reprocess the IDoc

  1. Execute transaction BD87.
  2. Provide the IDoc number (e.g., 85001).
  3. Click Execute and select the error IDoc.
  4. Click on Process.
Note 1: If the mode of dispatch selected during the creation of the outbound partner profile is Collect, you must execute the standard program RSEOUT00 to dispatch the collected IDocs to the relevant receiver system.
Note 2: If the mode of posting selected during the creation of the inbound partner profile is Trigger by Background (Collect), you must execute the standard program RBDAPP01 to post the collected IDocs to the respective database tables.
Note 3: After receiving status code 03, you should execute the standard program RBDMOIND.
- If status changes to 12, the IDoc has successfully reached the destination.
- If it remains 03, the IDoc is still in the TRFC queue.
- If it turns to 11, the IDoc is damaged in the queue.
Types of Data Distribution

Types of Distributing the Data

  • Send entire information
  • Send changes only (Change Pointer Technique)
  • Get entire information

Change Pointer Technique

The Change Pointer Technique is used to send only the changes made to master data from the sender system to the receiver system. This approach helps reduce unnecessary data transfers by identifying and transmitting only modified records.

Process flow of change pointer technique: -

Change Pointer Process

Whenever changes occur in the master data, the standard SAP system automatically creates a change document. The ALE service layer then invokes the SMD (Shared Master Data). The SMD reads the distribution model and identifies the interested receivers.

If any receiver is available, SAP generates change pointers for the change document. These change pointers are stored in the BDCP table.

The change pointer technique reads the change pointers, generates the corresponding IDoc(s), and dispatches them to the appropriate receiver system.

ALE Configuration for Change Pointer Technique

ALE Configuration Steps for Change Pointer Technique

  1. ALE configuration for outbound IDoc:
    Create the distribution model using BD64 and configure the outbound partner profile in WE20.
  2. Activate the Change Pointer Technique:
    Use transaction BD61 to enable change pointer functionality.
  3. Activate the Message Type:
    Use transaction BD50 to activate the message type relevant to the master data.
  4. Generate and Dispatch the IDoc:
    Use transaction BD21 to generate and send the IDocs based on change pointers.
Note: This ALE configuration is used to send customer master data changes from the sender system to the receiver system using the change pointer technique.
Change Pointer Technique - Steps

Steps to Activate Change Pointer Technique

  1. Execute BD61.
  2. Select the checkbox Change pointers activated.
  3. Click on Save.

Steps to Activate Message Type

  1. Execute BD50.
  2. Click on Position and provide the message type DEBMAS.
  3. Select the Activate checkbox for DEBMAS.
  4. Click on Save.

Steps to Change the Customer

  1. Execute XD02.
  2. Provide the customer number 57789 and press Enter.
  3. Make the necessary changes.
  4. Click on Save.

Steps to Generate and Dispatch IDOC for Change Pointers

  1. Execute BD21.
  2. Provide the message type DEBMAS.
  3. Click on Execute.
  4. Check the IDoc in WE02 or WE05.

Note: Change pointer technique is always maintained on the sender system for master data.

Note: These changes are automatically reflected in the receiver system.

Standard Requesting Message Types

Some of the Standard Requesting Message Types

Application Message Type Requesting Message Type
Vendor CREMAS CREFET
Customer DEBMAS DEBFET
Material MATMAS MATFET
Note: ALEREQ01 is the IDOC type used for any requesting message type.
Note: EDIMSG is the standard database table that contains all message types, IDOC types, and requesting message types.
STEP I - Receiver System Configuration

STEP ( I ) – Receiver System 810

Steps to Maintain RFC Destination (SM59):

  1. Execute SM59.
  2. Select ABAP connections.
  3. Click on Create.
  4. Provide RFC Destination: LS800.
  5. Provide Short Description: Receiver to sender.
  6. Go to Logon & Security tab.
  7. Provide sender logon details:
    • Client: 800
    • User: sapuser
    • Password: india123
  8. Click Save.
  9. Click Connection Test.
  10. Click Remote Logon.

Steps to Create Distribution Model (BD64):

  1. Execute BD64.
  2. Click on Change Mode.
  3. Click on Create Model View.
  4. Provide Short Description and Technical Name, then press Enter.
  5. Select the last distribution model entry.
  6. Click on Add Message Type from the toolbar.
  7. Provide:
    • Sender: LS810
    • Receiver: LS800
    • Message Type: DEBFET
  8. Press Enter and click Save.

Steps to Create Port Number (WE21):

  1. Execute WE21.
  2. Select Transactional RFC.
  3. Click on Create, press Enter.
  4. Provide Short Description, Port Number, and RFC Destination: SP800.
  5. Click on Save.

Steps to Create Outbound Partner Profile (WE20):

  1. Execute WE20.
  2. Select Partner: LS800.
  3. Click on Create Outbound Parameter (+ symbol).
  4. Provide:
    • Message Type: DEBFET
    • Port Number: A000018
  5. Select Transfer IDOC Immediately.
  6. Select Basic Type: ALEREQ01.
  7. Click Save.

Steps to Get the Customer (BD13):

  1. Execute BD13.
  2. Provide:
    • Customer Number: 57790
    • Message Type: DEBMAS
  3. Click Execute.

Steps to Check the IDOC (WE02):

  1. Execute WE02.
  2. Provide required selection criteria.
  3. Click Execute.
STEP II - Sender System Configuration

STEP (II) – Sender System 800 Client

Steps to Create Inbound Partner Profile:

  1. Execute WE20.
  2. Select the partner: LS810.
  3. Click on Create Inbound Parameter.
  4. Provide Message Type: DEBFET.
  5. Select Process Code: DEBM.
  6. Click Save.

Steps to Check the IDoc:

  1. Execute WE05.
  2. Provide:
    • Message Type: DEBFET
    • Partner Number: LS810
  3. Click Execute.
Note: At the time the receiver sends a request, the sender system may not be ready, resulting in status code 56.
Now that the system is ready, reprocess the IDoc using transaction BD87.

STEP (III) and STEP (IV)

The requested data is automatically sent from the sender system to the receiver system and posted successfully.

Working with Transactional Data

Using the Message Control Technique, we can send transactional data. Whenever functional users or end users create and save transactional data, the system automatically generates and dispatches the IDoc.

ALE Configuration Steps for Transactional Data:

  1. Provide the output medium as ALE for the application.
ALE Configuration for Purchase Order

Object: Configure ALE to Send and Receive Purchase Order Information

Steps to Provide Output Medium as ALE for Purchase Order Application

  1. Execute NACE.
  2. Select the purchase order application: EF.
  3. Click on Output Types.
  4. Select the output type provided by functional team.
  5. Double-click on Processing Routines in the left panel and observe the medium.
  6. If the ALE medium isn’t available:
    • Click on Change Mode.
    • Select the EDI medium.
    • Click Copy from the application toolbar.
    • Set transaction medium to Distribution (ALE) instead of EDI.
    • Click Enter.
  7. Create the Distribution Model.

Steps to Create Outbound Partner Profile with Message Control

  1. Execute WE20.
  2. Select the partner.
  3. Click on Create Outbound Parameter.
  4. Provide:
    • Message Type: ORDERS
    • Port Number: A000075
  5. Select Transfer IDOC Immediate and Basic Type: ORDERS05.
  6. Click on the Message Control tab.
  7. Click Insert Row (+) and provide:
    • Application: EF
    • Message Type: NEU
    • Process Code: ME10
  8. If you want to send changes also:
    • Click Insert Row (+) again with same values.
    • Select the checkbox Change Message.
  9. Click Save.

Steps by Functional Team or End User

  1. Execute ME21N.
  2. Create the Purchase Order.
  3. Click on Messages in the application toolbar.
  4. Provide:
    • Output Type: NEU
    • Medium: ALE
    • Partner Type: LS
    • Partner Number
  5. Click on Further Data.
  6. Enter and select Dispatch Time: Send Immediately (When Saving the Application).
  7. Click Back and then Save.
Then automatically one IDoc is generated and dispatched to the receiver system.
Create Inbound Partner Profile

Steps to Create Inbound Partner Profile in Receiver System

  1. Execute transaction WE20.
  2. Select the partner.
  3. Click on Create Inbound Parameter.
  4. Select the Message Type: ORDERSP.
  5. Select the Process Code: ORDR.
  6. Click on Save.
Note:
• To send Purchase Order details to a vendor, create an Outbound Partner Profile under partner type LI (in WE20).
• To send Sales Order details to a customer, create an Outbound Partner Profile under partner type KU.
• To send Payment details to a bank, create an Outbound Partner Profile under partner type B.

To learn SAP ABAP please click here

To learn SAP Data sphere please click here

To learn SQL for native HANA please click here

To learn SAP SAC from SAP please click here

NO COMMENTS

LEAVE A REPLY

Please enter your comment!
Please enter your name here