You are on page 1of 106

Please check out

the custom shows Please pay attention to


the notes when printing
provided !
this document !

The IDoc Interface


R/3 Release

Thomas C. Becker
SAP AG

 SAP AG 1999 IDocEnjoy (Th. Becker) / 1


Electronic Commerce

Document

IDoc
SAP System R/3 SAP System R/3

IDoc IDoc

Transaction
EDI Subsystem Message EDI Subsystem

 SAP AG 1999 IDocEnjoy (Th. Becker) / 3


EDI Standards in the World
EANCOM
GENCOD
EDIFICE TRADACOMS
EIAJ UCS II, WINS
SEDAS
EDIFER

1 2
X T
EDIFICE
ELFE

A C
IF
HL7 E D CEFIC

PHOENIX
ARUA
GALIA EANCOM
ODETTE GENCOD
VDA TRADACOMS
UCS II, WINS
SEDAS
BAI, BAI2
ATA SPEC2000 MultiCash
AECMA SPEC2000M S.W.I.F.T.
HBCI
 SAP AG 1999 IDocEnjoy (Th. Becker) / 4
IDoc Concept

 Asynchronous
 Document-related

System 1 System 2

SAP  Document
Document
IDoc  Transaction
 Message

 R/3 System  EDI subsystem


 R/3 System
 R/2 System
 3rd party software

 SAP AG 1999 IDocEnjoy (Th. Becker) / 5


IDoc Record Types

Control Record IDoc-ID


Sender-ID
Receiver-ID
IDoc type and logical message
External structure

Data Record IDoc-ID


Sequence/Hierarchy
Segment Format definition for
• header data
• item data

Status Record IDoc-ID


Status information

 SAP AG 1999 IDocEnjoy (Th. Becker) / 6


IDoc Types

Control Record

Data Records

E1HDDOC E1TLSUM
M 1 C 1

E1HDADR E1ITDOC
C 5 M 1

E1ITSCH

Tree of Segments C 99 C 5

Status Records

 SAP AG 1999 IDocEnjoy (Th. Becker) / 7


IDoc Data Flow

Outbound Data Inbound

MM
Application SD
Application
...

Message Control Workflow

IDoc Interface & IDoc IDoc Interface &


ALE Services ALE Services

System 2 File System 2


e.g. EDI subsystem tRFC e.g. EDI subsystem
XML
...

 SAP AG 1999 IDocEnjoy (Th. Becker) / 8


Outbound Data Flow

SAP Application

Document

Message Control (NAST)


Document
NAST
Record

IDoc Interface & ALE Services

IDoc

System 2, e.g. EDI subsystem

 SAP AG 1999 IDocEnjoy (Th. Becker) / 9


IDoc View Concept

 An IDoc view is a selection of segments of a given IDoc


type and is compatible with the IDoc type‘s syntax.
 IDoc views are applied in outbound processing of
selected applications.
 Advantages of views:
 Enhancing the performance by restricting the number of
tables read
 Reducing the data volume in internal tables at run time

 SAP AG 1999 IDocEnjoy (Th. Becker) / 10


Message Control

SAP Application Processing

Application data

Output Determination Message proposal


NAST-Record

Processing acc/ TNAPR

Processing Program Output, e.g. as IDoc


e.g. RSNASTED

 SAP AG 1999 IDocEnjoy (Th. Becker) / 11


Message Control - Call Sequence

SAP Applications
communication message
structures default

pass suggest
condition
element evaluate output relation
condition determination
tables write

message trigger and message status


process status

Message table
Control TNAPR
call

formatting program

... printout fax ALE EDI E-mail ...

 SAP AG 1999 IDocEnjoy (Th. Becker) / 12


Message Control - Data Set Relations

Application Data possible contents of


documents to exchange

Communication Structures KOMB


KOMKyy
possible fields and values for decision
KOMPyy

Condition Elements application


...
procedure
...
message type

access sequence
...
access to condition table

 SAP AG 1999 IDocEnjoy (Th. Becker) / 13


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

Access to condition table

 SAP AG 1999 IDocEnjoy (Th. Becker) / 14


Message Control - EDI related

Check NAST-Reord R
S
Read Partner Profile
N
A
Call Selection Module
S
(application) T
E
Call ALE Service D

Transfer according
to output mode
„1“/„2“ „3“/„4“

Single IDoc Batch of IDocs


by RSEOUT00

 SAP AG 1999 IDocEnjoy (Th. Becker) / 15


Outbound Status Transitions

42
01 37 39 24 04

29
06 05

26

08 07
25

10 09
30

40 41 12 11

03 02

22

18 20
14 15

16 17

31

 SAP AG 1999 IDocEnjoy (Th. Becker) / 16


Inbound Data Flow

System 2, e.g. EDI subsystem

IDoc

IDoc Interface & ALE Services

IDoc +
Process

SAP Business Workflow IDoc +


Function Module

Document

SAP Application

 SAP AG 1999 IDocEnjoy (Th. Becker) / 17


Inbound Status Transitions

74
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

 SAP AG 1999 IDocEnjoy (Th. Becker) / 18


Process Code, Port and Partner Profile

SAP Application

Process Partner
Port
Code Profile

System 2
e.g. EDI subsystem

 SAP AG 1999 IDocEnjoy (Th. Becker) / 19


Partner Profile

General
Partner
Recipient of notifications

Outbound Inbound

Partner Partner
Logical message Logical message
Port Process code
IDoc type Recipient of notifications
EDI structure
NAST-Key
Recipient of notifications
Partner
Message

