Showing posts with label testing. Show all posts
Showing posts with label testing. Show all posts

Monday, October 31, 2016

ABAP: usage of ASSERTions, LOG-POINTs and BREAK-POINTs

Assertion in software development is technique used to detect and track a state in program which should not occur. In computer programming it is so called programming predicate that developer assumes that is always true. The predicate is Boolean valued function which returns a true–false expression.

Information about the predicate can be placed into comment of the program code. However it can be also directly included in the code. While the code is compiled or the compiled program runs there are checks for these predicates. These do not serve as treatment of unexpected or err nous states like user input checks. Instead it is about the detection of the status which is not supposed to happen.

Assertion or so called checkpoints define points in a program, at which the state of the program can be tested during program execution. Checkpoints are either conditional or unconditional. Conditional checkpoints are defined by ASSERT, unconditional checkpoints by BREAK-POINT or LOG-POINT. Needless to say that the checkpoint of all types are non-operational statement used just for test purposes.

Activation/deactivation of checkpoints outside of the program can be done by assigning them to a checkpoint group in t-code SAAB.

How the checkpoints or assertion is supported in ABAP programming language? There are a couple of ABAP statements for this purpose.

ASSERT statement - it is a checkpoint. It is used to verify specific assumptions about the status of a program at a specific point. The ASSERT statement is instantly recognizable for example when analysing ABAP dump.

LOG-POINT statement - is a checkpoint which creates a log entry when an active logpoint is reached. The logpoint must be assigned to a checkpoint group. The statement LOG-POINT was introduces to replace wrong usage of the ASSERT with a condition that is always wrong for simply writing log entries.

BREAK-POINT statement - is placed in the ABAP program. When it is reached in foreground/dialog processing it branches to the ABAP Debugger. If the breakpoint is set by user in ABAP editor it has limited validity - until user logs off. In case the breakpoint is hard-coded with the statement BREAK-POINT it is considered as unconditional checkpoint with an unlimited validity which is either always active or activated by assigning it to a checkpoint group.

More information:


See example of LOG-POINT statement usage: github.com/softy12/ABAP-LOGPOINT
Below see a simple log entry created by LOG-POINT statement.

Wednesday, December 16, 2015

ABAP web reporting URL parameters

Sometime back I wrote post about parameters of web reporting’s URL. That post was related to different parameters that we can employ into URL of web reporting based on JAVA or ABAP stack. In this post I want to list more parameter of ABAP based web reporting.
Recently I had to do stress tests of BW system. Most of my test cases involved web reporting. I need to quickly run multiple reports with deferent selection screen’s values. So I prepared simple HTML page where I put URL pointing to ABAP stack of the BW system. Each URL carried different parameter for BW report. Here are some of URL parameters I leveraged in my HTML page.

Parameters to address single value type of variable:
QUERY – mandatory parameter which tells the system which query to run
VAR_NAME_X – technical name of variable which is present on selection screen, where X is number to identity the variable
VAR_VALUE_EXT_X – value of variable on selection screen

Example of URL:
http://mybw.mydomain.com:8000/SAP/BW/BEX?&QUERY=Z_BW_QUERY&VAR_NAME_1=ZVAR1&VAR_VALUE_EXT_1=01.2014&VAR_NAME_2=ZVAR2&VAR_VALUE_EXT_2=01.2015

Parameters to address interval type of variable:
QUERY – see above
VAR_NAME_X - Technical name of the variable on report’s selection
VAR_VALUE_LOW_EXT_ X – "From" value for interval variable
VAR_VALUE_HIGH_EXT_X – "To" value for interval variable

Parameters to address select option type of variable:
QUERY – see above
VAR_NAME_X - see above
VAR_OPERATOR_X – Operator, following values are possible:
'EQ' = Individual value
'BT' = Interval
'LT' = Less than
'LE' = Less than or equal to
'GT' = Greater than
'GE' = Greater than or equal to
VAR_VALUE_LOW_EXT_ X - "From" value for select option variable
VAR_VALUE_HIGH_EXT_ X - "To" value for select option variable
VAR_SIGN_ X – in case it equals to 'I' values are included into the report’s output, in case 'E' found values are removed

Lastly I want to mention that as per my tests these parameters are valid for web reporting based on ABAP Stack of SAP BW.

More information: