BC621 - EN - 46A - FV - 010807 (1) - SAP Idoc Interface Development PDF
BC621 - EN - 46A - FV - 010807 (1) - SAP Idoc Interface Development PDF
%&
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
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,QWHUIDFH6WDQGDUG
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 &RXUVH2EMHFWLYHV
l &RXUVH&RQWHQW
l &RXUVH2YHUYLHZ'LDJUDP
l 0DLQ%XVLQHVV6FHQDULR
SAP AG 1999
$WWKHFRQFOXVLRQRIWKLVFRXUVH\RXZLOOEH
DEOHWR
l ([WHQG,'RFW\SHV
l 'HILQHQHZ,'RFW\SHV
SAP AG 1999
$WWKHFRQFOXVLRQRIWKLVFRXUVH\RXZLOOEHDEOH
WR
l %XLOGDQGH[WHQGWKHGDWDVWUXFWXUHRI,'RFW\SHV
l 8VHWKH,'RFW\SHHGLWRUDQGVHJPHQWHGLWRU
l 8VHFXVWRPHUH[LWVWRSURFHVV,'RFW\SHV
SAP AG 1999
3UHIDFH
8QLW Introduction
8QLW Development Environment for IDoc Types
8QLW Extension of IDoc Types
8QLW Development of IDoc Types
$SSHQGL[
SAP AG 1999
)
'(
*
!&
"
# $%
"
!&
"
!
"
SAP AG 1999
(QWHUSULVHWUDGLQJ
(QWHUSULVHWUDGLQJFRPSDQ\$ZDQWV9HQGRU
9HQGRU%
FRPSDQ\$
%WRVKLSWKHLUPDWHULDORUGHUVYLD(',
+HUUPDQQ 5LHPHUZLOOGLHHQWVSUHFKHQGHQ
%HVWHOOXQJHQJOHLFKHOHNWURQLVFKYHUEXFKHQ
$OV*UXQGODJHZROOHQGLH8QWHUQHKPHQGHQ
,'RF7\S25'/*7YHUZHQGHQGHUDEHU
HYHQWXHOOQRFKGHQ%HGUIQLVVHQ
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.
l 'DWD6WUXFWXUHV
,'RF5HFRUG7\SHV
,'RF7\SHV
,'RF6HJPHQWV
l 'HYHORSPHQWDQG([WHQVLRQ
SAP AG 1999
l 8QGHUVWDQGWKHGHYHORSPHQWHQYLURQPHQWIRU,'RF
W\SHV
l 'HVFULEHWKHIXQFWLRQDOLW\RIWKHGHYHORSPHQW
HQYLURQPHQWIRU,'RFW\SHV
l ([SODLQWKHGLIIHUHQFHEHWZHHQGHYHORSPHQWDQG
H[WHQVLRQV
SAP AG 1999
0
-+., / &
'!)(*,
!"#$%
& %'!)(*"+,
SAP AG 1999
$SSOLFDWLRQ
2 03
89,#,,):;%=< & >
7
$
'1(*+
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.
&RQWURO5HFRUG IDoc ID
Partner
IDoc Type and Logical Message
External Structure
'DWD5HFRUGV
6WDWXV5HFRUGV IDoc ID
Status Information
SAP AG 1999
%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
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
l %\UHOHDVLQJVHJPHQWVDQG,'RFW\SHVWKHH[WHUQDO
LQWHUIDFHLVIUR]HQDQGJLYHQXQLTXHQDPHVIRU
WKHVHREMHFWVIRUDQH[WHUQDOSDUWQHUV\VWHP
l 7KHUHFDQRQO\EHRQHVHJPHQWYHUVLRQIRUHDFK6$3
UHOHDVHIRUH[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
(','& ,'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".
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".
,'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.
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.
l $Q,'RFW\SHLVDFRPSOH[GDWDVWUXFWXUHFRPSRVHG
RIVHJPHQWV
l 6HJPHQWW\SHVDUHVWUXFWXUHVLQWKH$%$3GDWD
UHSRVLWRU\
l ,'RFW\SHVDQGWKHLUSURFHVVLQJFDQEHH[WHQGHGLQ
WKHDSSURSULDWHSRVLWLRQVE\FXVWRPHUV
SAP AG 1999
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.
l &UHDWH,'RF6HJPHQW
l ([WHQGDQ,'RF7\SH
l ,PSOHPHQWDFXVWRPHUH[LWLQRXWERXQGSURFHVVLQJ
l ,PSOHPHQWDFXVWRPHUH[LWLQLQERXQGSURFHVVLQJ
SAP AG 1999
.
*/
0*
1"0
%
&' $ ( )*
+,-"
!#"$
SAP AG 1999
l 7KHFRGLQJSURYLGHGLQWKHVWDQGDUGV\VWHPIRU
SURFHVVLQJLVXVHG
l 'HYHORSPHQWVDQGFRUUHFWLRQVRIWKHFRGLQJ
GHOLYHUHGLQWKHVWDQGDUGV\VWHPDUHWKHUHIRUH
DXWRPDWLFDOO\DYDLODEOH
l ([WHQVLRQLVOHVVWLPHFRQVXPLQJWKDQQHZ
GHYHORSPHQW
SAP AG 1999
l $GGLWLRQDOFXVWRPHUILHOGVDUHUHFRUGHGLQWKHLURZQ
FXVWRPHUVHJPHQWV
l &XVWRPHUVHJPHQWVGHSHQGRQ6$3VHJPHQWV
VXFFHVVRURUFKLOGUHODWLRQVKLSV
l 7KHSURFHVVLQJRIFXVWRPHUVHJPHQWVLVH[FOXVLYHO\
LPSOHPHQWHGLQWKHFXVWRPHUH[LWVRIWKHFRGLQJ
SURYLGHGLQWKHVWDQGDUGV\VWHP
SAP AG 1999
$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
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.
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
%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
l $QH[WHQVLRQFDQEHOLPLWHGWRSURFHVVLQJ
l 1RUPDOO\DQH[WHQVLRQHQFRPSDVVHVWKHGDWD
VWUXFWXUHDVZHOODVWKHSURFHVVLQJ
l ([WHQGHGGDWDVWUXFWXUHVFDQEHFRPPXQLFDWHGWR
WKHVXEV\VWHPE\WKHGRFXPHQWDWLRQWRROV
SAP AG 1999
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:
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-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:
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.
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.
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-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.
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:
6-4 Check the order to see if it contains the delivery conditions. The condition text
should contain the string from the customer exit.
8QLW([WHQVLRQRIDQ,'RF7\SH
7RSLF([WHQVLRQRI,QERXQG3URFHVVLQJ
4-2 The extension ZEXTENQQ consists of standard segments E1HEAD and E1ITEM.
The customer segment Z1INCOQQas child segment depends on standard segment
E1HEAD.
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.
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.
l 'HYHORSPHQWRIWKHGDWDVWUXFWXUH
l 3URFHVVLQJH[DPSOH
SAP AG 1999
l &UHDWH,'RFVHJPHQWV
l 'HYHORSQHZ,'RFW\SHV
l 7HPSODWHIRU,'RFRXWERXQGSURFHVVLQJ
l 7HPSODWHIRU,'RFLQERXQGSURFHVVLQJ
SAP AG 1999
./
01!2$#
SAP AG 1999
l 6HJPHQWVDUHIRUPHGDVORJLFDOXQLWVEDVHGRQWKH
DSSOLFDWLRQILHOGV7KH\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”).
$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
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.
l 2XWERXQGSURFHVVLQJXVLQJ
K 0HVVDJH&RQWURO0&"
K $/(,QWHUIDFH)00$67(5B,'2&B',675,%87("
l ,QERXQGSURFHVVLQJXVLQJ
K %XVLQHVV:RUNIORZVLQJOHVWHSRUPXOWLVWHSWDVN"
K $/(,QWHUIDFHIXQFWLRQPRGXOH"
SAP AG 1999
l &KHFNLQJ0HVVDJH&RQWUROWKDWLVWKHFRQQHFWLRQ
IRUWKHPHVVDJHGHIDXOW
K &RQGLWLRQWDEOH
K $FFHVVVHTXHQFH
K &RQGLWLRQW\SHV
K 3URFHGXUH
K $SSOLFDWLRQ
l ,PSOHPHQWDWLRQRIDIXQFWLRQPRGXOHWKDWPDNHV
DSSOLFDWLRQGDWDDYDLODEOHLQ,'RFIRUPDW
l 'HILQLWLRQRIDQRXWERXQGSURFHVVFRGH
SAP AG 1999
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
l ,PSOHPHQWDWLRQRIDZRUNIORZWRFRQWUROLQERXQG
SURFHVVLQJ
7KLVLQFOXGHV
K 'HILQLWLRQRIREMHFWDQGPHWKRGVLQ%25
K 'HILQLWLRQRIZRUNIORZ
l 'HILQLWLRQRILQERXQGSURFHVVFRGH
SAP AG 1999
l :ULWHIXQFWLRQPRGXOHWKDWSRVWVWKH,'RFDVDQ
DSSOLFDWLRQGRFXPHQW
l ,PSOHPHQWDWLRQRIDZRUNIORZWRVHQGPHVVDJHVLQFDVH
RIHUURU7KLVLQFOXGHV
K 'HILQLWLRQRIREMHFWDQGPHWKRGVLQ%25
K 'HILQLWLRQRIZRUNIORZ
l 0DLQWHQDQFHRIWKHFKDUDFWHULVWLFVIRUWKHIXQFWLRQ
PRGXOHIRUWKH$/(&DOO
l $OORFDWLRQRIWKHIXQFWLRQPRGXOHWRDORJLFDOPHVVDJH
DQGWRDQ,'RFW\SHIRUWKH$/(&DOO
l 'HILQLWLRQRIDQLQERXQGSURFHVVFRGHDQGHVWDEOLVKLQJD
FRQQHFWLRQZLWKWKH$/(OD\HU
SAP AG 1999
%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
l 7KHGDWDVWUXFWXUHLVGHILQHGDVDQ,'RFW\SH
l 'HSHQGLQJRQWKHSURFHVVLQJFRXUVHDQGGLUHFWLRQ
GLIIHUHQWSURJUDPPLQJWHPSODWHVFDQEHXVHG
K 2XWERXQGXVHVPHWKRGV
0HVVDJH&RQWURODQG$/(
K ,QERXQGXVHVPHWKRGV
:RUNIORZDQG$/(
SAP AG 1999
*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.
$/(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
2UGHUFRQILUPDWLRQ6'
,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
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.