Process code
Logical message

 SAP AG 1999 IDocEnjoy (Th. Becker) / 20


Port Types of the IDoc Interface

SAP Application

IDoc Interface & ALE Services

IDoc & IDoc &


IDoc IDoc IDoc IDoc
status status

File
tRFC CPI-C MIME ABAP XML
+ RFC

EDI ALE EC
R/2 Internet Any
Any Any Any
2.1 on 3.1 on 4.5 on 4.6 on
3.0 on 3.0 on

 SAP AG 1999 IDocEnjoy (Th. Becker) / 21


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

 SAP AG 1999 IDocEnjoy (Th. Becker) / 22


EDI related Output Modes

Output Description
Mode
Transfer of single IDoc and start
1 of the EDI subsystem (trigger)

Transfer of single IDoc;


2 no trigger

Transfer of batch of IDocs and start


3 of the EDI subsystem (trigger)

Transfer of batch of IDocs;


4 no trigger

 SAP AG 1999 IDocEnjoy (Th. Becker) / 23


EDI related Priorities and Output Modes

Application Message IDoc Interface EDI subsystem


Control
Save Priority = 4 output mode = 1
Realtime

Save Priority = 1 output mode = 1


Fast batch

Save Prio = 1 output mode = 3


Batch

Save Prio = 1 mode = 4


Batch

 SAP AG 1999 IDocEnjoy (Th. Becker) / 24


Status via File Interface

1 Status 4
report IDoc

IDoc Interface
EDI subsystem

2 startrfc 3
startrfc.exe

IDoc

 SAP AG 1999 IDocEnjoy (Th. Becker) / 25


Status via IDoc Type SYSTAT01

IDoc

IDoc Interface
EDI subsystem

IDoc

 SAP AG 1999 IDocEnjoy (Th. Becker) / 26


Port Type „ABAP“

IDoc Interface
IDOC_INBOUND_ASYNCHRONOUS

Own_function Own_program

?
 SAP AG 1999 IDocEnjoy (Th. Becker) / 27
Port Type „XML“

 The port type XML is


available in release 4.6A.
 The port type
 creates files with data in IDoc/XML format (rendering)
 processes files with data in IDoc/XML format (parsing)
 For documentation of the format and validation by XML
parsers document type definition (DTD) is available for each
IDoc type. DTDs are available by IDoc type documentation,
transaction WE60.
 Measurements for EDI supply-chain messages compared with
port type file
 XML file is 1.5 to 2 times smaller
 XML file inbound to IDoc database is about 10 times slower
 Communication, e.g. via http, is not yet available.
 SAP AG 1999 IDocEnjoy (Th. Becker) / 28
Port Type „XML“, ORDERS (Header)
<?xml version = "1.0"?> <ORDERS01> <IDOC BEGIN="1">
<EDI_DC40 SEGMENT="1">
<TABNAM><![CDATA[EDI_DC40]]></TABNAM>
<MANDT>004</MANDT> <DOCNUM>0000000000307013</DOCNUM> <DOCREL>46B</DOCREL>
<STATUS>30</STATUS> <DIRECT>1</DIRECT> <OUTMOD>3</OUTMOD> <IDOCTYP>ORDERS01</IDOCTYP>
<MESTYP>ORDERS</MESTYP> <STD>X</STD> <STDVRS>3/70</STDVRS> <STDMES>850</STDMES>
<SNDPOR>SAPQ99</SNDPOR> <SNDPRT>LS</SNDPRT> <SNDPRN>Q99CLNT004</SNDPRN>
<RCVPOR>WTBXML</RCVPOR> <RCVPRT>LI</RCVPRT> <RCVPFC>LF</RCVPFC> <RCVPRN>WTBLIEF</RCVPRN>
<CREDAT>19990622</CREDAT> <CRETIM>074519</CRETIM> <SERIAL>19990622074509</SERIAL> </EDI_DC40>
<E1EDK01 SEGMENT="1">
<CURCY>DEM</CURCY> <WKURS>1.00000</WKURS> <ZTERM>0001</ZTERM>
<BSART>NB</BSART> <BELNR>4500000328</BELNR> <RECIPNT_NO>WTBLIEF</RECIPNT_NO> </E1EDK01>
<E1EDK14 SEGMENT="1">
<QUALF>014</QUALF> <ORGID>0001</ORGID> </E1EDK14>
<E1EDK14 SEGMENT="1">
<QUALF>009</QUALF> <ORGID>001</ORGID> </E1EDK14>
<E1EDK14 SEGMENT="1">
<QUALF>013</QUALF> <ORGID>NB</ORGID> </E1EDK14>
<E1EDK14 SEGMENT="1">
<QUALF>011</QUALF> <ORGID>0001</ORGID> </E1EDK14>
<E1EDK03 SEGMENT="1">
<IDDAT>012</IDDAT> <DATUM>19990622</DATUM> </E1EDK03>
<E1EDK03 SEGMENT="1">
<IDDAT>011</IDDAT> <DATUM>19990622</DATUM> </E1EDK03>
<E1EDKA1 SEGMENT="1">
<PARVW>AG</PARVW> <PARTN>WTBKUND</PARTN> <TELF1>06227/341285</TELF1>
<BNAME>Einkaeufer 1</BNAME>
<PAORG>0001</PAORG> <ORGTX>Einkaufsorg. 0001</ORGTX> <PAGRU>001</PAGRU> </E1EDKA1>
<E1EDKA1 SEGMENT="1">
<PARVW>LF</PARVW> <PARTN>WTBLIEF</PARTN> </E1EDKA1>
<E1EDKA1 SEGMENT="1">
<PARVW>WE</PARVW> <LIFNR>0001</LIFNR> <NAME1>Werk 0001</NAME1> <NAME2>Walldorf</NAME2>
<STRAS>Neurottstrasse 16</STRAS> <ORT01>Walldorf</ORT01> <PSTLZ>69190</PSTLZ>
<LAND1>DE</LAND1> </E1EDKA1>
<E1EDK02 SEGMENT="1">
<QUALF>001</QUALF> <BELNR>4500000328</BELNR>
<DATUM>19990622</DATUM> <UZEIT>074509</UZEIT> </E1EDK02>
<E1EDK17 SEGMENT="1">
 SAP AG<QUALF>001</QUALF> <LKOND>CFR</LKOND>
