Wednesday, May 20, 2009

How to Debug a Sap Script ?

They are two ways to debug the SAP Script.
1. Use Tools - Word Processing - Layout Set (SE71). Enter name of layout set and then Utilities - Activate Debugger. It is of no consequence which layout set you enter when selecting the SAP script debugger. (Menu path: Tools-Word processing - Forms, Utilities - Activate Debugger) The next layout set called will invoke the debugger.
2. Another way to set the SAP Script 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 SAP Script, you actually debug the code ( scripting) you have written SAP Script Form.In transaction SMARTFORMS look up the name of the generated function module for your smart form. Copy the name and go to transaction SE37. Get into the source code of the function module; via menu Go to -> Main Program and then find your piece of code by SEARCH 'VBELN1 = GS_HD_REF-ORDER_NUMB'. Put a breakpoint there and print your smart form. It will stop at the breakpoint.Script: In SE71 give your form name and in Utilities-->Active debugger.Then put a break point in your print program where ever you want to stop it.After that you need to go to your transaction like VF03/../..Etc for Invoice you need to execute it by giving Output type. Then it will debug step by step .

No comments: