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.
Step 2: Press the display button to open the code of the function.
Step 3: Press the Find (control+F) button.
Step 4: In the find screen, paste the copied text (control+V) in the Text.
Select the option “In main Program”
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.
That’s it. So, when you run the application it will stop to this break point.
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.
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.