1999 IDocEnjoy (Th. Becker) / 29 <LKTEXT>Kosten und Fracht</LKTEXT> </E1EDK17>
Port Type „XML“, ORDERS (Item 10)
<E1EDP01 SEGMENT="1">
<POSEX>00010</POSEX> <ACTION>001</ACTION> <PSTYP>0</PSTYP>
<MENGE>7.000</MENGE> <MENEE>PCE</MENEE> <BMNG2>7.000</BMNG2>
<PMENE>PCE</PMENE> <VPREI>17.77</VPREI> <PEINH>1</PEINH> <NETWR>124.39</NETWR>
<NTGEW>5.53</NTGEW> <GEWEI>KGM</GEWEI>
<MATKL>004</MATKL> <BPUMN>1</BPUMN> <BPUMZ>1</BPUMZ>
<E1EDP20 SEGMENT="1">
<WMENG>7.000</WMENG> <EDATU>19990622</EDATU> </E1EDP20>
<E1EDP19 SEGMENT="1">
<QUALF>002</QUALF> <IDTNR>WTBMATERIAL</IDTNR> </E1EDP19>
<E1EDP19 SEGMENT="1">
<QUALF>001</QUALF> <IDTNR>WTBMATERIAL</IDTNR>
<KTEXT>Testmaterial Thomas Becker</KTEXT> </E1EDP19>
<E1EDP17 SEGMENT="1">
<QUALF>001</QUALF> <LKOND>CFR</LKOND>
<LKTEXT>Kosten und Fracht</LKTEXT> <LPRIO>00</LPRIO> </E1EDP17>
<E1EDPT1 SEGMENT="1">
<TDID>BEST</TDID> <TSSPRAS>D</TSSPRAS> <TSSPRAS_ISO>DE</TSSPRAS_ISO>
<E1EDPT2 SEGMENT="1">
<TDLINE>Dies ist der Einkaufsbestelltext</TDLINE> </E1EDPT2>
<E1EDPT2 SEGMENT="1">
<TDLINE>Ein schoenes deutsches Wort.</TDLINE> </E1EDPT2>
</E1EDPT1>
</E1EDP01>

 SAP AG 1999 IDocEnjoy (Th. Becker) / 30


Port Type „XML“, ORDERS (Item 20 + Trailer)
<E1EDP01 SEGMENT="1">
<POSEX>00020</POSEX> <ACTION>001</ACTION> <PSTYP>0</PSTYP>
<MENGE>17.000</MENGE> <MENEE>PCE</MENEE> <BMNG2>17.000</BMNG2>
<PMENE>PCE</PMENE> <VPREI>18.33</VPREI> <PEINH>1</PEINH> <NETWR>311.61</NETWR>
<NTGEW>1588.65</NTGEW> <GEWEI>KGM</GEWEI>
<MATKL>001</MATKL> <BPUMN>1</BPUMN> <BPUMZ>1</BPUMZ>
<E1EDP20 SEGMENT="1">
<WMENG>17.000</WMENG> <EDATU>19990622</EDATU> </E1EDP20>
<E1EDP19 SEGMENT="1">
<QUALF>002</QUALF> <IDTNR>WTBMATERIAL2</IDTNR> </E1EDP19>
<E1EDP19 SEGMENT="1">
<QUALF>001</QUALF> <IDTNR>WTBMATERIAL2</IDTNR>
<KTEXT>Materialvariante Thomas Becker</KTEXT> </E1EDP19>
<E1EDP17 SEGMENT="1">
<QUALF>001</QUALF> <LKOND>FOB</LKOND>
<LKTEXT>Frei on Board</LKTEXT> <LPRIO>00</LPRIO> </E1EDP17>
<E1EDPT1 SEGMENT="1">
<TDID>BEST</TDID> <TSSPRAS>D</TSSPRAS> <TSSPRAS_ISO>DE</TSSPRAS_ISO>
<E1EDPT2 SEGMENT="1">
<TDLINE>
Will man das Material bestellen, so wird der Einkaufsbestelltext
</TDLINE> </E1EDPT2>
<E1EDPT2 SEGMENT="1">
<TDLINE>sicherlich bei der Entscheidung helfen.</TDLINE>
</E1EDPT2>
<E1EDPT2 SEGMENT="1">
<TDLINE>Oder auch nicht!?</TDLINE> </E1EDPT2>
</E1EDPT1>
</E1EDP01>
<E1EDS01 SEGMENT="1">
<SUMID>002</SUMID> <SUMME>436</SUMME> <SUNIT>DEM</SUNIT> </E1EDS01>
</IDOC>
</ORDERS01>

 SAP AG 1999 IDocEnjoy (Th. Becker) / 31


