Escolar Documentos
Profissional Documentos
Cultura Documentos
BC620
BC620
SAP IDoc
Interface
(Technology)
SAP AG 1999
SAP AG
Release: 4.6A
Status: January 2000
Mat. No.: 5003 4022
0.2
Copyright
SAP AG 2001
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, Saarbrücken
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 Netscape
Communications, 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, 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.
Other products, services, logos, or brand names included herein are trademarks or registered
trademarks of their respective owners.
0.3
Business Integration Technologies II
Level 2 Level 3
BC619 3 days
Application Link
Enabling (ALE)
Technology
BC620 2 days BC621 1 day
SAP IDoc Interface SAP IDoc Interface - Data Exchange
Technology Development
CA150 2 days
Building Enterprise BC420 5 days
Solutions with SAP Data Transfer
Components BC415 2 days
Communication
CA925 5 days Interfaces in ABAP Interface
Programming with Programming
BAPIs in Visual Basic CA926 5 days
Programming with
CA927 5 days BAPIs in JAVA
R/3 Interface and BAPI
Programming in C++
SAP AG 1999
0.4
Course Prerequisites
Recommended:
Basic knowledge of the R/3 System, as gained from
courses SAP20 and SAP50, for example
SAP AG 1999
0.5
Target Group
Participants:
Consultants
Administrators
Project team
members
Duration: 2 days
SAP AG 1999
1
Course Overview
Contents:
Course Goals
Course Objective(s)
Course Content
Course Overview Diagram
Main Business Scenario
SAP AG 1999
SAPAG1999
SAP AG 1999
Exercises
Solutions
Appendix
SAP AG 1999
R/3 System
IDocs in Business
Processes
Archive
Archive IDoc?
IDoc? Partner
Partner Profiles
Profiles
Test,
monitoring
Message
Control, Port
Port Definition
Definition
Workflow
A Process Chain
SAP AG 1999
SmartMart
QuickDeliver
IDoc IDoc
Message
EDI Subsystem EDI Subsystem
SAP AG 1999
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.
Contents:
SAP AG 1999
SAP AG 1999
System 1 System 2
Message-oriented
Asynchronous
SAP AG 1999
IDoc is an SAP standard format for data transfer between systems. IDoc stands for Intermediate
Document. It is intermediate in two respects:
Message-oriented - Data is also stored in applications, only in other formats (the application
documents). 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 is
important, 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.
Business
R/2 System Connector
Internet
Intranet
ALE
IDoc
EDI
Subsystem
R/3 System
Other
Workflow Systems...
Electronic
Form
SAP AG 1999
Document
IDoc
SAP R/3 System SAP R/3 System
IDoc IDoc
Message
EDI Subsystem EDI Subsystem
SAP AG 1999
R/3 System
Post document
Generate IDoc
Transfer data,
process further
External system
SAP AG 1999
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
R/3 System
Post document
Archive
Archive IDoc
IDoc ?? Generate IDoc Partner
Partner Profiles
Profiles
External System
SAP AG 1999
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.
External System
Send data to
R/3 System
transfer
R/3 System
No
SAP AG 1999
Receiving data from an external system and the subsequent processing in the R/3 System is called
inbound processing 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.
External System
Send data to
EDI
EDI Subsystem
Subsystem ?? R/3 System
Documentation
Documentation
Tools
Tools
Post document
Error handling
R/3 System
SAP AG 1999
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.
SAP AG 1999
SAP AG 1999
SAP AG 1999
SAPAG1999
Control record
Data records
Status records
SAP AG 1999
SAP AG 1999
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.
Data record
Control part, contains Application data
segment names Field 1 Field 2 ...
Segment
SAP AG 1999
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.
SAP AG 1999
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.
Data records
SAP AG 1999
Control Record
E1HDDOC E1TLSUM
M 1 C 1
E1HDADR E1ITDOC
C 5 M 1
Elternsegment
E1ITSCH
E1ITSCH
Kindsegment
C 99 C 5
Status Records
SAP AG 1999
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).
SAP Application
R/3 System
External System
SAP AG 1999
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.
SAP Application
Document
IDoc
External System
SAP AG 1999
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
SAP Application
Master IDoc
IDoc Interface / ALE Services
External System
SAP AG 1999
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 application
itself 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.
External System
IDoc
IDoc +
process
Document
SAP Application
SAP AG 1999
The external system sends IDocs to the R/3 System. The R/3 System is addressed via the port name
SAP<SID> 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.
External System
IDoc
IDoc
SAP Application
SAP AG 1999
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.
SAP AG 1999
Explain terms
Define IDoc structure
Output formats
SAP AG 1999
SAP AG 1999
R/3 System
Post document
Archive
Archive IDoc
IDoc ?? Generate IDoc Partner
Partner Profiles
Profiles
External System
Documentation
EDI
Transfer data, Tools
EDI Subsystem
Subsystem ?? process further
SAP AG 1999
SAPAG1999
Segment
Release 3.0
internal
external
SAP AG 1999
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 the
defined segment fields.
Externally as a release-dependent structure (SAP names begin with E2), containing only the
segment 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”.
? ?
? ?
SAPAG1999
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 the
hierarchy 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 is
to 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.
SAP AG 1999
SAP AG 1999
As a member of the EDI project team for your company, you require
information 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. As
you wish to use the standard and have not yet extended any IDoc types, enter the IDoc
type ORDERS01 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 User
settings, 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 format HTML page due to
the convenient navigation options. Three files are generated on your PC. If you have
not changed any of the settings, these files are ORDERS01_F.HTM,
ORDERS01_I.HTM and ORDERS01_D.HTM. File ORDERS01_F.HTM can be
opened via Internet Explorer.
SAP AG 1999
SAP AG 1999
R/3 System
Post document
Archive
Archive IDoc
IDoc ?? Generate IDoc Partner
Partner Profiles
Profiles
External System
Documentation
Documentation
Transfer data, Tools
Tools
EDI
EDI Subsystem
Subsystem ?? process further
SAP AG 1999
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.
SAPAG1999
IDoc Interface
IDoc/ IDoc/
IDoc IDoc IDoc IDoc
status status
?
External System R/2 System
SAP AG 1999
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 or
perform an external dispatch.
RFC destination
(TCP/IP connection)
rfcexec
out.script
Command file
Outbound file
IDoc file
Inbound file
Status report
Status file
SAP AG 1999
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 file
are 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 generates
names 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 should
start 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 transaction
SM59 (TCP/IP connections). It is a setting outside of the IDoc Interface.
IDoc Interface
Write RFC 4 3
1 2 Read RFC
rfcexec startrfc
IDoc file
IDoc file in.script
Status report
out.script status.script
Read Call 1 2
4 3 Write Call
External System
SAP AG 1999
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 “startrfc”command 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.
SAP AG 1999
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.
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.
RFC destination
(R/3 connection)
SAP AG 1999
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".
IDoc Interface
RFC Interface
TCP/IP
RFC Interface
External System
SAP AG 1999
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 (under R/3 Library->CA-Business Framework)
sideinfo-entry
TXCOM entry
Host on R/2
Host destination
RFC destination
Technical parameters
Send status records?
SAP AG 1999
The logical destination and the host destination are determined in the port definition. The RFC
destination is created with the transaction SM59 and contains the logon data (name, password). The
host 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 unit on the R/2
side in a sideinfo-file of this gateway. The logical unit is part of the network architecture SNA and
identifies computers or also programs to be started.
Besides the target system, the port definition also contains technical parameters like the buffer size
of the CPI-C data buffer or a flag showing whether the R/2 System should send a confirmation of
receipt.
Note that for this port type not only the name, but rather also technical parameters are also important
for inbound processing. The reason for this is that the R/2 System is always passive, that is, the R/3
System 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.
1. TCP/IP
Communication
structure 2. Retrieve/send IDocs or
CPI-C receive/send status
records
LU 6.2
SAP AG 1999
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.
Internet destination
Internet address
Folder name for outbound IDocs
Additional mail attributes
SAP AG 1999
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.
IDoc Interface
IDoc
SAPoffice/SAPconnect
MIME e-mail
External System
SAP AG 1999
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 and
managing 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 the
application in the port definition: “Configure the SAPoffice user address for the Internet”
Own
function module
in the R/3 System
Function module:
Name and description
SAP AG 1999
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.
ID o c In te r fa c e
ID o c
O w n fu n c tio n m o d u le
S A P AG 1999
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.
4.X
Field 1 Field 3 Field 2
Field 1 Field 2
2.1/2.2
SAP AG 1999
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).
SAP AG 1999
You are a member of the EDI project team. The decision has been made
to 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, select IDoc Port
definition, 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 can
be 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 corresponding
pushbutton (check icon). Save your entries.
Fast entry
SAP AG 1999
SAP AG 1999
R/3 System
Post document
Partner Profiles
Archive
Archive IDoc
IDoc ?? Generate IDoc
Documentation
Documentation
Transfer data, Tools
Tools
EDI
EDI Subsystem?
Subsystem? process further
SAP AG 1999
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,
use EDI subsystems and must configure their IDoc Interface accordingly.
SmartMart must configure the IDoc Interface for sending data (outbound processing or simply
outbound):
SmartMart defines QuickDeliver as a partner for message type ORDERS in the partner profiles and
enters the port which has already been defined.
SAPAG1999
Partner
Permitted agents
General Partner
Message
Port
IDoc type
EDI structure
Permitted agents Partner
Application
Outbound Processing
Process code
Logical message
Partner MC parameters
Message
Process code
Permitted agents
Inbound Processing
SAP AG 1999
SAP AG 1999
Partner profiles can be checked for consistency. This function is reached via a pushbutton from the
partner profile initial screen.
You should ensure that both parts of the outbound partner profile are maintained: The "outbound
parameter" (general) part and the "Message Control" part: If the Message Control part is missing, a
warning is always displayed, even if this part is not required because the system cannot recognize
whether or not this part is needed. If you do not require the Message Control part, you should simply
ignore this warning message.
SAP Application
Document
MC settings
MCMC
settings Document
MC
record
General+outbound
General+outbound
IDoc Interface / ALE Services
IDoc
Receiving System
SAP AG 1999
The company SmartMart wishes to send purchase orders from module MM to QuickDeliver. IDoc
outbound processing must therefore be configured. In the MM module, outbound processing always
takes place using Message Control (MC). As a result, SmartMart must maintain the following parts
of the partner profile for QuickDeliver:
General partner profile: Here, the name QuickDeliver is entered as the partner number using the
form in which it appears in the master data. The partner type is LI: This identifies QuickDeliver as
a vendor in the R/3 System.
Outbound processing (general): Partner number and partner type are entered from the general
settings. Additional parameter: Partner function LF (vendor): This function must be entered as it
refers to the corresponding key in the MC record. The message type is ORDERS.
Additional parameters for outbound processing under MC: The partner function and message type
are entered from the general outbound settings. MC-specific keys are the application EF
(purchasing) and the output type NEW (in contrast to change messages).
The message type is to be used productively. As a result, the test flag is not set.
Note: Only the key fields are considered here!
SAP AG 1999
As always, the key fields determine the contents of the other fields. As a result, when SmartMart
sends an order to QuickDeliver, the partner profiles have the following effect:
Message Control (MC) creates a data record containing the application EF, output type NEW and the
partner QuickDeliver. In the MC settings for the partner profile, these key fields define the process
code ME10 and the message ORDERS.
The process code specifies the function module which inserts the order data in the IDoc type. The
message ORDERS and partner QuickDeliver are assigned to the corresponding fields in the general
partner profiles, which are the key fields in this case. They determine that the IDoc type ORDERS01
is to be used (that is, will contain the application data); as well as the outbound port.
Summary: In conclusion, the MC record determines the IDoc type, port and function module, hence
the entire outbound processing. There are other dependent fields such as "permitted agents" for
notifications.
The appendix contains a set of common combinations of MC and partner profile fields.
Process code:
Partner: QD; Message: ORDRSP
ORDR;
Permitted agents: EDI Inb. Processing
agent for partner
QuickDeliver, order
acknowledgments
SAPAG1999
SmartMart wants to be able to receive and process EDI order acknowledgments from QuickDeliver
for their purchase orders. IDoc inbound processing must therefore be configured. As a result,
SmartMart must still maintain the inbound part of the partner profile for QuickDeliver. Partner
number and partner type are entered from the general settings. The message type is ORDRSP
(order confirmation). The message is to be received productively. As a result, the test flag is not set.
As well as these key fields, the process code ORDR is an important data field.
If QuickDeliver now sends an order acknowledgment to SmartMart, the partner profiles have the
following effect:
In the control record, the inbound IDoc contains the partner QuickDeliver and the message
ORDRSP, which are assigned to the corresponding fields in inbound processing. Together with the
test flag (also part of the control record), these key fields uniquely determine the process code.
The process code specifies the function module which reads the data from the inbound IDoc.
Summary: The IDoc type determines the inbound processing for the IDoc. There are other dependent
fields such as recipients of notifications.
P
artn e r
A
pp licatio
n
M
es s .type
P
roc
essc
ode
Functio
n m odu
le(w
rite
stheapp
lic
atio
n
P
r
E
xo
ac
e
ms
psc
:o
leMd
e
C p
ara
m e ter
s i
n par
tne
r p
rof
ile
s
datainan outb
oundIDoc)
S
APA
G 1
999
A process code is only another name for a process carried out by a function module or a workflow.
IDocs are processed in these cases, that is data is written to the IDocs or read from the IDocs.
The partner profiles only contain the process codes, never the real name of the function module. You
can therefore replace an old process with a new one for all relevant partners in one single step:
Assigning the new process to the existing process code.
Partner profiles contain process codes for inbound and outbound processing. In addition, process
codes for error handling are configured in the IDoc Interface, which do not save any work in the
above sense. They were introduced for completeness, so that all processes connected to the IDoc
Interface can be processed via a process code.
Only one process code exists for outbound processing when Message Control (MC) is used (because
the direct way simply sends an IDoc to the IDoc Interface). This process code always identifies a
function module.
Note: Process codes are client-specific!
E
xamp
le
:In
bou
nd
P
artn
er
M
es s
age
P
roc
essc
ode
Func
tio
n m
odu
le
/wo
rkflo
w (r
e a
dsd a
tafr
o ma
n
P
roc
essc
ode
in
boundID
oca
ndpr
o cess
e sdatafu
rth
er)
S
APA
G 1
999
The inbound partner profiles always contain a process code which specifies either a workflow or a
function module (direct processing).
There are two types of process codes for error handling:
System: Error handling for IDoc processing (both inbound and outbound)
D o c u m e n ta tio n v ia m e s s a g e s
M essage
P ro c e s s c o d e
SAP AG 1999
In order to find the correct process code for your business process, search for it via the "logical"
message (for example ORDERS for a purchase order).
Then choose Documentation Process code from the initial node of the IDoc Interface.
There is an n:m relationship between process codes and message types. For new definitions of
business processes or IDoc types you determine new process codes or messages in the assignment
table (see BC621).
P
artn e
r D
esc
rip
tio
n
p
rofile
Tra
n s
fe rsin
g leIDoc+
s
tartexternals ys
tem(trig
ger)
T
ransfe
rsin
gleID
oc;
n
otrigg
er
T
rans
fermultip
leID ocs+ s
tart
e
xte
rnals
yste m(trig
ger)
T
ransfe
rm u
ltip
leID
ocs
;
n
otrigg
er
S
APAG1
999
The transfer time is only defined if the external system is triggered, which helps maintain data
consistency.
Non-triggered data transfer includes the danger that IDoc or status files may be processed several
times or not processed at all.
Other port types always include external system triggering (because the IDocs are not saved
temporarily in files but transferred directly). Only outbound modes which include triggering are
displayed here.
The IDoc Interface programs use sequential numbers for outbound modes: field OUTMOD has
values from 1 to 4 (read from top to bottom in the diagram).
Display
SAPAG1999
Partner profiles can be displayed in the R/3 System (the same initial access as create). A link from
the Utilities menu leads to the tree output which provides a clear means of display, even for several
partners.
The tree can be printed from the menu System->List. Also check the "application help" in the
transaction.
Partner profiles can also be sent via the special IDoc type SYPART01. A partner profile for this
IDoc type with the "logical" message SYPART is therefore a prerequisite.
SAP AG 1999
As a member of the EDI project team for your company, enter the
company T-BILnn as the EDI vendor with whom purchase orders and
order acknowledgments are to be exchanged.
1-1 Maintain the partner profiles for your EDI vendor as follows:
Purchase orders can be sent to the EDI vendor
Order acknowledgments from the vendor can be received
The corresponding master data in the MM application has already been created for you.
1-2 From the initial node of the IDoc Interface, choose IDoc Partner Profile. Firstly,
enter the header data for the vendor. Position the mouse on the partner type LI and
choose Create. There, enter a permitted agent.
1-3 Configure the outbound processing. Choose Create outbound parameter. Enter the
vendor (code LF). The message is ORDERS. Firstly, maintain the Outbound options:
The recipient port has already been maintained as PORT-nn and represents the
connection to the EDI subsystem. In output mode choose Send IDoc immediately and
Do not start subsystem. Finally in this view, enter the data structure for the exchange as
an IDoc type. As you are going to use the standard system, select the IDoc type
ORDERS01.
As outbound processing for confirmations is determined via Message Control, you
must also maintain the Message Control tab page. The application is linked to Message
Control. In MC, the process is identified by the partner function (code LF) and the
application (application EF and message type NEU). You determine how the document
data is generated as an IDoc via the process code. You should remember that in certain
circumstances, there can be several process codes for one message. Select the most
recent version of confirmation outbound processing via process code ME10.
1-4 Now configure inbound processing for the order acknowledgment in Create inbound
parameters. The process depends on the vendor and the message. Using the
information sent to your system by the EDI subsystem in the control record, the correct
partner profile can be determined. You should therefore select the message ORDRSP
to identify the process. The actual processing of the IDoc is selected via the process
code. Select the process code ORDR.
1-5 Check the settings you have entered by selecting Partner Check.
nn is the number of your group (01 to 18).
SAP AG 1999
S
A
P
AG
1
9
99
You always create a new test-IDoc with the test tool. However, you can use one of the IDocs
available in the database as a template and edit the copy.
You can add or delete segments and therefore create your own IDoc type in an ad hoc manner.
You can change the content of every single segment field
You can change all the control record fields
There are other possibilities if you do not want to use an IDoc as the model for editing:
You can enter data in the empty IDoc type (including the control record)
You can import an IDoc from a file.
You can even create an IDoc from nothing by simply adding segments step by step.
The test tool saves the edited IDoc as a new IDoc in the database before the actual processing test
begins.
Function Module
(inbound only)
Direct call
Mass test Standard processing
Generate file
SAP AG 1999
The following options are available in the test tool for both inbound and outbound processing:
Standard processing: Your test IDoc is sent for normal inbound or outbound processing.
Mass testing: Several copies of the edited IDoc are sent for processing. If the relevant flag is not
set, only one copy is sent.
In addition, the following options are available for inbound processing:
Generate file: In the case of a port with type "File", an IDoc file is created during inbound
processing. The test tool takes over the role of the external system. Inbound processing does not
have to be triggered by the generation of the IDoc file, which means that the IDoc file is not
deleted by the system and is therefore available for further tests.
Direct call of inbound function module. This allows the function module to be debugged. If this
flag is not set, the IDoc is sent for standard processing, as in the outbound test.
Like the other test programs, the test tool has a special test status with which you can identify test
IDocs in the monitoring programs.
As a member of your EDI project team in purchasing, you want to test the
following as soon as possible:
Sending purchase orders
Receiving order acknowledgments
1-1 Create a purchase order for methanol (material number SH-100) from the vendor T-
BILnn by selecting Logistics Materials Management Purchasing Purchase
Order Create Vendor Known (transaction ME21).
1-2 As a member of the purchasing department, you belong to purchasing organization
1000 and purchasing group 001. The methanol is required for plant 1100 (Berlin).
Company code is 1000 (IDES AG 1000).
1-3 After the data has been entered successfully, select Header -> Messages from the menu
in the item overview to check the proposal for the output of the purchase order via
Message Control. If dispatch time 4 has been selected, an IDoc for this purchase order
is generated as soon as the data is saved.
1-4 Change to Purchase Order Display. By selecting System Links the IDoc that has
just been generated is displayed.
2-1 You can now use the purchase order IDoc that has just been generated as a template for
the inbound order acknowledgment to be tested.
2-2 From the initial node of the IDoc Interface, choose Test Test Tool. Choose Existing
IDoc and call the value help, in which you search with the recipient partner number.
Choose Create.
2-3 Select the control record (the first record) by clicking with the mouse and change the
following fields:
Qualifier: 002
Document For example BC620-
: Test-4711
Choose Continue to close the dialog box.
2-5 The acknowledgment of your vendor now has to be assigned to the item. Create a
corresponding segment E1EDP02 directly after the item segment E1EDP01 as a
subsegment. Maintain the following fields:
Qualifier: 001
Document: Order number, in segment E1EDK02, qualifier 001, field
document
Document Document item, in segment E1EDP01, field document item
item:
Choose Continue.
2-6 Choose Standard Inbound and then Continue.
2-7 The system changes your original order. You can display the changed order by
selecting Logistics Materials Management Purchasing Purchase Order
Display. If you double-click on the item, you will see the acknowledgment number that
has just been transferred. By selecting System Links from the item overview, you
can display the IDoc which is linked to the outbound purchase order, as well as the
IDoc which is linked to the inbound acknowledgment.
Condition components
Dispatch times
SAP AG 1999
SAP AG 1999
SAPAG1999
SAP Application
Document
Find proposal
MC Edit
MC
record
Process
SAP AG 1999
Message Control (MC) generates messages from application documents. The possible messages are
defined as condition records in Customizing.
From the possible messages, MC searches for those which match the current application data. This
message determination can result in several messages being found, or possibly none. In the
following example, we will presume that one message was found.
If supported by the application, this message is proposed for editing in the transaction which started
MC. When creating a purchase order, this means that the message proposal can be edited (displayed
and changed) before the purchase order is posted.
In any case, the message is generated and processed (if not deleted during the editing process): for
example, if the order is to be printed, the processing program sends the message to the printer. If the
message is to be sent as an IDoc, a special processing program is called from the IDoc Interface.
The new message is represented by a new entry in the MC table. Part of this record is the processing
status, which can have the following values: 0 = not yet processed, 1 = successfully processed, 2 =
processed with error.
Note: For reasons of clarity, this slide does not show the transfer of the IDoc to an external system,
although this is also part of outbound processing.
SAP Application
Editing
Application data
Message Determination
Message proposal
MC record
SAP AG 1999
The process diagram shows message determination, message editing and message processing.
Message Control allows a dispatch time flag to be set, which determines whether the message is
processed immediately after the application document is created or at a later time. In the second case,
you must schedule report RSNAST00 as a job, otherwise the message remains as an MC record with
processing status 0.
The MC record refers to the document as a BOR object (BOR = Business Object Repository) which
contains all the important data for the message.
Table TNAPR contains the processing programs (RSNASTED in the case of EDI). Form routine
EDI_PROCESSING is accessed within this program.
SAP Application
1:n
Procedure
m:n
Output Type
n:1
Access Sequence
m:n
Condition Table
SAP AG 1999
Message determination uses the condition technique, which is also used in SD price determination.
Messages defined in Customizing are searched in a specified sequence. The condition elements and
their hierarchy define this sequence.
The messages are records in a condition table. Several condition tables can belong to one output
type. The condition tables can be accessed according to a certain access sequence with different key
fields.
Several output types can belong to one procedure and several procedures can belong to one
application, for example the application EF (purchasing).
Therefore, if one application wishes to send EDI messages via Message Control, only the procedure
for that application and the current application object (for example the document) is searched for
corresponding messages.
The condition component "Access sequence” can be used to define whether only one message is to
be found: If this is the case, you should set the "exclusive” flag. If this flag is not set, the entire
access sequence is processed, that is, several messages have possibly been found.
CheckMCrecord R
S
Readpartner profile N
A
Call selectionmodule S
(fromapplication) T
E
Call ALEServices
D
Transfer accordingto
output mode
'1'/ '2' '3'/ '4'
SingleIDoc M ultipleIDocs
viaRSEOUT00
SAPAG1999
The transmission medium is part of the condition record (the message defined in Customizing). The
transmission media for IDoc processing with Message Control are:
"6" EDI (Electronic Data Interchange), that is, without distribution model
"A" ALE (Application Link Enabling), that is, with distribution model
The EDI program for message processing is started with these parameters: RSNASTED, with the
form routines EDI_PROCESSING or ALE_PROCESSING.
IDocs are transferred individually from program RSNASTED when using output modes "1" and "2"
(field OUTMOD in the control record).
IDocs are not transferred directly when using output modes "3" and "4" (field OUTMOD in the
control record). Instead, they are collected by the program RSEOUT00 (batch mode) and sent as a
group.
SAP AG 1999
You should note that there are two different dispatch times for outbound processing using Message
Control: one controlled by MC, the other by the IDoc Interface. Each of these times can be switched
between "immediately" and "later". If "later" is selected, the program must be started manually (for
test purposes) or as a batch job (in production operation), while the program is started automatically
if "immediately" is selected.
If an EDI subsystem is the external system and port type "file” is used, there is a third stop sign: The
subsystem, when it is not triggered.
Recommended combinations of stop signs (see slide):
Real time: IDocs are sent to the external system individually when the application documents are
created.
Fast batch: IDocs are sent to the external system individually when the MC selection program is
started manually or as a batch job. This can result in large amounts of data requiring inbound
processing in the EDI subsystem in a short space of time.
Batch: A stack of IDocs is sent to the external system when the IDoc Interface selection program
is started manually or as a batch job. To use the system resources efficiently, you should select the
first stop sign, the MC dispatch time "later" (1 or 2).
SAP AG 1999
As a member of the EDI project team you must configure the electronic
dispatch of an order acknowledgment. For this you create an individual
output type and condition records.
1-1 Create the output type ZBnn as a copy of output type BA01 in transaction NACE.
The output type should provide the transmission medium 6 (EDI) as the default
values for the condition records.
1-2 You must transfer the processing program and routine for your transmission
medium EDI from output type BA01 . You must also ensure that the possible
partner function AG (sold-to party) is entered for your new output type.
1-3 Determine your new output type in the procedure for the sales Order messages
(application V1). Go to the navigation Control for this procedure.
1-4 Now create a condition record for output type ZBnn for your partner T-BIKnn of
sales organization 1020. You should use 6 (EDI) as the transmission medium.
1-1 In transaction NACE select Expert mode and choose the application V1 (sales).
Enter ZBnn as the target entry. In the Default values tab page change the
transmission medium, if necessary, to EDI.
When saving, you must confirm that you also want to copy all of the dependent
entries. You must still maintain the language field for the dependent entry for the
mail title (also if you do not use the transmission medium “mail”). Choose, for
example, EN (English).
Note: By copying you have also transferred the access sequence of the original
BA01, which contains a condition table. You must fill this condition table in the
last part of the exercise.
1-2 In the output types screen, select your new output type ZBnn.
Check the entry. The program RSNASTED and the form routine
EDI_PROCESSING must be determined for the transmission medium 6 (EDI).
To add the partner function AG, select New Entries and enter this function for the
transmission medium 6 (EDI).
Save your changes and return to the initial screen of transaction NACE.
1-3 In the initial screen of the transaction NACE, select the application V1 (sales).
Choose Procedures.
Do not enter a condition, in order to ensure that in determination your output type
is searched every time for messages.
Save your changes and return to the initial screen of transaction NACE.
1-4 In the initial screen of the transaction NACE, select the application V1 and choose
Condition records.
Enter the sales organization 1020 in the selection screen and select continue.
Customer T-BIKnn
Function AG
Transmission medium 6 (EDI)
Time 4 (immediately)
Language EN (English)
You can leave the partner field empty as the partner is determined from the
customer master data. In the present case, it is identical to the customer. Finally the
message is sent to them, here as an IDoc.
Save your changes and return to the initial screen of transaction NACE.
Note: The condition table is usually maintained in the sales master data as an order
message. The maintenance interface is the same as in the NACE initial access.
Number ranges
Event-receiver linkage
IDoc administration
Fast entry
SAP AG 1999
SAP AG 1999
Cross-application
components
Project management
Activities
SAP AG 1999
General parameters for the IMG can be entered via the IMG. The IMG is a set of implementation
guidelines which can be used by customers to configure the R/3 System to meet their requirements
("Customizing"). The corresponding tables are maintained via activities.
By selecting the appropriate attributes, users can display only the activities which are required in
each case. For example, if a customer wishes to adopt all SAP standard settings, only the activities
with the attribute "required" must be executed.
The IMG node or path for the IDoc Interface is Cross-application Components ->IDoc Interface.
You should read the IMG documentation, which is available for each activity (double-click on the
relevant document).
You can also create your own projects from the standard IMG: Projects are a type of view of the
standard IMG, which are used by different teams. The IMG offers project management functions
(resource planning and so on) as well as functions for creating your own project documentation via
customer notes.
IDoc Interface
[…]
SAP AG 1999
Number ranges are intervals of natural numbers which are assigned to objects centrally by the R/3
System. This is called "internal number assignment".
In the IDoc Interface, number ranges are set for:
- IDocs: the IDoc IDs are taken from the interval
- Ports: the names of the tRFC ports are defined by the interval
- Mailbags: These are only used for communication with an R/2 System. IDocs are transmitted in
mailbags
These number ranges are maintained from the IMG node for the IDoc Interface.
IDoc Interface
Processing
R/3 Application
SAP AG 1999
When IDocs are received, they are first saved in the database. In a second and independent step, they
are processed further (for port types "file", "XML", "CPI-C"). This is made possible by the workflow
event concept: If IDocs are saved in the database, an event is created , which waits for the "receiver"
in the system. The "receiver" (a function module) finds the event and triggers inbound processing.
As a result of this step, the function module has used the event, which no longer exists in the system.
The Workflow Manager determines when the receiver starts to search for events: There is therefore
an interval between the data being saved and further processing being initiated (asynchronous
processing).
To enable this new form of inbound processing to take place, the corresponding event must be
actively linked to the receiver.
You must therefore activate the event-receiver linkage in the IMG for the IDoc Interface.
SAP AG 1999
SAP AG
The IDoc administrator is always notified when an error occurs during IDoc processing and no
partner profile could be found. Otherwise, the partner-specific agent (and the message-specific agent,
if required) entered in the partner profile is notified.
In the system environment, the IDoc interface is informed whether non-Basis components exist, for
example Message Control or application components. If these entries are not made, it is possible that
the IDoc interface may call function modules, for example, that do not exist in the specified system
(Basis system only).
Processing details:
The maximum number of syntax errors which can be recognized in one IDoc and therefore logged
as status records. The larger this value, the higher the probability that the error messages do not
refer to "real" errors, but only subsequent errors.
Whether or not IDoc inbound processing is triggered synchronously (not via the event-receiver
linkage) (port type File). In this case, immediately after the event of the event receiver
System parameters can be entered as "global parameters" from the initial screen of the IDoc
interface by choosing Control->IDoc Administration or can also be set from the IMG node of the
IDoc interface.
After how many data records a COMMIT WORK is initiated. You should also see the F1 Help
function for the input fields.
Tests
Documentation Tools
Development
SAP AG 1999
SAP AG
User-specific parameters for the IDoc interface cannot be entered from the IMG. Instead, choose
Control -> IDoc administration from the initial node of the IDoc interface.
The test parameter is the port proposed as standard by the test programs.
For the documentation tools, you should define the default documentation output, for example,
whether the individual segment fields are also to be included in the documentation of IDoc types.
You can enter a default development class for the development of IDocs and segments. Course
BC621 contains more information about developing and defining IDoc types.
Default values
SAP AG 1999
During fast entry of the partner profile values, default values ("templates") are already set in the IMG
, which facilitates the maintenance of the partner profiles in the IDoc interface.
The default values are set for partner type and direction (inbound/outbound).
If you select the fast entry option for partner profiles (via the pushbutton on the initial screen, see
later unit), the values which you have entered in the IMG for the current partner type and direction
are entered as the default values. According to your requirements, you need only select and modify
these values.
You can also reach the transaction from the initial node of the IDoc interface.
In the IDES system, the following message types are maintained for the vendor or customer,
depending on the direction:
DELINS - forecast/JIT delivery schedule
ORDCHG - change purchase order/sales order
ORDERS - purchase order/sales order
DESADV - shipping notification
INVOIC - invoice/billing document
ORDRSP - order/sales confirmation
Type
Type "Short01"
"LongNameXYZ01"
SAP AG 1999
Release 4.0 introduced the concept of the extended namespace. As a result, new IDoc Interface
objects which were developed for Release 4.0 (for example IDoc types) can have longer names than
before.
This fact can lead to problems when communicating with older releases which only recogníze short
names. If required, tables which can convert the long names to short names must therefore be
maintained.
These tables are maintained in the IMG or from the IDoc Interface development (path for segments
or IDoc types from the relevant editor: Environment -> Conversion -> <object name>). You should
also read the online documentation.
SAP AG 1999
As a member of the EDI project team enter the company T-BIKnn as the
EDI customer for the sales orders and order acknowledgments As you
expect further EDI customers for these messages, you want to use
corresponding proposals in Customizing.
Parameter Value
Partner type KU
Message type ORDRSP
Partner function AG
Basic type ORDERS01
Application V1
Output type BA00
Process code SD10
Inbound Processing:
Parameter Value
Partner type KU
Message type ORDERS
Partner function AG
Process code ORDE
(C) SAP AG BC620 11
2-1 Now transfer these default values to the partner profiles of your customer. As a result
you can
Receive sales orders from the customer
Send order confirmations to this customer
The corresponding master data in the SD application has already been created for you.
2-2 From the initial node of the IDoc Interface, choose IDoc Partner Profile. Choose
Utilities Fast Data Entry and enter the customer number T-BIKnn. Select the
proposal for outbound processing. The logical message is ORDRSP.
2-3 Choose Utilities Fast Data Entry again but now for inbound processing. The logical
message is ORDERS. Save your entries.
2-4 Go to the outbound parameters for message ORDRSP. Replace output type BA00 with
your output type ZBnn from the exercise in the “Message Control” unit.
Test layers
Test programs
SAP AG 1999
SAP AG 1999
SAPAG1999
Application
MC Workflow
WE19 ,
WE15 WE18
IDoc Interface
WE18
SAP AG 1999
The arrows show the layers where the tests start. Alongside is the relevant transaction. Outbound
processing is on the left, inbound processing on the right. According to the process code (partner
profile entry), the inbound test IDocs are processed directly in the application or via a workflow.
All test programs write a special status. Hence you can determine whether or not each IDoc was
generated for test purposes.
The IDoc statistics provide an overview of all test IDocs (F5 key, also see "Statistics and
Monitoring").
The test tool (transaction WE19, see corresponding unit) is the most general tool. Both inbound and
outbound processing can be tested for one IDoc (which can even be created manually).
The other test programs require either an existing file, a message status record (MC record), or a file
in the file system (at the operating system level).
If a file port is selected in outbound processing, a complete test cycle (from outbound processing to
inbound processing) can be executed, including the file system.
A
pplic
atio
n
M
M
CC
W
E15
ID
ocIn
terfa
ce
W
E14
,WE
19
E
xtern
al
S
ystem
SA
P A
G 1
999
When testing from MC (transaction WE15), you can test whether an IDoc is created correctly from a
generated MC record. In this case, dispatch time 1 or 2 must be configured in the message condition
record: This stops message processing, that is, the processing program RSNAST00 is not started
directly when the application document is created, and the MC record is assigned the status 0 (not
yet processed).
Transaction WE15 does nothing but start program RSNAST00, that is, trigger further processing
manually. Using this method, you can, for example, go into debugging mode or export messages,
which is not possible in other cases.
Both the IDoc test (transaction WE14) and the test tool (transaction WE19) test the transfer of one or
more IDocs to the specified port. As a prerequisite for the IDoc test, an outbound IDoc which has not
been sent to any ports must exist already (current status 30). Such an IDoc can be generated, for
example, using transaction WE15: In the corresponding partner profiles, the output mode must be
entered as "collect IDocs”, so that the IDocs are not forwarded immediately.
There are no prerequisites for the test tool.
Note: Transaction WE15 can only be used in conjunction with moving data from the applications SD
and MM. The corresponding message types are ORDERS, ORDRSP, DESADV and INVOIC, for
example. Only these modules and messages use Message Control for IDoc outbound processing.
Application
Workflow
WE19
IDoc Interface
WE16
SAPAG1999
Both the modified outbound file test (transaction WE12) and the original inbound file test (WE16)
test the transfer of an IDoc file via the IDoc Interface. WE12 changes control records to create an
inbound IDoc from an outbound IDoc, before the IDoc is sent to the IDoc Interface.
There are no prerequisites for the inbound test tool: no inbound port of type "file" is needed and no
files are required from the file system. The test tool can even create inbound IDocs if necessary.
Check the online documentation (extended help) for the test tools.
Note: WE16 erases the inbound file after the file has been read successfully. This does not apply to
outbound files, which are read by WE12 and can therefore be used for further test runs.
A p p lic a tio n
W o rk flo w
W E19 ,
W E18
ID o c In te rfa c e
W E16 W E17
O u tb o u n d W E12 In b o u n d S ta tu s
file w ith file w ith c o n firm .
SYSTAT01 SYSTAT01
F ile S ys te m
W E18
S A P A G 1999
You test the transfer of status confirmations in file format with "process status file" (transaction
WE17). Transaction WE18 ("generate status file") does not need a file as it is self-generating. The
IDoc display function can be used to check if the status records were written correctly to the relevant
IDoc.
Caution: As in the case of an original inbound IDoc, the status file is deleted after being read
successfully. The test can therefore be carried out only once for each file.
When a status record is received which indicates an error, a workflow is started: The (status) process
code for this purpose in the standard system is EDIS. Other process codes for other tasks/workflow
definitions for status processing can be created via Control -> Status process code and Control ->
Status maintenance from the IDoc Interface initial screen.
Status records must refer to outbound IDocs in the system, otherwise an error occurs in status
processing.
The general status confirmation for all port types and directions runs via the special IDoc type
SYSTAT01, which is processed by standard task TS300000206. This status processing therefore
always takes place via workflow. If an incorrect status is returned, a work item is generated.
SYSTAT01 can be used with all the inbound test programs. IDocs of this type must be present in file
form, except in the case of the test tool.
SAP AG 1999
SAP AG 1999
SAP AG 1999
SAP AG 1999
SAPAG1999
SAP AG 1999
The MM master data must contain certain parameters which are sent to the order recipient via IDoc:
Apart from the partner number and type, the vendor master record must contain the partner function.
The partner function is a required field entry in the additional outbound partner profile using
Message Control (MC).
The vendor master record should contain the name which appears as the partner number in the
recipient partner profiles as the "account with vendor" (field LFB1-EIKTO). This field is compared
with the partner number value in the recipient inbound partner profile. If this field is not maintained,
additional conversions are required in the recipient system.
The vendor material information must contain the material name for the vendor, because the
recipient determines from the contents of a segment of type E1EDP19 which material has been
ordered.
The MC condition record must contain a transmission medium "6” (EDI). The recipient cannot see
this value. If another transmission medium is entered, the IDoc Interface will not be activated.
Send data to
R/3 System
R/3 System
SAP AG 1999
IDoc
IDoc Type
Type ORDERS01
ORDERS01
SAP AG 1999
The SD master data must contain EDI-specific parameters which are compared with the data from
the order IDoc:
Partner number, type and function of the sender are assigned according to the data in the partner
profile. This data must also exist in the SD master data.
The material number is transferred in a segment of type E1EDP19. This material must exist in the
material master record. The qualifier 002 in the segment shows that this is the material number for
the vendor.
If the EDI subsystem does not assign the combination of customer and vendor to a sales organization
via segments of type E1EDK14 (document header organizational data), you must maintain this
assignment yourself using the customizing transaction (VOED).
SAP AG 1999
As a member of the EDI project team you want to simulate the message
chain from the outbound purchase order via the incoming order to the
sending and subsequent receiving of the order acknowledgment. First,
you take the role of the customer, then the vendor (incoming order and
outbound order acknowledgment) in order to act as the customer again
(incoming order acknowledgment) at the end of the message chain.
1-1 Create a purchase order for methanol (material number SH-100) from the vendor T-
BILnn by selecting Logistics Materials Management Purchasing Purchase
Order Create Vendor known (transaction ME21).
1-2 As a member of the purchasing department, you belong to purchasing organization
1000 and purchasing group 001. The methanol is required for plant 1100.
1-3 After the data has been entered successfully, select Goto Messages from the menu in
the item overview to check the proposal for the output of the purchase order via
Message Control. If dispatch time 4 has been selected, an IDoc for this purchase order
is generated as soon as the data is saved.
1-4 Change to Purchase order Display. By selecting System Links the IDoc that has
just been generated is displayed.
As Send IDoc immediately has been set in the partner profiles, the IDoc has the status
03, that is, it has been written in a file.
2-1 In the previous exercise, a file was created in which the data is correct but the control
record is incorrect.
You can set default values for source, destination and port, by setting your port Port-nn
for the test by choosing Goto User settings.
2-3 The sender is customer T-BIKnn, from whom you wish to receive the order. Enter T-
BIKnn as the partner number, KU as the partner type and AG as the partner function.
The logical message is ORDERS. For all other values, you can use the default values.
2-5 Choose IDoc Display IDoc or IDoc IDoc Lists to view the IDoc which you have
created. By choosing System Links the order that has just been generated is
displayed.
3-1 In the previous exercise you posted an order. An outbound IDoc has already been
generated by Message Control for order acknowledgment. The IDoc has the status 30,
therefore has not yet been sent by the SAP System.
3-2 Initiate the transfer of the order IDocs by choosing Test Outbound Processing from
IDoc from the initial node of the IDoc Interface. Select with the recipient partner
number.
3-3 Return to the order (transaction VA03) and check the status of the ORDRSP IDoc, and
choose System Links. If this IDoc has status 03, you have generated a file.
4-1 In the previous exercise, a file was created in which the data is correct but the control
record is incorrect.
4-2 Select Test -> Inbound Processing of Modified Outbound File from the initial node of
the IDoc Interface. This transaction allows you to change the control record so it is
(C) SAP AG BC620 10
correct, that is, matches the partner profile you created in the exercise "partner profiles"
for your customer T-BILnn.
4-3 The sender is vendor T-BILnn, from whom you wish to receive the order
acknowledgment. Enter T-BILnn as the partner number, LI as the partner type and LF
as the partner function. The logical message is ORDRSP. For all other values, you can
use the default values.
SAP AG 1999
SAP AG 1999
SAPAG1999
Statistics "RSEIDOCM"
4711
4712
List, IDoc 4713
search 4718
Display
SAP AG 1999
When errors occur, the IDoc Interface always notifies users actively (error handling via work items).
In addition, the IDoc Interface provides four passive programs and one active program for IDoc
monitoring.
The passive monitoring tools can be ordered according to their level of detail: The IDoc statistics
assign IDocs to status groups according to their current status, for example, to the group "inbound
error within the IDoc Interface". The individual IDocs are displayed in the IDoc list. This also
applies to the IDoc search, where IDocs are selected according to values in the segment fields.
Finally, IDoc display allows direct access to an individual IDoc via the ID. Double-clicking on the
relevant entry displays more details, as usual.
The passive monitoring tools can be found in the IDoc menu from the IDoc Interface initial node.
Active monitoring (report RSEIDOCM) uses the status groups from IDoc statistics. It is possible to
define threshold values. When these values are exceeded, responsible users are notified via work
items. Active monitoring can therefore be seen as a configurable error handling function.
Active monitoring is scheduled as a job (from the R/3 initial screen, choose System -> Services ->
Jobs -> Define job). Variants are created from the ABAP editor (choose Goto -> Variants).
Control record
IDoc statistics
IDoc list
IDoc search
IDoc display
Active
monitoring
SAPAG1999
The monitoring programs are reports which select IDocs in the R/3 database according to certain
criteria from the control record.
The most important selection field is the date on which the control record was created. The IDoc
statistics tool selects according to the change date.
All monitoring programs allow selection of IDocs according to partner and message. In IDoc
statistics, this works via the extended selection.
The highest number of selection fields is offered by the IDoc display function. Apart from the IDoc
ID, users can make selections according to EDI-specific parameters, for example the transmission
file in the EDI subsystem, which allows the data flow with the EDI subsystem to be monitored.
IDoc list
IDoc display
SAP AG 1999
All monitoring functions can display an individual IDoc. However, users can only access an IDoc
directly via the IDoc display function (using the IDoc ID). As the most selective tool, IDoc display is
usually used when technical questions arise (for example problems when communicating with an
EDI subsystem)
The IDoc list function has less selection fields and is therefore easier to use. As with the remaining
tools, this function is used when application questions arise (for example how to display all IDocs of
message type INVOIC).
IDoc statistics gives a broad overview and is often used for presentations because of its graphical
capabilities. To obtain statistics about "repaired" IDocs, choose the function "Evaluation history" in
the IDoc statistics. This displays all status records for the IDoc.
You can use active monitoring as an alternative to normal exception handling if a user (employee) is
only to receive a work item if a certain number of incorrect IDocs (the threshold value) are found
within a specified time period. However, note that normal exception handling still takes place.
Note that IDoc statistics selects all IDocs which have experienced a status change within the
specified time period, while active monitoring selects all IDocs created during the same period.
4 = "ID o c tra n s fe r
s u c c e s s fu l"
13 =
"S e n d o k " 12 =
R e tra n s m is s io n "S end ok"
ok
3 9 = "ID o c in
ta rg e t s ys te m (A L E )"
S A P A G 1999
Status values for active monitoring and statistics about status groups are combined to prevent the
information becoming too complicated.
The standard R/3 System assigns a group to each status via the "qualification” (synonym for "status
group”) value. This assignment can be changed from the initial IDoc Interface menu by choosing
Control -> Maintain status values.
According to the status group the individual statuses, for example, are displayed in the IDoc list in
the traffic light colors green, yellow or red. It should therefore be clear in the standard system
whether it concerns an error status, transfer- or success status. The traffic light color assignment for
status groups can be changed by choosing Control -> Maintain status groups.
For more information about the status groups which are supplied in the standard R/3 System, you
should read the online documentation for the IDoc statistics function.
SAP AG 1999
Work items are instances of defined single-step tasks. The IDoc Interface uses them mainly for
exception handling (see corresponding unit). They therefore contain the incorrect IDoc or the
incorrect application document which was created from the inbound IDoc.
As in IDoc statistics, the work item analysis function allows work items belonging to a certain task
to be displayed. This can be useful, for example, if no user could be found for the work item, and the
work item did not therefore appear in any inbox. From the work items, you can jump to the IDoc
display function.
The work item analysis function can be accessed by choosing Tools -> Business Workflow ->
Development -> Reporting -> Work item analysis, for example the work items per task (transaction
SW12_FREQ).
SAP AG 1999
1-1 ''Which statuses has IDoc XY, which contains a purchase order for vendor T-
BILnn, already been assigned?''
2-1 "Which IDoc was used to send purchase order XY to vendor T-BILnn?" You have
the following information:
3-1 "As a member of the purchasing department, can I access the corresponding IDocs
directly from my purchase order?"
4-1 "As a member of the purchasing department, can I access the corresponding IDocs
directly from my sales order?"
(C) SAP AG BC620 10
Note for exercises 3 and 4: Choose System Links from your application
document.
5-1 You want to trace IDocs in status 03. Include the report RSEIDOCM.
5-2 Go into the ABAP Workbench (SE38) and enter the report.
5-3 Choose Execute. Enter the following values in the selection screen:
Recipient type US
5-4 After executing the report you receive notification in the Business Workplace.
Execute the work item. The IDoc statistics are displayed where the current status of
the report execution is displayed. By selecting Refresh, the current status is
displayed.
1-1 Search by selecting IDoc Display IDoc and entering the direction as “outbound”
and the partner number of the recipient. You have already generated the purchase
order IDoc in exercise 1 of the previous chapter.
1-2 Apart from the status which has been reached, determine which message has been put
on hold with the status value "30", that is, the values for code, message number,
message type and ID.
2-1 Search for the IDoc(s) using the IDoc search function. Select the following:
Direction 1 = “outbound”
Basic type ORDERS01
Segment You have the number of the purchase order. The number is in
field BELNR of segment E1EDK02 with the qualifier "001“.
4-1 Select Logistics Sales and Distribution Sales Order Display (transaction
VA03). Enter the sales order number and choose Continue. The overview screen for
the transaction is displayed. Alternatively, find the sales order via the purchase order
number from exercise 3 and the search function. Choose System Links. The IDoc
which is linked to this sales order is displayed and you can request more detailed
information about the IDoc by double-clicking on the relevant entry.
Inbound processing
Exception handling
Notification concept
Organizational structure
SAP AG 1999
SAP AG 1999
SAPAG1999
IDoc +
process
Review,
edit,
Workflow
forward,
and so on.
Document
SAP Application
SAP AG 1999
IDoc inbound processing can include a workflow which is triggered by a process code. This
workflow is defined by the user. Examples:
An application document is created automatically from the IDoc. The application document is then
sent to a user for review.
The IDoc is edited and modified if necessary before the application document is created. In this
case, the IDoc is edited and not the application document.
The IDoc or application document is forwarded to other users or new (outbound) IDocs are sent,
using the inbound IDoc as a basis.
Note: For reasons of clarity, this slide does not show the transfer of the IDoc from the external
system, although this is also part of inbound processing.
R/3 System
Check partner, generate IDoc
No Express
SAP AG 1999
Exception handling or error handling is always defined as a workflow. One or more agents can be
notified about the error situation. The agents are defined in the IDoc Interface and in the organization
model of your company.
SAP standard exception handling in the IDoc Interface always takes place using single-step tasks. It
is identified by means of process codes.
If you set the express indicator in the process codes maintenance, the agent responsible for the
corresponding task receives a message on their screen as soon as a new work item appears in their
integrated inbox.
The slide only shows exception handling being accessed from inbound processing. However,
exception handling can also be accessed from outbound processing.
SAP Application
or MC Message without IDoc
EDIM
without MC...
Document EDIN ...with MC
or MC
record
Syntax error
EDIX in IDoc
EDIR
External System Status confirmation
EDIS
Customer
SAP AG 1999
External System
EDIM Message without IDoc
IDoc
...error during
EDIL status file
SAP Application
IDoc with or without
Application application document
SAPAG1999
Exception handling via single-step tasks for inbound processing is the same as for outbound
processing. Errors which occur when posting an application document (due to incorrect data, for
example) are sometimes handled and repaired by application-specific tasks and the corresponding
process codes. Application documents can also be generated in this way.
EDIM applies as in outbound processing, EDII and EDIY are the same as the outbound process
codes EDIO and EDIX.
Any messages can be sent in text format using the IDoc type TXTRAW01. Special case: an
exception occurs in the external system and the R/3 System is to be notified of this exception.
If a status file of the external system cannot be read, the process code EDIL is activated. The SAP
System error message is displayed in exception handling.
Organizational structure
Possibleagents
Task
Roleresolution Selectedagent
Partner profile
Permittedagents
IDocInterface
SAPAG1999
The agent determined in the IDoc Interface is only the permitted agent of a workflow task. All
"possible agents" are attached to the task itself. Role resolution determines the set of agents which
are both allowed and possible agents. These agents are called the selected agents.
All selected agents now receive the notification as a work item (as an "instance" of the workflow
task) in their integrated inbox.
The IDoc Interface function module for role resolution is EDI_ROLE_FOR_PROCESSING.
The IDocs can only be "repaired" and processed further from the integrated inbox.
Note: If the tasks are defined as general tasks for notification, all users are possible agents, and the
set of selected agents is the same as the set of permitted agents.
SAP AG 1999
Permitted agents are entered in the following partner profiles for the IDoc Interface: Inbound,
outbound (optional), and general (required entry field). When an error occurs (for example a syntax
error in an inbound IDoc), the most relevant permitted agent is determined: The search for the agent
responsible for the message and partner (key fields in the profiles) therefore starts in the inbound or
outbound partner profile.
If no agent could be found in the inbound or outbound profiles (either because no value had been
entered or because no inbound or outbound partner profile could be found for the current partner-
message combination), the general partner profile is searched to determine a permitted agent for the
partner.
If this search is also unsuccessful (because no general partner profile for the current partner could be
found), the search continues in IDoc Administration (general settings). If no entry is found, no users
are notified! For this reason, you should always enter an agent ("administrator") in the general
settings.
In all cases, the agent can be a single person (type US=user) or a group which must be maintained in
the PD-ORG model, either as a job or a department.
r
e p
or
tsto
/
i
s s
uper
iort
o
c
os
tc
en
te
ra
ss
ig
nme
nt
O
r
gan
i
zat
ion
alu
ni
t C
os
tc
en
te
r
b
el
ong
st
o c
os
tce
nt
er
a
ss
ig
nment
i
ncl
ude
s
d
es
cr
ibe
dby b
el
ong
st
o
J
ob d
es
cr
ibe
s P
os
i
tion i
ncl
u d
es W
or
kce
nt
er
d
es
cr
ibe
dby
h
ol
ds
d
es
cr
ibe
dby
d
es
cr
ibe
s h
ol
der
d
es
cr
ibe
s
P
er
son
/
u s
er
T
as
k
SA
PAG
19
99
Workflow auto-customizing (transaction SWU3) includes all tasks relating to the IDoc Interface as
"general tasks", that is, all R/3 users are possible agents. If you want to restrict this number, you can
do this using an organizational structure.
The organizational structure defines a responsibility hierarchy. For example, a general organizational
unit "administrators" could exist. This organizational unit can now be assigned to several persons
who hold as many positions. This organizational unit (not an individual) could be entered as a
possible agent in the IDoc Interface.
You can also enter a position which corresponds to one person as a possible agent. The advantage is
that notifications are tied to positions, not to individuals whose responsibilities can change. This
concept can be compared to the process code and the relevant function module/workflow.
Further elements of the organizational structure which can be entered as "possible agents" for a
standard task:
Job
User: R/3 user
Work center
Customizing activities
Maintenance from the Workflow
menu
SAP AG 1999
SAPoffice
Message Workflow
Missed deadline
...
SAP AG 1999
The integrated inbox can be accessed directly from the IDoc area menu (IDoc -> Integrated inbox) or
via transaction SO01. Via Workflow, you access your "worklist", that is, the list of work items for
which you are entered as a "selected agent". Work items are the instances of the single-step tasks.
You can edit a work item from your worklist. As a result, the work item disappears from the
integrated inbox of all other selected agents.
SAP AG 1999
1-1 The organizational unit 50010120 ("EDI Department“) has already been created for
EDI administration. You should now assign your user to the organizational unit. To do
this, proceed as follows:
Choose Tools Business Workflow Development Definition Tools
Organizational Management Organizational Plan Change. Enter
organizational unit 50010120 and select Change. Access the Staff assignments. Place
the cursor on the required function and choose Assign holder. On the next screen, you
can now assign yourself as user BC620-nn of the organizational unit. Choose Save.
2-1 This exercise continues from exercise 3 in the unit "A Process Chain" (outbound order
acknowledgment). In this exercise, a file was created in which the data is correct but
the control record is incorrect. This outbound file is to be modified to an incorrect
inbound file.
2-2 Choose Test Inbound Processing Modified Outbound File from the initial node of
the IDoc Interface. This transaction allows you to change the control record so it is
correct and matches the partner profile you maintained in the exercise "partner profiles"
for your vendor T-BILnn. However, you should intentionally make one mistake so that
a notification is generated.
2-3 The sender is vendor T-BILnn, from whom you wish to receive the sales orders. Enter
T-BILnn as the partner number. You should intentionally make one error in the partner
type and enter US (instead of LI). This results in no partner profile being found and the
IDoc administrator is notified. But this is the organizational unit 50010120.
2-4 You must still enter LF as the partner function and ORDRSP for the logical message.
Choose Execute.
2.5 Select Inbox to display the integrated inbox. Execute the work item. Look at the status
record and the logged long text. Access the control record via the tree display for the
IDoc. If you use change mode here, you can change the partner type to LI. After you
have saved your entries and gone back to the previous screen via the F3 key, you can
choose Edit Process Background Processing to continue inbound processing.
2.6 You can display the resulting IDocs via Display IDoc or IDoc Lists (select with the
partner number). One IDoc was generated as a result of the test, the other was
generated as a copy of the original IDoc immediately before the original was modified.
More documentation
SAP AG 1999
SAP AG 1999
Documentation
Documentation
Tools
Tools
R/3 System
Check port & partner, Port
Port Definition,
Definition,
Archive
Archive IDoc?
IDoc? generate IDoc Partner
Partner Profiles
Profiles
Post document
Error handling
SAP AG 1999
SAPAG1999
Communication
SAPAG1999
The most important task of the EDI subsystem is converting to or from the required EDI standard;
This task is carried out by the translator as a subfunction of the EDI subsystem. The individual
criteria, for example selecting and assigning fields, are mapping components (usually customer-
specific).
Further processing, message handling, is divided into outbound processing, inbound processing and
status confirmation. In outbound processing, the messages transferred from the translator are
combined in transmission files. In the case of inbound processing, the messages are separated from
the transmission files and sent to the translator. Status confirmations depend on the selected EDI
standard: For example, standard ANSI X.12 uses functional and interchange acknowledgments to
confirm successful data transfer between EDI systems.
Physical data transfer takes place using the communication module of the EDI subsystem. This also
includes the implementation of the communication protocols, for example X.25 and X.400. The
communication module is often produced by a different supplier.
Partner profiles contain the individual settings for a partner and a process, for example mapping.
The addresses are required by the communication module.
Archiving takes place in accordance with various laws and directives. These include the guidelines
laid down by the relevant tax authorities.
When EDI processes are being monitored, certain statuses are expected to be sent to the R/3 System
as reference points to ensure integration with the applications.
SAPAG1999
In inbound processing, the IDoc Interface assigns the key fields from the partner profiles to fields in
the control record. The values of other fields are checked explicitly in the coding.
As a result, an EDI subsystem must send certain fields with their values for IDoc inbound
processing:
Partner, message (three fields each) and test flag (1 field) must correspond to the entries in the
partner profile. This also means that the partner function value, for example, must be left empty if
the corresponding field in the partner profile is also empty.
Direction = 2 (inbound), structure = EDI_DC40 (external control record structure in Release 4.0).
An R/3 System (Release 3.x) would expect a different structure.
Sender port and recipient port
IDoc type. The IDoc Interface checks whether the IDoc type is assigned to the message
(assignments can be maintained from the initial node by selecting Development -> IDoc
type/message).
Special requirements can require additional fields:
(Customer-) extension. (see course BC621 for more information)
Logical address of sender/recipient for automatic forwarding
The IDoc Interface enters values for empty optional fields and checks the values, which can lead to
an error if the wrong value is found.
A complete list of fields can be found in the appendix.
SAP AG 1999
The EDI subsystem can use a parser which "understands" the appropriate output format for the IDoc
Interface. This means that the external formats (record types and IDoc types) can be recognized by
other systems.
C-headers fulfill the same purpose: They can be included in the corresponding C-programs in the
EDI subsystem.
There are also "meta-IDocs": These are two special IDoc types which describe the external formats
in their data records: The types are called
SYIDOC01 - contains the format definition of an IDoc type (that is record types and segments)
SYRECD01 - contains the format definitions of IDoc record types:
It is conceivable, for example, that an EDI subsystem only recognizes record types from releases
2.X and 3.X (that is, "versions” 1 and 2). Using SYRECD01 (record type versions 1 or 2), the new
record types for Release 4.0 (version 3) can be sent to the EDI subsystem.
Metadata can also be output for XML IDocs.
SAP AG 1999
As a member of the EDI project team for your company, you require
information on IDoc type ORDERS01 for two reasons:
1. To prepare for a project discussion about “purchase order/order via
EDI”.
2. To inform your EDI subsystem provider of this data structure.
1-1 A machine-readable format should be generated for your subsystem provider. You
decide to transfer the information on IDoc type ORDERS01 with the aid of the
Transport IDoc. A partner profile with partner type LS and partner number
ID3CLNT400 already exists and can be used in this exercise.
Note down the number of the IDoc generated.
1-2 Choose IDoc Display IDoc or IDoc IDoc lists from the initial node of the
IDoc interface to view the IDoc which you have created. Search for "your" IDoc
number.
Status transfers
Archiving status
SAP AG 1999
Archive IDocs
Describe a status transfer
SAP AG 1999
R/3 System
Post document
Documentation
Documentation
Transfer data, Tools
Tools
EDI
EDI Subsystem?
Subsystem? process further
SAP AG 1999
SmartMart must configure the IDoc interface for outbound processing:
When communication with QuickDeliver has been tested successfully, SmartMart wishes to
determine which statuses are suitable for archiving and can then be deleted from the system.
SAPAG1999
IDoc Interface
Archiving
programs
Possible
Storage
File System
SAP AG 1999
IDocs which can be archived are copied from the R/3 database to one or more archive files in a file
system (at operating system level) via the archiving programs in the IDoc Interface. Settings in ADK
Customizing (Archive Development Kit, enhanced function builder application) determine whether
the IDocs are exported to an external storage medium (optical disk, for example).
In a second, separate step, all IDocs which have been archived can be deleted from the R/3 database.
The archiving programs in the IDoc Interface are called via the central archiving transaction
(SARA). This transaction provides you with the archiving object IDOC. As a result, you can see
which programs you have to call. A message and time period are entered as "variants" for the
programs (reports), and define when the IDocs are generated. The programs check whether the
current status can be archived.
The deletion job completes an archiving run. A complete archiving run therefore moves the IDocs to
an external storage medium and deletes the IDoc from the database.
42
01 37 39 24 04
29
06 05
26
08 07
25
10 09
30
40 41 12 11
03 02
22
18 20
14 15
16 17
Statuses can only be assigned to an IDoc in defined combinations. This slide illustrates the permitted
combinations for outbound processing: The following mean:
01 IDoc generated
02 Error while sending data to port
03 Data transfer to port OK
04 Error in EDI subsystem control information
05 Error during conversion
06 Conversion OK
07 Syntax error in EDI message
08 Syntax check OK
09 Error in interchange handling
10 Interchange handling OK
11 Error while sending
12 Send OK
14 Interch. Acknowledgment positive (EDI-Subsystem)
15 Interch. Acknowledgment negative (EDI subsystem)
16 Funct. Acknowledgment positive (EDI subsystem)
17 Funct. Acknowledgment negative (EDI subsystem)
18 EDI subsystem triggered OK
20 Error while triggering
22 Send OK, still waiting for acknowledgment (EDI subsystem)
24 EDI subsystem control information OK (EDI subsystem)
25 Further processing despite syntax error
26 Syntax error in IDoc
29 Error in ALE services
30 IDoc is ready for dispatch (ALE services)
31 Error, no further processing (deletion flag)
35 IDoc retrieved from archive
37 IDoc added with error 1
39 IDoc in target system (ALE services)
40 Application document not created in target system
56 68
65
63
60
74 61 52
66
51
50 64 62 53
70 69 73 71 54 57
The permitted status combinations for inbound processing are displayed above. 50 IDoc added
51 Application document not posted
52 Incomplete application document posted
53 Application document posted
54 Error during formal application check
56 Incorrect IDoc added
57 Test IDoc: Error during application check
60 Syntax error in IDoc
61 Further processing despite syntax error
62 IDoc sent to application
63 Error while sending IDoc to application
64 IDoc is ready to be sent to application
65 Error in ALE services
66 IDoc waiting for predecessor (serialization)
68 Error, no further processing (deletion flag)
69 IDoc edited
70 Original version of edited IDoc
71 IDoc retrieved from archive
73 IDoc archived
74 IDoc created from test transaction
IDoc status ..
Description ...
Processing
Direction .
Processing layer .
Effect
Qualification .
Archiving
possible
excluded
SAP AG 1999
From the initial node of the IDoc Interface, select Control -> Status maintenance (transaction WE47)
to change the attributes of an individual status. An example of an attribute is whether or not
archiving is permitted.
This transaction can also be used to find out general information about a certain status.
SAP AG 1999
SAP Application
SAP AG 1999
The IDoc Interface allows the exchange of business data between SAP applications and external
systems. The formats used for transmitting data (IDoc types) are documented.
IDocs are exchanged with external systems on a partner-specific and message-specific basis. IDoc
data flow is therefore defined via the partner profiles and the port definitions.
In outbound processing, IDocs can be collected in a group or sent to the external system
immediately.
In inbound processing, IDocs can be processed via workflow.
Exception handling for incorrect IDocs always takes place via workflow.
Monitoring programs and statistics programs are available for the IDoc data flow. Active monitoring
can be used to automatically notify the agent responsible.
IDocs which have been processed completely can be archived.
If the IDoc types in the standard system do not meet your requirements, you can add upwardly-
compatible extensions or define your own IDoc types. This is the subject of course BC621.
SAP AG 1999
Glossary
Archiving
Administration
Display IDoc
IDoc initial screen:
Display IDoc
IDoc Administration
IDoc initial screen:
Control IDoc Administration
IDoc initial screen
Tools Business Communication
Port definition
IDoc initial screen:
Port definition
Processing tests
IDoc initial screen:
menu option according to the required function>
The following tables contain the fields from the IDoc control record which:
must always be entered by the external system in structure EDI_DC40
must be entered in special cases by the external system in structure EDI_DC40
may be entered by the external system in structure EDI_DC40 (optional fields). If the values are entered, they
are checked by the IDoc Interface.
Field Description
TABNAM Record type (structure): = “EDIDC_40” for IDocs to be processed in Release 4.0.
DIRECT Direction: = “2” (inbound).
IDOCTYP Basic type.
MESTYP Message type, e.g. ORDERS. Assigned to one or more IDoc types in the IDoc
Interface.
SNDPOR Sender port. Must be defined as a port in the receiving R/3 System.
SNDPRN Partner number of the sender. Must correspond to a partner number from the
partner profiles.
SNDPRT Partner type of the sender. “LS” (logical system) in ALE scenarios. In non-ALE
scenarios, this value is usually “KU” (customer) or “LI” (vendor).
RCVPOR Receiver port: = “SAP<SYSID>”, where <SYSID> is the ID of the receiving R/3
System, e.g. C11.
RCVPRN Partner number of the recipient. In ALE scenarios, this value is
<SYSID>CLNT<CLNT>, where <CLNT> is the client of the receiving R/3
System and <SYSID> is defined in the field RCVPOR. In non-ALE scenarios,
this value is application-specific (e.g. the value can be the organization number).
RCVPRT Partner type of the recipient “LS” (logical system) in ALE scenarios. In non-ALE
scenarios, this value is application-specific (e.g. “SD” for the SD module).
Field Description
CIMTYP Customer extension to a basic type. Must be present in the corresponding partner
profile.
MESFCT Message function for further message division. Must be present in the
corresponding partner profile.
MESCOD Message code for further message division. Must be present in the corresponding
partner profile.
SNDPFC Partner function for further partner division. Must be present in the corresponding
partner profile.
Optional fields
Field Description
MANDT Client in the R/3 System. An incorrect entry causes an error.
DOCREL R/3 release version. An incorrect entry causes an error.
OUTMOD Outbound processing mode (e.g. send IDocs individually, start subsystem). Each
value is overwritten in inbound processing.
DOCNUM IDoc ID. As the inbound IDoc is generated first in the database, each value here is
overwritten by the internal IDoc ID.
CREDAT Date of IDoc generation. Handling as in DOCNUM.
CRETIM Time of IDoc generation. Handling as in DOCNUM.
Process code and Message type are fields in the IDoc partner profiles, all other fields belong to
Message Control (MC):
#!/bin/sh
DIRWORK=/users/ediadm
cd $DIRWORK
FILE='basename $1'
date >> $DIRWORK/ediadm.trace
echo ++ run external system with file $FILE >> $DIRWORK/ediadm.trace
# insert command to start EDI subsystem here
echo ++ removed IDoc file $FILE from application server >> $DIRWORK/ediadm.trace
chmod 666 $DIRWORK/ediadm.trace
#!/bin/sh
DIREXEC=/users/ediadm/run
DIRWORK=/users/ediadm
cd $DIRWORK
date >> $DIRWORK/ediadm.trace
echo ++ start SAP system with file $1 >> $DIRWORK/ediadm.trace
$DIREXEC/startrfc -3 -t
-d <system ID> -u <user> -p <password> -c <client>
-h <router string> -s <system number>
-g <gateway machine> -x <gateway name>
-F EDI_DATA_INCOMING
-E PATHNAME=$DIRWORK/$1
-E PORT=<subsystem>
chmod 666 $DIRWORK/ediadm.trace
Note: the script for status files only differs from the script for inbound IDocs because the
function module EDI_STATUS_INCOMING is called.