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