Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to debug Idoc

Former Member
0 Likes
8,157

Hi Guys ,

How to debug Idoc please tell me,

One way I know ,( Going to we19 and after that giving idoc number,

selecting inbound function module and after that giving that FM name callin that one in degug and Fore ground)

But I dont want this one way because it was creating new idoc , please Giude me

Thanks,

Durga Prasad.

7 REPLIES 7
Read only

Clemenss
Active Contributor
0 Likes
3,202

Hi Durga,

because IDOCS are usually processed in background processes, it's not too simple.

I remember we included a waiting loop somewhere in the coding that is processed,

i.e.


data:
    lv_run          TYPE     f,
    lv_end          TYPE     f,
    lv_wait_seconds TYPE    INT4.

      lv_wait_seconds = 60.
      GET RUN TIME FIELD  lv_run.
      lv_end = lv_run + 1000000 * lv_wait_seconds.
      WHILE lv_run <  lv_wait_seconds and lv_wait_seconds  > 0.
        GET RUN TIME FIELD  lv_run.
      ENDWHILE.

The start your normal IDOC processing and start transaction SM50 process overview.

Your IDOC processing will loop endlessly for 60 seconds. During this time, you can swith on debugging for the process (Menu Program -> Program -> Debugging). In the WHILE LOOP, clear lv_wait_seconds so that processing is continued. Now you can debug as you want.

Regards,

Clemens

P.S. This solution for debugging in background was posted so often that I wonder why your search was not successful

Read only

Former Member
0 Likes
3,202

Hi Clemens Thansk for your inputs,

This is one is nothing but debugging of back ground job , this one i know, this is nothing but debugging of new idoc which is coming into our system via back ground,

But My point is , I have one idoc posted that one but it contains some errors then, then i will go to the we19 there i will give this no through debug i will rectify error, every time if i go to debug the original idoc it will create duplicate idoc related to that idoc , But i dont want those duplicate idocs . is there any another way to over come this one.

Read only

Sm1tje
Active Contributor
0 Likes
3,202

1. What about transaction BD87. Select the IDoc you want to reprocess, press /h and process IDoc.

2. Process IDoc via debugging from report RBDPROCESS.

Read only

former_member404244
Active Contributor
0 Likes
3,202

Hi,

we can very well check in WE02 , if there is any error in a segment..Please see if your idoc is failing due to this. WE19 is the way where we can debug the idoc . we can delete the idoc if we want, please use tcode ->WE11..

Regards,

Nagaraj

Read only

0 Likes
3,202

Hi

Please use BD87 to reprocess the IDOC this will not create a new IDOC,If you use WE19 it will create a new IDoc which will be a copy of the exisiting IDOC

Read only

aris_hidalgo
Contributor
0 Likes
3,202

Hi,

Just like what others have said, you use tcode BD87 to reprocess an idoc. And one way to debug idocs is to change the processing mode of idoc to not trigger immediately and put a break point in the FM of your idoc.

Hope it helps...

Read only

Former Member
0 Likes
3,202

Hi Prasad,

All the answers are good and informative for me too because i wanted to post the same question.

One tip i found and i want to share with is that, once you are inside in debuggin mode you can go to menu breakpoint==>Breakpoint at==>Breakpoint at Statement and then press F7. It will help you find quickly the error message.

Kind Regards

Umer