Skip to Content
Author's profile photo Former Member

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,

/wp-content/uploads/2013/03/pic1_198261.png

/wp-content/uploads/2013/03/pic1_198261.png

    /wp-content/uploads/2013/03/pic1_198261.png

  • 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

/wp-content/uploads/2013/03/pic1_198261.png

  • 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

/wp-content/uploads/2013/03/pic1_198261.png

  • 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:-

 

   

 

  1. FORM  %WRITE_TEXT
  2. FORM  %WRITE_TEXT_MODULE

  3. FORM %WRITE_INCLUDE_TEXT

  4. FORM %WRITE_DYNAMIC_TEXT

  5. FORM %RAISE

/wp-content/uploads/2013/03/pic1_198261.png

/wp-content/uploads/2013/03/pic1_198261.png

  

   

/wp-content/uploads/2013/03/pic1_198261.png

/wp-content/uploads/2013/03/pic1_198261.png  

  /wp-content/uploads/2013/03/pic1_198261.png

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:

/wp-content/uploads/2013/03/pic1_198261.png

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’.

Assigned Tags

      4 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Naimesh Patel
      Naimesh Patel

      Hello Nitin Kacker,

      As a matter of fact, all the code to process the SmartForms like processing Table, a node, a cell, a template, everything would be available in *F01 include.

      You should be able to easily find out the node and relevant code point by using the search and selecting the search scope as main program.

      Check out one of my old post on the same subject - Smartforms - Debugging

      Regards,
      Naimesh Patel

      Author's profile photo Former Member
      Former Member
      Blog Post Author

      Hi Naimesh,

      Thanks for your comment !  But, if you observer carefully the post, you will find that I have mentioned the Word 'nodes' and given the e.g. of the main window.So, the word 'node' covers everything like tables,templates etc.

      BR,

      Nitin

      Author's profile photo Naimesh Patel
      Naimesh Patel

      Hello Nitin,

      Agree that you mentioned Nodes. Why I think it is more complicated is because - children nodes are wrapped in their parents and parents are wrapped in their and so on and so forth. This make is very difficult to find out which node belongs to which. Another reason would be - all the node names are not co-relating with the actual names.

      Regards,
      Naimesh Patel

      Author's profile photo Jelena Perfiljeva
      Jelena Perfiljeva

      Nitin, please don't let this to discourage you from sharing, but there was actually an SCN wiki already posted on this back in 2009. There are also many forum posts. You might want to search before posting if there was already any content posted on SCN on the same subject. If you've already searched and feel that your blog adds to the existing content, then it would probably make sense to add a link to it.

      Thank you.