8/2/2019 BC620+ Technology)
1/198
BC620 - SAP IDoc Interface (Technology)BC620
R/3 System Release 46B 25.06.2002
0
8/2/2019 BC620+ Technology)
2/198
BC620 - SAP IDoc Interface (Technology)........................................................................................................ ...... 0-1
Copyright .......................................................................................... ..................................................................... 0-2
Business Integration Technologies II................................................................................................................ 0-3
Course Prerequisites ...................................................................................... .................................................... 0-4
Target Group.................................................................................................... .................................................. 0-5
Course Overview.......................................................................... ......................................................................... 1-1
Course Goals............................................................................. ......................................................................... 1-2
Course Objective(s) ....................................................................................... .................................................... 1-3
Course Content ..................................................................................................... ............................................. 1-4
Course Overview Diagram............................. ............................................................................... .................... 1-5
Main Business Scenario ....................................................................................... ............................................. 1-6
Basic Principles .......................................................................................... ........................................................... 2-1
Topic Objectives........................................ ................................................................................................ ........ 2-2
IDoc Concept............... .................................................................................................... .................................. 2-3
IDoc Applications.............................................................. ................................................................................ 2-4
EDI and ALE................................................................................... .................................................................. 2-5
Process Flow: Sending Data....................................................... ....................................................................... 2-6
IDoc Settings: Sending Data ......................................................................................... .................................... 2-7
Process Flow: Receiving Data ................................................................. ......................................................... 2-8
IDoc Settings: Receiving Data .......................................................................... ................................................ 2-9
Basic Principles: Summary .................................................................................... ......................................... 2-10
IDocs in Business Processes ........................................................................ ......................................................... 3-1
IDocs in Business Processes: Course Objectives ........................................................................................ ..... 3-2
Business scenario........................................................................................................... .................................... 3-3IDoc Record Types.................................................................. .......................................................................... 3-4
Control record.......................................... .................................................................................................. ........ 3-5
Data Records and Segment Structures ............................................................................... ............................... 3-6
Status Record.......................... ................................................................................................... ........................ 3-7
IDoc Record Types: Summary............................. ....................................................................................... ...... 3-8
IDoc Types................................................................................................................... ...................................... 3-9
Outbound and Inbound Processing ................................................................................................ ................. 3-10
Outbound Processing using Message Control ............................................................................... ................. 3-11
Direct Outbound Processing using ALE.................................. ....................................................................... 3-12
Inbound Processing using Workflow...... ..................................................................................................... ... 3-13
Direct Inbound Processing using ALE .......................................................................................... ................. 3-14
IDocs in Business Processes: Summary ...................................................................................................... ... 3-15
IDocs in Business Processes Exercise ........................................................................................... ................. 3-16
IDocs in Business Processes Solutions .......................................................................................... ................. 3-18
Documentation Tools ........................................................................................ .................................................... 4-1
Documentation Tools: Unit Objectives ......................................................................................... ................... 4-2
Overview Diagram (Sending Data).......................................................................... ......................................... 4-3
8/2/2019 BC620+ Technology)
3/198
Business scenario........................................................................................................... .................................... 4-4
Internal and External Structures............................ ............................................................................................ 4-5
Output in Various Formats I........................................................................................ ...................................... 4-6
Output in Various Formats II ........................................................................................ .................................... 4-7
Documentation Tools: Summary ................................................................................................... ................... 4-8
Documentation Tools Exercise ................................................................................... ...................................... 4-9
Port Definition ............................................................................................ ........................................................... 5-1
Port Definition: Unit Objectives ................................................................................................... .................... 5-2
Overview Diagram (Sending Data).......................................................................... ......................................... 5-3
Port Definition: Business Scenario ............................................................................................... .................... 5-4
IDoc Interface: Port Types ................................................................................ ................................................ 5-5
Port Definition: Port Type................................... .............................................................................................. 5-6
Process Flow: Port Type File (with Triggering)......................................................... ...................................... 5-7
Port Type XML: Flat File and XML File ................................................................... ...................................... 5-8
Port Type XML: Flat File and XML File (2).............................................................. ...................................... 5-9
Port Definition - Port Type tRFC.................................................................................................................... 5-10Process Flow: Port Type tRFC..................................................... ................................................................... 5-11
Port Definition: CPI-C (R/2 System)...................................................................................... ........................ 5-12
Process Flow: Port Type CPI-C .................................................................................. .................................... 5-13
Port Definition: Internet .............................................................................................. .................................... 5-14
Process Flow: Port Type Internet..... ......................................................................... ...................................... 5-15
Port Definition: PI ................................................................................................ ........................................... 5-16
Process Flow: Port Type PI........................................................................................ ..................................... 5-17
Communication with Older Releases.......................................................................... .................................... 5-18
Port Definition: Summary ......................................................................................... ...................................... 5-19
Port Definition Exercise .............................................................................................. .................................... 5-20
Partner Profiles ........................................................................................ .............................................................. 6-1
Partner Profiles: Unit Objectives .............................................................................. ........................................ 6-2
Overview Diagram (Sending Data).......................................................................... ......................................... 6-3
Partner Profiles: Business Scenario ............................................................................ ...................................... 6-4
Partner Profiles: Fields .................................................................... .................................................................. 6-5
Checking Partner Profiles.................................................................... .............................................................. 6-6
Partner Profiles: Outbound Processing I........................................................................................ ................... 6-7
Partner Profiles: Outbound Processing II ................................................................... ...................................... 6-8
Partner Profiles: Inbound Processing.................... ............................................................................................ 6-9
Process Codes I............................................... .............................................................................................. ... 6-10
Process Codes II ................................................................................................... ........................................... 6-11
Process Codes III ................................................................................. ............................................................ 6-12
Outbound Modes: Port Type File.................................................................................................................... 6-13
Partner Profiles Output.................................................................................. .................................................. 6-14
Partner Profiles: Summary ................................................................................... ........................................... 6-15
Partner Profiles Exercise .......................................................................... ....................................................... 6-16
8/2/2019 BC620+ Technology)
4/198
The Test Tool................................................................................ ......................................................................... 7-1
Test Tool Options..................................................................... ......................................................................... 7-2
Test Tool Options (2) ............................................................................. ........................................................... 7-3
Test Tool Exercise........... .................................................................................................. ................................ 7-4
Message Control and IDocs ................................................................................... ............................................... 8-1
Message Control and IDocs: Unit Objectives............................................................................................. ...... 8-2
Business Scenario...................... ................................................................................................ ........................ 8-3
Outbound Processing using Message Control ............................................................................................. ..... 8-4
Message Control.................................................................................................. .............................................. 8-5
Condition Elements .................................................................................. ......................................................... 8-6
Message Processing: IDocs...................................................................................... ......................................... 8-7
Dispatch Times in Outb. Procg using MC.................................................................................................. ...... 8-8
Summary............................................. ....................................................................................................... ........ 8-9
Message Control and IDocs Exercise ..................................................................................... ........................ 8-10
Message Control and IDocs: Solution .................................................................................... ........................ 8-11
General Settings......................................................... ............................................................................................ 9-1General Settings: Unit Objectives...... ....................................................................................................... ........ 9-2
Customizing using the IMG..................................................................... ......................................................... 9-3
Number Ranges ................................................................................................. ................................................ 9-4
Event-Receiver Linkage.............................................................................................. ...................................... 9-5
IDoc Administration: Global Parameters......................................................................................... ................. 9-6
IDoc Administration: User Parameters................................................................................... .......................... 9-7
Fast entry ............................................................................................... ............................................................ 9-8
Long Names - Short Names .......................................................................... .................................................... 9-9
General Settings: Summary...................................................................................... ....................................... 9-10
General Settings Exercise................................................................................................ ................................ 9-11
Additional Test Programs........................................................................... ......................................................... 10-1
Processing Tests: Unit Objectives................................................................................................................... 10-2
Processing Tests: Business Scenario..................................................................................................... .......... 10-3
Test Layers: Overview ......................................................................................... ........................................... 10-4
Test Layers: Outbound Processing ............................................................................. .................................... 10-5
Test Layers: Inbound Processing .............................................................................. ...................................... 10-6
Test Layers: Status Confirmation................................................................................................ .................... 10-7
When to Test Which Function?..................................................................................................... .................. 10-8
Processing Tests: Summary ................................................................................... ......................................... 10-9
A Process Chain........................................................................................................ ........................................... 11-1
A Process Chain: Unit Objectives................................................................................................. .................. 11-2
A Process Chain: Business Scenario................................................................................ ............................... 11-3
Purchase Orders for SmartMart ......................................................................................... ............................. 11-4
EDI-Relevant Master Data in Purchasing......................................................................................... .............. 11-5
Standard Order for QuickDeliver.............................. ...................................................................................... 11-6
EDI-Specific Master Data in Sales ......................................................................................... ........................ 11-7
8/2/2019 BC620+ Technology)
5/198
A Process Chain: Summary.............................................................................................. ............................... 11-8
Process Chain Exercise ........................................................................................ ........................................... 11-9
Statistics and Monitoring............................................................................................... ...................................... 12-1
Statistics and Monitoring: Unit Objectives................................................... .................................................. 12-2
Business Scenario...................... .............................................................................................. ........................ 12-3
Monitoring Programs: Overview ................................................................................................... ................. 12-4
Selection Fields for Monitoring .................................................................................. .................................... 12-5
Implementing Functions.......................................................... ........................................................................ 12-6
Status Group: Monitor/Statistics.......................................................................... ........................................... 12-7
Work Item Analysis......................................................................... ................................................................ 12-8
Statistics and Monitoring: Summary.............................................................................................. ................. 12-9
Statistics and Monitoring Exercise ............................................................................. .................................. 12-10
Statistics and Monitoring: Solution............................................................................. .................................. 12-12
Workflow and IDocs ........................................................................................... ................................................ 13-1
Workflow and IDocs: Unit Objectives................................................................................. ........................... 13-2
Workflow and IDocs: Business Scenario ................................................................... .................................... 13-3Inbound Processing with Workflow .............................................................................................. ................. 13-4
Exception Handling with Workflow......................................................................... ...................................... 13-5
Exceptions in Outbound Processing ......................................................................... ...................................... 13-6
Exceptions in Inbound Processing ........................................... ....................................................................... 13-7
Notification Concept I .......................................................................................... ........................................... 13-8
Notification Concept II.......................................... ................................................................................ .......... 13-9
Notification Concept III ...................................................................................... .......................................... 13-10
Maintaining an Organizational Structure......................................................................................................13-11
Integrated Inbox............................................................................... .............................................................. 13-12
Workflow and IDocs: Summary ............................................................................... .................................... 13-13
Workflow and IDocs Exercise ................................................................................. ..................................... 13-14
Using an EDI Subsystem.............................................................. ....................................................................... 14-1
Using an EDI Subsystem: Unit Objectives................................................ ..................................................... 14-2
Overview Diagram (Receiving Data) ....................................................................................................... ...... 14-3
Business Scenario...................... .............................................................................................. ........................ 14-4
EDI Subsystem: Responsibilities ....................................................................................... ............................. 14-5
Required Fields in IDoc Inb. Processing: Control Record............................................................................. 14-6
More Documentation............................................................................. .......................................................... 14-7
Using an EDI Subsystem: Summary.................................................................... ........................................... 14-8
Using an EDI Subsystem Exercise.......................................................................................... ........................ 14-9
Archiving ................................................................................. ............................................................................ 15-1
Archiving: Unit Objectives ......................................................................................... .................................... 15-2
Overview Diagram (Sending Data).......................................................................... ....................................... 15-3
Archiving: Business Scenario ....................................................................................................... .................. 15-4
Archiving Object: IDOC ............................................................................... .................................................. 15-5
Status Transfers in Outbound Processing ........................................................................................ ............... 15-6
8/2/2019 BC620+ Technology)
6/198
Status Transfers in Inbound Processing.................................................................... ...................................... 15-7
Status Maintenance - Archiving............................................................................................................ .......... 15-8
Archiving: Summary ........................................................................................... ............................................ 15-9
Course Summary .................................................................................... ....................................................... 15-10
Appendix........................................................................................................... ................................................... 16-1
Appendix........................................................................................................................ .................................. 16-2
8/2/2019 BC620+ Technology)
7/198
SAP AG 1999
BC620 - SAP IDoc Interface (Technology)
SAP AG
BC620BC620SAP IDocInterface(Technology)
SAP IDocInterface(Technology)
Release: 4.6A
Status: January 2000
Mat. No.: 5003 4022
8/2/2019 BC620+ Technology)
8/198
SAP AG 2001
Copyright 2001 SAP AG. All rights reserved.
Neither this training manual nor any part thereof maybe copied or reproduced in any form or by any means,or translated into another language, without the priorconsent of SAP AG. The information contained in thisdocument is subject to change and supplement without priornotice.
All rights reserved.
Copyright
Trademarks:
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.
Lotus ScreenCam is a registered trademark of Lotus Development Corporation. Vivo and VivoActive are registered trademarks of RealNetworks, Inc.
ARIS Toolset is a registered Trademark of IDS Prof. Scheer GmbH, Saarbrcken
Adobe and Acrobat are registered trademarks of Adobe Systems Inc. TouchSend Index is a registered trademark of TouchSend Corporation.
Visio is a registered trademark of Visio Corporation. IBM , OS/2 , DB2/6000 and AIX are a registered trademark of IBM Corporation.
Indeo is a registered trademark of Intel Corporation.
Netscape Navigator , and Netscape Communicator are registered trademarks of NetscapeCommunications, Inc.
OSF/Motif is a registered trademark of Open Software Foundation.
ORACLE is a registered trademark of ORACLE Corporation, California, USA. INFORMIX -OnLine for SAP is a registered trademark of Informix Software Incorporated. UNIX and X/Open are registered trademarks of SCO Santa Cruz Operation. ADABAS is a registered trademark of Software AG
The following are trademarks or registered trademarks of SAP AG; ABAP, 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, andALE/WEB. The SAP logo and all other SAP products, services, logos, or brand names includedherein are also trademarks or registered trademarks of SAP AG.
Other products, services, logos, or brand names included herein are trademarks or registeredtrademarks of their respective owners.
8/2/2019 BC620+ Technology)
9/198
SAP AG 1999
Business Integration Technologies II
Business IntegrationTechnology
BC095 3 days
Level 2 Level 3
Building EnterpriseSolutions with SAPComponents
CA150 2 days
Data Transfer
BC420 5 days
Programming withBAPIs in Visual Basic
CA925 5 days
R/3 Interface and BAPIProgramming in C++
CA927 5 days
Application LinkEnabling (ALE)
Technology
BC619 3 days
EDI Interface
CA210 4 days
InterfaceProgramming
Data Exchange
Communication
Interfaces in ABAP
BC415 2 days
Programming withBAPIs in JAVA
CA926 5 days
SAP IDoc Interface -Development
BC621 1 day
SAP IDoc InterfaceTechnology
BC620 2 days
8/2/2019 BC620+ Technology)
10/198
SAP AG 1999
Recommended:Basic knowledge of the R/3 System, as gained fromcourses SAP20 and SAP50, for example
Course Prerequisites
8/2/2019 BC620+ Technology)
11/198
SAP AG 1999
Participants:
Consultants
Administrators
Project teammembers
Duration: 2 days
Target Group
8/2/2019 BC620+ Technology)
12/198
(C) SAP AG BC620 1-1
SAP AG 1999
Course Overview
Course Goals
Course Objective(s)
Course Content
Course Overview Diagram
Main Business Scenario
Contents:
8/2/2019 BC620+ Technology)
13/198
(C) SAP AG BC620 1-2
SAP AG 1999
Understand the possibilities offered by theIDoc Interface for electronic data transfer
Use the IDoc Interface
Course Goals
This course will enable you to:
8/2/2019 BC620+ Technology)
14/198
(C) SAP AG BC620 1-3
SAP AG 1999
Course Objective(s)
Configure the IDoc Interface
Trace the processing of IDocs in thesystem
Select and use the correct IDoc types foryour business processes
At the conclusion of this course, you will beable to:
8/2/2019 BC620+ Technology)
15/198
(C) SAP AG BC620 1-4
SAP AG 1999
Course Content
Unit 9 General Settings
Unit 10 Further Test Programs
Unit 11 A Process Chain
Unit 12 Statistics and Monitoring
Unit 13 Workflows and IDocs
Unit 14 Using an EDI Subsystem
Unit 15 Archiving
Unit 1 Course Overview
Unit 2 Basic Principles
Unit 3 IDocs in Business Process
Unit 4 Documentation Tools
Unit 5 Port Definition
Unit 6 Partner Profiles
Unit 7 The Test Tool
Unit 8 MC and IDocs
Preface and Introduction
Exercises
Solutions
Appendix
8/2/2019 BC620+ Technology)
16/198
(C) SAP AG BC620 1-5
SAP AG 1999
External SystemExternal System
Course Overview Diagram
Data flow
A Process Chain
Test,monitoring
MessageControl,Workflow
Archive IDoc?Archive IDoc?
EDI Subsystem?EDI Subsystem?
Partner ProfilesPartner Profiles
Port DefinitionPort Definition
DocumentationTools
DocumentationTools
IDocs in Business
Processes
R/3 System
The units can be divided as follows:
- Units which describe how to configure the IDoc Interface- Units which describe the data flow in the R/3 System and between R/3 Systems and external
systems
The unit "Test" describes an important step in the process of configuring the IDoc Interface. The
emphasis is placed on the implementation of the test programs in the data flow.
The unit "General Settings" describes Customizing activities which, for example, create templates
for configuring the IDoc Interface. You should therefore consider this chapter to be more advanced
than the other "configuration chapters".
8/2/2019 BC620+ Technology)
17/198
(C) SAP AG BC620 1-6
SAP AG 1999
Main Business Scenario
Message
IDocIDoc
QuickDeliverSmartMart
SAP R/3 SystemSAP R/3 System
EDI SubsystemEDI Subsystem EDI SubsystemEDI Subsystem
SAP R/3 SystemSAP R/3 System
In order to reduce costs, the company SmartMart wishes to send purchase orders to QuickDeliver via
EDI. QuickDeliver wishes to immediately post these purchase orders electronically. Both companies
have R/3 Systems and must configure their IDoc Interface accordingly. The IDocs are to be
translated into another EDI standard form.
8/2/2019 BC620+ Technology)
18/198
(C) SAP AG BC620 2-1
SAP AG 1999
Basic Principles
IDoc concept and fundamental terms
Data flow and process flows when using the IDoc Interface
Contents:
8/2/2019 BC620+ Technology)
19/198
(C) SAP AG BC620 2-2
SAP AG 1999
Explain the terms IDoc, EDI and ALE
Identify the basic steps in IDoc processing
Topic Objectives
At the conclusion of this unit, you will be able to:
8/2/2019 BC620+ Technology)
20/198
(C) SAP AG BC620 2-3
SAP AG 1999
IDoc Concept
Message-oriented
Asynchronous
System 1
Document
System 2
IDoc Document
IDoc is an SAP standard format for data transfer between systems. IDoc stands forIntermediate
Document. It is intermediate in two respects:
Message-oriented- Data is also stored in applications, only in other formats (the applicationdocuments). The IDoc communicates between these application documents, as the language
spoken by both applications. It is not important whether the application is programmed by SAP or
by another third-party system.
Asynchronous - Data can be stored in IDocs before an application document is created. This isimportant, for instance, when incorrect data is transferred: In this case, the application document is
only created when the data is corrected.
The IDoc Interface is available in the R/3 System from Release 2.1A onwards and in the R/2 System
from Release 5.0F.
8/2/2019 BC620+ Technology)
21/198
(C) SAP AG BC620 2-4
SAP AG 1999
IDoc Applications
WorkflowWorkflow
BusinessBusiness
ConnectorConnector
ElectronicElectronic
FormForm
ALEALE
EDIEDI
SubsystemSubsystem
R/3 SystemR/3 System
R/2 SystemR/2 System
OtherOtherSystems...Systems...
InternetInternet
IntranetIntranet
IDocIDoc
Examples of systems or applications which use IDocs:
ALE: Application Link Enabling EDI: Electronic Data Interchange Business Connector: Sending business documents using the Internet
8/2/2019 BC620+ Technology)
22/198
(C) SAP AG BC620 2-5
SAP AG 1999
EDI and ALE
Document
IDoc
Message
IDocIDoc
SAP R/3 SystemSAP R/3 System
EDI SubsystemEDI Subsystem EDI SubsystemEDI Subsystem
SAP R/3 SystemSAP R/3 System
Two special IDoc application areas should be defined:
EDI: Electronic data interchange between different companies ALE: Electronic data interchange between different systems within one company
Systems can exchange IDocs either directly (for example R/3 with R/3) or have them translated into
other standards (for example UN/EDIFACT or ANSI X.12) by EDI subsystems.
The application which uses IDocs (for EDI or ALE) must be able to write data to IDocs, or read data
from IDocs, or both.
The IDoc format is valid as an EDI standard when used for EDI. However, translating IDocs into
other standards has the advantage of allowing communication with more partners.
Within the R/3 System, only IDoc formats are used. All translations into other EDI Standards are
performed by an EDI subsystem. The advantage is that SAP applications only have to recognize the
IDoc format - not several EDI standards - and are therefore easier to maintain. The disadvantage is
that SAP do not supply an EDI subsystem and customers must purchase such a subsystem when
other EDI standards are to be used.
8/2/2019 BC620+ Technology)
23/198
(C) SAP AG BC620 2-6
SAP AG 1999
Process Flow: Sending Data
Check partner, find port
Transfer data,
process further
Post document
Generate IDoc
R/3 SystemR/3 System
External systemExternal system
In the following examples, data flow is always seen from the point of view of the R/3 System.
Therefore, if data is sent via IDocs from an R/3 System to an external system, the process is called
outbound processing or simply outbound.
Outbound processing includes:
Posting the application document
Generating the corresponding outbound IDoc
Finding the partner and the port
Transfer of the IDoc to the external System via the port
8/2/2019 BC620+ Technology)
24/198
(C) SAP AG BC620 2-7
SAP AG 1999
IDoc Settings: Sending Data
Post document
Generate IDoc
Check partner, find port
Transfer data,process further
Archive IDoc ?Archive IDoc ?
EDI Subsystem ?EDI Subsystem ?
Partner ProfilesPartner Profiles
Port DefinitionPort Definition
DocumentationTools
DocumentationTools
R/3 SystemR/3 System
External SystemExternal System
SmartMart must configure the IDoc Interface for outbound processing:
SmartMart defines the system which will receive IDocs and the technical parameters via the port
definition.
SmartMart defines QuickDeliver as a partner for message type ORDERS in the partner profiles
and enters the port which has already been defined.
Outbound IDocs created in the R/3 System should be archived by SmartMart and then deleted.
The documentation tools inform the EDI Subsystem which IDoc types are to be recognized.
8/2/2019 BC620+ Technology)
25/198
(C) SAP AG BC620 2-8
SAP AG 1999
Process Flow: Receiving Data
Error handling
ok?
ok?
No
No
Check port & partner,
Generate IDoc
Send data to
R/3 Systemtransfer
Post document
R/3 SystemR/3 System
External SystemExternal System
Receiving data from an external system and the subsequent processing in the R/3 System is called
inboundprocessing or also inbound.
Inbound processing includes:
Receiving IDoc data from an external system via an inbound port
Creating the inbound IDoc
Finding the correct processing type via the partner profiles
Creating the application document
If an error occurs, error handling (more general: exception handling) is triggered. Exception
handling is a different kind of processing and is not part of inbound processing. There is also
exception handling for outbound processing but it is less important: For outbound processing you
should usually presume that the data being sent is correct.
8/2/2019 BC620+ Technology)
26/198
(C) SAP AG BC620 2-9
SAP AG 1999
IDoc Settings: Receiving Data
Error handling
Send data toR/3 System
Check port & partner,generate IDoc
Post document
Port Definition,Partner Profiles
Port Definition,Partner ProfilesArchive IDoc ?Archive IDoc ?
DocumentationTools
DocumentationTools
EDI Subsystem ?EDI Subsystem ?
R/3 SystemR/3 System
External SystemExternal System
QuickDeliver must configure the IDoc Interface for inbound processing:
The documentation tools inform the EDI Subsystem which IDoc types are to be recognized.
The port name must be maintained in the port definition before IDocs can be accepted by the R/3
System.
In the partner profiles, QuickDeliver enters SmartMart as a partner for inbound processing and the
message type ORDERS. In addition, agents responsible for error processing are entered here,
specifically for partners and messages.
Like SmartMart, QuickDeliver wishes to archive and subsequently delete inbound IDocs which have
been generated.
8/2/2019 BC620+ Technology)
27/198
(C) SAP AG BC620 2-10
SAP AG 1999
IDoc is an SAP standard for data transfer betweensystems.
Known implementation areas for IDocs: ALE andEDI scenarios
The IDoc Interface facilitates both IDoc processingand flexible error/exception handling
Basic Principles: Summary
8/2/2019 BC620+ Technology)
28/198
(C) SAP AG BC620 3-1
SAP AG 1999
IDoc Record Types
IDoc and IDoc type
IDoc processing: Inbound and outboundprocessing
IDocs in Business Processes
8/2/2019 BC620+ Technology)
29/198
(C) SAP AG BC620 3-2
SAP AG 1999
At the conclusion of this unit, you will be able to:
IDocs in Business Processes: Course Objectives
Explain the difference between IDocs andIDoc types
Describe the structure of an IDoc
Determine where in the business process orthe process chain the IDoc was created
8/2/2019 BC620+ Technology)
30/198
(C) SAP AG BC620 3-3
SAP AG 1999
Business scenario
As a member of the implementation team foryour company (SmartMart or QuickDeliver), youare responsible for configuring the IDocInterface. You must therefore understand thebasic principles behind the interface: the IDocformat and how to embed the interface in bothoutbound processing (SmartMart) and inboundprocessing (QuickDeliver).
8/2/2019 BC620+ Technology)
31/198
(C) SAP AG BC620 3-4
SAP AG 1999
IDoc Record Types
Status records
Data records
Control record
Each IDoc in the SAP database consists of:
One control record
Data records which store the application data in segments and describe the hierarchy of these
segments.
Status records which determine the defined processing steps for the IDoc. As a result, the
number of status records for an IDoc increases as processing continues.
An IDoc for transmission to or from an external system, however, only consists of:
One control record
The data records
If the external system is to inform the R/3 System of the progress of the IDocs which were sent, a
status confirmation message is sent. The R/3 System then appends the status records which were
received to the corresponding outbound IDoc in the database. The R/3 System can also send status
confirmation messages for IDocs. However, this is only possible via the special IDoc type
SYSTAT01, that is, no control records or data records are sent in this case. The status information is
therefore located in the data records for each IDoc!
Summary: IDocs which are transmitted between two different systems are always 'smaller' than the
IDocs in the R/3 System because they do not contain status records.
8/2/2019 BC620+ Technology)
32/198
(C) SAP AG BC620 3-5
SAP AG 1999
Control record
Control record IDoc ID
PartnerIDoc type and logical messageExternal structure
An important part of the control record is the IDoc ID, a 16-digit number which is assigned
automatically by the system. This number is used as a unique identifier for the IDoc in the R/3
System. Status confirmations also refer to this number.
The control record also contains the key fields for partner profiles: Partner and logical message (3
fields each), as well as a flag indicating whether it involves a test partner. For inbound IDocs, these
key fields determine the dependent parameters of the inbound partner profile, for example, how
inbound IDocs should be processed in the R/3 System.
The three key fields for the partner (recipient) are:
Partner number (internal number from master data in the R/3 System)
Partner type (customer, vendor or logical system in ALE scenarios)
Partner function (important in outbound processing using Message Control, otherwise optional)
The three fields for logical messages are:
Message type (corresponds to UN/EDIFACT messages if possible)
Message variant (optional)
Message function (optional)
Other fields relate to the control record, for example conversion to another EDI standard via an EDI
subsystem or an external EDI message archive.
8/2/2019 BC620+ Technology)
33/198
(C) SAP AG BC620 3-6
SAP AG 1999
Data Records and Segment Structures
Data record
Control part, containssegment names
Application data
Field 2Field 1 ...
Segment
Segment names are stored in the control part of a data record. This segment is defined as a structure
in the R/3 System.
As a result of the segment name being stored in the control part, a structure is assigned to the
unstructured section of the application data by applying the "network of application fields". This
always happens when an application reads data from an IDoc or when the application writes data to
an IDoc.
The data type of the segment fields is character.
If possible, ISO codes are used for coded fields.
8/2/2019 BC620+ Technology)
34/198
(C) SAP AG BC620 3-7
SAP AG 1999
Status Record
Status Record IDoc IDStatus information
The IDoc number of the IDoc to which the status record refers is an important part of the status
record. This allows the IDoc relevant to a status conformation message to be identified in the system
and the returned status records can therefore be appended.
The first status information during processing is taken from the status value or status. This is used as
a basis for the exception handling.
More detailed information can be obtained from three fields which are used to name R/3 messages in
the standard system. If an error occurs during IDoc processing in the R/3 System, a corresponding
error message can be stored in the status record via the status value "incorrect". Example - message
SAPE0133 ("error during RFC with port X"):
SAP: R/3 message, displayed in a standard window (field STAMQU)
E0: Message class as defined in table T100 (field STAMID)
133: Message number as defined in table T100 (field STAMNO).
If the first three characters refer to an external system, special messages can be displayed for the
system. However, the display must be programmed specifically and a link to the program must be
included to table TEDE3.
Other fields in the status record include the creation date, creation time and name of the program
which discovered the error during IDoc processing.
8/2/2019 BC620+ Technology)
35/198
(C) SAP AG BC620 3-8
SAP AG 1999
IDoc Record Types: Summary
Control record
Data records
IDoc ID
PartnerIDoc type and logical messageExternal structure
Control part Application data
Status records IDoc ID
Status information
8/2/2019 BC620+ Technology)
36/198
(C) SAP AG BC620 3-9
SAP AG 1999
IDoc Types
Control Record
Status Records
Data records, represented as a segment tree
E1TLSUM
E1HDADR
E1ITSCH
E1HDDOC
E1ITDOC
Elternsegment
Kindsegment
E1ITSCH
C 5
E1ITDOC
M 1
C 99
M 1
C 5
C 1
Each business process (for example a purchase order) usually corresponds to a certain IDoc type,
which can include the relevant data.
An IDoc type is defined by the segments, their hierarchy, sequence and frequency of use. This
information is contained in the control part of the data records.
The segment hierarchy can be represented in tree form as parent and child segments. This allows the
application data to be structured.
Summary: IDoc types are special data structures for special applications or messages. If such a
structure contains application data, an IDoc is created (the instance of the IDoc type).
8/2/2019 BC620+ Technology)
37/198
(C) SAP AG BC620 3-10
SAP AG 1999
Outbound and Inbound Processing
Outbound Processing Inbound
IDoc Interface/ALE Services
External System
SAP Application
R/3 System
Directions are always defined from R/3. Therefore, in the outbound direction, data is sent from the
application to the external system via the IDoc Interface. For the inbound direction, the opposite is
true.
For inbound processing, the external system must be assigned certain authorizations. Documents
(IDocs and application documents) are to be created in the R/3 System.
Different options are available for both inbound and outbound processing. These options are
explained in the following slides.
8/2/2019 BC620+ Technology)
38/198
(C) SAP AG BC620 3-11
SAP AG 1999
Outbound Processing using MessageControl
IDocIDoc
MCMC
recordrecord
DocumentDocument
SAP Application
Message Control (MC)
External System
IDoc Interface / ALE Services
During outbound processing using Message Control, the application sends IDocs to the IDoc
Interface via Message Control. The IDocs can be processed further (for example filtered) by the ALE
services, if required, before being sent to the port.
The IDoc Interface sends each IDoc to the subsequent system according to the technical port
definition. Examples of various port types:
External system = R/3 System: usually transactional RFC (standard ALE scenario)
External system = EDI subsystem: Usually the file interface
8/2/2019 BC620+ Technology)
39/198
(C) SAP AG BC620 3-12
SAP AG 1999
Comm. IDocComm. IDocComm. IDocComm. IDoc Comm. IDocComm. IDoc
MasterIDoc
MasterIDoc
Direct Outbound Processing using ALE
SAP Application
External System
IDoc Interface / ALE Services
During direct outbound processing, the ALE services are always called. These services:
- Filter the IDoc: Data not required for the communication is removed from the IDoc- Change the (segment) version: if the recipient only recognizes an earlier version of the IDoc
type, the version can be changed here. This means that less data is transported, as later versions
of IDoc types can only contain more data than former versions and never less.
- Determine the IDoc recipient using a maintained distribution model, in case the applicationitself did not specify the recipient.
- Duplicate the IDoc, if required, for distribution models. The ALE services create one (or more) communication IDoc(s) from one master IDoc (which is
transferred to function module MASTER_IDOC_DISTRIBUTE).Only communication IDocs are
saved in the database.
8/2/2019 BC620+ Technology)
40/198
(C) SAP AG BC620 3-13
SAP AG 1999
Inbound Processing using Workflow
DocumentDocument
IDoc +IDoc +
processprocess
IDocIDoc
SAP Application
SAP Business Workflow
External System
IDoc Interface & ALE Services
The external system sends IDocs to the R/3 System. The R/3 System is addressed via the port name
SAP for example SAPC11 for an R/3 System called C11.
If the IDoc Interface recognizes the external system, the inbound IDocs are accepted and checked,
that is, a syntax check is performed and the system checks whether the sender is entered as a partner.
The IDoc is sent to the application via SAP Business Workflow according to the settings in the
partner profile.
If required, the IDoc can be processed by the ALE services before being saved in the database as an
inbound IDoc.
8/2/2019 BC620+ Technology)
41/198
(C) SAP AG BC620 3-14
SAP AG 1999
IDocIDoc
Direct Inbound Processing using ALE
IDocIDoc
SAP Application
External System
IDoc Interface & ALE Services
Until the partner profile settings are read, direct inbound processing works in the same way as
inbound processing via workflow:
The IDoc is passed directly to the application function module according to the partner profile
settings.
You can also set the process code (see the Partner Profiles unit) so that the ALE services are always
called during direct inbound processing. As in the case of outbound processing, these services are
responsible for filtering and version changes. However, IDocs cannot be duplicated during inbound
processing.
When using an ALE service, the end result is only ever stored in the database. This is the
application IDoc, in contrast to the inbound communication IDoc.
8/2/2019 BC620+ Technology)
42/198
(C) SAP AG BC620 3-15
SAP AG 1999
IDocs in Business Processes: Summary
Each IDoc in the R/3 database consists of one controlrecord and several data and status records. Onlycontrol records and data records are exchanged withexternal systems.
There are various IDoc types which are distinguishedby their segments and their order. This information isstored in the control part of the data records.
Different processing options are available for IDocs inboth inbound and outbound processing.
8/2/2019 BC620+ Technology)
43/198
(C) SAP AG BC620 3-16
IDocs in Business Processes Exercise
Data for exercises:
Training system: Will be announced by the instructor (for exampleI40)
Client: 400User: BC620-nn
Password: KURS
Ports: SUBSYSTEM of type File (default)
Data Data in training system Data in IDES
Customer side:
Material SH-100 SH-100
Vendor T-BILnn 1014
Purchasing organization 1000 1000
Purchasing group 001 001
Plant 1100 1100
Vendor side:
Material SH-100 SH-100
Sold-to party T-BIKnn 1110
Order type TA
Sales organization 1020 1020
Distribution channel 22 22
Division 00 00
Delivering plant 1100 1100
nn is your group number
8/2/2019 BC620+ Technology)
44/198
(C) SAP AG BC620 3-17
Unit: IDocs in Business Processes
Explain terms
Define IDoc structure
1.1 True or false:
1.1.1 IDocs are always used for process chains.
1.1.2 IDocs are intermediate documents: When the application documents havebeen created, the IDocs are deleted from the R/3 System.
1.1.3 IDoc types describe how IDocs are structured.
1.1.4 There are basic rules for IDoc structures.
1.1.5 The differences between IDoc types involve more than the segments whichthey contain.
1.2 True or false:
1.2.1 In outbound processing, IDocs are always generated by the IDoc Interface
or by the application.
1.2.2 In inbound processing, IDocs are always generated by the IDoc Interface.
1.2.3 Exception handling via workflow is not possible in outbound processing.
1.2.4 An external system has its own formats for IDoc data. There are thereforeno IDocs in the external system.
8/2/2019 BC620+ Technology)
45/198
(C) SAP AG BC620 3-18
IDocs in Business Processes Solutions
Unit: IDocs in Business Processes
1.1 True or false:
1.1.1 IDocs are always used for process chains.
false: Process chains can also be used within the R/3 System (for example
workflow) and can therefore be used without IDocs.
1.12 IDocs are intermediate documents: When the application documents havebeen created, the IDocs are deleted from the R/3 System.
false: IDocs can only be deleted from the system when they have beenarchived. The phrase intermediate document does not refer to the "life
expectancy" of an IDoc.
1.1.3 IDoc types describe how IDocs are structured.
true
1.1.4 There are basic rules for IDoc structures.
true
1.1.5 The differences between IDoc types involve more than the segments whichthey contain.
false: IDoc types are only defined by their segments. IDocs, however, can
be distinguished by the IDoc type and their contents.
1.2 True or false:
1.2.1 In outbound processing, IDocs are always generated by the IDoc Interfaceor by the application.
true
1.2.2 In inbound processing, IDocs are always generated by the IDoc Interface.
true
1.2.3 Exception handling via workflow is not possible in outbound processing.
false: Exception handling exists for processing errors or syntax errors
when dealing with both inbound and outbound processing.
1.2.4 An external system has its own formats for IDoc data. There are thereforeno IDocs in the external system.
false: The IDoc format must at least be recognized by the external system.
In addition, "external systems" can be R/3 Systems or R/2 Systems, in
which case IDocs are always stored in the system.
8/2/2019 BC620+ Technology)
46/198
(C) SAP AG BC620 3-19
8/2/2019 BC620+ Technology)
47/198
(C) SAP AG BC620 4-1
SAP AG 1999
Documentation Tools
Record types, IDoc types, segments
Output formats
8/2/2019 BC620+ Technology)
48/198
(C) SAP AG BC620 4-2
SAP AG 1999
Use the documentation tools
Decide in which situations they would be useful
At the conclusion of this unit, you will be able to:
Documentation Tools: Unit Objectives
8/2/2019 BC620+ Technology)
49/198
(C) SAP AG BC620 4-3
SAP AG 1999
Overview Diagram (Sending Data)
R/3 SystemR/3 System
Post document
Generate IDoc
Check partner, find port
Transfer data,process further
Archive IDoc ?Archive IDoc ?
EDI Subsystem ?EDI Subsystem ?
Documentation
Tools
Documentation
Tools
Partner ProfilesPartner Profiles
Port DefinitionPort Definition
External SystemExternal System
SmartMart must configure the IDoc Interface for outbound processing:
Using the documentation tools, SmartMart sends information about the structure of IDoc Type
ORDERS01 to the EDI subsystem.
8/2/2019 BC620+ Technology)
50/198
(C) SAP AG BC620 4-4
SAP AG 1999
Business scenario
As a member of the implementation team for yourcompany (SmartMart or QuickDeliver), you areresponsible for configuring the IDoc Interface.Your EDI subsystem does not yet know the structureof the IDoc type to be used. The IDoc Interface canexport IDoc type structures in various formats, usingthe documentation tools. You must know about thisfunction, as you can save yourself a lot ofprogramming work in the EDI subsystem.
8/2/2019 BC620+ Technology)
51/198
(C) SAP AG BC620 4-5
SAP AG 1999
Release3.0
Internal and External Structures
Field 1 Field 2
Field 1 Field 2 Field 3 Field 4
Segment
internal
external
E1...
E2...001
IDoc types are distinguished by their segments, that is the structure or raster laid upon the data part
of the data record. These Segments exist in both internal and external form:
Internally as a release-independent structure (SAP names begin with E1), containing all thedefined segment fields.
Externally as a release-dependent structure (SAP names begin with E2), containing only thesegment fields defined for the specified release in the partner profile.
In addition to the segments, there are also IDoc record types, in both internal (in the R/3 database)
and external (as structures sent to the external system) forms. Both have changed in different R/3
Releases. The documentation tools only export the external structures in this case.
As a result, when running the documentation tools, you have to enter the following parameters:
The version of the external record types (as entered in the port definition)
The release of the external segment(as entered in the partner profiles) The default values are the current release number and the relevant status record version. If you
change the values, go back to the past.
8/2/2019 BC620+ Technology)
52/198
(C) SAP AG BC620 4-6
SAP AG 1999
Output in Various Formats I
?? ?
?
IDoc types, segments and record types can be displayed in user-friendly formats which can be read
by other systems. The following display options are available:
R/3 tree display: In the case of general record types, the "tree" has only one level because thehierarchy only exists for segments and therefore for special IDoc types.
HTML file In the IDoc administration user parameters you can set whether an external browser isto be started or whether the SAP internal HTML control should be used.
The documentation goes beyond the structure: It also relates to the data elements behind the segment
structure fields. The documentation tools can also provide information about using individual IDoc
types.
8/2/2019 BC620+ Technology)
53/198
(C) SAP AG BC620 4-7
SAP AG 1999
Output in Various Formats II
Begin
End
typedef struct z2incodx000
z2incodx000
?? ?
?
XML
Machine-readable formats are:
A simple chain of begin..end declarations which can be read by a parser C-Header Meta-IDoc, type SYRECD01 (IDoc record types) or SYIDOC01 (IDoc types) Meta data for IDoc types in XML format
You start the documentation tools from the initial node of the IDoc Interface from the
Documentation menu. The parser has its own menu entry, both for record types and IDoc types.
8/2/2019 BC620+ Technology)
54/198
(C) SAP AG BC620 4-8
SAP AG 1999
Documentation Tools: Summary
The documentation tools describe both thestructure and the use of different IDocs.
The structure is in the structure information.External structures are always documented,specifically regarding how they are exchangedwith external systems.
The output formats can be read by externalsystems, so that non-R/3 Systems can quicklyrecognize the IDoc structure.
8/2/2019 BC620+ Technology)
55/198
(C) SAP AG BC620 4-9
Documentation Tools Exercise
Unit: Documentation Tools
Topic: Output formats
At the conclusion of these exercises, you will have:
Learned about different output formats
As a member of the EDI project team for your company, you requireinformation on IDoc type ORDERS01 for two reasons:
To prepare for a project discussion about purchase order/order via EDI.
To inform your EDI subsystem provider of this data structure.
1-1 Select Documentation IDoc types from the initial node of the IDoc interface. Asyou wish to use the standard and have not yet extended any IDoc types, enter the IDoctypeORDERS01 and then select Basic type in the Development object frame.
1-2 You wish to receive all the information on the IDoc type. By selecting Goto Usersettings, you can check that all the display attributes are activated. Save your entries
and return to the initial screen.
1-3 When preparing for the discussion, you opt for the output formatHTML page due tothe convenient navigation options. Three files are generated on your PC. If you havenot changed any of the settings, these files are ORDERS01_F.HTM,ORDERS01_I.HTM and ORDERS01_D.HTM. File ORDERS01_F.HTM can beopened via Internet Explorer.
8/2/2019 BC620+ Technology)
56/198
(C) SAP AG BC620 5-1
SAP AG 1999
Port Definition
Port types and when they are used
Port definition parameters
Communication with Older Releases
8/2/2019 BC620+ Technology)
57/198
(C) SAP AG BC620 5-2
SAP AG 1999
Decide which port types should be implementedfor which external systems
Enter a port definition in the R/3 System
Determine which additional steps are required forlinking to the relevant external system
Enter special settings which are required forcommunication with older R/3 releases and R/2Systems
At the conclusion of this unit, you will be able to:
Port Definition: Unit Objectives
8/2/2019 BC620+ Technology)
58/198
(C) SAP AG BC620 5-3
SAP AG 1999
Overview Diagram (Sending Data)
R/3 SystemR/3 System
Post document
Generate IDoc
Check partner, find port
Transfer data,process further
Archive IDoc ?Archive IDoc ?
EDI Subsystem ?EDI Subsystem ?
Documentation
Tools
Documentation
Tools
Partner ProfilesPartner Profiles
Port DefinitionPort Definition
External SystemExternal System
The company SmartMart wishes to send purchase orders to QuickDeliver via EDI. QuickDeliver
wishes to immediately post these purchase orders electronically. Both companies have R/3 Systems
and must configure their IDoc Interface accordingly.
SmartMart must configure the IDoc Interface for sending data (outbound processing or simply
outbound):
SmartMart defines the system which will receive IDocs and the technical parameters via the port
definition.
8/2/2019 BC620+ Technology)
59/198
(C) SAP AG BC620 5-4
SAP AG 1999
Port Definition: Business Scenario
As a member of the implementation team for
SmartMart, you are responsible for configuringthe IDoc Interface.
You must decide which port type is suitable forthe system of your partner companyQuickDeliver.
8/2/2019 BC620+ Technology)
60/198
(C) SAP AG BC620 5-5
SAP AG 1999
IDoc Interface: Port Types
IDoc Interface
CPI-C
R/2 SystemExternal System
File
IDoc/IDoc/
statusstatusIDoc/IDoc/
statusstatus
PI
IDocIDoc
?
XML
IDocIDoc
tRFC
IDocIDoc
Internet
IDocIDoc
Ports are the channels via which the IDocs are exchanged. The IDoc Interface supports six different
transmission methods. These are the port types:
"File": IDocs are written in files at an operating system level. The receiving system can read the files
here. The receiving system can also be started using the synchronous RFC. Besides IDocs (that is
data and control records), status records can also be exchanged by file.
"XML": The IDocs are written in XML format in the files. As is the case with the port type "file",
the receiving system is started via RFC, but here status records are only transferred by means of the
IDoc type SYSTAT01.
"Transactional RFC" IDocs are sent as tables. Typically here, the external system is an R/3 System
(ALE scenarios).
"CPI-C" IDocs or control records are transferred according to the CPI-C protocol, in the way it is
implemented for the IDoc Interface in the R/2 System. The external system is always an R/2 System.
IDocs are always exchanged by means of the CPI-C protocol in the R/2 IDoc Interface (available
from R/2 Release 5.0F). For further information see the R/2 handbook, p53.2.
"Internet": The IDocs are written in MIME format to an e-mail attachment.
"Programming Interface (PI)": IDocs are sent as tables to one of the function modules defined. You
therefore do not leave the R/3 System via a PI port. Your function module can naturally trigger orperform an external dispatch.
8/2/2019 BC620+ Technology)
61/198
(C) SAP AG BC620 5-6
SAP AG 1999
Port Definition: Port Type "File"
Command file
Outbound file
Inbound file
Status file
IDoc file
Status report
rfcexec
out.script
RFC destination(TCP/IP connection)
Data for technical linking is determined in the port definition for the IDoc Interface. So that a port
can be used, settings outside of the IDoc Interface must be made.
The port definition for the port type "file" includes
Name and directory of files. Only the outbound file is important, as the place and name of the fileare determined by the external system during inbound processing of IDocs or a status
confirmation. However, if you do enter a parameter for the inbound IDoc and status file, the test
tool can generate default values. It is important that the port exists every time, even if it is only
used in inbound processing, as the IDoc Interface only accepts ports that it recognizes.
Instead of the outbound file, you can also store a function module, which dynamically generatesnames and thus helps to prevent files from being over-written. You can also use logical file names:
You should also see the F1 Help for the field.
Name and directory of command file that is to be called from program "rfcexec" and which shouldstart the external system - this file must be created so that the R/3 System can start the receiving
system automatically (= trigger) as soon as it has generated an IDoc file.
If you trigger using RFC, you require the RFC destination. This is maintained with the transactionSM59 (TCP/IP connections). It is a setting outside of the IDoc Interface.
8/2/2019 BC620+ Technology)
62/198
(C) SAP AG BC620 5-7
SAP AG 1999
Process Flow: Port Type File (with Triggering)
1
Write
IDoc file
4
Read
2
RFC
3
Call
rfcexec
out.script
1
Write
IDoc fileStatus report
startrfc
in.scriptstatus.script
3
RFC
2
Call
4
Read
IDoc Interface
External System
IDoc outbound:
In step 1, a new file is generated with the transferred IDocs by the IDoc Interface. In the second step,
the program rfcexec (synchronous RFC) with the path to an executable program is called (here:
out.script) and also the path to the IDoc file. out.script thus contains the path and name of the
file as an input value. In step 3, it therefore calls the external system, which reads the file in step 4.
After successful processing of the IDoc file, the external system must delete the IDoc file. The call
command in out.script depends on the external system.
IDoc inbound:
In step 1, the external system generates an IDoc file. In step 2 it starts the R/3 System in which it
executes the program "startrfc". startrfc receives the logon parameter and the names of the function
module to be executed, the port and the path to the IDoc file. The startrfccommand can be included
in an executable program, here in.script. In step 4, the R/3 System started then processes the IDoc
file and deletes it after successful processing. It is important that the external system logs on to
an R/3 System with a user which has the corresponding authorization for creating application
documents.
The status report works in exactly the same way as an inbound IDoc, except that here a status file
instead of an IDoc file is transferred. rfcexec and startrfc are example programs for the use of the RFC library and are supplied with
this.
8/2/2019 BC620+ Technology)
63/198
(C) SAP AG BC620 5-8
SAP AG 1999
Port Type XML: Flat File and XML File
EDI_DC40 004000000000030702346B 3013 ORDERS01
...
E2EDP01005 00400000000003070230000210000000200
E2EDP20 00400000000003070230000220000210323
...
E2EDPT1001 004000000000030702300002600002103BESTD
E2EDPT2001 004000000000030702300002700002604This is
The IDoc data is written in a file under the port type "XML", but in XML format. Hence the port
definition and technical structure are almost identical.
Under port type "file", no structure information at all is written in the file. The individual segments
are put in a row one after another as data records and are separated with carriage return. Thus you
also speak of a "flat file".
The fields are identified by means of their position in the individual records. Such a flat file therefore
contains as many blank characters as possible so that the fields are in the right place.
8/2/2019 BC620+ Technology)
64/198
(C) SAP AG BC620 5-9
SAP AG 1999
Port Type XML: Flat File and XML File (2)
EDI_DC40
E1EDP01
E1EDP20
E1EDPT1
E1EDPT2
A[EDI_DC40]]>0040000000000307023...
00010 001023.000...
...
23.000 19990622
...
BEST
D...
...
...This is the
purchase order text....
...
The segments are also written one after another in the XML file. But they are considerably different
to a flat file:
Segments are enclosed by start and end tags and therefore do not need to be separated by carriage
return. As the fields are also enclosed by tags, the segments are only ever as long as the data
contained requires hence there are no "unnecessary" blank characters.
As the tags can be connected with one another in XML, you can display an XML file as a tree. The
SAP system IDoc structure therefore remains in the file received and can be displayed in any XML-
compatible browser.
8/2/2019 BC620+ Technology)
65/198
(C) SAP AG BC620 5-10
SAP AG 1999
Port Definition - Port Type tRFC
RFC destination
(R/3 connection)
Port name (assigned automatically)
Application server forreceiving system
Only the name of an existing logical RFC destination is entered in the port definition. The system
then generates a name for this port which consists of an "A" and a 9 digit number. The automatic
number assignment requires a number range which is configured in IDoc Interface Customizing.
There you can also set whether the numbers are to be assigned internally or by an external system.
Alternatively to port definition in the IDoc Interface, you can create tRFC ports from ALE
Customizing.
The RFC destination itself is maintained with the transaction SM59 as the "R/3 connection".
8/2/2019 BC620+ Technology)
66/198
(C) SAP AG BC620 5-11
SAP AG 1999
Process Flow: Port Type tRFC
IDoc Interface
External System
RFC Interface
RFC Interface
TCP/IP
For tRFC a system calls a function module in a second system. It follows for the IDoc data exchange
that the sending system is always the active system: It calls the function module in the receiving
system and transfers the IDocs as tables. The function modules are therefore inbound function
modules of the respective system.
Inbound function modules in the IDoc Interface are the function modules
INBOUND_IDOC_ASYNCHRONOUS (new for Release 4.0) and INBOUND_IDOC_PROCESS
(older releases). Therefore if you want to send IDocs from a 4.0 System to an older R/3 release, you
must call INBOUND_IDOC_PROCESS there: This is set via the port version.
Non-R/3 Systems require the R/3 RFC library. The external RFC Interface can be generated for the
function module from the development environment (transaction SE37) (menu: Utilities -> RFC
Interface -> Generate). If a non-R/3 System wants to be able to receive IDocs by tRFC, it still needs
a function module that is configured like INBOUND_IDOC_ASYNCHRONOUS or
INBOUND_IDOC_PROCESS.
All IDocs transferred are saved asynchronously in the database using the single COMMIT WORK
command.
For further information see the ALE documentation (underR/3 Library->CA-Business Framework)
8/2/2019 BC620+ Technology)
67/198
(C) SAP AG BC620 5-12
SAP AG 1999
Port Definition: CPI-C (R/2 System)
Host destination
RFC destination
Technical parametersSend status records?
sideinfo-entry
Host on R/2
TXCOM entry
The logical destination and the host destination are determined in the port definition. The RFCdestination is created with the transaction SM59 and contains the logon data (name, password). Thehost destination indicates an entry in the R/3 internal table TXCOM.
The TXCOM entry refers to a gateway. The logical destination is assigned a logical uniton the R/2
side in a sideinfo-file of this gateway. The logical unitis part of the network architecture SNA andidentifies computers or also programs to be started.
Besides the target system, the port definition also contains technical parameters like the buffer sizeof the CPI-C data buffer or a flag showing whether the R/2 System should send a confirmation ofreceipt.
Note that for this port type not only the name, but rather also technical parameters are also importantfor inbound processing. The reason for this is that the R/2 System is always passive, that is, the R/3System also collects the IDocs from the R/2 System under inbound processing.
The exact functions and configuration of this port type can be found In the R/2 manual S53.2 (IDoc Interface). Unit 8 of the manual describes in detail how the sending
and receiving side of the CPI-C connection in an EDI subsystem are configured
In the R/3 OSS note 61524 and In the R/2 OSS notes 52553 and 57014.
8/2/2019 BC620+ Technology)
68/198
(C) SAP AG BC620 5-13
SAP AG 1999
Process Flow: Port Type CPI-C
R/2 IDoc Interface
LU 6.2
TCP/IP
2.2. Retrieve/send IDocs orRetrieve/send IDocs or
receive/send statusreceive/send status
recordsrecords
CPI-C
1.Communicationstructure
R/3 IDoc Interface
The R/2 System is always passive, the communication is always started from the R/3 System. The
data bindings supported are:
R/3 outbound, IDoc from R/3 to the R/2 (R/3 sends IDocs: from R/2 Rel. 5.0F, from R/3 Rel. 3.0) R/3 inbound, IDoc from R/2 to R/3 (R/3 receives IDocs: from R/2 Rel. 5.0F, from R/3 Rel. 3.1) Status report (R/3 sends exactly one status record per IDoc: from R/2 Rel. 5.0F, from R/3 Rel. 3.1)
Status report (R/3 receives exactly one status record per IDoc: from R/2 Rel. 5.0H, from R/3 Rel.3.1)
The CPI-C protocol commands are used (Common User Programming Interface). The gateway
converts the CPI commands into:
LU 6.2 protocol commands to the R/2 side (IBM mainframe) TCP/IP protocol commands to the R/3 side (client/server systems)
The IDocs are saved synchronously in the database.
8/2/2019 BC620+ Technology)
69/198
(C) SAP AG BC620 5-14
SAP AG 1999
Port Definition: Internet
Internet address
Folder name for outbound IDocs
Additional mail attributes
Internet destination
The most important part of the port definition is the Internet address (IP address). Together with the
IDoc it is transferred via SAPconnect to the Internet gateway (or the Microsoft Exchange server).
Furthermore, the port definition contains mail attributes:
- an explanatory text which can be read first when receiving a mail as the mail body
- the title of the mail in the mail header
- the name of a folder in which IDocs to be sent can be saved in the original system for control
purposes.
The general settings (IDoc Administration) contain the name of the folder where mails with the
inbound IDocs are saved. Normal IDoc inbound processing can only be started from this folder.
8/2/2019 BC620+ Technology)
70/198
(C) SAP AG BC620 5-15
SAP AG 1999
Process Flow: Port Type Internet
IDoc Interface
SAPoffice/SAPconnect
External System
IDocIDoc
MIME e-mail
For sending via the Internet, IDocs are converted to another format (SAPoffice name: R3I): a table
with 255 characters. This table is transferred by SAPconnect:
To the Internet gateway (sendmail program), or To the Microsoft Exchange server.
The gateway (or the Exchange server) converts the IDoc table into MIME format.
For inbound processing, the procedure is reversed. Internet IDocs are displayed to the relevant users
as mail attachments in SAPoffice.
To use this port type, the following parameters must be entered:
A SAPconnect node for address type INT (Internet) must be configured (for forwarding andmanaging Internet messages)
The user must have a SAPoffice address for address type INT to receive IDocs
The recipient of an Internet IDoc forwards this to the dummy user EDI USER (see the Help on theapplication in the port definition: Configure the SAPoffice user address for the Internet
8/2/2019 BC620+ Technology)
71/198
(C) SAP AG BC620 5-16
SAP AG 1999
Port Definition: PI
Function module:Name and description
Own
function module
in the R/3 System
For a port of type "programming interface", only enter the name of the function module to be called
for outbound processing.
In this ABAP function module you can program any type of processing. Only the interface is
standard.
The standard system includes the function module OWN_FUNCTION as an example.
8/2/2019 BC620+ Technology)
72/198
(C) SAP AG BC620 5-17
SAP AG 1999
Process Flow: Port Type PI
IDoc Interface
Own function module
IDocIDoc
Outbound Processing
The IDoc Interface calls the function module and transfers the IDoc control records in table format.
Further processing (reading data, processing data, writing status records) is programmed by the user.
Inbound Processing
Your function module must call the SAP function module IDOC_INBOUND_ASYNCHRONOUS,
which saves the IDocs in the database and triggers the event. This event asynchronously starts
inbound processing.
8/2/2019 BC620+ Technology)
73/198
(C) SAP AG BC620 5-18
SAP AG 1999
Communication with Older Releases
Field 1 Field 2
Field 1 Field 2
Field 2
2.1/2.2
3.0/3.1
4.X
New field 3
Field 1 Field 3
Differences in IDoc record types
The IDoc record types are defined in the dictionary by their structure.
Structures have changed in different releases, with names becoming longer and new fields being
added.
Example: For R/3 Release 3.0, the partner function was included in the control record. To be able to communicate with earlier releases, the version is specified in the port definition:
Version 1: Record types are transferred using the Releases 2.X structure Version 2: Structure of Release 3.X Version 3: Structure of Release 4.X
For port type "tRFC", a non-R/3 System must also recognize the function module to be called, as
well as the correct record types: INBOUND_IDOC_ASYNCHRONOUS (new in Release 4.0) or
INBOUND_IDOC_PROCESS (older releases).
As record types in the R/2 System always have the same structure, no version must be maintained for
port type CPI-C. The structure is covered by R/3 Release 3.0/3.1 (version 2).
8/2/2019 BC620+ Technology)
74/198
(C) SAP AG BC620 5-19
SAP AG 1999
Port Definition: Summary
IDocs or status records are always exchanged with an
external system via a port.
In the port definition for the IDoc Interface, users definethe target system and the technical communicationparameters. In addition, users can specify the release
status for the external system via the version entry.
Additional technical settings must also be entered (alsooutside R/3), before a port can be used.
There are six basic communication techniques for theIDoc Interface, represented by the six different porttypes.
8/2/2019 BC620+ Technology)
75/198
(C) SAP AG BC620 5-20
Port Definition Exercise
Unit: Port Definition
At the conclusion of these exercises, you will be able to:
Create a port
You are a member of the EDI project team. The decision has been madeto connect the EDI subsystem to the R/3 System via the file (port type
"File").
1-1 Create a new port: From the initial node of the IDoc Interface, selectIDoc Portdefinition, choose File and select Create.
You should use the port name PORT-nn. As the first test does not involve triggering,you only have to maintain the Outbound file tab page. Ensure that the file names canbe generated dynamically. Select the logical directory EDI_GLOBAL_PATH and a
suitable function module. Leave the Outbound file field empty.
From the Outbound file tab page, check the settings using the correspondingpushbutton (check icon). Save your entries.
Top Related