IDOCs For Intro
IDOCs For Intro
IDOCs For Intro
IDOCs
Objective:-
Uses of IDOCs
What is an IDOC ?
Asynchronous
Document-related
System 1 System 2
SAP
IDoc Document
Document Transaction
Message
SAP application
Document
IDoc
IDoc
IDoc +
Process
Document
SAP application
Advantages of using IDOCs
Using the standard tools ( IDOC editor and segment editor ) you can
either enhance standard SAP IDOCs or create new IDOCs in the system
to support custom interface.
The newly developed IDOCs integrate seamlessly into the standard ALE/
EDI interface because they are developed using standard tools provided
by the system. They also become available in the standard
list of SAP IDOCs and can take advantage of all the tools are designed
like IDOC monitoring, error handling and archiving.
Advantages of using IDOCs
The standard IDOCs and the segments within the IDOC have a
version associated with them.Each time a standard IDOC or a
segment is enhanced, the system assigns it a newer version.
Partner applications that were developed using a previous version
of the IDOCs are fully supported. SAP can generate and process
back-level IDOCs. This version management technology offers
backward compatibility.
Advantages of using IDOCs
Several tools are available to monitor the state of the system. They
range from simple IDOC display to IDOC statistics.
EDI integration
ALE Integration
ZMREPT01 Segments
Lname Fname SSN Dob
Z1EMHDR
(M,1,1)
Z1WKDET
Week no Hrly Rate Tot Hrs
(O,1,99999)
Z1CLDET
(O,1,1)
Clsite Work desc.
Z1SUMRY
(O,1,1)
Tot hrs Tot amount
Comparison
140 6900
Name:
Custom IDOC types always start with Z the last two character
represents the version number.After a basic IDOC type is released
and you move to a newer version of the SAP system, any changes
to the structure of the basic IDOC type will create a new basic IDOC
type i.e the version number is incremented by 1.
Arrangement of segments:
SEGMENTS
Segment Components
1) Segment type
This is version independent name of the segment. SAP provided
segment types begin with E1, whereas custom-defined segment
types begin with Z1.
In the example Z1EMPHDR and Z1WKDET are segment types.
IDOC Definition Components
2) Segment definition
This is version dependent definition of a segment where you specify
the fields that belong to the segment. SAP segment definitions start
with E2, whereas customer segment definitions start with Z2.
Segment definitions
Z2TEST Z2TEST001 Z2TEST002
Field 5 Field 5
Field 6
IDOC Definition Components
3) Segment Documentation
This represents the data dictionary documentation for each field
in the segment definition.Segment documentation of SAP-provided
segments begins with E3, whereas the segment documentation of
customer-defined segment types with Z3.
Control Record
Data Record
Status Record
Control Record
Data Records
Status Record
Extending IDOCS
Advantages of Extensions
Creating IDOCS
You create a new basic IDOC type when the standard basic IDOC
types do not meet your business needs as is or by extending them.
Do not make segments larger then 1,000 bytes. Try to split the
segments into functionally separate segments when a segment
definition exceeds 1,000 bytes.
Creating a New IDOC type
The need to create new data elements is minimal because if you are
extracting data from SAP to put into an IDOC, the data already
exists in the database and is represented by a data element.You
need to create new data elements in following cases:
A data element in SAP does not use one of the allowed data types
for IDOC segments.
Here is a list of allowed data types
2) Enter the values in the various fields.You are now maintaining the
first segment definition.The system automatically assigns a name to
the segment definition based on segment type.
Once you have developed all the needed segment types you are ready
to create the basic IDOC type.You use IDOC editor transaction
WE30.
3) Click on the IDOC name and click on the create icon.The system
prompts you to enter a segment type and its attributes.Choose
appropriate values and press Enter.The system transfers name of
segment type to IDOC editor.
Create Basic IDOC type
When you are satisfied with your IDOC structure and segments,you
can release them formally to signify their completion and make them
available for transport to test and production systems.
First you release the segments,and then you release the basic IDOC
types.
Note:-
If you release a basic IDOC type without releasing its segments
and then, by transporting the basic IDOC type,the segments are not
transported.
Extending a Basic IDOC type
3) Create an IDOC extension that ties the custom segment to the SAP
segment which is to be extended.
Assume that you have extended the customer master screen to include
additional sales data information about your customer.This includes
two custom fields delivery priority and customer ranking.In order to
distribute customer master data between two SAP systems,you need
to also distribute information in the two custom fields.
In this step you create the custom segment Z1KNVVM. This segment
contains two fields and required data elements: ZZDELPRTY
( Delivery priority ) and ZZRANK ( Customer Rank ).
(a)Enter the name for your IDOC extension in the Obj.Name field.
This entry can be any meaningful name and does not have to start
with Z.Click on Extension type radio button and then on Create icon.
(b)On the next screen,click on the create New button and enter a
description for your extension and linked basic type .Press Enter.
Extending a Basic IDOC type
(c) Select the extension type E1KNVVM and say Create.The system
informs you that the segment is added as a child segment..Confirm
the entry and the system prompts you with a dialog box to enter the
name of the custom segment and various attributes such as maximum
number and mandatory versus optional.Enter the appropriate values
and press Enter.
2. Determine the key of the application document from the object specified
in step 1.
3. Select application data from the database using the object key identified
in step 2.
5. Populate an internal table of type EDIDD with data records for various
segments.
7.Commit work.
Programming in IDOC Interface
3. Parse through each data record.If using the call transaction,then build
the BDC data table;if not ,build internal tables.