Você está na página 1de 17

Jordi Escoda, March 2014

1 Using SAAB
1.1 Abstract
The use of the transaction SAAB combined with the use of instructions LOG-POINT,
ASSERT and BREAK-POINT offers a very interesting technical tool to trace and test
program execution.

This document presents how to use it.

1.2 Creation of a Checkpoint group


The first thing we have to do is to create a Checkpoint group.

To do so, execute transaction SAAB.

Enter a checkpoint group name, in our example, we call it ZTEST_SAAB.

Enter a transport order (for testing we can use it as Local Object).

http://www.goodatsap.com
Now the object is ready to be used in combination with the instructions LOG-POINT,
ASSERT or BREAK-POINT.

1.3 Using SAAB in combination with LOG-POINT


Code:

DATA: l_land1 TYPE land1.


DATA: l_land2 TYPE land1.
DATA: lt_countries TYPE STANDARD TABLE OF land1.

l_land1 = 'GB'.
APPEND l_land1 TO lt_countries.
l_land2 = 'FR'.
APPEND l_land1 TO lt_countries.

LOG-POINT ID ztest_saab SUBKEY 'Countries' FIELDS l_land1 l_land2 lt_countries.

When the sentence LOG-POINT is executed, has no effect unless the logpoint is
active. In case the logpoint is active, then the system saves the fields in the log.

http://www.goodatsap.com
SAAB for ZTEST_SAAB, change Logpoint from inactive to log and Save.

We can choose for how long we are going to have it activated:

The activation takes place only for the current user.

Now we execute the code once. After that, go to SAAB, tab Log:

http://www.goodatsap.com
Note that the Subkey ‘Countries’ we specified in the ABAP code is appearing.
Several subkeys can be used. This allows having a hierarchical view in the log.

And we see the values of the variables specified in fields clause, including the
internal table

At every program execution, a new log entry is generated whenever the Logpoint is
active and the fields value change. In case field value does not change between
executions, the counter is increased.

http://www.goodatsap.com
The Log tab looks like:

We can empty the log by using the waste button or by using the context menu.

1.3.1 Limits
Regardless of the data type, every field stored in the log is stored in a container
limited to 976 bytes. Structures and internal tables are streamed into this
container. The container can be found in the transparent table SRTM_DATAX.

If a variable is larger than the container limit, the system truncates it and shows a
“Value truncated” in the attributes field:

1.4 Using SAAB in combination with ASSERT


Code:

DATA: l_land1 TYPE land1.


DATA: l_land2 TYPE land1.
DATA: lt_countries TYPE STANDARD TABLE OF land1.

l_land1 = 'GB'.
APPEND l_land1 TO lt_countries.
l_land2 = 'FR'.
APPEND l_land1 TO lt_countries.

ASSERT ID ztest_saab SUBKEY 'Countries' FIELDS lt_countries


CONDITION l_land1 <> l_land1.

When the sentence ASSERT is executed, has no effect unless the Assertion is
active. In case the Assertion is active, then the system reacts according to the
choice of the activation.

http://www.goodatsap.com
1.4.1 Assert activation with Break
SAAB for ZTEST_SAAB, change Assertions from inactive to Break.

The system asks what to do in case of Background processing. This is not the case,
since we will run online, but we have to choose.

Save…

http://www.goodatsap.com
The activation takes place only for the current user.

Now we execute the code. The debugger opens with the program stopped in the
assert:

1.4.2 Assert activation with Log


SAAB for ZTEST_SAAB, change Assertions from inactive to Log and Save.

http://www.goodatsap.com
The activation takes place only for the current user.

Now we execute the code once. After that, go to SAAB, tab Log:

http://www.goodatsap.com
1.4.3 Assert activation with Abort
SAAB for ZTEST_SAAB, change Assertions from inactive to Abort and Save.

The activation takes place only for the current user.

http://www.goodatsap.com
Now we execute the code. The system shows a Dump

1.5 Using SAAB in combination with BREAK-POINT


Code:

DATA: l_land1 TYPE land1.


DATA: l_land2 TYPE land1.
DATA: lt_countries TYPE STANDARD TABLE OF land1.

l_land1 = 'GB'.
APPEND l_land1 TO lt_countries.
l_land2 = 'FR'.
APPEND l_land1 TO lt_countries.

BREAK-POINT ID ztest_saab.

When the sentence BREAK-POINT is executed, it has no effect unless the break
point is active. In case the break point is active, then the system opens the
debugger with the program stopped in the break point.

SAAB for ZTEST_SAAB, change Logpoint from inactive to log and Save.

http://www.goodatsap.com
The activation takes place only for the current user.

Now we execute the code. The debugger opens with the program stopped in the
break-point:

1.6 Where used


We can know where is used a checkpoint group:

http://www.goodatsap.com
1.7 Who has activated a Checkpoint group
We can know which user(s) has activated a Checkpoint group

http://www.goodatsap.com
1.8 Specify activation for a specific user

http://www.goodatsap.com
1.9 Specify global activation
Use this option with caution, since all users will be affected!

To deactivate, press the waste button.

http://www.goodatsap.com
1.10 Activation by server
Use this option with caution, since all users will be affected!

1.10.1 Specific server


The activation will affect only to the chosen application server

Choose an application server and the activation.

http://www.goodatsap.com
To deactivate:

1.10.2 All servers


The activation will affect to all servers

To deactivate:

http://www.goodatsap.com
Disclaimer and Liability Notice

GoodAtSAP will not be held liable for any responsibility in using the information or
code published in this document. Anyone using this information is assuming that it
is at his/her own risk.

License CC BY-NC-ND 4.0

You are free to share copy and redistribute the material in any medium, under the
following terms:

Attribution — You must give appropriate credit, provide a link to the license, and
indicate if changes were made. You may do so in any reasonable manner, but not
in any way that suggests the licensor endorses you or your use.

Non Commercial — You may not use the material for commercial purposes.

No Derivatives — If you remix, transform, or build upon the material, you may not
distribute the modified material.

http://www.goodatsap.com

Você também pode gostar