Debugging is necessary when we have program lines node in our Smartforms and the code in the program lines node is not working as per our expectation. Currently, we don’t have the Breakpoint button as what we have in the ABAP code Editor in the Workbench. So, what are the options to put a break point in Smartforms:
1. 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. This is good option when we are developing the Smartforms. But we all, as per the Human nature, forgot to remove those BREAK-POINTs from the program lines and Users would have to face the debugger at each and every break-point and would start shouting..!! This is what we all don’t want. So, this option is not good.
2. Breakpoint using BREAK user-name: We can put the break point using the statment user name addition to the break command, for example BREAK NAIMESH. These break points would not stop any other users who would run this Smartform. Still it has some disadvantages: Everytime the developer who has put the break point will stop i n the Debugger. It is fine, if we have only one or two, but we have many than it would be a problem. So, this makes the option less powerful.
3. 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 dispaly 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”
Press Enter
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.
It seems to be the lengthy steps, but they are effective.
since two days iam looking fr this one.atlast i got it. thank u
Very good notes…Thank you very much
Very informative…Thank you
I was setting the breakpoints using the “Program Lines” object. This is a clever alternative. And a quicker one at it. Thanks.
Very Good Tip.
Thanks.
You can also put break point like that:
attach code to smartform:
data: debug type xfeld value 'x'.
while debug is not initial.
endwhile.
Run Smartfrom and go to transaction SM50. You can see infinite loop. Select this line and select Program -> Program -> trace to run debugger.
Hello Marcin Gajewski,
Thanks to add one more tip to debug the smartform. But, I would not recommend this method as it goes into the infinite loop.
Regards,
Naimesh Patel
very valuable and informative information. thank a lot