How to debug a smartform ?
The Form debugging has some challenges , like – the form has no versions,there is no message display when exceptions occur and ABAPcode is usually embedded in the specific,program line node.The following steps for debugging a smartform may be helpful:-
Since , whenever a form is activated a Function Module is generated, we can go directly to the FM and insert break-points; as,
- In the Top Include, we have all the Global Data and Types that has been declared in the Global Definitions Tab.
All the performs (ABAP Form routines) are included in the *F01 Include
- All the data and code that has been declared in the ‘Initialization Tab’ can also found in the
FORM %GLOBAL_INIT, within the Include *F01
- Following Form routines available in the *F01 Include are highly useful in debugging.These are always called, whenever a Node( like main window) is processed:-
- FORM %WRITE_TEXT
For each Window/Node that has been created within the form an equivalent Form(ABAP Form Routine) is created in the *F01 Include:-
Like for e.g. for the Node ‘Main’ Window,following Include is created:
The Form Raise, as specified above, is particularly useful whenever, we see that there is no print-preview appearing , when executing the driver program.This means that exception has occured and that can only be traced, if we set a breakpoint in the FORM routine ‘Raise’.