You are on page 1of 65

%&6$3,'RF,QWHUIDFH 'HYHORSPHQW

%&

6$3,'RF,QWHUIDFH
'HYHORSPHQW
 SAP AG 1999

n R/3
n Release 4.6A
n October 1999
n Material Number 5003 5260
&RS\ULJKW

&RS\ULJKW6$3$*$OOULJKWVUHVHUYHG
1HLWKHUWKLVWUDLQLQJPDQXDOQRUDQ\SDUWWKHUHRIPD\
EHFRSLHGRUUHSURGXFHGLQDQ\IRUPRUE\DQ\PHDQV
RUWUDQVODWHGLQWRDQRWKHUODQJXDJHZLWKRXWWKHSULRU
FRQVHQWRI6$3$*7KHLQIRUPDWLRQFRQWDLQHGLQWKLV
GRFXPHQWLVVXEMHFWWRFKDQJHDQGVXSSOHPHQWZLWKRXWSULRU
QRWLFH

$OOULJKWVUHVHUYHG

 SAP AG 1999

7UDGHPDUNV
n Microsoft ®, Windows ®, NT ®, PowerPoint ®, WinWord ®, Excel ®, Project ®, SQL-Server ®,
Multimedia Viewer ®, Video for Windows ®, Internet Explorer ®, NetShow ®, and HTML Help ®
are registered trademarks of Microsoft Corporation.
n Lotus ScreenCam ® is a registered trademark of Lotus Development Corporation.
n Vivo ® and VivoActive ® are registered trademarks of RealNetworks, Inc.
n ARIS Toolset ® is a registered Trademark of IDS Prof. Scheer GmbH, Saarbrücken
n Adobe ® and Acrobat ® are registered trademarks of Adobe Systems Inc.
n TouchSend Index ® is a registered trademark of TouchSend Corporation.
n Visio ® is a registered trademark of Visio Corporation.
n IBM ®, OS/2 ®, DB2/6000 ® and AIX ® are a registered trademark of IBM Corporation.
n Indeo ® is a registered trademark of Intel Corporation.
n Netscape Navigator ®, and Netscape Communicator ® are registered trademarks of Netscape
Communications, Inc.
n OSF/Motif ® is a registered trademark of Open Software Foundation.
n ORACLE ® is a registered trademark of ORACLE Corporation, California, USA.
n INFORMIX ®-OnLine for SAP is a registered trademark of Informix Software Incorporated.
n UNIX ® and X/Open ® are registered trademarks of SCO Santa Cruz Operation.
n ADABAS ® is a registered trademark of Software AG
n The following are trademarks or registered trademarks of SAP AG; ABAP/4, InterSAP, RIVA, R/2,
R/3, R/3 Retail, SAP (Word), SAPaccess, SAPfile, SAPfind, SAPmail, SAPoffice, SAPscript,
SAPtime, SAPtronic, SAP-EDI, SAP EarlyWatch, SAP ArchiveLink, SAP Business Workflow, and
ALE/WEB. The SAP logo and all other SAP products, services, logos, or brand names included
herein are also trademarks or registered trademarks of SAP AG.
n Other products, services, logos, or brand names included herein are trademarks or registered
trademarks of their respective owners.
%XVLQHVV,QWHJUDWLRQ7HFKQRORJLHV,,

/HYHO /HYHO


3 days
Application Link
Enabling (ALE)
Technology
 4

2 days 1 day ,-"./'0'!1!')&!


SAP IDoc Interface SAP IDoc Interface -
Technology Development
  

3 days 4 days

Business Integration EDI Interface


Technology



2 days  
Building Enterprise 5 days
Solutions with SAP Data Transfer 2 3
'
Components 2 days
  Communication
 !"
5 days Interfaces in ABAP
Programming with  $$ #$%'&)((+* )&
BAPIs in Visual Basic 5 days
  Programming with
5 days BAPIs in JAVA
R/3 Interface and BAPI
Programming in C++
 SAP AG 1999
&RXUVH3UHUHTXLVLWHV

l 5HFRPPHQGHG%DVLV%&$%$3
:RUNEHQFK%DVLFV
l 5HTXLUHG%DVLV%&,'RF,QWHUIDFH 6WDQGDUG

 SAP AG 1999
7DUJHW$XGLHQFH

l $%$3'HYHORSHUV
l &RQVXOWDQWV

 SAP AG 1999