Port Type „XML“, DTD for IDoc type ORDERS01
<!-- ORDERS01 Purchasing/Sales -->
<!ELEMENT ORDERS01 (IDOC+) >
<!ELEMENT IDOC (EDI_DC40, E1EDK01, E1EDK14*, E1EDK03*, E1EDK04*, E1EDK05*, E1EDKA1*, E1EDK02*, E1EDK17*,
E1EDK18*, E1EDKT1*, E1EDP01*, E1EDS01*) >
<!-- IDoc Control Record for Interface to External System -->
<!ELEMENT EDI_DC40 (TABNAM, MANDT?, DOCNUM?, DOCREL?, STATUS?, DIRECT, OUTMOD?, EXPRSS?, TEST?, IDOCTYP,
CIMTYP?, MESTYP, MESCOD?, MESFCT?, STD?, STDVRS?, STDMES?, SNDPOR, SNDPRT, SNDPFC?, SNDPRN, SNDSAD?,
SNDLAD?, RCVPOR, RCVPRT, RCVPFC?, RCVPRN, RCVSAD?, RCVLAD?, CREDAT?, CRETIM?, REFINT?, REFGRP?,
REFMES?, ARCKEY?, SERIAL?) >
<!-- IDoc: Document header general data -->
<!ELEMENT E1EDK01 (ACTION?, KZABS?, CURCY?, HWAER?, WKURS?, ZTERM?, KUNDEUINR?, EIGENUINR?, BSART?, BELNR?,
NTGEW?, BRGEW?, GEWEI?, FKART_RL?, ABLAD?, BSTZD?, VSART?, VSART_BEZ?, RECIPNT_NO?, KZAZU?, AUTLF?,
AUGRU?, AUGRU_BEZ?, ABRVW?, ABRVW_BEZ?, FKTYP?, LIFSK?, LIFSK_BEZ?, EMPST?, ABTNR?, DELCO?, WKURS_M?) >
...
<!-- IDoc: Document Item General Data -->
<!ELEMENT E1EDP01 (POSEX?, ACTION?, PSTYP?, KZABS?, MENGE?, MENEE?, BMNG2?, PMENE?, ABFTZ?, VPREI?, PEINH?,
NETWR?, ANETW?, SKFBP?, NTGEW?, GEWEI?, EINKZ?, CURCY?, PREIS?, MATKL?, UEPOS?, GRKOR?, EVERS?, BPUMN?,
BPUMZ?, ABGRU?, ABGRT?, ANTLF?, FIXMG?, KZAZU?, BRGEW?, PSTYV?, EMPST?, ABTNR?, ABRVW?, WERKS?, LPRIO?,
LPRIO_BEZ?, ROUTE?, ROUTE_BEZ?, LGORT?, VSTEL?, DELCO?, MATNR?, VALTG?, HIPOS?, HIEVW?,
E1EDP02*, E1EDP03*, E1EDP04*, E1EDP05*, E1EDP20*, E1EDPA1*, E1EDP19*, E1EDP17*, E1EDP18*, E1EDPT1*) >
<!-- IDoc: Document Item Reference Data -->
<!ELEMENT E1EDP02 (QUALF?, BELNR?, ZEILE?, DATUM?, UZEIT?, BSARK?, IHREZ?) >
...
<!-- Field MESTYP in EDI_DC40: Message type -->
<!ELEMENT MESTYP (#PCDATA) >
<!-- Field MFRNR in E1EDP19: Manufacturer number -->
<!ELEMENT MFRNR (#PCDATA) >
...
<!ATTLIST IDOC BEGIN (1) #REQUIRED >
<!ATTLIST EDI_DC40 SEGMENT (1) #REQUIRED >
<!ATTLIST E1EDK01 SEGMENT (1) #REQUIRED >
...
<!ATTLIST E1EDP01 SEGMENT (1) #REQUIRED >
<!ATTLIST E1EDP02 SEGMENT (1) #REQUIRED >
...
<!ATTLIST E1EDS01 SEGMENT (1) #REQUIRED >

 SAP AG 1999 IDocEnjoy (Th. Becker) / 32


SAP BC Positioning

 As of today common technologies


for interface development are R/3
BAPI and IDoc.
RFC
 SAP will invest into Business
Connector and ITS technology Business Connector

 Business Connector:
R/3 to R/3 and R/3 to non-R/3 internet XML SAP/XML
communication via IDocs, BAPIs and RFCs.
 ITS:
Advanced internet enablement of R/3
business transactions.

 SAP will invest into enhanced XML capabilities of SAP


Business Technology.
 SAP will actively watch and participate in the evolution
of XML in the W3C standarization committee.
 SAP AG 1999 IDocEnjoy (Th. Becker) / 33
SAP BC - Architecture

Internet
XML/HTML via
HTTP(S)

Representation/Validation

Flow (Mapping,Routing)

RFC Coder/Decoder
RFC
tRFC

IDoc BAPI
R/3

 SAP AG 1999 IDocEnjoy (Th. Becker) / 34


SAP BC - A Pool of Services

SBC XML
CALL HTML

Parameter Internet
Stable and generic Stable and generic
Connector

R/3 Calling Model R/3 Interface


Business

for Internet Calls for incoming Internet Calls


Server for
Outbound and
Inbound Calls
Internet Middleware
makes use of
Middleware Service Pool
Internet-related

RFC Connection pooling

Target Determination

HTTP Server & Client


RFC Session handler
Middleware

Unicode Conversion
Administration GUI

Mapping Service
Security Service
Services

HTML Service
tRFC Service
BAPI Service

XML-Service
IDoc Service

...

Service
Service

 SAP AG 1999 IDocEnjoy (Th. Becker) / 35


Monitoring and Notification

100
80
60
40
20

 The IDoc interface offers 2 different 0


1. 2. 3. 4.
Qrtl. Qrtl. Qrtl. Qrtl.
approaches for tracking of data load
and data flow:
 Reports for monitoring
 Workflow for notifications
 Both approaches are based on the concept of status
transitions, i.e. an IDoc changes its status from a given value
to another value.
 Status transitions can be triggered by the SAP system as
well as by any subsystem, e.g. EDI subsystem.

 SAP AG 1999 IDocEnjoy (Th. Becker) / 36


Monitoring Programs

Statistic
„RSEIDOCM“
4711 Active Monitoring
4712
4713
List 4718

Display

 SAP AG 1999 IDocEnjoy (Th. Becker) / 37


Scenario for Monitor

 7 purchase orders were created and


wait for their transfer to an EDI
subsystem (status „30“). SAP Application

 5 purchase orders were transfered to


an EDI subsystem (status „18“).  Create
 3 of the 5 IDocs were confirmed with IDoc Interface
positive status by an EDI subsystem
(status „12“).
 Transfer  Status
1 of the 5 IDocs was confirmed with a
negative status by an EDI subsystem
(status „05“). EDI Subsystem

 SAP AG 1999 IDocEnjoy (Th. Becker) / 38


Case 1 - Statistics, after step 

7 purchase orders
were created and wait
for their transfer to an
EDI subsystem.

 SAP AG 1999 IDocEnjoy (Th. Becker) / 39


Case 1 - Statistics, after step 

5 purchase orders
were transferred to an
EDI subsystem.

 SAP AG 1999 IDocEnjoy (Th. Becker) / 40


Case 1 - Statistics, after step 

4 purchase orders
were confirmed by an
EDI subsystem via
IDoc msg. STATUS.

 SAP AG 1999 IDocEnjoy (Th. Becker) / 41


Case 2 - Lists, after step 

7 purchase orders
were created and wait
for their transfer to an
EDI subsystem.

 SAP AG 1999 IDocEnjoy (Th. Becker) / 42


Case 2 - Lists, after step 

5 purchase orders
were transferred to an
EDI subsystem.

 SAP AG 1999 IDocEnjoy (Th. Becker) / 43


Case 2 - Lists, after step 

4 purchase orders
were confirmed by an
EDI subsystem via
IDoc msg. STATUS.

 SAP AG 1999 IDocEnjoy (Th. Becker) / 44


Case 3 - Display, after step 

7 purchase orders
were created and wait
for their transfer to an
EDI subsystem.

 SAP AG 1999 IDocEnjoy (Th. Becker) / 45


Case 3 - Display, after step 

5 purchase orders
were transferred to an
EDI subsystem.

 SAP AG 1999 IDocEnjoy (Th. Becker) / 46


Case 3 - Display, after step 

4 purchase orders
were confirmed by an
EDI subsystem via
IDoc msg. STATUS.

 SAP AG 1999 IDocEnjoy (Th. Becker) / 47


Case 3 - Display, by EDI References (after step )

An EDI administrator
searches for IDocs by
interchange and message
references reported by an
EDI subsystem.

 SAP AG 1999 IDocEnjoy (Th. Becker) / 48


Case 4 - Find IDoc by Business Document

 SAP AG 1999 IDocEnjoy (Th. Becker) / 49


Outbound Data Flow w/ Notification Points

SAP application

Document

Message w/
EDIN NAST record
Message Control
EDIM Message
NAST
Record
IDoc w/
EDIX syntax error
IDoc Interface
EDIO IDoc

IDoc
EDIP IDoc batch

Message for
EDI subsystem EDIL Status report
EDIS
Status report
EDIR
Customer

 SAP AG 1999 IDocEnjoy (Th. Becker) / 50


Inbound Data Flow w/ Notification Points

EDI subsystem TXTRAW IDoc message

IDoc
EDIM Message

IDoc Interface EDII IDoc

IDoc w/
EDIY syntax error
IDoc

IDoc w/o
SAP application Application application document

 SAP AG 1999 IDocEnjoy (Th. Becker) / 51


Determination of Selected Agents

Organizational Plan

Possible agents

Task

Role resolution Selected agents

Partner profile

Permitted agents

 SAP AG 1999 IDocEnjoy (Th. Becker) / 52


Selected Agents by General Task
Organizational Plan

Possible agents

General Task

Role resolution Selected agents

Partner profile

Permitted agents

 SAP AG 1999 IDocEnjoy (Th. Becker) / 53


Selected Agents acc/ Technical & Business Layer

Possible agents
- Business Layer -
Organizational Plan

Task Selected
business agents

Role resolution Permitted agents

Partner profile Selected


technical agents

Possible agents
- Technical Layer -

 SAP AG 1999 IDocEnjoy (Th. Becker) / 54


Determination of Permitted Agents

General Administrator
(System profile)

Determination strategy
Partner Representative
(Partner profile w/o message)

Partner & Process Representative


(Partner profile w/ message)

 SAP AG 1999 IDocEnjoy (Th. Becker) / 55


Table of Notification Tasks

Process Task Role


code resolution

EDIM TS30000020 30000001 Administrator, system profile

EDIN TS70008037 70000141 Partner profile, system profile


EDIP TS60001307 30000001 Administrator, system profile
EDIO TS00007989 30000013 Representative, partner profile
EDIX TS00008070 30000013 Representative, partner profile

EDII TS00008068 30000013 Representative, partner profile


EDIY TS00008074 30000013 Representative, partner profile
application TSnnnnnnnn 00000134 Representative, partner profile

EDIL TS70008373 30000001 Administrator, system profile


EDIS TS30000078 30000001 Administrator, system profile
EDIR TS70008125 30000001 Administrator, system profile

RSEIDOCM TS30200108 30200013 Party from selection screen

All application tasks can be found by the logical message as search term!

 SAP AG 1999 IDocEnjoy (Th. Becker) / 56


Task Groups

 For convenience in the


Business Workflow Explorer the
notification tasks are grouped
into task groups:
 TG70000015 All administration tasks
 TG70000016 All generic tasks of processing
 TG20000010 All application tasks for notification
about status 51 in use with EDI in
the supply-chain.
 TG20000011 The 3 groups mentioned before plus
inbound processes implemented as
SAP Business Workflows in
the supply-chain.

 SAP AG 1999 IDocEnjoy (Th. Becker) / 57


Additional Functionality

 The text message TXTRAW is implemented via a new version


of IDoc type, i.e. TXTRAW02. This IDoc type comprisese
segments to set
 recipients of message
 title of message
 An express indicator
for notification can be
set for process codes
 system and
 status.
 The notification can be
turned off for process
codes system.
OSS note #149368.

 SAP AG 1999 IDocEnjoy (Th. Becker) / 58


How to Change Role Resolution

 Create a new standard role. This


comprises the implementation of a
function module.
 Copy the standard task to a new task
for error notification.
 Change the default role for agent of
the new task to the standard role
Role resolution
created in step 1.
 Activate the triggering event of the
new task.
 Deactivate the triggering event of the
standard task.

 SAP AG 1999 IDocEnjoy (Th. Becker) / 59


Example of an User‘s Inbox

 SAP AG 1999 IDocEnjoy (Th. Becker) / 60


Workitem: Error in EDI subsystem

A change of status is
triggered by an EDI
subsystem because of
translation error(s).

 SAP AG 1999 IDocEnjoy (Th. Becker) / 61


Workitem: Status Transition Pending

Change of status triggered by an


EDI subsystem is pending for
more than 5 hours (end time...).
This is dedected by program
RSEIDOCM.

 SAP AG 1999 IDocEnjoy (Th. Becker) / 62


Development Areas of an IDoc Process

Application

Function Module Business Workflow

Program Function Module

s s
Report
c e
o
Pr
IDoc Type

s s d
e n
roc b o u
P Segment
In
n d
o u
b
O ut
Segment Segment
Type Name

IDoc Interface
r e
c t u
St ru
a t a
D
 SAP AG 1999 IDocEnjoy (Th. Becker) / 68
Definition: IDoc Type

Basis Type
= IDoc Type

Basis Type
+ Extension
= IDoc Type

 SAP AG 1999 IDocEnjoy (Th. Becker) / 69


Definition: Segment

Segment Name
E2ccccc000

Segment Type Segment Name


E1ccccc E2ccccc001

Segment Name
E2ccccc013 Segment Name
/partner/ccccc000

Segment Type Segment Name


/partner/ccccc /partner/ccccc001

Segment Name
/partner/ccccc013

 SAP AG 1999 IDocEnjoy (Th. Becker) / 70


Definition: Released & Version

 By releasing segments and IDoc types the data structures of


the interface are „frozen“ from the subsystems point of view.
The structures are labelled with unique names to distinguish
versions for segments as well as for IDoc types.
 In one SAP correction level, e.g. 4.0B, only one current
version can exist.
 A new version of the development objects segment and IDoc
type is created always, if changes are made after releasing
that object.
 Possible changes are strongly restricted to guarantee
external compatibility of the IDoc interface.

 SAP AG 1999 IDocEnjoy (Th. Becker) / 71


IDoc Types - Names in ABAP Programming

Control Record, EDIDC

Data Records, EDIDD

E1HDDOC E1TLSUM
M 1 C 1

E1HDADR E1ITDOC
C 5 M 1

E1ITSCH

Tree of Segments C 99 C 5

Status Records, EDIDS

 SAP AG 1999 IDocEnjoy (Th. Becker) / 72


IDoc Types - Names in Subsystem

Control Record, EDI_DC40

Data Records, by segment name

E2HDDOC* E2TLSUM*
M 1 C 1

E2HDADR* E2ITDOC*
C 5 M 1

E2ITSCH*

Tree of Segments C 99 C 5

Status Records, EDI_DS40

 SAP AG 1999 IDocEnjoy (Th. Becker) / 73


Tools to Develop an IDoc Type

Tool to define the


IDoc type with its segments

Tool to define the E1HDDOC


segment with its fields

 SAP AG 1999 IDocEnjoy (Th. Becker) / 74


What Kind of Development, and When

 The IDoc type requested is available, and matches all


requirements:
Nothing to be done !
 The IDoc type requested is available, but does not match in
all the requirements:
Development as „extension“ !
 The IDoc type requested is not available, or matches only in
few requirements:
Development as „basis type“ !

 SAP AG 1999 IDocEnjoy (Th. Becker) / 75


Areas of a Customer Extension

Application  Define data structure:


In area menu „WEDI“.
Function Module Business Workflow
 Implement processing in
Program Function Module
outbound and inbound:
Report
IDoc Type
Project management „CMOD“.
 Publish documentation:
In area menu „WEDI“.
Segment

Segment Segment
Type Name

IDoc Interface

 SAP AG 1999 IDocEnjoy (Th. Becker) / 76


Advantages of Extensions

 The standard code of processing is still in use.

 Developments and corrections of standard code


are available automatically.

 Extensions are much less effort than


developments.

 SAP AG 1999 IDocEnjoy (Th. Becker) / 77


Fundamental Rules for Customer Extensions

 Additional customer fields are assembled in separate


customer segments.
 Customer segments are assigned to standard
segments as child-segments.
 Processing of customer segments is implemented in
„customer-exits“.
The customer-exits are called in standard code.

 SAP AG 1999 IDocEnjoy (Th. Becker) / 78


Steps to Extend the Data Structure

 Identify the required fields, and their


underlying data elements in ABAP
repository.
 Define the required segments with the
„segment editor“.
 Define the „extension“ by extending a
basis type with the
„IDoc type editor“.
 Assign the logical message to the
extension via
„environment in the IDoc type editor“.

 SAP AG 1999 IDocEnjoy (Th. Becker) / 79


Steps to Extend the Processing

 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.
 Activate project in „project management“.

 SAP AG 1999 IDocEnjoy (Th. Becker) / 80


Outbound Call Sequence

SAP Application

Message Control
IDoc Interface

Customer-exit 1

Customer-exit 2 Process Code


Call Function ...

Customer-exit x

IDoc Interface

EDI subsystem

 SAP AG 1999 IDocEnjoy (Th. Becker) / 81


Inbound Call Sequence

EDI subsystem

IDoc Interface

Customer-exit 1

Customer-exit 2 Process Code


Call Function ...

Customer-exit x

SAP Application

 SAP AG 1999 IDocEnjoy (Th. Becker) / 82


Areas of a Basis Type Development

Application  Define data structure:


In area menu „WEDI“.
Function Module Business Workflow
 Implement processing in
Program Function Module
outbound and inbound:
Report
IDoc Type
In Object Browser „SE80“.
 Publish documentation:
In area menu „WEDI“.
Segment

Segment Segment
Type Name

IDoc Interface

 SAP AG 1999 IDocEnjoy (Th. Becker) / 90


Fundamental Rules for Basis Type Development

 Segments are constructed as semantical units by


(application) fields.
 Segments are reusable units of the IDoc development.
 Groups of segments are constructed as semantical units by
segments.
 IDoc types are constructed by segments and groups of
segments. They are the data structure of application
documents for transmission.
 In development IDoc types are created as basis types.
 The business process itself is not identified by an IDoc type,
but the logical message assigned.

 SAP AG 1999 IDocEnjoy (Th. Becker) / 91


Steps to Develop the Data Structure

 Identify the required fields, and their


underlying data elements in ABAP
repository.
 Define the required segments with the
„segment editor“.
 Define the basis type with the
„IDoc type editor“.
 Create the logical message via
„environment in the IDoc type editor“.
 Assign the logical message to the
basis type via
„environment in the IDoc type editor“.

 SAP AG 1999 IDocEnjoy (Th. Becker) / 92


Types of Processing

 Outbound processing implemented via


 Message Control (NAST) ?
 ALE Interface (MASTER_IDOC_DISTRIBUTE) ?

 Inbound processing implemented via


 Business Workflow ?
 ALE Interface (function module) ?

 SAP AG 1999 IDocEnjoy (Th. Becker) / 93


 Steps to Develop Outbounds via NAST

 Check interface to message control in the application


mentioned and its condition elements:
 Condition tables
 Access Sequences
 Condition Types
 Schema
 Application
 Implementation of the function module, which creates
the application data in „IDoc format“.
 Definition of process code outbound.

 SAP AG 1999 IDocEnjoy (Th. Becker) / 94


 Steps to Develop Outbounds via ALE Interface

 Implementation of a program, which invokes


function module MASTER_IDOC_DISTRIBUTE.
Interface:
 Import MASTER_IDOC_CONTROL like EDIDC
 Tables COMMUNICATION_IDOC_CONTROL like EDIDC
MASTER_IDOC_DATA like
EDIDD

 For each of these programmes the control


features have to be decided upon,
e.g. timing, events, dialog steps.

 SAP AG 1999 IDocEnjoy (Th. Becker) / 95


 Steps to Develop Inbounds via Workflow

 Implementation of Workflow for control of


inbound processing. This comprises:
 Implementation of object and method(s) in BOR.
 Implementation of workflow.
 Definition of process code inbound.

 SAP AG 1999 IDocEnjoy (Th. Becker) / 96


 Steps to Develop Inbounds via ALE Interface

 Implementation of the function module,


which creates the application document
from the IDoc.
 Implementation of Workflow for notification
in case of application errors (IDoc status 51).
This comprises:
 Implementation of object and method(s) in
BOR.
 Implementation of workflow.
 Definition of properties of the function
module for ALE invocation.
 Assignment of the function module to logical
message and IDoc type for ALE invocation.
 Definition of process code inbound and
linkage to ALE layer.
 SAP AG 1999 IDocEnjoy (Th. Becker) / 97
Publish Documentation of IDoc Types

...
Begin typedef struct z2incodx000 “XML”
… { e.g. DTD

End } z2incodx000

 SAP AG 1999 IDocEnjoy (Th. Becker) / 99


IDoc Layers of Testing

Application

Message Control Workflow

WE15 WE19 WE19

IDoc Interface

WE14 WE16 WE17


WE19 WE18

Outbound WE12 Inbound Status


IDoc file IDoc file report

 SAP AG 1999 IDocEnjoy (Th. Becker) / 100


IDoc Outbound Testing

 With transaction WE15,


program RSNAST00 Application
test the creation of an IDoc based on the
Message Control record. Message Control

 With transaction WE14,


program RSEOUT00 WE15

test the forwarding of an IDoc to the


receiver system, e.g. IDoc Interface

 as preparations for the inbound testing WE14


WE19
 EDI processing with an EDI subsystem
 With transaction WE19, „Test Tool“ Outbound
IDoc file
example outbound IDoc files can be
created.

 SAP AG 1999 IDocEnjoy (Th. Becker) / 101


IDoc Inbound Testing

 With transaction WE12,


Application
test the inbound processing of an IDoc
by coping an outbound file, and handle
Workflow
the copy as an inbound file.
 With transaction WE16, WE19
test the inbound processing of an IDoc
by picking-up any inbound file. IDoc Interface
 With transaction WE19, „Test Tool“ WE16
test the inbound processing of an IDoc
by creating the IDoc in editor
and feed the result to the Outbound WE12 Inbound
inbound process. IDoc file IDoc file

 SAP AG 1999 IDocEnjoy (Th. Becker) / 102


IDoc Inbound Testing, WE19

 SAP AG 1999 IDocEnjoy (Th. Becker) / 103


IDoc Status Testing

 With transaction WE17,


test the processing of the status report, Application
and the reactions in behalf of the status
report. Workflow

 With transaction WE18,


create a status report and initiate the WE19

processing as with transaction WE17.


IDoc Interface
 With transaction WE19, „Test Tool“
create a status report as IDoc type WE17
WE18
„SYSTAT01“ and follow inbound testing
features.
Status
report

 SAP AG 1999 IDocEnjoy (Th. Becker) / 104


Industries

REQOTE
Customer
QUOTES Vendor
PRICAT

ORDERS/ORDCHG

ORDRSP
TXTRAW
IMPINV DESADV

TXTRAW STPPOD

INVOIC EXPINV

REMADV

Bank
PAYEXT CREADV

DEBADV LOCKBX

FINSTA FINSTA

 SAP AG 1999 IDocEnjoy (Th. Becker) / 105


Scenario: Automotive

Manufacturer DELINS Supplier


OEM DELORD

DESADV
ACCSTA
TRXSTA ACCSTA
GSVERF/SBINV

INVOIC

REMADV

Bank
PAYEXT

DEBADV CREADV

 SAP AG 1999 IDocEnjoy (Th. Becker) / 106


Retail & Consumer Products

Distribution Center PRICAT


Retailer CP Manufacturer
PROACT

ORDRSP

ORDCHG

ORDRSP

DESADV

INVOIC

REMADV

Bank
PAYEXT

DEBADV CREADV

 SAP AG 1999 IDocEnjoy (Th. Becker) / 107


EDI Subsystem Responsibilities

EDI subsystem

partner profile translator archive

addresses message handling monitor

mappings communication

 SAP AG 1999 IDocEnjoy (Th. Becker) / 108


EDI Certification

 Certified process
 Purchase Order, out
 Customer order, in
 Order confirmation, out
 P.O. Acknowledgement, in
 Certified functionality
 file interface w/ RFC
 outbound IDoc
Document
 status report
 inbound IDoc System R/3 System R/3

IDoc IDoc

Transaction
Subsystem Subsystem
 SAP AG 1999 IDocEnjoy (Th. Becker) / 109
Questions ...

 SAP AG 1999 IDocEnjoy (Th. Becker) / 110


Agenda

 Overview in 11 Slides

 What is an IDoc ?

 How does it work ?

 What is an EDI subsystem ?

 SAP AG 1999 IDocEnjoy (Th. Becker) / 111


Agenda

 Overview in 24 Slides

 What is an IDoc ?

 How does it work ?

 What are the testing tools ?

 What processes are available ?

 What is an EDI subsystem ?


 SAP AG 1999 IDocEnjoy (Th. Becker) / 112
Agenda

 Monitoring and
Notification by Workflow

 Processing

 Monitor

 Notification

 SAP AG 1999 IDocEnjoy (Th. Becker) / 113


Agenda

 Monitoring and
Notification by Workflow

 Processing

 Monitor

 Notification

 SAP AG 1999 IDocEnjoy (Th. Becker) / 114


Agenda

 Monitoring and
Notification by Workflow

 Processing

 Monitor

 Notification

 SAP AG 1999 IDocEnjoy (Th. Becker) / 115


Agenda

 Test Utilities

 Outbound

 Inbound

 Status

 SAP AG 1999 IDocEnjoy (Th. Becker) / 116


Agenda

 Developing IDoc Interfaces

 Definitions

 How to Extend ?

 How to Develop new ?

 SAP AG 1999 IDocEnjoy (Th. Becker) / 117


Agenda

 Developing IDoc Interfaces

 Definitions

 How to Extend ?

 How to Develop new ?

 SAP AG 1999 IDocEnjoy (Th. Becker) / 118


Agenda

 Developing IDoc Interfaces

 Definitions

 How to Extend ?

 How to Develop new ?

 SAP AG 1999 IDocEnjoy (Th. Becker) / 119


Agenda

 Message Control

 Generals

 Especially for EDI

 SAP AG 1999 IDocEnjoy (Th. Becker) / 120

You might also like