Вы находитесь на странице: 1из 22

Learn SAP — IDOC Configuration

If you want to know the IDOC basic (create , execute and select the list) then Click Here.

In this post let us see how to configure a new IDOC message type in the SAP system.

The Main SAP Transaction for IDOC processing is WEDI. AS soon as you go there you
will see all the t-code associated with the IDOC will appear. This contains all the IDOC t-
codes from creating to processing to configuration.

Here we are going to look in to a business case and see how we can configure the IDOC
and how to process the IDOC. We have a Text file coming from a 3rd party with
customer first name, last name and Age.

We need to create a new message type and store this information as idoc. Once we
received this IDOC we need to process the data and load this data to a table(real life we
call a SAP BAPI or sap function module normally BP create).

The text file format is as follows

First name char(20), last name char(20) and age number (3).

All of the following things are transportable. Save the transports. You can move the same
config and the data from one system to another using this transport.

Create and/or Configure New IDOC segments:

T-Code is WE31.

Create a new Segment type ZTEST_CUST. See the following screen shot.
Click create and see the following screen shot. Now the Segment is created we are ready
to create Idoc types and Message type.

Create and/or Configure New IDOC types:

T-Code is WE31.

Create a new IDOC type ZTEST_IDOC_TYPE.

Click create that will take you to the next screen. see the screen shot.

Click on the create segment. A pop-up will display. See the following screen shot. Select
the created segment type and click continue.
Now click save and save the IDOC type. Now we have a IDOC structure that can have
the first,last name and the age.Now let us go to the message type.

Create and/or Configure New Message types:

T-Code is WE81.

Go to the screen click on edit/change and add new entries and add a new message type
ZTEST_MES_TYPE. See the following screen shot.

Now the new message type is created.

Configure the New Message type and the New IDOC Type:

T-Code is WE82.

Now connect the Message type and the IDOC type. Go to the screen click on edit/change
and add new entries and add the ZTEST_MES_TYPE ,ZTEST_IDOC_TYPE and
version as 46C or any SAP valid Version. Save the data and store the transport. See the
following screen shot.
Now Assign a function module to this new message type.

Create and/or Configure New Message types / Application Object :

T-Code is WE57.

Add the new function module to this message type so that when ever we get a new IDOC
data then the SAP will call this function module where we need to put the code in for
what ever process we need to do.(usually decode the idoc and validate the data and post
the data in the system).

Go in to this transaction and go to change mode and add new entries. See the following
screen shots.

In the new entry screen add the function module that you want to execute for this IDOC
data. See the following screen shot.

Now setup the Inbound processing code. It is in WE42. Go to BD51 and add your
function module.

go to WE42 and add your input processing code. See the following screen shot.
Now go to the Partner function and add this IDOC. So that for the same data type we can
control what function we need to do if that comes from different partners.

Create and/or Configure Partner Profile:

T-Code is WE20.

Go to this transaction and setup this Message type to the partner that are sending the data
to the SAP system. Our message is inbound so add this to the inbound parameters. See
the following screen shot.

Hope this helps. Let me know if you have any questions.


Beginners Guide to ALE and IDOC Processing

ALE (Application Link Enabling) supports the construction and operation of distributed
applications. ALE handles the exchange of business messages across loosely coupled
SAP applications, ensuring that data is consistent. Applications are integrated by using
synchronous and asynchronous communication, rather than through a central database.

What is ALE?

ALE is SAP proprietary technology that enables communication of data between two or
more SAP R/3 and/or R/3 and external systems.

ALE provides intelligent mechanisms which clients can achieve integration and
distribution of applications and data. ALE technology facilitates rapid application
prototyping and application interface development, thus reducing delays in
implementation.

ALE comes with application distribution and integration scenarios, and a set of tools,
programs, data definitions, and methods that you can easily configure to get an interface
up and running.

Advantages of ALE

ALE offers better performance interface entrants compared to traditional techniques such
as data sets (BDC) or call transactions. ALE does not use input screen on the lot.

