SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

Creating Activatable Breakpoints and Assertions



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Debugging
View previous topic :: View next topic  
Author Message
admin
Администратор
Администратор



Joined: 01 Sep 2007
Posts: 1636

PostPosted: Sun Nov 25, 2007 10:57 pm    Post subject: Creating Activatable Breakpoints and Assertions Reply with quote

Creating Activatable Breakpoints and Assertions

You can now create (de)activable breakpoints in your programs. You can release these breakpoints in production and a customer will have the opportunity to activate and debug your code more easily.
The following is an activable break-point : BREAK-POINT ID dany.

The checkpoint group is defined by double clicking on the checkpoint group in the editor OR directly via transaction SAAB.

Below is the SAAB screen. In the breakpoints part of the screen, you can set it to "inactive" or "break". All breakpoint groups will be shipped inactive by default.



Assert:

An assertion is a condition which must be true during program execution. By using asserts in your program, you can find cause of error in shorter time. The reaction when violating an assertion depend on a customizing and could be :
Start the debugger from this assert
Do nothing, ignore the assert
Log the assertion in a log
Terminate the program with runtime error ASSERTION_FAILED

The assertions are defined in SAAB (exactly like the breakpoints, see screen above).Here is an example of a use for an assertion :

Code:
METHOD sort_by_name.
 
DATA: l_f1 TYPE i VALUE 2,
      l_f2 TYPE c LENGTH 10 VALUE 'test',
      l_t1 TYPE TABLE OF sflight.
 
   the_sorting_algorithm.
 
   ASSERT ID        dany
          SUBKEY    'danysub1'
          FIELDS    l_f1 l_f2 l_t1
          CONDITION itab->is_sorted_by_name( ) <> ' '.               
ENDMETHOD.


This will ensure that the table is sorted. Below is the result of the log for this assert

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Debugging All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG.
SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG.
Every effort is made to ensure content integrity. Use information on this site at your own risk.