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

12/1/2017 IDOC in SAP ABAP

SAP ABAP AND WEBDYNPRO TUTORIALS SUBSCRIBE

SAP ABAP AND WEBDYNPRO TUTORIALS SUBSCRIBE

IDOC in SAP ABAP Select Topics

March 03, 2017

What is an IDOC in SAP ABAP


What is a IDOC?
Idoc in SAP ABAP is important tool which is used to exchange docs between two
different process that modules in the idoc format.In this lesson ,we are going to learn
what is an idoc and its de nition and how to create idoc and importand idoc
transactions
An IDoc is simply a data container that is used to exchange information between any
two processes that can understand the syntax and semantics of the data. IDoc is not a
process.
     IDocs are stored in the database.
     In the SAP system, IDocs are stored in database tables.
     IDocs are independent of the sending and receiving systems.
     IDocs are independent of the direction of data exchange.

What is an EDI and ALE: 

IDocs are text encoded documents with a rigid structure that are used to exchange
data between R/3 and a foreign system.Therefore an IDoc data exchange is always an
asynchronous process.

The signi cant difference between simple RFC-calls and IDoc data exchange is the
fact, that every action performed on IDocs are protocolled by R/3 and IDocs can be
reprocessed if an error occurred in one of the message steps.

While IDocs have to be understood as a data exchange protocol, EDI and ALE are
typical use cases for IDocs.

R/3 uses IDocs for both EDI and ALE to deliver data to the receiving system.

The difference between EDI and ALE can be de ned  ,If we send data to an external
partner, we generally using EDI, while ALE is a mechanism to reliable replicate data
between trusting systems to store a redundant copy of the IDoc data.

http://www.sapabapwebdynprotutorials.com/2017/03/idoc-in-sap-abap.html 1/10
12/1/2017 IDOC in SAP ABAP

Difference between ALE and EDI 


SAP ABAP AND WEBDYNPRO TUTORIALS SUBSCRIBE

ALE is used to support distributed yet integrated processes across several SAP
systems whereas EDI is used for the exchange of business documents between the
systems of business partners ALE is SAP's technology for supporting a distributed
environment whereas EDI is a process used for exchange of business documents
which now have been given a standard format Both ALE and EDI require data
exchange.

In simple words , an idoc is like a data le with a speci ed format which is exchanged
between 2 systems which know how to interpret that data.

IDOC stands for " Intermediate Document" When we execute an outbound ALE or EDI
Process, an IDOC is created.

IDOCs are based on EDI standards, ANSI ASC X12 and EDIFACT. In case of any con ict
in data size, it adopts one with greater length.
EDI (Electronic Document interchange) - EDI is the electronic exchange of business
documents between the computer systems of business partners, using a standard
format over a communication network.
EDI is also called paperless exchange.

 Idoc Advantages:

Reduced Data entry errors


Reduced processing time
Availability of data in electronic form
Reduced paperwork
Reduced Cost
Reduced inventories and better planning
Standard means of communications
Better business process

EDI has two process


1. Outbound process
2. Inbound process

Outbound Process:

1.Application document is created.


2. IDOC is generated
3.Idoc is transferred from SAP to Operating system layer
4 Idoc is converted into EDI standards
http://www.sapabapwebdynprotutorials.com/2017/03/idoc-in-sap-abap.html 2/10
12/1/2017 IDOC in SAP ABAP
4.Idoc is converted into EDI standards

SAP
5.Edi ABAP
document AND WEBDYNPRO
is transmitted TUTORIALS
to the business partner SUBSCRIBE
6.The Edi Subsystem report status to SAP

Inbound Process:

1.EDI transmission received


2.EDI document is converted into an IDOC
3.IDOC is transferred to the SAP layer
4.The application document is created
5.The application document can be viewed.

 IDOC:
IDOC is a container that can be used to exchange data between any two processes.
Each IDOC is assigned a unique number for tracking and future reference.

IDOC consists of several segments, and segments contain several elds.

IDOC contains the following three types of records...

1. One Control Record.


2. One or many Data Record
3. One or many Status record. 

PORT:
Port is used in the outbound process to determine the name of the EDI subsystem
program, the directory path where the IDOC le will be created at the operating system
level, the IDOC le names and the RFC destinations.

RFC Destination:
Used to de ne the characteristics of communication links to a remote system on
which a functions needs to be executed.

Partner Pro le:


Partner pro le speci ed the various components used in an outbound process
(Partner number, IDOC type, message type, Port, Process code), the mode in which it
communicates with the subsystem (batch or immediate) and the person to be noti ed
in case of errors.

Message Control
Used in pricing, account determination, material determination, and output
determination. The message control component enables you to encapsulate business
rules with out having to write ABAP programs.

http://www.sapabapwebdynprotutorials.com/2017/03/idoc-in-sap-abap.html 3/10
12/1/2017 IDOC in SAP ABAP

How to Create an IDOCs


SAP ABAP AND WEBDYNPRO TUTORIALS SUBSCRIBE

Transaction code: WE 30
Steps of De ning Segment
Creating Segment : Tcode - WE31
Creating Message Type : Tcode - we81
Assigning Message type to Idoc type: Tcode - we82
Process
The two processes for IDoc are Outbound Process and Inbound Process.
Outbound Process
When the data is sent out from the system, the process is called Outbound Process
and the IDoc is known as Outbound IDoc.
Inbound Process
When the data is coming in, the process is called Inbound Process and the IDoc is
known as Inbound IDoc.

Outbound Process (Sending System) Steps :

1) Goto Tcode SALE:


 Creating the logical system
Click on Sending and Receiving Systems à Select Logical Systems--Here De ne the
Logical Systems à Click on Execute Button
Go for New Entries
1)  System Name : LOG1:Description: Sending System
2)  System Name : LOG2:Description: Receiving System
Press Enter & Save it will ask for Request if you want new request create new request
or press continue for transferring the objects.
Assigning Client to the Logical System:
Select Assign Client to Logical Systems -
Client                   : Sending System
Logical System    : LOG1
and also
Client   : Receiving System
Logical System    : LOG2
Save this Data.

How to creare RFC Creation for IDOC

 Goto Tcode SM59 and  Select R/3 Connects


Click on create Button
RFC Destination Name should be same as partner's logical system name and case
sensitive to create the ports automatically while generating the partner pro les
Give the information for required elds:
RFC Destination    : LOG2
Connection type : 3
http://www.sapabapwebdynprotutorials.com/2017/03/idoc-in-sap-abap.html 4/10
12/1/2017 IDOC in SAP ABAP
Connection type    : 3

SAPHost
Target ABAP
           : AND WEBDYNPRO
sappdc.hcl.com TUTORIALS SUBSCRIBE
System No              : 01
Client                      : 220
User                        : Login user name
Password                :
Save this & Test it and Remote Login

Step 3) Goto Tcode BD64: 


Click on the change button>Click on the create model view
Short Text: model view
Technical Name: LMOD
Save this & press ok
Select just created model view
Name: "LMOD"
Goto add message type
Model Name  : LMOD
Sender           : LOG1
Receiver         : LOG2
Message type: ZMESS
Save and press Enter.
4) Goto Tcode BD82:
Give Model View   : LMOD
Partner system     : LOG2
Execute this by pressing F8
It will gives you sending system port No:  A00000000089 .
5) Goto Tcode BD64:
Select the model view
Goto >Edit >model view > Distribute
Press ok and Press Enter.
Run your Zprogram
REPORT  ZALE                             .
DATA: Begin of imara occurs 0,
matnr like mara-matnr,
mtart like mara-mtart,
end of imara.
DATA: wamas_con LIKE edidc,
ittble_data like   edidd 
ittbel1_con like  edidc 
PARAMETERS: e_matnr LIKE mara-matnr,
e_msgtyp LIKE edidc-mestyp,
e_rcvprn LIKE edidc-rcvprn.

SELECT matnr mtart FROM mara INTO TABLE imara WHERE


matnr = e_matnr.

M t id t l d
http://www.sapabapwebdynprotutorials.com/2017/03/idoc-in-sap-abap.html 5/10
12/1/2017 IDOC in SAP ABAP
Master idoc control record
SAP ABAP =AND
wamas_con-rcvprt 'LS'. WEBDYNPRO TUTORIALS SUBSCRIBE

wamas_con-rcvprn = e_rcvprn.
wamas_con-idoctp = 'ZIDOC'.
wamas_con-mestyp = e_msgtyp.

 master idoc data records


LOOP AT imara.
imas_data-segnam = 'ZSEG'.
move imara to imas_data-sdata .

APPEND ittble_data.
ENDLOOP.

CALL FUNCTION 'MASTER_IDOC_DISTRIBUTE'


