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 subroutine called in sapscript

Former Member
0 Likes
2,169

Hi,

I there any way how to debug subroutine called in sapscript by "perform form in program ZXYZ"? Setting (only session) breakpoint in that subroutine doesn't work....

Thanks for any reply.

Regards Jiri

5 REPLIES 5
Read only

Former Member
0 Likes
1,232

First screen of teransaction SE71 there is a menu option to enable debugging. Try that and see if it works.

Read only

SimoneMilesi
Active Contributor
0 Likes
1,232

The not so clean solution is to put


DATA: x_out.
DO.
   IF x_out IS NOT INITIAL.
     EXIT.
   ENDIF.
ENDDO.

At the start of your subroutine.

When you execute the print, go to SM50 and you'll see your subroutine running.

Select the row and then "Program/session -> Program -> Debug".

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
1,232

Place a break point in your subroutine, now activate the sap script debugger.

Press F5 and continue debugging in sap script once it reaches the statement where the routine is called it will take you to the code.

Read only

Former Member
0 Likes
1,232

Hi,

How are you triggering the print program? Are you generating an immediate print or doing a print preview? An immediate print may be triggering a separate update call, hence breakpoint not triggered - either that or your ABAP code isn;t even being triggered.

If you're triggering an immediate print to a printer, I'd advise changing that to a print in scheduled job then running RSNAST00 in SE38 (if you're triggering from an output type).

Running RSNAST00, for your particular output, in SE38 should then cause your breakpoint to trigger, provided that code is being executed.

If you're running a print directly or a print preview then try one of the earlier suggestions in this post.

Regards, Andy

Read only

Clemenss
Active Contributor
0 Likes
1,232

Hi Yuri55,

if the session breakpoint does not work although you start from the logon menu, then the form is not called properly, probably due to incorrect parameter transfer.

Anyway, switch on sapscript debugger from se71, set breakpoint on PERFORM or step through to perform. At perform statement, enter /h and see where you get and what happens.

Regards,

Clemens