ALE is the strategy architecture of R / 3 “loose coupling” with the legacy and third-party
applications and is a key element of the Business Framework. It provides an architecture
based on asynchronous message to the integration of Business Framework, including
Business Components, Business Objects and BAPIs.

Components of ALE

• Legacy System
• Message type
• IDOC type
• Customer Distribution Model
• Filter object type and filter objects
• Change pointers
• Ports
• Process codes
• Partner profile
• Message Control
The Main Steps in the Design of ALE

The Distribution Model is a distribution tool that stores information about the flow of
messages between different systems.

A filter object type is used in the distribution model of the customer to impose a selection
criterion on the message (type) arising from the logic of the system. A filter object type
with a value associated with it is called a filter object

Change pointers SAP R/3 objects that mark changes in SAP data. Change pointers are
managed by sharing mechanisms in a Master Data and changes are based on documents
(CD) objects. CD objects record the changes to master data at a field level. These
changes are recorded in Tables CDHDR (header table) and CDPOS (detail table).

Maintain Object Attributes

A port is a logical representation of a communication channel in SAP. There are four


types of ports that can be defined in R / 3: tRFC, file R / 2, and the Internet.

Process codes are used in the ALE and EDI to identify the function module or the API.
Code of each process is associated with a message type. Outbound process codes are
stored in the table TEDE1 while entering codes are stored in process TEDE2.
Use transaction WE41 to display outgoing codes and process WE42 to display the codes.

Message control is a mechanism by which the documents are output based on certain
selection criteria, requirements, and sequences. Message control determines the type of
document, date, number and the medium (paper, fax, ALE or EDI).

Partner Profile

is an identifier for a system used for communicating messages. There are four types of
partner profiles: KU for Customer, LI for Vendor, B for Bank, and LS for Logical
System. KU, LI, and B are used for EDI partners, while LS is used for ALE
communications.

IDOC Definition

An intermediate document (IDOC) is a container for distributing R/3 application data


among between R/3, R/2 and non-SAP systems.

ALE uses IDocs to exchange data between logical systems. Non-SAP systems can use
these IDocs. In the standard interface for data transfer, IDocs are created by message
types and Methods when data is to be distributed. The type of message is the format in
which data for a business process is transmitted electronically.

More info about the IDOC


An IDoc represents a configuration of an Idoc Type that determines the IDoc structure.
An IDoc consists of a header, several data segments and status records. The functions of
the individual elements of an IDoc are as follows:
The contents, structure, sender, receiver and current status of the IDoc are defined in the
IDoc header.
Each data segment contains a standard header consisting of a sequential segment
number, a description of the segment type and a 1000 character long string field
containing the actual data of the segment.
The status records show the history of the processing steps applied to the IDoc.

How to check the status of IDOC?

In the sending System

Transaction Code for IDoc list is : WE05


A list of IDocs grouped by status is displayed:

Status
03, 12, 38 - IDoc successfully transferred
02, 04, 05, 25,26, 29 - Processing error
30 - Waiting status

In the Receiving System


Transaction Code for IDoc list is : WE05
A list of IDocs grouped by status is displayed:

Status

53 - IDoc successfully updated


64 - Waiting status (still processing…)
63, 65 - Inbound error

Message Types
The flow of message across Distributed environment is done through Message Types.
CUSTOMER - DEBMAS
VENDOR – CREMAS
MATERIAL – MATMAS
SALES ORDER – ORDRSP
PURCHASE ORDER – ORDERS

Use the Transaction WE81 to view the message types.

Transaction Codes for ALE


SALE : To Define and Assign Logical Systems .
SM59 : To Establish RFC Connection.
BD64 : To Create Customer Distribution Model.
BD82 : To Generate Partner Profiles.
WE05/WE02: To View IDoc Lists.
BD10: To Send the Material Data.
BD11: To Receive the Material Data.
WE19: To Debug the IDoc.
ALE Configuration

To develop and configure a new custom ALE scenario, comprises 5 steps:


1. Design and develop the custom IDoc with it’ s segments and a new message type
2. Configure the ALE environment with the new IDoc and message type (customer
model,
partner profiles and linking IDoc to message type)
3. Develop the outbound process which does the following:

