SAP iDoc-1

Table of Contents

Introduction

In this tutorial we will discuss in detail, iDoc functionality, it’s uses, it configuration in SAP, iDoc customizing etc. Some of the key topics covered will be :

  1. Configure outbound iDoc in SAP
  2. Apply filters to outbound iDoc
  3. Understand contents of outbound iDoc in SAP
  4. Configure inbound iDoc in SAP
  5. Apply derivations to inbound iDocs
  6. Understand content of inbound iDocs
  7. Create extended iDocs in SAP
  8. Error handling of iDocs in SAP
  9. Create custom iDocs in SAP

Need for iDoc

iDoc is used by companies running on SAP ERP to exchange data with other companies who could be their vendors, customers, banks, Non SAP application processing company data and than feeding it into it’s SAP ERP.

What is an iDoc

IDoc is an SAP object ( A type of file format) that carries data of a business transaction from one system to another in the form of electronic message. IDoc is an acronym for Intermediate Document. The purpose of an IDoc is to transfer data or information from SAP to other systems, which could be SAP or Non SAP and vice versa.

iDoc is transferred from SAP to another SAP system using SAP’s ALE technology.

Outbound iDoc

An outbound iDoc is triggered in SAP. From SAP it goes to middleware which could be EDI system or Muelsoft or any other middleware system. In case the receiving system is a non SAP system Middleware transform the iDoc into an XML / flat file and feeds it into the receiving system.

In case the other system is SAP iDoc is sent to othe system through transactional RFC connection between the two SAP systems. We will discuss all these is details along with their set in SAP later in this article. E.g of outbound iDoc could be sent customer master data from SAP to other applications, Vendor master data, Material master data etc

Inbound iDoc

This iDoc is generated outside of receiving SAP system. Middleware system like EDI / Mulesoft receive the inbound data which could be in the flat file, xml format. This is than transformed into iDoc format by the middleware system. This iDoc is than sent to receiving SAP system. SAP system process the iDoc and post documents in SAP

Configuring Outbound iDoc in SAP

SAP has different iDoc types for different purposes. Here we will configure Customer master outbound iDoc type. Below are some of the iDoc types:

iDoc PurposeiDoc Type
Send Customer master dataDEBMAS
Send Vendor Master dataCREMAS
Send Material master dataMATMAS

Below steps are involved in setting up outbound iDoc in SAP

  1. Create Logical System
  2. Create RFC Destination
  3. Allocate Logical System to Client
  4. Maintain Ports
  5. Create Partner Profile
  6. Create Distribution Model and Filter
  7. iDoc Segment Filtering
  8. Enable Change Pointer
  9. Enable Change pointer for specific message type
  10. Create iDoc from change pointer
  11. Send full customer master data through iDocs

Create Logical System in Sending System

A ‘logical system’ is used to identify an individual client in a system, for ALE communication between SAP systems.

Login to Client 105 (SENDER SYSTEM)

Transaction code : BD54

Create Logical Systems with naming convention ‘system name’+’CLNT’+client no . E.g: ECW_00_800

Create Logical Systems with naming convention ‘system name’+’CLNT’+client no ex: example for receiving system e.g.: ID3CLNT800

Save and come back

Receiving LS

Sending System

Assign Logical System to client in Sending System

Log on to SAP system, client 105

Transaction : SALE – Logical System – Assign Logical System to client

Assign client 800 to Logical system ECW_00_800

Create Logical System in Receiving System

Login to Client 800 (RECEIVING SYSTEM)

Transaction code : BD54

Create Logical Systems with naming convention ‘system name’+’CLNT’+client no ex: example for receiving system e.g.: ID3CLNT800

Save and come back

Assign Logical System to client in Receiving System

Log on to SAP system, client 800

Transaction : SALE – Logical System – Assign Logical System to client

Assign client 800 to Logical system ID3CLNT800

Create RFC Destination

Transaction : SM59

The information about the target system of an RFC call is stored in the RFC destination. The attributes of destinations are defined statically and managed in AS ABAP using the transaction SM59. Every destination managed in transaction SM59 has a unique name that can be specified after the addition DESTINATION in RFC

RECEIVING SYSTEM

Maintain Ports

Go to transaction WE21

Select folder Transactional RFC

Click create and select generate port name

In the RFC destination field give the Receiving system (ID3CLNT800) created earlier in transaction BD54

Please note an iDoc can be created in 3 formats

  • Transactional RFC
  • XML file
  • Flat file

Transactional RFC : This for real time transfer of data from one SAP system to another SAP system

XML File : Here the iDoc is created in an XML file format. If XML file format iDoc is required select folder XML in transaction WE21 and then specify the receiving system port. In this we have to also specify a location in share point where the XML file will be delivered by the sending system. Receiving system will pick the file from the location specified here.

