Beruflich Dokumente
Kultur Dokumente
IDoc, short for Intermediate Document, is a SAP document format for business
transaction data transfers.[1] Non SAP-systems can use IDocs as the
standard interface (computing) for data transfer.[2] IDoc is similar to XML in
purpose, but differs in syntax. Both serve the purpose of data exchange and
automation in computer systems, but the IDoc-Technology takes a different
approach.
While XML allows having some metadata about the document itself, an IDoc is
obliged to have information at its header like its creator, creation time etc. While
XML has a tag-like tree structure containing data and meta-data, IDocs use a table
with the data and meta-data. IDocs also have a session that explains all the
processes which the document passed or will pass, allowing one to debug and
trace the status of the document.
Different IDoc types are available to handle different types of messages. For
example, the IDoc format ORDERS01 may be used for both purchase orders and
order confirmations.
IDoc technology offers many tools for automation, monitoring and error handling.
For example, if the IDocs are customised that way on a particular server, then a
user of SAP R/3 system creates a purchase order; this is automatically sent via an
IDoc and a sales order is immediately created on the vendor's system.
When this order cannot be created because of an application error (for example:
The price per piece is lower than allowed for this material), then the
administrator on the vendor's system sees this IDoc among the erroneous ones
and can solve the situation. If the error is in the master data at the vendor's
system, he can correct them and order the IDoc to be processed again.
Because of the flexibility and transparency of IDoc technology, some non-SAP
technologies use them as well.
Contents
[hide]
• Control record (it contains the type of IDoc, port of the partner, release of SAP
R/3 which produced the IDoc etc.)
• Data records of different types. The number and type of segments is mostly
fixed for each IDoc type, but there is some flexibility (for example an SD order
can have any number of items).
• Status records containing messages like 'IDoc created', 'The recipient exists',
'IDoc was successfully passed to the port', 'Could not book the invoice
because..'
Error Handling[edit]
SAP provides a standard report (WE02) or (WE05) to display and edit IDocs.
Unfortunately, the provided functionality is very basic; therefore, most customers
are forced to create their own custom solution. [citation needed].
ABSTRACT
Today IDocs are used in most SAP applications for transfer of
message(information) from SAP system to other systems and vice versa. Though
lot of documentation is available on IDocs it is difficult for a functional consultant
to understand such documents due to their technical nature. While a functional
consultant is not expected to know the IDoc concepts in its entirety, an effort has
been made to capture the minimum necessary information that one needs to be
aware of in order to handle project/support issues on IDocs.
OVERVIEW
IDoc is an SAP object that carries data of a business transaction from one system
to another in the form of electronic message. IDoc is an acronym
forIntermediate Document. The purpose of an IDoc is to transfer data or
information from SAP to other systems and vice versa. The transfer from SAP to
non-SAP system is done via EDI (Electronic Data Interchange) subsystems whereas
for transfer between two SAP systems, ALE is used.
IDoc can be triggered in SAP system or in EDI subsystem. This depends on the
direction in which IDoc is sent and is called as Inbound IDoc and Outbound IDoc
accordingly. In case of outbound flow, IDoc is triggered in SAP through document
message control which is then sent to EDI subsystem. EDI converts the data from
IDoc into XML or equivalent format and then sends the data to partner system
through Internet.
For inbound flow, EDI converts partner data and IDoc is created in SAP. After
successful processing of this IDoc, Application Document is posted in SAP.
IDOC TERMINOLOGIES
IDOC (BASIC) TYPE
IDoc Types are based on the EDI standards and mostly on EDIFACT standards.
Basic Types (or IDoc Type) defines the structure of an IDoc. Each basic type
describes standard IDoc segments, format of data fields and their size. Basic Type
also defines number of segments and fields in an IDoc. All the fields that are
necessary for transmission of message for a particular business transaction are
mapped in different segments. It also defines the structure and relationship of
IDoc segments along with mandatory and optional segments.
IDOC EXTENSION
Basic type contains all the standard fields that are necessary for carrying out a
business transaction. However, if any additional values are to be sent to the
partner then we can make use of the IDoc Extension feature. IDoc extension is
extension of basic type and contains additional custom IDoc segments and fields
that are not available in standard basic type.
IDOC SEGMENTS
IDoc segments contain the actual data that is sent to or received from a partner.
These segments contain the actual values that are sent as part of IDoc
transmission.
INBOUND/OUTBOUND IDOCS
IDocs sent outside the system are termed as Outbound IDocs and the ones that
are received into the system, are called as Inbound IDocs.
IDOC DIRECTION
This signifies the direction is which information is sent and is similar to
terminology used in mails. If information is sent outside the system then the
direction is outbox when it is received into the system then direction is inbox. In
SAP Outbox direction is represent by “1” i.e. outbox and Inbox direction is
represented by “2”.
PARTNER
Partner is the Business Partner with which the exchange of information is to take
place using IDoc. It can be a vendor or customer or any other system. Depending
on the direction of information in which the information is sent it plays a role of
either a “sending partner” or a “receiving partner”.
PARTNER TYPE
Partner type/role is used to identify partners within the sap systems. Partner type
is KU for customer, LI for vendor and LS for Logical System.
MESSAGE TYPE
IDoc processing involves transmission or receipt of document in the form of a
message, each of which represents a document in SAP. These documents can be
Order, Shipment Confirmation, Advance Shipping Notification, Goods Receipt, or
Invoice. Message type is associated with Basic IDoc Type (Basic Type) and defines
the kind of data or document that is exchanged with the partner.
PROCESS CODE
The process code contains the details of the Function Module that are used for
IDoc processing. Message Type can be linked to the Process code.
PORT
IDoc Port contains the information about the way data is sent between the source
or target system. The type of port defines the information contained within the
port. For port type “Internet” Port will contain IP address of the target system. For
port type “file”, directory or file name information is maintained. “tRFC” port
contains information about the RFC destination of the target system. For IDoc
transmission using ALE “tRFC” ports are used.
Process Code is linked to the Function Module in SAP that converts application
data into an IDoc. Standard function modules are provided by SAP for this
conversion however these can also be customized as per business needs.
Change Message Indicator indicates whether the IDoc is sent as a notification of
change. For example, Purchase Order change messages are sent to vendor using
EDI standard message type 860.
Separate message type should be triggered in the purchase order for PO change.
Additional line with change message type must be added in the Message control
tab with change message indicator on.
INBOUND OPTIONS (INBOUND PARAMETERS)
For inbound options process code is maintained in the Inbound screen only. IDoc
processing can be triggered by background program and triggered immediately.
In the post processing option we can maintain the workflow details of the users or
positions to which an error notification will be sent if an IDoc processing fails.
TELEPHONY (INBOUND/OUTBOUND PARAMETERS)
We can also maintain the contact details in the telephony option.
For example, Message Type 850 is an EDI standard for Purchase Order IDoc and is
linked to IDoc Message Type Orders.
Initial Status numbers are 64 for inbound and 03 for outbound. Successful status
is 53 for inbound and 16 for outbound IDocs.
SENDING AND RECEIVING IDOCS
TRIGGERING AN OUTBOUND IDOC
Outbound IDocs can be triggered from the output message types of Purchase
Orders, deliveries, Material Documents, invoices, etc. The following figure shows
that once the output ZXX1 of PO XXXXXXX1 is processed an IDoc
“000000XXXXXXXXX1” is added/created.
The relationship between the IDoc and the application document can be found in
two ways:
1. Relationship tab of IDoc
2. Relationship tab of Application Document, e.g. PO, SO, Material Document, etc.
The initial status of this IDoc will be 30, which after successful processing will
convert into status 16.
A successful outbound IDoc will pass through all the above statuses in reverse
order (01-03-18-06-12-16). Each status represents an IDoc validation step. If an
IDoc passes all the validations it would reach status 16. These different validation
steps for outbound IDocs are explained below:
01: IDoc generation successful
30: IDoc is ready to be processed by IDoc Processing job
03: IDoc data is passed to the Port
18: IDoc successfully triggered EDI subsystem
06: IDoc data translated to EDI format
12: IDoc is dispatched successfully to the partner
16: Partner has received the IDoc successfully
IDoc can possibly fail at any of the above steps during validation.
An inbound IDoc goes through all the above statuses in reverse order (50-64-53).
IDOC PROCESSING
AUTOMATIC/IMMEDIATE PROCESSING
In this case, IDoc are processed immediately as they generated or added in the
system. The check “Transfer IDoc immediately” is selected in Outbound Options
and “Trigger Immediately” is selected in Inbound Option. These checks are
generally used when the real time information exchange is necessary between
two systems.
MANUAL PROCESSING
IDocs can also be manually processed using the TCODE BD87 in SAP.
REPROCESSING IDOCS
On the basis of IDoc statuses different programs can be used for reprocessing of
failed IDocs. These are given below:
TESTING AND EDITING IDOCS
If an IDoc contains error in the data then such IDocs can be edited using TCode
WE02 or WE05. When an IDoc is edited the original IDoc information(backup) is
saved in a New IDoc under status 70 (for inbound) / 33 (for outbound). These IDoc
stays in the system for reference only and cannot be processed. The status of the
edited IDoc becomes 69 (inbound) and 32 (outbound). These IDocs can then be
processed using BD87 transaction or batch jobs.
Debugging of IDocs can be done using by copying the IDocs using TCodeWE19.
WE19 is a test tool for Idocs processing. WE19 copies the existing idoc and creates
a new IDoc which can then be modified as per testing needs. The newly generated
IDoc can also be processed using BD87.
Though, the IDoc failure may not be related to any of the above mentioned
reasons, the best way to find the IDoc error is to compare the existing IDoc with
the good example. Good example IDoc can be easily searched with any of the
IDoc search methods as described above.
The Business API (BAPI) is an interface that allows you to call the methods of
these SAP Business Objects. A-Synchronous Description Interface MethodsIDoc
Intermediate Document (IDoc)interface is an SAP standard format for exchanging
data betweenSAP systems and between an SAP system and an external
application.Nov 7, 2012
Skip to end of metadata
• Created by Brandon Jacobson, last modified by Werner Daehn on Jan 15, 2013
Go to start of metadata
Summary
DataServices is a technical integration tool, so it has to support the interfaces the
users believe is best suited for a given task.
When dealing with SAP you have to ask yourself different kind of questions:
• What technical method to connect to SAP? ABAP, RFC or the underlying database.
• What object to use from SAP? Tables, Function Modules, Extractors, IDOCs, BW
InfoSource/DataSources.
• Reading or Loading data?
Not all objects can be used with all methods, the following table provides an
overview
ABAP via RFC in a regular underlying
dataflow dataflow database
SAP Table (Read) yes yes (use DS 4.1 RFC yes/no (only
transport method transparent
for larger amounts tables)
of data)
BW no yes no
InfoSource/DataSource
(Load)
Most of the restrictions are natural, like you cannot simply load a SAP table, data
has to go through the regular validation rules and might end up in multiple tables
at the end.
Or BW provides interfaces to read/load data, hence we show BW to the end users
like any other database with tables.
The fact that you cannot use table parameters of SAP function modules in an
ABAP dataflow is a technical restriction, one that hurts occasionally.
And sometimes you might have multiple options, e.g. loading Sales data via BAPIs
or IDOCs? Both have pros and cons. Or BW objects are nothing else then SAP
tables, so could theoretically be used that way.
But one is obvious, connecting to the underlying SAP database directly is very
limited and hence the exception.
• Direct SQL
• ABAPs
• RFC ReadTable
• Extractors
• RFC-BAPI
• IDOCs
Previous Next
During inbound (client) processing, IDocs are transferred to the interface and
stored in the R/3 System. The document data is generated in a second step, also
in the course of a workflow.
If the upstream system is recognized, then the IDoc is saved in the database. If a
partner is defined with the corresponding message in partner profiles, the IDoc is
then processed further. This is done independently in the second step. This
ensures that the external system can receive the data quickly and reliably
(automatically).
You must perform the following steps to configure SAP for inbound IDoc
processing:
8. Enter a name and description for your request and click Save.
The logical system you configured, for example, ORACLETDS, is now added
to the list.
Description of the illustration ale_logicalsysdisplay.gif
A distribution model is used to describe the ALE message flow between logical
systems. Business objects are distributed to connected recipients according to a
unique distribution model that can contain rules of varying complexity depending
on the type of business objects involved.
5. Enter a model view name in the Short text field and a name in
the Technical name field, which also serves as a description.
6. Click the check mark icon to enter the information.
You are returned to the main Change Distribution Model window. The
distribution model you configured is now added to the list.
Description of the illustration ale_distmodel4.gif
a. In the Sender and Receiver fields, enter the logical system you
configured, for example, ORACLETDS.
You can click the icon to the right of each field to browse from a list
of logical systems.
b. In the Message type field, enter the message type you want to use,
for example, MATMAS.
You can click the icon to the right of each field to browse from a list
of available message types.
9. Click Save.
Defining a Partner Profile
Partner profiles are a prerequisite for data exchange. This involves defining who
can exchange messages with the SAP system and using which port.
2. In the left pane, expand Partner type LS and select the logical system you
configured from the list, for example, ORACLETDS.
In the right pane, the Partn.number field refers to the name of the logical
system.
3. Click Save.
4. From the Inbound parameters table, click the Create inbound parameter
icon.
5. In the Message type field, enter the message type you want to use, for
example, MATMAS.
You can click the icon to the right of each field to browse from a list of
available message types.
6. In the Process code field, enter the process code you want to use, for
example, MATM.
You can click the icon to the right of each field to browse from a list of
available process codes.
In this case the adapter writes IDocs to the SAP database, which is
processed immediately.
• Trigger immediately.
In this case, the adapter waits for the SAP system to process IDocs.
This can take anywhere from 1 to 15 minutes.
Click Save.
SAP pseudo events are not processed by the SAP Event manager, but are called
from an ABAP program or Remote Function Call (using the Destination
parameter).
The following topic lists and defines specific terminology related to SAP and SAP
event handling.
RFC programs for non-SAP systems can function as either the caller or the called
program in an RFC communication. There are two types of RFC programs:
• RFC Client
• RFC Server
The RFC client is the instance that calls the RFC to run the function that is
provided by an RFC server. The functions that can be called remotely are called
RFC functions, and the functions provided by the RFC API are called RFC calls.
SAP Gateway
An RFC server program can be registered with the SAP gateway and wait for
incoming RFC call requests. An RFC server program registers itself under a
Program ID at an SAP gateway and not for a specific SAP system.
When configuring multiple events in the Oracle Application Server using a single
SAP program ID, SAP load balances the event data. For example, if multiple
remote function calls or BAPIs use the same program ID (for example,
ORACLETDS) and multiple SAP listeners are configured with this progamID, then
SAP sends one request to one listener and the next to another listener, and so on.
There is a load-balancing algorithm present in the SAP Gateway Server. This
mechanism is proprietary to SAP application development and might work by
comparing total throughput of the connection, the number of times in wait state,
and so on. This means one connection might receive nine messages and a second
connection might receive one message. If five of the nine messages are rejected
for schema validation and the one message on the other connection is rejected
for schema validation, you might suspect that you are missing SAP event handling
messages.
Load balancing in client (outbound from adapter to SAP) situations is handled only
by the SAP application design. If your system supports a Message Server, then you
can load balance in client situations. If you have only one application server, you
cannot load balance except by application server tuning, such as maximum
number of connections permitted or time of day limits on connections.
The SAP system default limit is 100 RFC (communication) or adapter users. Each
user takes up more than 2 MB of memory on the application server of the SAP
system, and more or less on the adapter depending on the workload.
Connection Pooling
A connection pool can check which connections are no longer in use and can be
closed to save system resources. The time period after which the pool checks the
connections as well as the time after which a connection will time out can be
configured by the calling application.
A pool is always bound to one user ID and password, meaning that all connections
taken from this pool will also use these credentials. An SAP connection is always
bound to an SAP user ID and an SAP Client number.
If you log on with a pool size that is set to 1, no connection pool is created (1
userid – 1 process thread). If you log on with a pool size that is greater than 1, a
pool is created with a size of n, which is the number you specified.
For more information about connection pooling, see the SAP JCO API
documentation.
To enable your SAP system to issue the following calls or interfaces to the SAP
event adapter, you must register your program ID under an RFC destination.
The RFC destination is a symbolic name (for example, ORACLETDS) that is used to
direct events to a target system, masking the program ID. The Program ID is
configured in both SAPGUI and the event adapter.
In the SAP Server, the SE37 transaction enables you to send an RFC (Remote
Function Call) or a BAPI (Business Application Programming Interface) to any RFC
destination. For more information on RFC destination, see Registering Your
Program ID in SAPGUI.
2. To choose single test, press F8 and click the Single Test icon or
choose Function module, select Test and then Single Test.
3. Enter an RFC target system, for example, ORACLETDS.
4. Enter input data for the particular RFC modules, for example, AB*.
5. To execute, press F8.
The function name and input data are transferred through RFC to create an
XML document on the Oracle Application Server with the parameters input
in SAPGUI.
The SAP event adapter receives IDocs (Intermediate Documents) from SAP. To
configure an SAP system to send IDocs to the SAP event adapter, use the ALE
(Application Link Embedding) configuration to:
A port identifies where to send messages. This port can be used only if an RFC
destination was created previously.
Defining a Port
To define a port:
2. In the left pane under Ports, select Transactional RFC and click Create.
3. Select Generate port name.
4. Enter the IDoc version you want to send through this port.
5. Click the destination you created, for example, ORACLETDS.
6. Save the session, making note of the system-generated RFC port.
One type of partner is a logical system. A logical system manages one or more RFC
destinations.
1. In the ALE configuration, enter the area menu selection SALE transaction.
2. Select SAP Reference IMG.
3. Expand the following nodes: Basis Components, Application Link Enabling
(ALE), Sending and Receiving Systems, Logical Systems, and Define Logical
System.
4. Click the check mark beside Define Logical System.
Partner type is LS, and the Message type is DEBMAS, which is the IDoc
document type.
Collected IDocs
When using collected IDocs on any platform during inbound processing (service
mode), if the DOCNUM field does not have a unique document number for each
IDoc, the system creates an IDoc for each header record in the collected IDoc file
and duplicates the data for each IDoc.
Make sure the DOCNUM field is included in the EDI_DC40 structure and that each
IDoc has a unique sequence number within the collected IDoc file.
Creating a Distribution Model for the Partner and Message Type
You must create a distribution model for the partner and message type you
designated.
3. Enter a short text string and a technical name for your new model view.
4. Click Save.
The Add Message Type box is displayed. It contains fields for specifying the
sender and receiver of the message, as well as the message type.
c. In the Sender field, provide the sender that points to the SAP system,
which sends the IDoc, for example, I46_CLI800.
In this case, the sender is an SAP 4.6B system.
The Change Distribution Model window displays the new model view to use
to send message type, DEBMAS, from the I46_CLI800 SAP system to the
ORACLETDS logical system.
You are now ready to test the connection to the logical system.
Testing the SAP ALE Configuration
In the SAP Server, the BD12 transaction enables you to send IDocs to any logical
system, for example, to an event adapter.
1. In the Send Customers window, enter the IDoc message type, for example,
DEBMAS in the Output type field.
2. In the Logical system field, enter the logical system, for example,
ORACLETDS.
3. Click Run.
The SAP event adapter receives the IDoc in XML format. No response is
expected from the event adapter.
Definition of Variants
You can adapt the mass processing function and the order information system in
a very flexible way, to meet the requirements of your company and its individual
users. You can put together user-dependent report variants, report transactions,
and variant transactions to provide every user with the exact range of functions
required.
Techniques Used
Report variants
With a report variant (see Variant Maintenance), you can specify default values
for fields, hide fields or make them unavailable for input on the initial screen of a
program. You can use report variants to schedule in the background or to define a
report transaction. For technical reasons, only the display and input availability of
the selection criteria can be influenced for the program. The display and input
availability of other fields (for example, the parameters for mass processing or the
list category) can only be controlled via a transaction variant. Conversely, the
selection criteria cannot be influenced in the transaction variant.
Example
The following example shows you how to create a customized transaction for
reprinting time tickets.
Defining a report variant
Using transaction SE38, you define the report variant Z_LV01 for program
PPIO_ENTRY. When you do this, you preset the following:
The operation list is the only list that can be selected.
The object Operations is predefined for the List field.
The Mass Processing Active indicator is set.
Selection fields that are not needed are hidden.
Print and Print mode, as mass processing functions, are preset for immediate
execution. You define that these fields are blocked for entry.
Defining a report transaction
Using transaction SE93, you define the report transaction Z_LV01_T for report
variant Z_LV01 of program PPIO_ENTRY.
Defining a transaction variant
Using transaction SHD0, you define the transaction variant Z_LV01_01 for report
transaction Z_LV01_T. You hide the Production orders and Planned orders fields.
Defining a variant transaction
Using transaction SE93, you define the variant transaction ZLV01 for transaction
variant Z_LV01_01 of report transaction Z_LV01_T. This variant transaction can be
added to a user's favorites menu or role menu, for example.
Execution in the Order Information System and Mass Processing
The central program for mass processing and the order information system is
PPIO_ENTRY. Examples have been set up in the standard system to demonstrate
the use of the options described above:
Mass Processing
Variant Transaction for production order: COHV
transaction Logistics → Production → Shop Floor Control →Control → Mass
Processing
Transaction for process order: COHVPI
Logistics → Production – Process → Process Order →Tools → Mass
Processing
Report variant Report: PPIO_ENTRY, Variant : SAP&HVOM or SAP&HVOMPI
Order Information System
Report Transaction for production order: COOIS
transaction Logistics → Production → Shop Floor Control →Information
System → Order info system
Transaction for process order: COOISPI
Logistics → Production – Process → Process Order →Tools → Mass
Processing
Report variant Report: PPIO_ENTRY, Variant : SAP&COOIS or SAP&COOISPI
Collective Release
Variant Transaction: CO05N
transaction Logistics → Production → Shop Floor Control →Control → Collective
release
Transaction Transaction: COHVOMRELEASE, transaction variant: CO05
variant
Report COHVOMRELEASE
transaction
Report variant Report: PPIO_ENTRY, Variant : SAP&RELEASE
Print
Variant Transaction: CO04N
transaction Logistics → Production → Shop Floor Control →Control → Print
Variant Transaction: COHVOMPRINT, transaction variant: CO04
transaction
Report COHVOMPRINT
transaction
Report variant Report: PPIO_ENTRY, Variant : SAP&PRINT
Collective Availability Check
Variant Transaction: COMAC
transaction Logistics → Production → Shop Floor Control →Control → Collective
availability check
Report variant Report: PPIO_ENTRY, Variant: SAP&AVAILCHK
Missing Parts List
Variant Transaction: CO24
transaction Logistics → Production → Shop Floor Control →Information
System → Missing parts information system
Report variant Report: PPIO_ENTRY, Variant: SAP&MPART
Pick List
Variant Transaction: CO27
transaction Logistics → Production → Shop Floor Control → Goods
Movements → Material Staging → Pick
Report variant Report: PPIO_ENTRY, Variant: SAP&PICK or SAP&PICKPI
Variants allow you tosave your selection parameters in the input screen.
It minimizes the need to enter selection parameters each time you run a SAP
report.
Variants can be storted for ANY SAP REPORTas long as the Save Button is
available in the SAP Menu bar for the report.
Create a Variant
1. Enter the values for selection criteria while you are in any SAP report.
2. Once all selection criteria are populated , Click the Save button
Retrieve a Variant
Click the Get Variant Button
Delete a Variant
While in ANY SAP Report Select GoTO > Variants > Delete
1. Select the "only in current client" radio button. (All Clients option will delete
the variant across ALL clients)
2. Click Continue
Variant is deleted.
Your Feedback & Ideas are very important to us. Please share your
suggestions here
Low ---Class C
4. Here you can specify,when the job is to start by choosing Start Condition. If
you want the job to repeat, or be periodic, check the box at the bottom.
The job, even those scheduled for immediate processing, can not run without first
being released.So,do remember to release.