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

submit not allowing debug

Former Member
0 Likes
3,751

Hi  Friends

There are another custom program inside main program

I want to execute rows of 2nd program , but  I have to run the 1st program ,

I have set the breakpoint on submit statement  its taking one time to 2nd program ,

but  then its going to START of SELECTION and coming back to first main program and not going down of code

What I should do to  run the other rows of 2nd  program   and if am using  Breakpoint Set on statement then its taking  to so many places of standard programs where ever that statement is getting use.

Thanks

Meeta

1 ACCEPTED SOLUTION
Read only

Private_Member_7726
Active Contributor
0 Likes
2,131

Hi,

You should set to breakpoints in the called (the second, if I understand correctly) program. Theer must be something wrong with program structure if the program returns upon reaching start-of-selection - one would need to see the code.

Other than that, you could and probably should invest few hours to watch the debugging series of videos created by Olga Dolinskaja - they are well worth the time...

cheers

Jānis

5 REPLIES 5
Read only

Private_Member_7726
Active Contributor
0 Likes
2,132

Hi,

You should set to breakpoints in the called (the second, if I understand correctly) program. Theer must be something wrong with program structure if the program returns upon reaching start-of-selection - one would need to see the code.

Other than that, you could and probably should invest few hours to watch the debugging series of videos created by Olga Dolinskaja - they are well worth the time...

cheers

Jānis

Read only

0 Likes
2,131

Thanks Janis B  for your reply

actually the 2nd program calling by submit and Job creation happening its like this ,

CALL FUNCTION 'JOB_OPEN'
             EXPORTING
               jobname  = jobname
               jobgroup = 'FEB '
             IMPORTING
               jobcount = jobcount.

           SUBMIT ZFEJKE0 USING SELECTION-SET par_vari
                             WITH infile INCL w_physical_name
                             AND RETURN
                             USER sy-uname
                             VIA JOB jobname NUMBER jobcount.

           CALL FUNCTION 'JOB_CLOSE'
             EXPORTING
               jobname   = jobname
               jobcount  = jobcount
               strtimmed = 'X'.

         ELSE.

           SUBMIT (p_prog) USING SELECTION-SET par_vari
                             WITH infile INCL w_physical_name
                             AND RETURN .



here it goes to 2nd prog by submit and come back  and doing background job debugging is not easy .


Regards

Meeta

Read only

0 Likes
2,131

You can force the background job into debugger from process overview in SM50 (look for debugging option under the SM50 menu) while it's still running, or use job overview to execute a finished job again under debugger.

or, if you can change the programs that are submited via job, write some kind of endless loop at initialization event, which you can exit via debugger, then use SM50 to enter debugger:

while some_variable is initial .

  wait up to 1 seconds.

endwhile.

cheers

Jānis

Message was edited by: Jānis B

Read only

A-J-S
Active Participant
2,131

Hi Meeta,

You cannot debug directly if the submit statement is called in session method using FM JOB_OPEN.

There are ways you can perform the debugging though by not letting the session to process and by executing the report with all inputs separately.

From the code i could see there is an option without session after ELSE statement. If you put the breakpoint in second program and the code after ELSE is executed means the debugger will trigger.

Thanks and Regards,

Ajith

Read only

jayanthi_jayaraman
Active Contributor
0 Likes
2,131

Hi,

If you want to debug the completed job, go to SM37 and then select the same and only put JDBG command in the command bar and execute it and then you can check line by line.