EXPORTING
master_idoc_control = wamas_con
TABLES
communication_idoc_control = ittble1_con
master_idoc_data = imas_data
COMMIT WORK.

How to check  Transfer of IDOCs 

Tcode - we05
ALE/IDOC Status Codes (outbound):
01=  IDoc Added
30 = IDoc ready for dispatch
29 =Error in ALE service Layer
12 =Dispatch ok
 03 = Data passed to port ok.

Inbound Process (Receiving System) Steps:

Do the same step as you did in sending system


Creating IDoc
De ning the Segment
Creating Message Type
Assigning the Message Type
De ning the Logical System
 Assigning the Logical System
Creating the Distribution Model

1) Goto Tcode - we57:

http://www.sapabapwebdynprotutorials.com/2017/03/idoc-in-sap-abap.html 6/10
12/1/2017 IDOC in SAP ABAP

Assign function module to IDoc type


SAP ABAP AND WEBDYNPRO TUTORIALS
Module: Function module
SUBSCRIBE

Basic type:  
Message type:

Direction: 2 (inbound)
2) Creating Inbound process code - we42
3) Verifying Idoc List Tcode - we05
4) ALE/IDOC Status Codes (Inbound):
50 = IDoc Added
51= Application Document not posted
64 =IDoc ready to be transferred to application
62 =IDoc passed to application
53 = Application Document posted

From this lesson ,we have learnt what is an idoc? and its de nition and how to create
an idoc and how to check it and how to create program for an idoc?.

Read also
IDOC Status Codes
ALE IDOC Program to send an IDOC
ALE/IDOCs Interview Questions

RELATED POSTS:

How To Disable SAP ABAP Full Form How To Check RFC How To Write A
Icons In SAP ALV Connection Using Program In SAP
Too... F... ABAP

Related Posts Widget


IDOC/ALE SAP ABAP

No comments yet

Add a comment as sobhan koneru

http://www.sapabapwebdynprotutorials.com/2017/03/idoc-in-sap-abap.html 7/10
12/1/2017 IDOC in SAP ABAP

SAP ABAP AND WEBDYNPRO TUTORIALS SUBSCRIBE

Popular ABAP Tutorials

ALV Reports Interview Questions


April 12, 2017

SAP ABAP ALV Reports Interview Questions and Answers for Experienced  Here, i am
sharing very import real time oriented questions which are faced at several interviews
on ALV Reports to help for freshers and experienced SAP ABAP consultants with …

KEEP READING

Sample ABAP Programming Examples for Practice


July 16, 2017

Sample ABAP Programming Examples for Practice Are you beginner to ABAP
Language ,you're looking for example programs for practice .Here i collected some
sample programs from various objects in ABAP useful for beginners to improve …

KEEP READING

SAP ABAP Smartforms Interview Questions and Answers


April 13, 2017

SAP ABAP Smartforms Interview Questions and Answers

What is smartform? Smart Forms are printing forms used to print Invoice and …
http://www.sapabapwebdynprotutorials.com/2017/03/idoc-in-sap-abap.html 8/10
12/1/2017 IDOC in SAP ABAP
at s s a t o ?S a t o sa ep t g o s used to p t o ce a d

SAP ABAP AND WEBDYNPRO TUTORIALS SUBSCRIBE


KEEP READING

SAP ABAP Data Dictionary Real Time Interview Questions and


Aanswers
April 11, 2017

SAP ABAP Data Dictionary Real Time Interview Questions and Answers
These interview Questions from the SAP ABAP Data Dictionary are faced at the
different companies in the several interviews which are useful for real time …

KEEP READING

BADI Interview Questions in SAP


April 13, 2017

BADI Interview Questions in SAP A BAdI is an object-oriented enhancement option,


which makes it the most sophisticated enhancement type. The main characteristic of
a BAdI is that it provides a mechanism to change the functionality of a well-de ned …

KEEP READING

Like on Facebook

SAP ABAP and WebD…


304 likes

Liked Share

Powered by Blogger

Theme images by Michael Elkan

Labels

http://www.sapabapwebdynprotutorials.com/2017/03/idoc-in-sap-abap.html 9/10
12/1/2017 IDOC in SAP ABAP

Monthly Updates
SAP ABAP AND WEBDYNPRO TUTORIALS SUBSCRIBE

Report Abuse

Donate to Me
Donate with PayPal

Privacy Policy

http://www.sapabapwebdynprotutorials.com/2017/03/idoc-in-sap-abap.html 10/10

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