1RWHVWRWKHXVHU
n The training materials are QRWWHDFK\RXUVHOISURJUDPV7KH\FRPSOHPHQWWKHFRXUVH
LQVWUXFWRU
VH[SODQDWLRQVOn the sheets, there is space for you to write down additional
information.
,QWURGXFWLRQ&RQWHQWV

l &RXUVH*RDOV
l &RXUVH2EMHFWLYH V
l &RXUVH&RQWHQW
l &RXUVH2YHUYLHZ'LDJUDP
l 0DLQ%XVLQHVV6FHQDULR

 SAP AG 1999

(C) SAP AG BC621 1-1


&RXUVH*RDOV

$WWKHFRQFOXVLRQRIWKLVFRXUVH\RXZLOOEH
DEOHWR
l ([WHQG,'RFW\SHV
l 'HILQHQHZ,'RFW\SHV

 SAP AG 1999

(C) SAP AG BC621 1-2


&RXUVH2EMHFWLYHV

$WWKHFRQFOXVLRQRIWKLVFRXUVH\RXZLOOEHDEOH
WR
l %XLOGDQGH[WHQGWKHGDWDVWUXFWXUHRI,'RFW\SHV
l 8VHWKH,'RFW\SHHGLWRUDQGVHJPHQWHGLWRU
l 8VHFXVWRPHUH[LWVWRSURFHVV,'RFW\SHV

 SAP AG 1999

(C) SAP AG BC621 1-3


&RXUVH&RQWHQW

3UHIDFH

8QLW Introduction
8QLW Development Environment for IDoc Types
8QLW Extension of IDoc Types
8QLW Development of IDoc Types

$SSHQGL[

 SAP AG 1999

(C) SAP AG BC621 1-4


%&&RXUVH2YHUYLHZ'LDJUDP

   
)
'(
 
 
*
!&
  "


#   $%
 "

!&
 "

 

 


 



 
 

 

! 
 "


   

 SAP AG 1999

(C) SAP AG BC621 1-5


0DLQ%XVLQHVV6FHQDULR

(QWHUSULVHWUDGLQJ
(QWHUSULVHWUDGLQJFRPSDQ\$ZDQWV9HQGRU
9HQGRU%
FRPSDQ\$
%WRVKLSWKHLUPDWHULDORUGHUVYLD(',
+HUUPDQQ 5LHPHUZLOOGLHHQWVSUHFKHQGHQ
%HVWHOOXQJHQJOHLFKHOHNWURQLVFKYHUEXFKHQ
$OV*UXQGODJHZROOHQGLH8QWHUQHKPHQGHQ
,'RF7\S25'/*7YHUZHQGHQGHUDEHU
HYHQWXHOOQRFKGHQ%HGUIQLVVHQ
HQWVSUHFKHQGHUZHLWHUWZHUGHQPX‰$OV
3URMHNWWHDPPLWJOLHGLQIRUPLHUHQ6LHVLFKDOVR
6$356\VWHP 6$356\VWHP
EHUGLH(QWZLFNOXQJVP|JOLFKNHLWHQGLHGLH
,'RF6FKQLWWVWHOOHELHWHW
5678 5678

+-,/.0.2143(,

(',6XEV\VWHP (',6XEV\VWHP

 SAP AG 1999

n Enterprise trading company A wants vendor B to ship their material orders via EDI. Vendor B would
like to electronically update the placed orders immediately. As a basis for this transaction, A & B
intend to use IDoc type ORDLGT01. However, IDoc type ORDLGT01 needs to be extended to meet
their needs. Your task as a member of the project team is to research the possibilities of the
development of the IDoc Interface.

(C) SAP AG BC621 1-6


'HYHORSPHQW(QYLURQPHQWIRU,'RF7\SHV

l 'DWD6WUXFWXUHV
,'RF5HFRUG7\SHV
,'RF7\SHV
,'RF6HJPHQWV
l 'HYHORSPHQWDQG([WHQVLRQ

 SAP AG 1999

(C) SAP AG BC621 2-1


&RXUVH2EMHFWLYHV

l 8QGHUVWDQGWKHGHYHORSPHQWHQYLURQPHQWIRU,'RF
W\SHV
l 'HVFULEHWKHIXQFWLRQDOLW\RIWKHGHYHORSPHQW
HQYLURQPHQWIRU,'RFW\SHV
l ([SODLQWKHGLIIHUHQFHEHWZHHQGHYHORSPHQWDQG
H[WHQVLRQV

 SAP AG 1999

(C) SAP AG BC621 2-2


&RXUVH2YHUYLHZ'LDJUDP

   0

 & ' 1( *+,


-+. ,  / &

'! )(*,

 

!"#$% 

& %'!)(*"+,

 
  

 SAP AG 1999

(C) SAP AG BC621 2-3


&RPSRQHQWVRIWKH,'RF3URFHVV

$SSOLFDWLRQ
2  03
  89 , #,,):;%=< &  >

4! 5 6 2 ?  @


 

7 $
' 1( *+

A 50

A +53+ A +50 

.*"+ +60

,'RF,QWHUIDFH

 SAP AG 1999

n The IDoc Interface consists of a data structure (the IDoc type) and process programs for this data
structure.
n The Subsystem Interface is built through the data structure.
n The process programs are inserted between SAP application and interface.
• In outbound processing you should be able to read the master and movement data as well as be
able to format it into an IDoc format.
• In inbound processing you can generate or change application data from the IDoc format.

(C) SAP AG BC621 2-4


,'RF5HFRUG7\SHV

&RQWURO5HFRUG IDoc ID
Partner
IDoc Type and Logical Message
External Structure

'DWD5HFRUGV

Control Part Application Data

6WDWXV5HFRUGV IDoc ID
Status Information

 SAP AG 1999

n Every IDoc in the SAP database consists of:


• One control record,
• Data records, containing the application data in the segments describing the hierarchy. These
segments are in a hierarchy sequence,
• Status records, which monitor specific IDoc steps. The further the IDoc is in its process the more
status records it has.
n An IDoc that has been exchanged with an external system, will only contain
• The control record and
• The data records.
n If the external system communicates the status of the sending IDoc with the R/3 System, this can be
carried out with a status confirmation. The R/3 System connects the received status records to the
corresponding outbound IDoc in the database. The R/3 System can also transmit status confirmations
about IDocs received. This, however, can only happen through the specific IDoc type SYSTAT01,
that is, the control and data records are exchanged here. In this case, the status information is
therefore contained in the IDoc data records.

(C) SAP AG BC621 2-5


,'RF7HUPV%DVLF7\SHDQG([WHQVLRQV

%DVLF7\SH

,'RF7\SH

%DVLF7\SH
 ([WHQVLRQ

,'RF7\SH

 SAP AG 1999

n The IDoc type is a hierarchy consisting of segments and complex data structures which can receive
an application document
n There is a formal distinction between basic types and extensions
n The specific document in "IDoc format" is called an IDoc and has a specific IDoc type.
n An extension expands a basic type (SAP standard) by a customer specific segment, which are
directly or indirectly dependent of basic type segments. The segments of the basic type are
represented by the roots and the sub-trees, formed by the customer segments.
n The control record identifies the IDoc type using the following fields:
IDOCTYP Name of the basic type
CIMTYP Name of extension
n Examples:
é IDoc type ORDERS01 from standard system, not extended:
The field IDOCTYP has the value ORDERS01
The field CIMTYP is empty
é IDoc type ORDERS01 from standard system, extended by customers:
The field IDOCTYP has the value ORDERS01
The field CIMTYP has the value of the name of the extension

(C) SAP AG BC621 2-6


,'RF7HUPV6HJPHQW

6HJPHQWQDPH Version 1
(FFFFF e.g. 3.0A
6HJPHQWW\SH
(FFFFF 6HJPHQWQDPH Version 2
(FFFFF e.g. 3.0C

6HJPHQWQDPH
SDUWQHUFFFFF
6HJPHQWQDPH
BC $,   EDGF

(FFFFF e.g.7.7x
6HJPHQWW\SH 6HJPHQWQDPH
SDUWQHUFFFFF SDUWQHUFFFFF

6HJPHQWQDPH
SDUWQHUFFFFF

 SAP AG 1999

n A segment consists of one


ÍSAP release independent segment type
ÍAt least one SAP release dependent segment name (segment definition)
n Segment types are structures in the dictionary. They are used as internal names in the SAP System.
n An external system, for example an EDI subsystem, can recognize the version of the current segment
by the segment name.
n Segment types are a maximum of 27 digits. Segment names are derived from the segment types by
adding 3 digits (starting with 000). The naming conventions are preserved through the IDoc
definition tools.
n SAP segments differ from this rule:
é Segment types start with “E1”, segment names with “E2“ and additionally have a version number.
é The customer can also use the namespace "Z1"/ "Z2" or a customer prefix. Partners always use a
prefix.
n All segment fields are of type CHAR. Thus all SAP data types with similar characters are permitted,
for example NUMC or CLNT.

(C) SAP AG BC621 2-7


,'RF)XQFWLRQV5HOHDVHDQG9HUVLRQ&UHDWLRQ

l %\UHOHDVLQJVHJPHQWVDQG,'RFW\SHVWKHH[WHUQDO
LQWHUIDFHLVIUR]HQDQGJLYHQXQLTXHQDPHVIRU
WKHVHREMHFWVIRUDQH[WHUQDOSDUWQHUV\VWHP
l 7KHUHFDQRQO\EHRQHVHJPHQWYHUVLRQIRUHDFK6$3
UHOHDVH IRUH[DPSOH%
l 7KH,'RFGHILQLWLRQWRROVFRQWUROWKHUHOHDVH$IWHU
HDFKUHOHDVHIXUWKHUGHYHORSPHQWOHDGVWRQHZ
YHUVLRQV
l &KDQJHVPXVWEHPDGHLQDFFRUGDQFHZLWKVWULFW
UXOHVVRWKDWWKHLQWHUIDFHUHPDLQVFRPSDWLEOH

 SAP AG 1999

H
The version of an IDoc type or segment is created at a maintenance level. The last version remains the current one in all
following maintenance levels. The current version is only replaced by the development of a new version.
H
All old versions remain in the system so that it is possible to reduce the current version to an older version at any time. This
enables the subsystems to be kept compatible even after an upgrade.
H
Segment version:
é New fields can only be added to an existing segment.
é By doing this the structure of segment types gets extended.
é A new segment name is formed.
H
Version of an IDoc type:
é You may only add new segments.
é A new IDoc type is created.
é A new version of an existing segment alone does not lead to a new version of IDoc type.
1RWHIRURXWERXQGSURFHVVLQJ In the partner profiles the versions are listed as follows:
H

é IDoc type: By entering the IDoc type.


é Segment: By entering a SAP release. This leads to the reduction of all segments which are used in the IDoc type to an
older version, that is, to the current version stated in the release. If the field remains empty, the current version of all
segments relating to the current release is used.
1RWHIRULQERXQG3URFHVVLQJ No settings are necessary or possible. The IDoc Interface recognizes the version and
H

processes the data accordingly.

(C) SAP AG BC621 2-8


$%$33URJUDPPLQJ1DPHV

(','& ,'RF7\SH
I/JLK3MONPJRQ9NTSVUVJWNYX

(',''GLVSOD\HGDVDVHJPHQWWUHH
a \1M.\bNPSCUVJLNTXL_

(+''2& (7/680
M 1 C 1
(+'$'5 (,7'2&
C 5 cdefgihjGfYkPlmfYgGh
M 1

(,76&+
(,76&+
nop q r jTfGkl9fgsh

C 99 C 5

(','6 (',B'6
Z[M$\LM^]_`NPSCUVJLNTX

 SAP AG 1999

n ABAP programming exclusively uses the segment types of the segments, for example in the
TABLES statement.
n Segment types implemented in the SAP standard system start with prefix "E1".

(C) SAP AG BC621 2-9


6XEV\VWHP1DPHV

ItJWK3M.NTJLQVNTSVU9JRNPX
(',B'& ,'RF7\SH

GLVSOD\HGDVDVHJPHQWWUHH
a \uM.\`NYSCU9JWNTXL_

(+''2& (7/680
M 1 C 1
(,7'2&
(+'$'5 (,7'2&
cPde#fgwhjsfTklxfPgGh
C 5 M 1

(,76&+
(,76&+
nop q r jYfGkl9fgwh

C 99 C 5

(',B'6
Z[M.\uMv]C_`NYSCUVJLNTX

 SAP AG 1999

n The segment names of the segments are exclusively visible by the subsystem.
n Segment names implemented in the SAP standard system start with prefix "E2".

(C) SAP AG BC621 2-10


,'RF'HILQLWLRQ7RROV

,'RF7\SH(GLWRU

y{zx| }

(+''2&
6HJPHQWHGLWRU

y{zx|9~

 SAP AG 1999

n Design and definition of IDoc types and their segments are supported by the IDoc definition tools
through the following:
• Testing of the formal design rules
• Simple usage in application of an ABAP development workbench
n The IDoc type editor allows:
• Definition of basic types (possible through SAP, partners and customers)
• Definition of extensions (only possible through customers)
n The segment editor permits the definition of segments for later use in the IDoc type editor.

(C) SAP AG BC621 2-11


:KHQLV:KLFK$FWLRQ1HFHVVDU\"

J 7KH,'RFW\SHUHTXLUHGLVDYDLODEOHDQGPHHWVDOO
UHTXLUHPHQWV
1RDFWLRQQHHGHG
K 7KH,'RFW\SHUHTXLUHGLVSUHVHQWEXWGRHVQRWPHHWDOO
UHTXLUHPHQWV
$FWLRQ&XVWRPHUH[WHQVLRQ
L 7KH,'RFW\SHUHTXLUHGLVQRWDYDLODEOHRULW ?€ SUHVHQWEXW
GRHVQRWPHHWDOOWKHUHTXLUHPHQWV
$FWLRQ'HYHORSPHQW

 SAP AG 1999

n The customer extension, that is, the development of an extension does not represent a modification.
Since all actions are captured in their own namespace, the extension can automatically be expanded
to new versions of the extended IDoc type.
n The customer development is totally independent of the standard. The necessary processes can easily
be activated as table entries using the process codes.

(C) SAP AG BC621 2-12


6XPPDU\

l $Q,'RFW\SHLVDFRPSOH[GDWDVWUXFWXUHFRPSRVHG
RIVHJPHQWV
l 6HJPHQWW\SHVDUHVWUXFWXUHVLQWKH$%$3GDWD
UHSRVLWRU\
l ,'RFW\SHVDQGWKHLUSURFHVVLQJFDQEHH[WHQGHGLQ
WKHDSSURSULDWHSRVLWLRQVE\FXVWRPHUV

 SAP AG 1999

(C) SAP AG BC621 2-13


([WHQVLRQRIDQ,'RFW\SH

l ([WHQVLRQRIWKHGDWDVWUXFWXUH
l ([WHQVLRQRIRXWERXQGSURFHVVLQJ
l ([WHQVLRQRILQERXQGSURFHVVLQJ

 SAP AG 1999

n We will consider the outbound order processing (enterprise trading company A is placing an
electronic order with vendor B) as well as the sales order (order being electronically processed by the
customer service department of vendor B).
n The course uses a sample IDoc type (ORDLGT01) for purchase orders and sales orders. This IDoc
type only consists of a segment for the document header and the item. The course does not correct
any errors in order to emphasize all important aspects of the IDoc type extensions.
n The IDoc type ORDLGT01 with logical message ORDLGT does not support transmission of
specialists name or delivery conditions. In this lesson, this information will be added to the IDoc
type.

(C) SAP AG BC621 3-1


&RXUVH2EMHFWLYHV

l &UHDWH,'RF6HJPHQW
l ([WHQGDQ,'RF7\SH
l ,PSOHPHQWDFXVWRPHUH[LWLQRXWERXQGSURFHVVLQJ
l ,PSOHPHQWDFXVWRPHUH[LWLQLQERXQGSURFHVVLQJ

 SAP AG 1999

(C) SAP AG BC621 3-2


&RXUVH2YHUYLHZ'LDJUDP

 .

 */
 0*
1 "0

%
& ' $ ( )*

+,- "

 


 
 
! #" $
 
   

 SAP AG 1999

(C) SAP AG BC621 3-3


$GYDQWDJHVRI&XVWRPHU(QKDQFHPHQW

l 7KHFRGLQJSURYLGHGLQWKHVWDQGDUGV\VWHPIRU
SURFHVVLQJLVXVHG
l 'HYHORSPHQWVDQGFRUUHFWLRQVRIWKHFRGLQJ
GHOLYHUHGLQWKHVWDQGDUGV\VWHPDUHWKHUHIRUH
DXWRPDWLFDOO\DYDLODEOH
l ([WHQVLRQLVOHVVWLPHFRQVXPLQJWKDQQHZ
GHYHORSPHQW

 SAP AG 1999

(C) SAP AG BC621 3-4


%DVLF5XOHVIRU&XVWRPHU([WHQVLRQ

l $GGLWLRQDOFXVWRPHUILHOGVDUHUHFRUGHGLQWKHLURZQ
FXVWRPHUVHJPHQWV
l &XVWRPHUVHJPHQWVGHSHQGRQ6$3VHJPHQWV
VXFFHVVRURUFKLOGUHODWLRQVKLSV 
l 7KHSURFHVVLQJRIFXVWRPHUVHJPHQWVLVH[FOXVLYHO\
LPSOHPHQWHGLQWKHFXVWRPHUH[LWVRIWKHFRGLQJ
SURYLGHGLQWKHVWDQGDUGV\VWHP

 SAP AG 1999

(C) SAP AG BC621 3-5


$UHDVRI&XVWRPHU([WHQVLRQ

$SSOLFDWLRQ
l 'DWDVWUXFWXUHLQWKH:(',
2
3 * 4  6578(3  >= 3 $?  $ $)@ACBD *E DUHDPHQX
9:; * 2 3  C  5-830  l 2XWERXQGDQGLQERXQG
<' SURFHVVLQJ7\SLFDOO\WKURXJK
#)G*" WUDQVDFWLRQ&02'RWKHUZLVH
WKURXJKLQGLYLGXDOWHFKQLTXH
F ; l 'RFXPHQWDWLRQ,QWKH:(',
DUHDPHQX
F ;/ F ;

G
" H */

,'RF,QWHUIDFH

 SAP AG 1999

(C) SAP AG BC621 3-6


6WHSV)RU([WHQGLQJWKH'DWD6WUXFWXUH

l &RPELQHWKHUHTXLUHGILHOGVDQGWKHLUGDWD
W\SHVLQWKHGLFWLRQDU\
l 'HILQLWLRQRIUHTXLUHGVHJPHQWV
VHJPHQWHGLWRU
l 'HILQLWLRQRIH[WHQVLRQ,'RFW\SHHGLWRU
l $VVLJQPHQWRIDORJLFDOPHVVDJHWRWKH
,'RFW\SHVXUURXQGLQJILHOGPHQXRI,'RF
W\SHHGLWRU

 SAP AG 1999

n In the segment editor you assign a name to each field and enter a data element that describes the field
in the application (documentation). The editor calculates the necessary character length of the field in
the segment from the data element.
n Segment editor, transaction WE31.
n In the IDoc type editor you build a complex data structure from the single segments. In doing so the
order and the hierarchical relationships of the segments are documented. In addition, you assign a
status (optional/mandatory) as well as the number of repetitions per segment and segment group.
The IDoc API tests that the generated program (Outbound: SAP processing, inbound: subsystem)
conforms to these characteristics. Violations of these characteristics are recorded through the IDoc
status syntax error (Outbound: 26, inbound 60).
n IDoc type editor, transaction WE30.

(C) SAP AG BC621 3-7


6WHSVIRU([WHQGLQJ3URFHVVLQJ

l 'HILQLWLRQRIDSURMHFW
SURMHFWPDQDJHPHQWDWWULEXWH
l &KRRVLQJWKHFRUUHFWFXVWRPHUH[LWV
SURMHFWPDQDJHPHQW6$3H[WHQVLRQV
l ,PSOHPHQWDWLRQRIWKHVHOHFWHGFXVWRPHUH[LWV
SURMHFWPDQDJHPHQWH[WHQVLRQFRPSRQHQWV
I 2XWERXQGSURFHVVLQJUHDGLQJRIWKH6$3GDWDEDVH
DQGGDWDLQ,'RFIRUPDW
I ,QERXQGSURFHVVLQJZULWLQJGDWDIURPWKH,'RF
IRUPDWLQWRWKH6$3GDWDEDVH
l $FWLYDWHSURMHFWLQSURMHFWPDQDJHPHQW

 SAP AG 1999

n Project management, transaction CMOD, radio button $WWULEXWH


• Enter a project name and select &UHDWH
• Enter short text and select 6DYH
• Choose SAP Extensions.
n Project management, transaction CMOD, radio button 6$3([WHQVLRQV.
• Find customer exit through the development class (F4 Help).
• Select the required SAP extensions and choose &RS\
• Select 6DYHand return to the initial screen of the transaction (F3).
n Project management, transaction CMOD, radio button ([WHQVLRQFRPSRQHQWV.
• Select &KDQJH
• Position the cursor on a component and choose (GLWFRPSRQHQW.
• Double-click the include in the program editor and follow the instructions in the window. Before
saving the program, don’t forget syntax testing.
• Activate the project after returning to the initial screen of the transaction.

(C) SAP AG BC621 3-8


2XWSXW'RFXPHQWDWLRQRIWKH([WHQVLRQ

%HJLQ W\SHGHILQHVWUXFWHGLBGF
« ;0/ ^«`
(QG HGLBGF

 SAP AG 1999

n The documentation tools are started from the initial node of the IDoc Interface by selecting
'RFXPHQWDWLRQ In addition, the parser output format has its own menu point for record types as well
as IDoc types.
n Automatic formats are:
• Simple, readable with a parser begin..end-Declaration sequence.
C-header.
• Meta IDoc from type SYRECD01 (IDoc record types) or SYIDOC01 (IDoc types).
• Meta data for IDocs in XML format.
n Navigation-compatible formats are:
• The tree display in the R/3 System.
• HTML file (three files, the *_ f-file is the frame that should be loaded by the browser and the
index *_i and actual documentation *_d).
n Documentation, IDoc record types: Transaction WE61
n Documentation, IDoc types: Transaction WE60
n Documentation, IDoc type (parser): Transaction WE63

(C) SAP AG BC621 3-9


6XPPDU\

l $QH[WHQVLRQFDQEHOLPLWHGWRSURFHVVLQJ
l 1RUPDOO\DQH[WHQVLRQHQFRPSDVVHVWKHGDWD
VWUXFWXUHDVZHOODVWKHSURFHVVLQJ
l ([WHQGHGGDWDVWUXFWXUHVFDQEHFRPPXQLFDWHGWR
WKHVXEV\VWHPE\WKHGRFXPHQWDWLRQWRROV

 SAP AG 1999

(C) SAP AG BC621 3-10


([HUFLVHV
'DWD8VHGLQWKH([HUFLVHV
7UDLQLQJ6\VWHP7KHLQVWUXFWRUZLOOLQIRUP\RX IRUH[DPSOH,
&OLHQW7KHLQVWUXFWRUZLOOLQIRUP\RX IRUH[DPSOH
8VHU%&QQ
3DVVZRUG.856
3RUW68%6<67(0RI7\SH´'DWD´ SUHSURJUDPPHG

'DWD 'DWDLQ7UDLQLQJ6\VWHP 'DWDLQ,'(66\VWHP


&XVWRPHU
Material SH-100 SH-100
Vendor T-BILQQ 1014
Purchasing Organization 1000 1000
Purchasing Group 001 001
Plant 1100 1100
9HQGRU
Material SH-100 SH-100
Sold-to party T-BIKQQ 1110
Order Type TA
Sales Organization 1020 1020
Distribution Channel 22 22
Division 00 00

QQ is your group number

(C) SAP AG BC621 3-11


8QLW([WHQVLRQRIDQ,'RF7\SH

• Make preparations for the extension

In the scenario send a purchase order to vendor T-BILQQ. In the second


step make the purchase order the sales order from customer T-BIKQQ.

In order to keep the exercises manageable, the IDoc type ORDLGT01 has been
introduced with message ORDLGT. This is a simplification of SAP standard
ORDERS01 and is only used for this course.
1-1 Prepare via /RJLVWLFV!0DWHULDOVPDQDJHPHQW!3XUFKDVLQJ!3XUFKDVHRUGHU
!&UHDWH!9HQGRUNQRZQ (transaction ME21) a purchase order with your vendor
T-BILQQ for methanol, material number SH-100. You belong to purchasing
organization 1000 and the purchasing group is 001. The methanol is being
purchased for plant 1100.
A partner profile for your partner already exists. It ensures that the IDoc is written
in a file and thus receives the status 03.
1-2 You simulate the incoming orders via the LQERXQGPRGLILHGRXWERXQGILOH test
program from the purchase order. You can offer default values for source,
destination and port by choosing *RWR→8VHUVHWWLQJV and selecting the port
SUBSYSTEM for the test.
Enter the following values on the tab page 6HQGHU:

Recipient, Port: SAP<SID>, System ID of SAP


system, for example SAPT80
Sender, Port: 68%6<67(0
Sender, partner number: 7%,.QQ
Sender, Partner type: .8
Sender, Partner function: $*

A corresponding inbound partner profile is already available. Select ([HFXWH. The


inbound IDoc generated gets status 51 with the error “document type NB
unknown”.

(C) SAP AG BC621 3-12


8QLW([WHQVLRQRIDQ,'RF7\SH
7RSLF([WHQVLRQRILQERXQGSURFHVVLQJ

• Get to know project administration


• Be able to write program code for inbound processing.

2-1 Extend the inbound processing of IDoc type ORDLGT01 to avoid errors status
“51”. Change the received error document type NB in one of the customer exits to
document type TA expected by the sales order. There is no need to extend the IDoc
type.

2-2 Create the 3URMHFW%&QQ in the project administration (transaction CMOD).


Select the SAP extension %&(QQ for the project. Write the extension code in
the inbound component.

2-3 Now activate your project.

2-4 Repeat the inbound sales order process with the help of the test program ,QERXQG
PRGLILHGRXWERXQGILOH derived from the already created purchase order.
Enter the following values on the tab page 6HQGHU:

Recipient, Port: SAP<SID>, System ID of SAP


system, for example SAPT80
Sender, Port: 68%6<67(0
Sender, Partner number: 7%,.QQ
Sender, Partner type: .8
Sender, Partner function: $*

QQ is the number of your group (from 01 to 18)

(C) SAP AG BC621 3-13


8QLW([WHQVLRQRIDQ,'RF7\SH
7RSLF([WHQVLRQRIRXWERXQGSURFHVVLQJ

• Get to know project management


• Be able to write the program code for outbound processing

In exercise 1 the field for 6SHFLDOLVWQDPH remained blank, even though it


was defined in the IDoc type. Since it has been agreed with your partner
to transfer the field, you decide to take care of the field through a
customer exit. There is no need to extend the IDoc type.

3-1 Change the 3URMHFW%&QQ in the project management (transaction CMOD) or


create it for the first time (if you have not completed exercise 2). Select the SAP
extension %&(QQ for the project. Write the program code in the extension
component for the outbound processing.

3-2 Activate your project.

3-3 Now repeat the purchase order through /RJLVWLFV!0DWHULDOVPDQDJHPHQW!


3XUFKDVLQJ!3XUFKDVHRUGHU!&UHDWH!9HQGRUNQRZQ(transaction ME21) to
your vendor T-BILQQ for methanol, material number SH-100.

3-4 Change to 3XUFKDVHRUGHU→ 'LVSOD\. You can display the IDoc that was just
generated from the overview screen by choosing 6\VWHP→/LQNV. Check that the
field with the user name has now been filled .

1RWH The number of filled fields is displayed in the bottom right area of the detail
display of a data record. It has increased to 8.

QQ is the number of your group (from 01 to 18)

(C) SAP AG BC621 3-14


8QLW([WHQVLRQRIDQ,'RF7\SH
7RSLF([WHQVLRQRIWKH'DWD6WUXFWXUH ,'RF7\SH

• Know how to use IDoc type editor

Your IDoc type ORDLGT01 does not contain any fields in order to
transfer the document header delivery conditions. You have to extend the
data structure, that is, the IDoc type, since delivery conditions have been
agreed to with your partner.

4-1 First define the customer segment =,1&2QQ in the segment editor. Customer
segment Z1INCOnn is to contain application fields INCO1 and INCO2. In the
application both fields INCO1 and INCO2 are contained in the structure EKKO.

4-2 In the segment editor, test that your definition is correct. Ignore the warning that the
segment has not yet been released.

4-3 Define the extension =(;7(1QQin the IDoc type editor. Extend the basic IDoc
type ORDLGT01 by segment Z1INCOQQ.

4-4 Add to the logical message ORDLGT the basic type ORDLGT01 with the
extension ZEXTENQQ in the IDoc type editor.

4-5 In the IDoc type editor, test that your definition is correct. Ignore the warning that
the IDoc type as well as the segment Z1INCOQQ has not yet been released.

QQ is the number of your group (from 01 to 18)

(C) SAP AG BC621 3-15


8QLW([WHQVLRQRIDQ,'RF7\SH
7RSLF([WHQVLRQRI2XWERXQG3URFHVVLQJ

• Revise project management


• Revise programming of outbound processing

After you have completed exercise 4, extending the customer segment


Z1INCOQQ of the IDoc type, in order to transfer the delivery conditions,
you now have to enter the delivery conditions in the customer segment in
a customer exit.

5-1 Change the 3URMHFW%&QQ in the project management (transaction CMOD) or


create it for the first time. Select the SAP extension %&(QQ for the project.
Write the program code in the extension component for the outbound processing.

5-2 Activate your project.

5-3 In partner agreement for vendor 7%,/QQ, in the outbound parameter table change
the IDoc type from basic IDoc type 25'/*7to extension =(;7(1QQ

5-4 Now repeat the purchase order through /RJLVWLFV!0DWHULDOVPDQDJHPHQW!


3XUFKDVLQJ!3XUFKDVHRUGHU!&UHDWH!9HQGRUNQRZQ(transaction ME21) to
your vendor T-BILQQ for methanol, material number SH-100.

5-5 Change to 3XUFKDVHRUGHU→ 'LVSOD\. You can display the IDoc that was just
generated from the overview screen by choosing 6\VWHP→/LQNV. Check if
customer segment Z1INCOQQ was created and filled. The IDoc has status 03, that is
a file was generated.

QQ is the number of your group (from 01 to 18)

(C) SAP AG BC621 3-16


8QLW([WHQVLRQRIDQ,'RF7\SH
7RSLF([WHQVLRQRI,QERXQG3URFHVVLQJ

• Revise project management


• Revise programming of input process

In exercise 4, after you extended IDoc type with customer segment


Z1INCOQQ In order to receive the delivery conditions, you need to read
the customer segment with delivery conditions in the customer exit and
this needs to be transmitted to the input process (BDC).

Exercise 5 is a prerequisite for this exercise.

6-1 Change the 3URMHFW%&QQ in the project management (transaction CMOD).


Write the program code in the extension component for the outbound processing.

6-2 Activate your project.

6-3 Repeat the inbound sales order process with the help of the test program ,QERXQG
PRGLILHGRXWERXQGILOH derived from the already created purchase order.
Enter the following values on the tab page 6HQGHU:

Recipient, Port: SAP<SID>, System ID of SAP


system, for example SAPT80
Sender, Port: 68%6<67(0
Sender, Partner number: 7%,.QQ
Sender, Partner type: .8
Sender, Partner function: $*

The generated IDoc contains the status 53 (application document posted).

6-4 Check the order to see if it contains the delivery conditions. The condition text
should contain the string from the customer exit.

(C) SAP AG BC621 3-17


6ROXWLRQV

8QLW([WHQVLRQRIDQ,'RF7\SH
7RSLF([WHQVLRQRI,QERXQG3URFHVVLQJ

2-1 Program code for outbound processing extension:


1 *----------------------------------------------------------------------*
2 * INCLUDE ZXDIXU02
3 *----------------------------------------------------------------------*
4
5 data: h_e1head like e1head. " Exercise 2
6
7 pe_vbak621 = pi_vbak621.
8
9 * Exercise 2
10 loop at pt_idoc_data_records
11 where segnam = ’E1HEAD’.
12 h_e1head = pt_idoc_data_records-sdata.
13 if h_e1head-auart = ’NB’.
14 pe_vbak621-auart = ’TA’.
15 endif.
16 endloop.

(C) SAP AG BC621 3-18


8QLW([WHQVLRQRIDQ,'RF7\SH
7RSLF([WHQVLRQRI2XWERXQG3URFHVVLQJ

3-1 Program code for outbound processing extension:


1 *----------------------------------------------------------------------*
2 * INCLUDE ZXDIXU01
3 *----------------------------------------------------------------------*
4
5 data: k_e1head like e1head. " Exercise 3
6
7 loop at pt_idoc_data_records
8 where segnam = ’E1HEAD’.
9 * Exercise 3
10 k_e1head = pt_idoc_data_records-sdata.
11 k_e1head-name = pi_ekko-ernam.
12 pt_idoc_data_records-sdata = k_e1head.
13 modify pt_idoc_data_records.
14 endloop.

(C) SAP AG BC621 3-19


8QLW([WHQVLRQRIDQ,'RF7\SH
7RSLF([WHQVLRQRIWKH'DWD6WUXFWXUH ,'RF7\SH

4-1 Segment Z1INCOQQ contains two fields:


INCO1 with data element INCO1 in export length 3
INCO2 with data element INCO2 in export length 28

4-2 The extension ZEXTENQQ consists of standard segments E1HEAD and E1ITEM.
The customer segment Z1INCOQQas child segment depends on standard segment
E1HEAD.

(C) SAP AG BC621 3-20


8QLW([WHQVLRQRIDQ,'RF7\SH
7RSLF([WHQVLRQRI2XWERXQG3URFHVVLQJ

5-1 Program code for outbound processing extension (extended INCLUDE from
exercise 3):
1 *----------------------------------------------------------------------*
2 * INCLUDE ZXDIXU01
3 *----------------------------------------------------------------------*
4
5 data: k_e1head like e1head. " Exercise 3
6 data: k_z1inco like z1incodx. " Exercise 5
7
8 loop at pt_idoc_data_records
9 where segnam = ’E1HEAD’.
10 * Exercise 3
11 k_e1head = pt_idoc_data_records-sdata.
12 k_e1head-name = pi_ekko-ernam.
13 pt_idoc_data_records-sdata = k_e1head.
14 modify pt_idoc_data_records.
15 * Exercise 5
16 clear pt_idoc_data_records.
17 clear k_z1inco.
18 k_z1inco-inco1 = pi_ekko-inco1.
19 k_z1inco-inco2 = pi_ekko-inco2.
20 pt_idoc_data_records-segnam = ’Z1INCODX’.
21 pt_idoc_data_records-sdata = k_z1inco.
22 append pt_idoc_data_records.
23 endloop.

(C) SAP AG BC621 3-21


8QLW([WHQVLRQRIDQ,'RF7\SH
7RSLF([WHQVLRQRI,QERXQG3URFHVVLQJ

6-1 Program code for inbound processing extension (extended INCLUDE from exercise
2):
1 *----------------------------------------------------------------------*
2 * INCLUDE ZXDIXU02
3 *----------------------------------------------------------------------*
4
5 data: h_e1head like e1head. " Exercise 2
6 data: h_z1inco like z1incodx. " Exercise 6
7
8 pe_vbak621 = pi_vbak621.
9
10 * Exercise 2
11 loop at pt_idoc_data_records
12 where segnam = ’E1HEAD’.
13 h_e1head = pt_idoc_data_records-sdata.
14 if h_e1head-auart = ’NB’.
15 pe_vbak621-auart = ’TA’.
16 endif.
17 endloop.
18
19 * Exercise 6
20 loop at pt_idoc_data_records
21 where segnam = ’Z1INCODX’.
22 h_z1inco = pt_idoc_data_records-sdata.
23 pe_vbak621-inco1 = h_z1inco-inco1.
24 * pe_vbak621-inco2 = h_z1inco-inco2.
25 pe_vbak621-inco2 = ‘Test BC621-DX’.
26 endloop.

(C) SAP AG BC621 3-22


'HYHORSPHQWRI,'RF7\SH

l 'HYHORSPHQWRIWKHGDWDVWUXFWXUH
l 3URFHVVLQJH[DPSOH

 SAP AG 1999

(C) SAP AG BC621 4-1


7RSLF2EMHFWLYHV

l &UHDWH,'RFVHJPHQWV
l 'HYHORSQHZ,'RFW\SHV
l 7HPSODWHIRU,'RFRXWERXQGSURFHVVLQJ
l 7HPSODWHIRU,'RFLQERXQGSURFHVVLQJ

 SAP AG 1999

(C) SAP AG BC621 4-2


&RXUVH2YHUYLHZ'LDJUDP

./ 

01!2 $#

&' ( %  )


 *+,!- (#

 




  
!" $# %
 
   

 SAP AG 1999

(C) SAP AG BC621 4-3


%DVLF5XOHVIRU'HYHORSPHQW

l 6HJPHQWVDUHIRUPHGDVORJLFDOXQLWVEDVHGRQWKH
DSSOLFDWLRQ ILHOGV7KH\DUHUHXVDEOHPRGXOHVRI
,'RFGHYHORSPHQW
l 6HJPHQWJURXSVDUHIRUPHGDVORJLFDOXQLWVIURP
VHJPHQWV
l ,'RFW\SHVDUHGHULYHGIURPVHJPHQWVDQGVHJPHQW
JURXSV
7KH\DUHWKHGDWDVWUXFWXUHRIDQDSSOLFDWLRQGRFXPHQW
IRUWKHWUDQVPLVVLRQ
l 'XULQJGHYHORSPHQW,'RFW\SHVDUHFUHDWHGDVEDVLF
,'RFW\SHV
l 7KHEXVLQHVVSURFHVVLWVHOILVQRWLGHQWLILHGWKURXJK
DQ,'RFW\SHEXWUDWKHUWKURXJKWKHORJLFDOPHVVDJH

 SAP AG 1999

n In the segment editor you assign a name to the field and enter a data element that describes the usage
of the field in the application (documentation). The editor calculates the necessary character length
for the field using the data element. ([DPSOHV
é Logical unit segment:
- An address consists of the fields street, postcode and city.
- Contact person consists of the fields first name, last name and telephone number.
é Logical unit of segment group:
- A company address consists of an address (logical unit segment) as well as several contact
persons (logical unit segment) in this company.
n In the IDoc type editor you build a complex data structure from the single segments. There you
determine the order and the hierarchical relationship of the segments. In addition, you assign a status
(optional/mandatory) as well as the number of repetitions per segment and segment group.
The IDoc API tests that the generated program (outbound processing: SAP processing, inbound
processing: subsystem) conforms to these characteristics. Violations of these characteristics are
recorded through the IDoc status syntax error (outbound: 26, inbound 60). “26”, inbound: “60”).

(C) SAP AG BC621 4-4


$UHDVRI'HYHORSPHQW

$SSOLFDWLRQ l 'DWDVWUXFWXUH
34 ! 5  6-74  =< 4 %> %%2?@BAC D LQWKH:(',DUHDPHQX

819 
3 4
!/ B  *6E74  l 2XWERXQGDQGLQERXQG
SURFHVVLQJLQWKH2EMHFW
:.
; 01!"G#I %URZVHU6(
l 'RFXPHQWDWLRQ
F 9H
 LQWKH:(',PHQX

F 9
F 9

G# J1 H

,'RF,QWHUIDFH

 SAP AG 1999

(C) SAP AG BC621 4-5


6WHSVIRUWKH'HYHORSPHQWRID'DWD6WUXFWXUH

l &RPELQHWKHUHTXLUHGILHOGVDQGWKHLUGDWD
W\SHVLQWKHGLFWLRQDU\
l 'HILQLWLRQRIUHTXLUHGVHJPHQWV
VHJPHQWHGLWRU
l 'HILQLWLRQRIEDVLF,'RFW\SHV
,'RFW\SHHGLWRU
l &UHDWLRQRIDORJLFDOPHVVDJHVXUURXQGLQJ
ILHOGPHQXRI,'RFW\SHHGLWRU
l $VVLJQPHQWRIDORJLFDOPHVVDJHWRWKH
,'RFW\SHVXUURXQGLQJILHOGPHQXRI,'RF
W\SHHGLWRU

 SAP AG 1999

n In the segment editor you assign a name to the field and enter a data element that describes the field
in the application (documentation). The editor calculates the necessary character length for the field
using the data element.
n Segment editor, transaction WE31.
n You build a complex data structure from the single segments in the IDoc type editor. There you
determine the order and the hierarchical relationship of the segments. In addition, you assign a status
(optional/mandatory) as well as the number of repetitions per segment and segment group.
The IDoc API tests that the generated program (outbound processing: SAP processing, inbound
processing: subsystem) conforms to these characteristics. Violations of these characteristics are
recorded through the IDoc status syntax error (outbound: 26, inbound 60).
n IDoc type editor, transaction WE30.

(C) SAP AG BC621 4-6


3URFHVVLQJ7\SHV

l 2XWERXQGSURFHVVLQJXVLQJ
K 0HVVDJH&RQWURO 0& "
K $/(,QWHUIDFH )00$67(5B,'2&B',675,%87( "

l ,QERXQGSURFHVVLQJXVLQJ
K %XVLQHVV:RUNIORZ VLQJOHVWHSRUPXOWLVWHSWDVN "
K $/(,QWHUIDFH IXQFWLRQPRGXOH "

 SAP AG 1999

(C) SAP AG BC621 4-7


6WHSVIRU'HYHORSPHQWRI2XWERXQG3URFHVVLQJ
XVLQJ0&

l &KHFNLQJ0HVVDJH&RQWUROWKDWLVWKHFRQQHFWLRQ
IRUWKHPHVVDJHGHIDXOW
K &RQGLWLRQWDEOH
K $FFHVVVHTXHQFH
K &RQGLWLRQW\SHV
K 3URFHGXUH
K $SSOLFDWLRQ
l ,PSOHPHQWDWLRQRIDIXQFWLRQPRGXOHWKDWPDNHV
DSSOLFDWLRQGDWDDYDLODEOHLQ,'RFIRUPDW
l 'HILQLWLRQRIDQRXWERXQGSURFHVVFRGH

 SAP AG 1999

n The function module must adhere to the following interface:


• Import OBJECT like MC
CONTROL_RECORD_IN like EDIDC
• Export OBJECT_TYPE like WFAS1-ASGTP
CONTROL_RECORD_OUT like EDIDC
• Tables INT_EDIDD like EDIDD
• Exceptions ERROR_MESSAGE_RECEIVED
n The function module cannot transmit any explicit or implicit COMMITs.
n Function module, transaction SE80.
n Outbound process code, transaction WE41.
n For examples, see the appendix.

(C) SAP AG BC621 4-8


'HYHORSPHQW6WHSVIRU2XWERXQG3URFHVVLQJ
XVLQJWKH$/(,QWHUIDFH

l ,PSOHPHQWDWLRQRIDSURJUDPWKDWFDOOVWKHIXQFWLRQPRGXOH
0$67(5B,'2&B',675,%87(,QWHUIDFH
K ,PSRUW 0$67(5B,'2&B&21752/OLNH(','&
K 7DEOHV &20081,&$7,21B,'2&B&21752/OLNH(','&
0$67(5B,'2&B'$7$OLNH(',''
l )RUWKLVSURJUDP\RXKDYHWRGHILQHKRZWKHFRQWUROZRUNV
VSHFLILFDOO\LIWKHFRQWUROLVWRWDNHSODFHYLDDWLPHWDEOH
HYHQWRUGLDORJVWHS

 SAP AG 1999

n The function module 0$67(5B,'2&B',675,%87( has the following interface:


é Import MASTER_IDOC_CONTROL like EDIDC
OBJ_TYPE like SERIAL-OBJ_TYPE
CHNUM like SERIAL-CHNUM
é Tables COMMUNICATION_IDOC_CONTROL like EDIDC
MASTER_IDOC_DATA like EDIDD
é Exceptions ERROR_IN_IDOC_CONTROL
ERROR_WRITING_IDOC_STATUS
ERROR_IN_IDOC_DATA
SENDING_LOGICAL_SYSTEM_UNKNOWN
n 1RWHVThe import parameter OBJ_TYPE and CHNUM will be available for the ALE Serializing as
of Release 4.5.
n The program calling the function module MASTER_IDOC_DISTRIBUTE has to transmit a
COMMIT WORK. Otherwise it’s possible that the IDocs will not be sent but rather will remain in
the sending system.

(C) SAP AG BC621 4-9


'HYHORSPHQW6WHSVRI,QERXQG3URFHVVLQJXVLQJ
%XVLQHVV:RUNIORZ

l ,PSOHPHQWDWLRQRIDZRUNIORZWRFRQWUROLQERXQG
SURFHVVLQJ
7KLVLQFOXGHV
K 'HILQLWLRQRIREMHFWDQGPHWKRG V LQ%25
K 'HILQLWLRQRIZRUNIORZ
l 'HILQLWLRQRILQERXQGSURFHVVFRGH

 SAP AG 1999

n BOR - Business Object Repository, transaction SWO1 (Business Object Builder).


n Workflow, transaction PFTC until 4.0B, from 4.5 on transactions PFTC_INS, PFTC_CHG and
PFTC_DIS.
n Inbound process code, transaction WE42.
n For an example, see the appendix.

(C) SAP AG BC621 4-10


'HYHORSPHQW6WHSVIRU,QERXQG3URFHVVLQJXVLQJ
$/(,QWHUIDFH

l :ULWHIXQFWLRQPRGXOHWKDWSRVWVWKH,'RFDVDQ
DSSOLFDWLRQGRFXPHQW
l ,PSOHPHQWDWLRQRIDZRUNIORZWRVHQGPHVVDJHVLQFDVH
RIHUURU7KLVLQFOXGHV
K 'HILQLWLRQRIREMHFWDQGPHWKRG V LQ%25
K 'HILQLWLRQRIZRUNIORZ
l 0DLQWHQDQFHRIWKHFKDUDFWHULVWLFVIRUWKHIXQFWLRQ
PRGXOHIRUWKH$/(&DOO
l $OORFDWLRQRIWKHIXQFWLRQPRGXOHWRDORJLFDOPHVVDJH
DQGWRDQ,'RFW\SHIRUWKH$/(&DOO
l 'HILQLWLRQRIDQLQERXQGSURFHVVFRGHDQGHVWDEOLVKLQJD
FRQQHFWLRQZLWKWKH$/(OD\HU

 SAP AG 1999

L Post application document: Function module, transaction SE80.


é Case 1: The function module uses an internal CALL TRANSACTION which triggers a COMMIT. In this
case you must display the ALE layer in the transaction BD51. The transaction uses internal function
modules IDOC_INPUT_OPEN and IDOC_INPUT_CLOSE, in order to write the IDoc status within the
LUW. In case of an error, foreground processing is possible using such a function module.
é Case 2: The function module uses internal APIs (Programming Interfaces) and does not release a COMMIT.
In case of an error, foreground processing is not possible using such a function module.
L Notification in case of error:
• BOR - Business Object Repository, transaction SWO1 (Business Object Builder).
• Workflow, transaction PFTC until 4.0B, from 4.5 on, transactions PFTC_INS, PFTC_CHG and
PFTC_DIS.
L Maintaining the characteristics of the function module: You must make the (technical program) characteristics
of the function module called by ALE known to the ALE layer, by using WUDQVDFWLRQ%'.
L Assignment of the function module: The allocation of a function module to a business process, called by ALE,
has to be executed via WUDQVDFWLRQ:(.
L Inbound process code and ALE Connection:
• The process code for the IDoc Interface is defined via WUDQVDFWLRQ:(
• As of this point, WUDQVDFWLRQ%' branches to establish the connection to the ALE layer. In case of an
error (IDoc trigger event) and the connection of IDoc and application document, information is stored in a
table.
L For examples, see the appendix.

(C) SAP AG BC621 4-11


2XWSXW'RFXPHQWDWLRQRI1HZ'HYHORSPHQW

%HJLQ W\SHGHILQHVWUXFWHGLBGF
« ;0/ ^«`
(QG HGLBGF

 SAP AG 1999

n The documentation tools are started from the initial node of the IDoc Interface by selecting
'RFXPHQWDWLRQ In addition, the parser output format has its own menu point for record types as well
as IDoc types.
n Automatic formats are:
• Simple, readable with a parser begin..end-Declaration sequence.
C-header.
• Meta IDoc from type SYRECD01 (IDoc record types) or SYIDOC01 (IDoc types).
• Meta data for IDocs in XML format.
n Navigation-compatible formats are:
• The tree display in the R/3 System.
• HTML file (three files, the *_ f-file is the frame that should be loaded by the browser and the
index *_i and actual documentation *_d).
n Documentation, IDoc record types: Transaction WE61
n Documentation, IDoc types: Transaction WE60
n Documentation, IDoc type (parser): Transaction WE63

(C) SAP AG BC621 4-12


6XPPDU\

l 7KHGDWDVWUXFWXUHLVGHILQHGDVDQ,'RFW\SH
l 'HSHQGLQJRQWKHSURFHVVLQJFRXUVHDQGGLUHFWLRQ
GLIIHUHQWSURJUDPPLQJWHPSODWHVFDQEHXVHG
K 2XWERXQGXVHVPHWKRGV
0HVVDJH&RQWURODQG$/(
K ,QERXQGXVHVPHWKRGV
:RUNIORZDQG$/(

 SAP AG 1999

(C) SAP AG BC621 4-13


$SSHQGL[

*ORVVDU\

Access An access identifies the document fields used by the system when searching for a
condition record.
Access sequence Sequence used by Message Control to access condition records when searching for
messages.
Basic type IDoc type supplied by SAP. Basic types can be modified by customers to create a
new, upward-compatible IDoc type.
Condition element Part of hierarchy which is examined when searching for a message. An example is
the output type which is at the top of this hierarchy: When a (new) purchase order is
posted, only the messages under the node for the message type NEW are searched.
Condition record Data record in which the key fields represent the condition under which the message
is "found". The remaining fields describe the message itself. Therefore, if one of the
data records transferred from the application matches these key fields, the message
is found and can then be processed (for example exported as a print form or as an
electronic message).
Control record The part of an IDoc which contains the data for identifying the sender and recipient,
as well as the structure of the IDoc itself. Each IDoc always has one control record.
Data record The part of an IDoc which contains the application data. An IDoc usually contains
more than one data record.
EDI = Electronic Data Interchange. EDI (for example of business documents) between
business partners, sometimes in separate countries, who may use different hardware,
software and communication services. The data is formatted according to specific
standards.
EDI message Standard format for a business process (for example, a purchase order) to
be handled by EDI. Various EDI standards (EDIFACT or ANSI X12) can
define different EDI messages for the same business process.
EDI standard General format for data to be transferred electronically. An EDI standard generally
comprises:
o EDI syntax
o Data element service
o Message type service
The SAP standard ’IDoc’ is not yet an EDI standard, but can be compared to other
EDI standards.
EDI subsystem System which converts the SAP standard IDoc into an EDI standard (for example
EDIFACT, ANSI X12) and vice versa. In addition to this task (which is carried out
by the EDI subsystem convertor), there are also administration activities, for
example, archiving the transferred messages, and technical tasks, for example,
technical connection to the subsequent system and syntax checks for formats, to be
considered.
Field catalog Contains all fields which can be selected as key fields for condition tables in
Message Control.
File interface = port type “file”
Hierarchy level Determines the position of a segment in a tree segment. A segment carries business
data in an IDoc. Dependencies in the application data can be represented in this tree
structure, that is, the various hierarchy levels.

(C) SAP AG BC621 5-1


IDoc interface Definition of formats (IDoc types, previously: intermediate structures) and methods
(port definitions) for electronic data exchange between SAP Systems and partner
systems.
IDoc type SAP format in which data for a business process is to be transferred. An IDoc is a
real business process formatted according to a certain IDoc type.
Inbound processing Conversion and processing of data for a business process from the time the data is
received in IDoc format to the posting of the corresponding document(s) in the SAP
application.
Mandatory segment The part of an IDoc type which contains important application data and must
therefore exist in an IDoc for an actual business process.
Mapping Rules for assigning the data elements of an EDI message type to the fields of an
IDoc type.
Message Business process (for example, a purchase order), which is transferred in IDoc
format between an SAP System and an external system.
Message Control Module designed to offer interfaces for further processing for applications. This
includes descriptions of the various data configurations and the required actions. An
example of an action is printing a document at a certain time in German. The action
is triggered when the application transfers data which matches your configuration.
Message determination A check to determine whether the application data matches the condition records
(specified in Customizing). If this is the case, one or more messages are "found" and
can then be processed (for example, sent electronically). In message determination, a
search is made for the condition records using a predefined hierarchy.
Message status record = MC record. Log record for the MC table which describes the send status of a
message in Message Control.
Notification If an error occurs (for example, an IDoc with incorrect syntax), a notification is sent
to one or more users. The users responsible are defined in the IDoc Interface or
indirectly via the organization model. Notifications are sent to the integrated inbox.
Optional segment Part of an IDoc type which can include additional, optional data about the business
process. The segment does not therefore have to appear in an IDoc for a specific
business process.
Outbound file Contains specific IDocs to be sent for port type “file”.
Outbound processing Conversion and processing of SAP document data from posting a document to
sending the data in IDoc format.
Partner Communication partner for the IDoc Interface. Definition from Sales and
Distribution: "An individual within or outside of your own organization who is of
commercial interest and who can be contacted in the course of a business
transaction".
Partner profile Definition of the general conditions for electronic data interchange with a business
partner via the IDoc Interface: which message is sent in which direction using which
method?
If a partner profile does not exist, communication with a partner via the IDoc
Interface is not possible.
Port Description of the channel used by the SAP system for communicating with the
external system during external data interchange. There are various technical
methods for implementing this type of communication (port types). The selection of
the port type depends on the technical configuration of the external system.
Example: Most EDI subsystems read IDocs in the form of sequential files, that is,
the port type ’file’ is used.
Procedure A group of messages. A procedure is searched for messages which are to be
processed for the specified data configuration (for example, sent electronically or
printed).

(C) SAP AG BC621 5-2


Process code Another name for a defined processing type, for example a function module or an
SAP Business Workflow task. In contrast, a defined IDoc type (standard format for
data communication) is usually assigned to a certain process code. If the process
type for this IDoc type is to be changed, you should assign the corresponding
process code to the new processing type. Without this process code, this IDoc type
must be assigned to the new processing code directly.
Record type An IDoc type consists of the following three record types:
• Control record
• Data record
• Status record
Segment Structure which includes the application data for an IDoc from the data records. As
a result, the data can be assigned to the correct application fields.
Status Processing status of an IDoc, either "generated" or "ready for sending".
An IDoc usually has several statuses which are stored in the status records and
reveal information about the IDoc history. The current (processing) status is also
stored in the control record for the IDoc.
Status confirmation Report from an external system about the processing status of business data received
from the R/3 System in the form of status records. The status confirmation is added
to the IDoc in the R/3 System in the form of status records.
Status file File which contains the status records sent to the IDoc Interface by the EDI
subsystem for outbound messages.
Status group The status group contains several statuses ("milestones" in the process chain), so that
the monitoring programs only have to consider these groups and not each individual
status. Examples:
Group 3 = outbound: IDoc in the external system
Group B = inbound: IDoc sent to the application
Status record One of three record types in an IDoc (SAP standard format for electronic exchange
of application data).
Each status record contains a status which corresponds to one step in IDoc
processing. This means that the number of status records increases as the processing
continues.
Translator Converts internal data formats (IDocs) into EDI messages and vice versa. The
translator is a component of the EDI Subsystem.
Transmission file A data packet which contains the messages to be exchanged electronically. The
messages are EDI messages, that is, they are formatted according to an EDI standard
(for example EDIFACT).
The conversion of the SAP standard IDoc into the EDI standard is carried out by an
external system (EDI subsystem).

(C) SAP AG BC621 5-3


,PSRUWDQW0HQX3DWKV

$/(5HJLVWUDWLRQ
IDoc initial node: 'HYHORSPHQW→0HVVDJH$SSOLFDWLRQREMHFW
$UFKLYLQJ
7RROV→$GPLQLVWUDWLRQ$GPLQLVWUDWLRQ→'DWDDUFKLYLQJ
0DLQWDLQLQJ$UFKLYLQJ6WDWXV
IDoc initial node: &RQWURO→0DLQWDLQVWDWXVYDOXHV
,'RF$GPLQLVWUDWLRQ
IDoc initial node: &RQWURO→,'RF$GPLQLVWUDWLRQ
'LVSOD\,'RF
IDoc initial node: ,'RF→'LVSOD\,'RF
,'RF,QLWLDO1RGH
7RROV→%XVLQHVV&RPPXQLFDWLRQ,'RF→,'RF%DVLV
,'RF6WDWLVWLFV
IDoc initial node: ,'RF→,'RF6WDWLVWLFV
,'RF7\SH(GLWRU
IDoc initial node: 'HYHORSPHQW→,'RFW\SHV
3DUWQHU3URILOH
IDoc initial node: ,'RF→3DUWQHUSURILOH
3RUW'HILQLWLRQ
IDoc initial node:,'RF→3RUW'HILQLWLRQ→0DLQWDLQ5)&GHVWLQDWLRQ
IDoc initial node: ,'RF→,'RFGHVWLQDWLRQ
6HJPHQW(GLWRU
IDoc initial node: 'HYHORSPHQW→,'RFVHJPHQWV
3URFHVVLQJ7HVWV
IDoc initial node: 7HVW→PHQXRSWLRQDFFRUGLQJWRWKHUHTXLUHGIXQFWLRQ!
0HVVDJH$OORFDWLRQ±,'RF7\SH
IDoc initial node: 'HYHORSPHQW→,'RFW\SHPHVVDJH

(C) SAP AG BC621 5-4


([DPSOHVIRU8QLW
([DPSOHV6WHSVIRUGHYHORSPHQWRIRXWERXQGSURFHVVLQJXVLQJ
0&
3XUFKDVHRUGHU00

IDoc type ORDERS01


Logical message ORDERS
Function module IDOC_OUTPUT_ORDERS
Outbound process code: ME10

2UGHUFRQILUPDWLRQ6'

IDoc type ORDERS01


Logical message ORDRSP
Function module IDOC_OUTPUT_ORDRSP
Outbound process code: SD10

,QERXQGSURFHVVFRGH 7;7
([DPSOH'HYHORSPHQWVWHSVRILQERXQGSURFHVVLQJE\%XVLQHVV
:RUNIORZ7H[WPHVVDJHLQERXQG
IDoc type: TXTRAW01
Logical message: TXTRAW
Object with method: IDOCTXTRAW.MAILCREATE
One-step task: TS30000008
Inbound process code: TXT1

(C) SAP AG BC621 5-5


([DPSOHV'HYHORSPHQWVWHSVIRULQERXQGSURFHVVLQJXVLQJ$/(
,QWHUIDFH
&XVWRPHURUGHU6'
Transaction VA01
IDoc type ORDERS01
Logical message ORDERS
Function module IDOC_INPUT_ORDERS
Inbound process code ORDE
Object with method IDOCORDERS.INPUTFOREGROUND
One-step task TS00008046

This function module starts the command CALL TRANSACTION and thus an implicit COMMIT WORK (case 1
in the slide). This is the ALE layer (transaction BD51). VA01 calls IDOC_INPUT_OPEN and
IDOC_INPUT_CLOSE in order to write the IDoc status in the same LUW (it is "ALE-compatible“). If errors
occur, foreground processing is possible.

2UGHUDFNQRZOHGJPHQW00
IDoc type ORDERS01
Logical message ORDRSP
Function module IDOC_INPUT_ORDRSP
Inbound process code ORDR
Object with method IDOCORDRSP.INPUTFOREGROUND
One-step task TS00008075

This function module uses APIs (not a transaction) and does not start a COMMIT WORK (case 2 on the
slide). If errors occur, foreground processing is not possible.

(C) SAP AG BC621 5-6