iDoc-9

Flat file iDoc : Similar to XML file. Only difference it is txt file format

Create Partner Profile

Transaction code : WE20

This has to be configured separately for different iDoc types. Here we will set it up for outbound iDoc type Vendor Master (CREMAS)

Select folder LS (Logical System) – Now click the create button

In the Partner Number field enter the receiving system created earlier

In the outbound Parameters click the plus sign

In the next screen enter iDoc message type CREMAS and other details as shown below

Create Distribution Model and Filters

Transaction Code : BD64

Click create model view. Give a name to your model, say AUMTECH, Save

Now select the model (AUMTECH) and click create message on header.

Enter the details as show below and save.

Adding Distribution Filters : BD59 and BD64

You need to create ur own filet object for custom message and link them. Follow the example below. To add an object type to our message type, follow these next few steps:

u2022 Enter transaction BD59 (ALE -> Extensions -> ALE object maintenance -> Maintain object types). u2022 Type in your message type ZINVRV and press enter u2022 Click on New entries u2022 Enter your object type, LIFNR (We need to use the vendor as a filter object), the segment name where LIFNR resides, Z1INVRV, a number 1 for the sequence followed by the actual field name LIFNR u2022 Save and exit.

You have now created an object that weu2019ll use as a filter object in the customer model to direct the flow of messages to the various logical systems based on the vendors in the filter of the message type ZINVRV.

Data sent of account groups specified in the filters

Filter object type and filter objects. A filter object type is used in the Customer Distribution Model to impose a selection criterion on the message (type) flowing to a Logical System. A filter object type with a value associated with it is called a filter object. For example, BUKRS (Company Code) is a filter object type available for message type DEBMAS (Customer Master). To distribute Customer master data of only Company Code “1001” to a particular Logical System, you would use filter object type BUKRS to create a filter object with value BUKRS = 1001. You can have multiple filter objects with different values for the same message type associated with that LS. While determining the receiver(s) of a particular message based on the Distribution Model, ALE performs object filtering. As with the Customer Distribution Model, filter objects are relevant only to ALE.

We now need to add our new message type to the distribution model.

Transaction code : BD64

Select the model created above. Now click on No filter Set as shown below.

Than click on create filter set. After that you can select specific fields as filter. For e.g. field company code can be used as a filter. It there are company code 100, 200, 300, 400 etc. and you select company code 100 in the filter. In that case vendor master data for company codes other than 100 only will be sent

iDoc Segment filtering

Transaction code : BD56

An iDoc is made up of many segments. These segments are buckets which contain fields. Fields have the value. Below we list Vendor master iDoc (CREMAS) segments. Go to transaction WE19 and enter the iDoc message type. In this case CREMAS. Here you will be able to see all iDoc segments as shown below

To see the fields in a segment enter the segment in SE11

Another segment – E1LFBKM

This iDoc segment has vendor bank details. You may not want to send vendor details to other system. For this in transaction BD56 remove the idoc segments which should not sent

Change Pointers

Enable change pointers

Transaction code : BD61

Enable Change Pointers for specific message type

Transaction code : BD50

As we are sending out Vendor master data through iDoc, message type is CREMAS. So enable change pointer for CREMAS

Send Full load of Vendor master data through iDoc

Transaction code : BD14

Send Vendor master when there are changes to Vendor master

Transaction code : BD21

Display and Edit iDoc

Transaction code : WE02

Let’s understand Vendor master iDoc. It has below segments. Segments are containers. Within each segments ae fields. For e.g. E1LFB1M has fields LIFNR (Vendor Number), BUKRS (Company code) etc.

iDoc type : CREMAS

SegmentFieldsFields DescriptionSample Value
E1LFB1M – Segment for company code data for vendorsLIFNRVendor account number1935
 BUKRSCompany code1000
 ERDATDate20030707
 ERNAMPerson who created Vendor numberPITZJ
 ZUAWASort Key002
 AKONTReconciliation account0000160000
 ZTERMPayment Term0001

You can go to transaction SE11, enter iDoc segment and see all fields in the iDoc segment

For Detailed step by step instruction on SAP iDoc uses, configuration, development, testing and various integration points, follow my video tutorial below SAP iDoc Training

Please visit next SAP iDoc Tutorial-2

 

Facebook
Twitter
LinkedIn

2 thoughts on “SAP iDoc-1”

  1. Pingback: Course Material - AIERP2

  2. Hi,

    I would like to receive SAP Idoc material as pdf, i tried to download but i couldn’t

    Thanks in advance

    Gular Najafova

Leave a Comment

Your email address will not be published. Required fields are marked *

error: Content is protected !!