Professional Documents
Culture Documents
The Idoc Interface: - R/3, Release 4.5
The Idoc Interface: - R/3, Release 4.5
Document
IDoc
SAP System R/3 SAP System R/3
IDoc IDoc
Transaction
EDI Subsystem Message EDI Subsystem
IDoc Concept Asynchronous
Document-related
System 1 System 2
SAP
IDoc Document
Document Transaction
Message
Data Records
E1HDDOC E1TLSUM
M 1 C 1
E1HDADR E1ITDOC
C 5 M 1
E1ITSCH
Tree of Segments C 99 C 5
Status Records
IDoc Data Flow
Outbound Data Inbound
MM
Application SD
Application
...
Document
IDoc
Application data
pass suggest
condition
component evaluate output relation
condition determination
tables write
Message table
Control TNAPR
call
formatting program
access sequence
...
access to condition table
Message Control - Object Relations
Catalogue of fields for key of conditions KOMB
Communication structures
Application
Application filter KOMKyy, KOMPyy
1
n
Procedure
m
n
Message type
m
1
Access sequence
m
n
Transfer according
to output mode
„1“/„2“ „3“/„4“
29
06 05
26
08 07
25
10 09
30
40 41 12 11
03 02
22
18 20
14 15
16 17
31
Inbound Data Flow
System 2, e.g. EDI subsystem
IDoc
IDoc +
Process
Document
SAP application
Inbound Status Transitions
50 56
65
Notifications
60 from the
61 EDI subsystem
prior to
64 IDoc creation,
can be received via
66
message TXTRAW.
62 63
52 51
53 68
Process Code, Port and Partner Profile
SAP Applications
Process Partner
Port
Code Profile
System 2
e.g. EDI subsystem
Partner Profile General
Partner
Receiver of notifications
Outbound Inbound
Partner
Logical message
Partner
Port Logical message
IDoc type
cond.: EDI structure Process code
NAST-Key cond.: Recv. of notifications
cond.: Recv. of notifications
Partner
Message
Process code
Logical message
IDoc Communication Channels
SAP Application
File
tRFC CPI-C MIME ABAP
+ RFC
EDI ALE
R/2 Internet Any
Any Any
2.1 on 3.1 on 4.5 on
3.0 on 3.0 on
Triggering with Port Type „File“
IDoc Interface
Write RFC 4 3
1 2 Read RFC
rfcexec startrfc
IDoc file
IDoc file in.script
Status report
out.script status.script
Read Call 1 2
4 3 Write Call
EDI subsystem
EDI related Output Modes
Output Description
Mode
1 Status 4
report IDoc
IDoc Interface
EDI subsystem
2 startrfc 3
startrfc.exe
IDoc
Status via IDoc Type SYSTAT01
IDoc
IDoc Interface
EDI subsystem
IDoc
Notification and Monitoring
100
80
60
40
20
Organizational plan
IDoc Interface
Determination of Permitted Agents
General Administrator
(System profile)
Determination strategy
Partner related CSR
(Partner profile w/o message)
CSR
Partner and document (Partner profile w/ message)
related
Table of Notification Tasks
All application tasks can be found by the logical message as search term!
Outbound Data Flow w/ Notification Points
SAP application
Document
Message Control
EDIM Message
NAST
Record
IDoc w/
EDIX syntax error
IDoc Interface
EDIO IDoc
EDIS
EDI subsystem Status report
Customer
Inbound Data Flow w/ Notification Points
TXTRAW IDoc message
EDI subsystem
IDoc w/
IDoc EDIY syntax error
SAP application
IDoc w/o
Application application document
Example of an User‘s Inbox
Workitem: Error in EDI subsystem
A change of status is
triggered by an EDI
subsystem because of
translation error(s).
Someone has to take
care of the situation,
and is notified by
status processing.
Workitem: Status Transition Pending
Statistics
“RSEIDOCM”
Active monitoring
4711
4712
Lists, 4713
Find 4718
Display
Statistics - Case 1a: Outbound P.O.
Purchase orders
were transfered to an
EDI subsystem,
some were
confirmed to SAP.
An administrator
monitors the process
by the statistics
transaction „WE07“.
Lists - Case 2a: Outbound P.O.
Purchase orders
were created, and
wait for their
transfer to an
EDI subsystem.
An administrator
monitors the
process by the lists
transaction
„WE05“.
Lists - Case 2b: Outbound P.O.
An administrator accesses
the IDoc(s) by selecting
with the interchange and
message references by the
display transaction „WE02“.
Case 4: Outbound P.O., but Application !
A purchase order was created,
the IDoc(s) assigned to that
P.O. are seen from the
application.
Development of an IDoc Type
Application
Report e ss
c
IDoc Type
P ro
ess nd
r oc b ou
P Segment
In
u nd
o
u tb
O Segment Segment
Type Name
IDoc Interface
r e
c t u
t ru
a S
a t
D
Definition (1): IDoc Type
Basis Type
= IDoc Type
Basis Type
+ Extension
= IDoc Type
Definition (3): Segment
A segment comprises
SAP release-independent segment type
at least one SAP release-dependent segment name
Segment types are structures in the ABAP
repository.
All fields of a segment are of data type character
(CHAR).
Definition (4): Segment Type & Segment Name
Segment Name Version 1
E2ccccc000 e.g. 3.0A
Segment Name
/partner/ccccc013
Definition (5): Release
E1HDDOC E1TLSUM
M 1 C 1
E1HDADR E1ITDOC
C 5 M 1
E1ITSCH
Tree of Segments C 99 C 5
Data Records
E2HDDOC* E2TLSUM*
M 1 C 1
E2HDADR* E2ITDOC*
C 5 M 1
E2ITSCH*
Tree of Segments C 99 C 5
Segment Segment
Type Name
IDoc Interface
Advantages of Extensions
Create project in
„project management, attributes“.
Select the „right“ customer-exit(s) in
„project management, SAP enhancements“.
Implement the selected customer-exit(s) in
„project management, enhancement components“.
Outbound: Read the SAP database and format
data into IDoc format.
Inbound: Write data from the IDoc format to the
database.
Outbound Call Sequence SAP Application
Message Control
IDoc Interface
Customer-exit 1
Customer-exit x
IDoc Interface
EDI subsystem
Inbound Call Sequence EDI subsystem
IDoc Interface
Customer-exit 1
Customer-exit x
SAP Application
Publish Documentation of the Extension
...
Begin typedef struct z2incodx000
… {
…
End } z2incodx000
Exercises to Extend IDoc Processing
Orders
Customer Vendor
IDoc
SAP System R/3 Orders Light SAP System R/3
Exercise 1: Start-Up
The IDoc type ORDLGT01 has the field NAME (ekko-ernam in purchasing) in
segment E1HEAD, anyway the field is not populated by outbound processing.
Hence you implement a customer-exit for the outbound processing in project
management.
Create a project
(With exercise 2 the project already exists!)
Select SAP enhancements; search with development class IDOCTRAINING
(With exercise 2 the enhancement is already selected!)
Implement the exit in enhancement components
Activate your project
Test your exit by creating a new purchase order via transaction ME21, and check
with one of the monitor programs that the IDoc exists, and the field NAME is
populated.
Exercise 4: Extend IDoc Type
You are asked to transmit „Terms of Delivery“ with your orders documents.
Neither IDoc type ORDLGT01 nor one of its segments has fields for „Terms of
Delivery“.
Extend the IDoc type ORDLGT01 with a 3-digit field for the code and a 28-digit
field for the description of „Terms of Delivery“ (dataelements INCO1 and INCO2).
Create a customer segment Z1INCOnn
Create an extension ZEXTENnn by extending IDoc type ORDLGT01
Assign logical message ORDLGT to basis type ORDLGT01 and extension ZEXTENnn.
The processing of that extension will be implemented in the following exercises
number 5 and 6.
Exercise 5: Extend Outbound (Fill Customer Segment)
You are asked to send „Terms of Delivery“ with your orders documents. The IDoc
type ORDLGT01 was already extended in exercise 4. Now you have to implement
the outbound processing.
Create a project
(With exercise 2 the project already exists!)
Select SAP enhancements; search with development class IDOCTRAINING
(With exercise 2 the enhancement is already selected!)
Implement the exit in enhancement components
Activate your project
Because of the IDoc type is maintained in the outbound partner profile, you have
to adjust the partner profile for vendor IDOC-LI-nn.
Test your exit by creating a new purchase order via transaction ME21, and check
with one of the monitor programs that the IDoc exists, and the segment Z1INCOnn
was populated (note the IDoc‘s number).
Exercise 6: Extend Inbound (Process Customer Segment)
You are asked to receive „Terms of Delivery“ with your orders documents. The
IDoc type ORDLGT01 was already extended in exercise 4. Now you have to
implement the inbound processing.
Create a project
(With exercise 2 the project already exists!)
Select SAP enhancements; search with development class IDOCTRAINING
(With exercise 2 the enhancement is already selected!)
Implement the exit in enhancement components
Activate your project
Test your exit by reprocessing the inbound IDoc from exercise 5 with the test tool,
transaction WE19.
With exercise 2 the IDoc reached status „53“: Sales document posted.
With the changes of this exercise also the „Terms of Delivery“ in the sales
document are updated.
IDoc Layers of Testing
Application
WE15 WE19
IDoc Interface
transaction WE12
transaction WE16 Status
report
transaction WE19
EDI Subsystem Responsibilities
EDI subsystem
mappings communication
EDI Certification
Certified process
Purchase Order, out
Customer order, in
Document Order confirmation, out
P.O. Acknowledgement, in
System R/3 System R/3
IDoc IDoc
Certified funtionality
Status IDoc Status IDoc
file interface w/ RFC
Subsystem Subsystem outbound IDoc
Transaction
status report
Transaction inbound IDoc