Show TOC

Conditions for WatchpointsLocate this document in the navigation structure

Context

You can specify additional conditions for watchpoints. The Debugger will then only stop if the value of the watchpoint variable changes AND the condition is fulfilled.

Syntax

A condition must have the following syntax:

<Function(Variable) or Variable or Literal> Operator <Function(Variable) or Variable or Literal>

The following functions are available when using watchpoint conditions:

For internal tables:
  • LINES( ITAB ) - Number of rows of an internal table ITAB
  • KEY_STATUS( ITAB KEY_NAME ) - Status of a secondary key KEY_NAME of an internal table ITAB
For strings:
  • STRLEN( S ) - Current length of a string S
To identify inexact arithmetic operations :
  • INEXACT_DF( ) - Operation in which a rounding error occurred The function INEXACT_DF( ) returns the value 'X' or ' ', depending on whether the final result of an operation (for example, COMPUTE or MOVE) is inexact (has been rounded) or not.
Examples for Valid Conditions
  • sy-index > 5
  • sy-index = sy-tabix
  • lines( itab ) > 0
  • lines( itab ) <> sy-tabix
  • lines( itab ) < lines( itab2 )
  • strlen( s ) >= sy-index
  • KEY_STATUS( <itab> <key_name> ) = 1
  • INEXACT_DF = 'X'
Special Usage of Functions

The functions KEY_STATUS( <itab> <key_name> ) as well as LINES( <itab> ) are valid Debugger symbols. They can therefore also be used as watchpoint variables. So the Debugger would only stop for a watchpoint at LINES( <itab> ) if the number of rows had not changed but the content of the table <itab> had.

Using KEY_STATUS( <itab> <key_name> ), you can monitor and query the secondary key of an internal table. The return values of this function are 1 (secondary key is out-of-date) or 0 (secondary key is up-to-date).

The (secondary) key (or index) of a table is not necessarily updated immediately for performance reasons; it is updated at the next read or write access to the table. This makes it difficult to determine which operations on the table lead to a given index needing to be refreshed. This is the situation where "KEY_STATUS( <itab> <key_name> )" can be used.