0% found this document useful (0 votes)
68 views11 pages

Debugging Inbound and Outbound IDocs

The document provides a step-by-step guide for debugging both inbound and outbound IDocs in SAP, detailing transactions like WE02, WE20, and BD87 for identifying IDocs, process codes, and function modules. It emphasizes setting breakpoints in function modules and executing IDocs for debugging purposes. Additionally, it outlines the necessary steps for processing IDocs based on their status and the presence of process codes.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
68 views11 pages

Debugging Inbound and Outbound IDocs

The document provides a step-by-step guide for debugging both inbound and outbound IDocs in SAP, detailing transactions like WE02, WE20, and BD87 for identifying IDocs, process codes, and function modules. It emphasizes setting breakpoints in function modules and executing IDocs for debugging purposes. Additionally, it outlines the necessary steps for processing IDocs based on their status and the presence of process codes.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Debugging Inbound IDocs

1. Identify the IDoc to debug, go to WE02 o WE05 and locate the IDoc and check the
segments and the status (I’m using the LIKOND for this example). Note the IDoc number,
partner profile, basic type, message type, port and status codes.

2. Identify the process code, go to WE20 and select the partner profile for the
corresponding message type and note the process code (LIKO in this case).

3. Identify the function module that is processing the idoc, in order to show the funtion
select with double click over the Process code, the name is defined on Identification field:
As alternative you can go to WE57, select print icon and search the message type to get the
ABAP function module (IDOC_INPUT_LIKOND in this example).

4. Set the breakpoints in the function module, go to SE37 transaction and set the function
module and click on Display to show the code. Now with set the cursor in the desired line
and add some sesion breakpoints.
5. Execute the IDoc to start the debug process, there are two ways:

A) Reprocess the IDoc using the BD87 transaction, set the IDoc number and choose Execute.
Then select the IDoc node and click on Process to start the debuger.
The IDoc processing result must be showed at the end of the debug session.

B) Use the Test Tool For IDoc processing, go to WE19 transaction, paste the IDoc number
and click on Create, the Test Tool editor is showed and you could modify the IDoc segments
and the data. Then select the processing mode (I’m used Inbound Function
Module with Call in debugging mode enabled), click on Continue to start debug process.
This tool creates a copy of the IDoc and it will show the new number at the end of the debug
session.
Debugging Outbound IDocs

1. Identify the IDoc to debug, go to WE02 o WE05 and locate the IDoc and check the
segments and the status (I’m using the ALEAUD for this example). Note the IDoc number,
partner profile, basic type, message type, port and status codes.

2. Identify the function module responsible for generating the IDoc. This can be found
in WE20 under the partner profile. Look for the process code and associated function
module.
Double click on Message type and choose Message control Tab to validate is there any
process code (in this example there is no one defined).

The process code normally links a message type and IDoc type with a specific function
module that reads application data and constructs the IDoc for outbound processing. When
no process code is defined, the outbound IDoc is not generated or triggered through the
standard message control mechanism where the process code specifies the function module
responsible.

The following image shows another example where the process code is defined, when it is
openend (double click on it) the funtion module is showed (IDOC_OUTPUT_ORDERS in this
example).
3. Set the breakpoints in the function module, go to SE37 transaction and Display the
function module to show the code. Then add some sesion breakpoints.
4. Processing the IDocs, you can only reprocess the IDoc with some errors. If you want to
execute an IDoc that was successfully sended you could make a copy and send it as new
IDoc. Please consider the following examples:

A) If the IDoc is ready for disptach, go to BD87 transaction, set the IDoc number, status or
the message type and choose Execute, then select the IDoc and Process to start the
outbound processing.

B) If the IDoc has the status as Data passed to Port OK (status 3), you can not reprocess it,
but you can create a copy of the IDoc in the WE19, set the IDoc number and
choose Create > Standard Outbound Processing and uncheck the option Start outbound
IDoc processing now, then go back to A) and process it, if you check the option the
processing is started inmediatly.

C) If the IDoc has a Process code, go to WE15 or SE38 and execute the
report RSNAST00 or RSNAST0D, complete the fields with the same data that IDoc has
defined in Mesage Control (taken from Partner profile) and execute it.

Note: The object key cuold be retrived from NAST table, you have to find the data for your
corresponding IDoc.
D) For non standard functions, go to SE37 and set some breakpoints into function
module MASTER_IDOC_DISTRIBUTE then execute the IDOC creation from your custom
application, you have to enable the debug sesion with /h.

Transaction summary

Task Transacition TO-DO

Identify the IDoc WE02/WE05 Get IDoc data and partner profile

Partner profile WE20 Get Message type and process code

Function module WE57 Get the FM using the Message type

Prepare for debug SE37 Review FM code and set breaks

Process the IDoc BD87 Reprocess the IDoc

Use IDoc Test Tool WE19 Execute a copy of the IDoc to test

Common questions

Powered by AI

For an IDoc with errors, use transaction BD87 to set the IDoc number and execute the reprocessing. For a successfully sent IDoc, you cannot reprocess it directly but can create a copy using WE19 for outbound processing. This distinction lies in the ability to modify copies versus re-executing the original .

Identifying a process code is necessary as it links a message and IDoc type with a function module responsible for processing. Verify its existence by navigating to WE20, selecting the partner profile, and checking the Message control tab for any defined process codes .

Determine the function module processing an inbound IDoc by locating the process code using WE20 under the partner profile for the corresponding message type. Double-click on the process code to reveal the function module defined in the Identification field or use WE57 to find it via the message type .

MASTER_IDOC_DISTRIBUTE is crucial for distributing master data through IDocs. During debugging, it serves as a target for setting breakpoints using SE37 to analyze IDoc creation, particularly in custom applications, enhancing understanding of data flow and IDoc generation processes .

Absence of a process code disrupts standard message control as it typically specifies the function module and linkage required for constructing IDocs and processing. Without it, the system cannot trigger outbound IDoc processes appropriately using message control .

To execute an IDoc, use transaction BD87 for reprocessing by providing the IDoc number and selecting 'Process'. Alternatively, use the Test Tool in transaction WE19 to create and modify a copy of the IDoc, executing it in debug mode. BD87 reprocesses the original IDoc, whereas WE19 allows modification and testing on a duplicate .

To initially debug an inbound IDoc, you should first identify the IDoc by viewing it through transactions WE02 or WE05. Here, you check the segments and status and take note of the IDoc number, partner profile, basic type, message type, port, and status codes .

SE38 allows execution of custom reports like RSNAST00, which processes output messages and can initiate the transfer of IDocs based on conditions set in the message control. This utility proves vital for cases involving custom processes, enabling precise control over when and how IDocs are generated and processed .

Transaction WE19 serves as the IDoc Test Tool, allowing users to create and modify copies of IDocs for testing. It enables selecting the processing mode and executing the process in debug to observe changes or diagnose issues with modified data and structures .

Critical steps include navigating to the SE37 transaction, displaying the relevant function module, and setting session breakpoints by placing the cursor on the desired line of code .

You might also like