1. Populates the custom IDoc with control info and functional data
2. Sends the IDoc to the ALE layer for distribution
3. Updates status and handles errors

4. Configure the ALE inbound side (partner profiles with inbound process code)
5. Develop the inbound process which does the following:

1. Reads the IDoc into a BDC table; selects other data that is required
2. Runs transaction using call transaction or BDC session
3. Updates status and handles errors

View/Download the Complete Guide on ALE Configuration and Development.

Let start learning IDOC. IDOC is new to me as well. I learned it when I was in one of the
project. It was great that I have the opportunity to learn new stuff. Back to the point… let
start what you need to do with IDOC.

1) Create segment (WE31)

Of course it will have naming convention for different company. Here are some tips:

If you copy from existing or std segment eg: Z1E1EDP01_01.

If not you can just put Z1….but this is only the example.

2) Create IDOC Types (WE30)

3) Create message type (WE81)

4) Link message type with basic type (WE82)


5) Create FM

In the FM all the attributes should be the same for Inbound or Outbound. Basically you
can get an example from the std FM eg: Inbound – IDOC_INPUT_DELVRY
Outbound – IDOC_OUTPUT_SHPMNT.

6) Create Process Code (Inbound – WE41/ Outbound – WE42)

IMPORTANT: Before you key in the FM, you are required to add the FM in this table
V_TBD51.

7) Link FM with Basic Type

For testing go to WE19.

Here are some of the std program that you can use for IDOC:

1) RSNAST00 – Issuing Output type

2) RBDINPUT – Processing Inbound idocs

3) RBDAPP01 – Processing Idocs that already processed before

4) RBDSEMAT- Stand alone program to generate IDocs (Send Material)

5) RBDMIDOC – Outbound triggered from change pointer

6) RSEINB00 – Convert file to IDOC in status 64

SAP Material Management


IDOC Configuration
Posted in Uncategorized by sapmm on January 28, 2009

If you want to know the IDOC basic (create , execute and select the list) then Click
Here.

In this post let us see how to configure a new IDOC message type in the SAP system.

The Main SAP Transaction for IDOC processing is WEDI. AS soon as you go there you
will see all the t-code associated with the IDOC will appear. This contains all the IDOC
t-codes from creating to processing to configuration.

Here we are going to look in to a business case and see how we can configure the
IDOC and how to process the IDOC. We have a Text file coming from a 3rd party with
customer first name, last name and Age.
We need to create a new message type and store this information as idoc. Once we
received this IDOC we need to process the data and load this data to a table(real life
we call a SAP BAPI or sap function module normally BP create).

The text file format is as follows

First name char(20), last name char(20) and age number (3).

All of the following things are transportable. Save the transports. You can move the
same config and the data from one system to another using this transport.

Create and/or Configure New IDOC segments:

T-Code is WE31.

Create a new Segment type ZTEST_CUST. See the following screen shot.

Click create and see the following screen shot. Now the Segment is created we are
ready to create Idoc types and Message type.

Create and/or Configure New IDOC types:

T-Code is WE31.

Create a new IDOC type ZTEST_IDOC_TYPE.


Click create that will take you to the next screen. see the screen shot.

Click on the create segment. A pop-up will display. See the following screen shot.
Select the created segment type and click continue.

Now click save and save the IDOC type. Now we have a IDOC structure that can have
the first,last name and the age.Now let us go to the message type.
How to create an Idoc & Attached to SAP Transaction?
For example we want to trigger IDOC To other system when we
Save the PO Via ME21N.

To create an Idoc.
1. Create message type.
2. Attach basic types of IDOC to message type.
3. Attach FM to the message type combination of IDOC types
4. Creat a process code and attach message type to it.
5. Create a Partner function through WE20. Add an message
type in the outbound paramater.
6. Have an entry of port name and basic types (IDoc types)
in the outbound options tab
7. Add and an entry in the message control option with the
output type (ME21N- Output type) and the process code.
8. When you db click on the process code the FM should
appear.
9. When an output is triggered in the ME21N transaction wit
the EDI output medium. The idoc will be triggered

