Debugging Smartforms and SAPScript in ABAP

3
752
It is often required to debug the mass printing forms, to check to accuracy or locate/correct the error. Both SAPScript and Smartforms have different ways for debugging.

Lets look at the steps for each debegging options.

1)  DEBUG Smartforms

a) Use T-Code SFTRACE – Using the Smart Form trace, you can trace how a Smart Form was processed during printing. You can then see, for example, the sequence in which the nodes were run or the point at which processing terminated due to an error.

b) Hardcode the BREAK-POINT: We just have to put the BREAK-POINT statement whereever we want to stop the code and look inside in Debugger.

c) Breakpoint using BREAK user-name: We can put the break point using the statment user name addition to the break command, for example BREAK NAVEEN. These break points would not stop any other users who would run this Smartform.

d) Breakpoint on the fly: To put a break point on the fly, we can follow these simple steps to put a breakpoint as required.

Step1: Open your Smartform and Copy the text as which you want to put a break point and press the Test Button. It will bring you the Function Builder.

SAPScript Debugging step 1
SAPScript Debugging step 1

Step 2: Press the display button to open the code of the function.

SAPScript Debugging step 2
SAPScript Debugging step 2

Step 3: Press the Find (control+F) button.

SAPScript Debugging step 3
SAPScript Debugging step 3

Step 4: In the find screen, paste the copied text (control+V) in the Text.
Select the option “In main Program”
Press Enter

SAPScript Debugging step 4
SAPScript Debugging step 4

Step 5: From the hit list, go to the source code by doing doubleclick on the search results. Now, put a Cursor on the line and press the “Set Breakpoint” button.

SAPScript Debugging step 5
SAPScript Debugging step 5

That’s it. So, when you run the application it will stop to this break point.

SAPScript Debugging step 6
SAPScript Debugging step 6

 

2). DEBUG SAPScript

They are two ways to debug the SAPScript.

a). Use Tools – > Word Processing – > Layout Set (SE71). Enter name of layout set and then Utilities – > Activate Debugger.

Activate SAPScript Debugger
Activate SAPScript Debugger

It is of no consequence which layoutset you enter when selecting the SAPscript debugger. (Menu path: Tools – > Wordprocessing – > Forms, Utilities – > Activate Debugger) The next layoutset called will invoke the debugger.

b). Another way to set the SAPScript debugger is to run program RSTXDBUG.

When you debug Print program it is same as you debug any other ABAP program. While when you debug SAPScript, you actually debug the code ( scripting) you have written SAPScript Form.

 

 

3 COMMENTS

LEAVE A REPLY

Please enter your comment!
Please enter your name here