create segment using we31 x-code


create idoc(basic type ) using we30 x-code
then use we81 and we 82 x-codes

Check this site for multiple interview question and


answers.http://www.allinterview.com/showanswers/33632.html

hi friends!while sending idoc from receiver side i got msg


type 3 and 12.but in receiver side while executing we02,i
am gettig the error 'no idocs selected' instead of getting
msg type 53.i am simply sending a material from one client
to another client.if anybody knows this problem ky revert
back.
check inbound partner profile(WE20) in the receiver
side.give the correct partner number,message type and
process code.i

The very first setting you need to check is in distribution


model if the message type is configured for given sending
recieving system combination.if this is correct and partner
profile is wrong, you will get an IDoc stuc in 56 status on
inbound.
You can also check in we09 with giving more details like
segment name (related to MARA table ) and the corresponding
material no. in the field for selection with MATNR.

Hi,

If above answers didn't solve your Problem, Check the Port


Numbere in Tcode IDX1. and Message types configuration in
IDX2.
Renjith Remanan
Collabera/IBM

how to send the idoc to multiple sub systems?

As per my knowledge, you cannot send the single IDOC to


multiple system . At a time an IDOC can be directed to only
single system .

if you are sending one idoc is to more systems you are


create one sender logical system and more recive logical
systems in T.CODE is SALE. then yoou are send In T.CODE
BD64.

Create Two output type for the same So/PO and assign the
output type in partner profile.

You Have to Maintina distribution model ( BD64 ) for this


scenario.

Then you need to maintain the partner numbers(ie logical


systems) in both SALE(tcode) and BD64. At the same time
maintain partner profiles for each receiver participating in
the communication.
IDOC

What is IDOC

• IDOC = Intermediate Document

• IDOC is simply a data container used to exchange information between any two
processes that can understand the syntax and semantics of the data.

• When we execute an outbound ALE or EDI Process, an IDOC is created

• In an inbound ALE or EDI process, an IDOC serves as input to create an application


document.

• In the SAP System, IDOCs are stored in database.

• Every IDOC has an unique number (within a client).

• IDOCs are independent of the sending and receiving systems.(SAP-to-SAP as well


as Non-SAP)

• IDOCs are based on EDI standards, ANSI ASC X12 and EDIFACT. In case of any
conflict in data size, it adopts one with greater length

• IDOCs are independent of the direction of data exchange e.g. ORDERS01:


Purchasing module : Inbound and Outbound

• IDOCs can be viewed in a text editor. Data is stored in character format instead of
binary format.

IDOC Components

Basic IDOC Type (we30)

• Basic IDOC Type defines the structure and format of the business document that is to
be exchanged.

• IDOC Type has a

– specific name

– list of permitted segments

– hierarchy of segments

– mandatory/optional segments
– minimum/maximum range of each segment.

Segments

• Segment defines the format and structure of a data record. Segments are reusable
components.

• For each segment SAP creates

– Segment Type (version independent)

– Segment Definition (version dependent)

– Segment Documentation

• The last 3 characters is the version of the segment

• Definitions keep changing as per the version but the segment type remains the same

IDOC Run-Time Components

• An IDOC is an instance of an IDOC Type

• At run time the following events occur

– A unique IDOC no. is allocated by SAP

– One control record is attached to the IDOC

– Segments translate into data records

– Status records are attached

– Syntax rules are checked.

• Each IDOC has 3 parts

– Control Record

– Data Record

– Status Record

• We02 or We05

Control Record
• All control record data is stored in EDIDC table. The key to this table is the IDOC
Number

• It contains information like IDOC number, sender, recipient information, channel it is


using, which port it is using etc.

Data Record

• Data record contains application data like employee header info, weekly details, client
details etc

• All data record data is stored in EDI_DD40 table and EDI_DD

Status Record

• Status record are attached to an IDOC at every milestone or when it encounter errors.

• All status record data is stored in EDID8 table.

Where and How IDOC is created

Where and How an IDOC is created?

• Lets take an example to understand this:

• Whenever a Purchase Order (PO) is created we want to send the IDOC to a vendor.

• The PO is sent in the form of an IDOC to the vendor (partner). That partner has to be
EDI enabled in that system.. SAP should realize that it could send doc to this vendor
electronically. (Creating a vendor is not sufficient). Partner Profile should be EDI enabled
i.e. A partner profile should exist in the sap system.

• Quotation, RFQ, PO, SO, Invoice, delivery challan etc are some of the commonly
exchanged documents through IDOCs

• We create only one profile for both inbound and outbound IDOCs.

• Partner profile should contain message type……to be able to exchange the IDOC.

• We define partner type, partner function and message type (it distinguish if an IDOC is
being sent to same person in same function for different reason e.g. SO)

Process Code

Creating Outbound Process Code (WE41)

• What is Process Code?


Process of filling the IDOC with application data is done by Function Module. But,
function module is not assigned to a Partner. It is encapsulated by a Process Code and
this Process Code is assigned to a Partner in Partner Profile.

• Assigning Function Module to Process Code

- Go to Transaction WE41.

- Switch to “Change” Mode and click “New Entries”.

- Enter Process Code Name and assign the Function Module created.

Partner Profile

Creating Partner Profile (WE20)

• What is Partner Profile?

We must maintain the business partners with whom we communicate via IDocs, in
Partner Profiles.

• Steps to create Partner Profile

- Goto Transaction WE20.

- Click on Create Button.

- Enter the Number of Vendor Created in Partner No. and ‘LI’ in Partner Type fields.

- Save the Data.

- For Outbound Partner Profile we have to create Outbound Parameters

- Specify Partner Function, Message type created, Port (create a port in WE21),Basic
Type and Output Mode.

- Goto “Message Control” Tab and link the Message Type and Process Code created.

- Save.

Change Application Data to be transmitted

• Change Purchase Order Created using transaction ME22n for the Vendor to which
partner profile has been created.

• Go to “Messages” , add the new “Message Type” to the list and Save the Purchase
Order.
• An IDOC will be created for the purchase order and will be dispatched to PORT
mentioned.

Check the status of IDOC (WE02)

• The IDOC status can be checked using transaction WE02

• If the status is ’03’, it implies that IDOC is passed to Port.

Summary: IDOC Workflow

The sequence:

1. Checks whether Partner profile exists or not

2. Whether that PP has a outbound parameter

3. Whether NEU message type is there or not (message control)

4. Checks the process code (gives the name of Function module)

5. Checks immediate transfer or batch transfer

6. Based on that it checks the receiver port

7. Then it will trigger the RFC destination

8. Then it triggers the event on subsystem/customer system

9. Transfer the IDOC to a port and transfer the Idoc in terms of file and it triggers the
customer system

10. Customer knows from where it should pick up the file ….it picks up the file.

Extending an Existing IDOC Type

• Used in cases where some additional information is required in addition to that supplied
by the Standard IDOC Type.

• In Transaction WE30 we create the IDOC as an Extension and specify the basic type
for which it is an extension.

• We add the segments needed as children to existing ones.

• None of the Reference Segments can be deleted or changed.

Extension Child Segs


Basic Type (ORDERS01)

F1

F2

F3

F4

F5

Cannot be modified

IDOC Views

• An IDOC type can be used for more than one message type, which results in IDOCs
containing more fields than required for a particular message type.

• IDOC views are used to improve performance in generating IDOCs to ensure only the
relevant segments are filled with data.

• IDOC Views are important only for Outbound Processing.

IDOC Type

F1

F2

F3

F4

F5

Processing Logic

• The processing logic associated with the IDOC is the function module that is written to
handle the inbound/outbound IDOC.

• Its written just like any function module but has to follow a standard interface (i.e.
Import, Export, Changing & Tables) parameters and it is should be RFC enabled.

• In this function module we are effectively building up a table of type EDID4 (IDOC Data
table) and change the control record.
Please let me know the table which contains the information of IDOC with
relevant to PO ie, I want to find the exact time & date as when PO is actually
transmitted from SAP system to vendor
Regards,
Meera

Вам также может понравиться