Prerequisites
You can set dynamic logpoints...
- In the active version of an ABAP program.
- For any executable ABAP statement in the program.
Context
In general, you can set dynamic logpoints for each source code line that contains an
executable ABAP statement. When the logpoint is reached during program execution,
the logpoint is evaluated. The logpoint evaluation first checks the condition. If
the condition is fulfilled, a log entry is written according to the specified
logpoint parameters.
Procedure
Setting Logpoints from the Ruler in the ABAP Source Code Editor
-
Position the cursor within the ruler (left bar) in the source editor at the line that contains
the executable ABAP statement of your interest.
-
Open the context menu and choose Add Logpoint
Figure 1:
Setting logpoints from the ruler in the ABAP source code editor
-
In the wizard page that appears, specify the parameters for the logpoint to
be created.
Activity
So that you can use logpoints in
the context of various use cases, the wizard provides you with a set of
predefined activity options. You can select one of the predefined activity
options or apply the logpoint syntax for a user-defined logpoint:
Activity |
Meaning |
Log Variable Values |
You can enter one or multiple ABAP variables, separated
by a SPACE or a comma. All variables define the key of
the logpoint to be created. More on this: Key Definition in Logpoints
Whenever the logpoint is reached during program
execution, the values of these variables will be added
to the log entries as the key.
Note Only variables with elementary data types (for
example: variables that can be used within a
WRITE statement) are valid variables here.
|
Log Call Stacks |
With this option, you can set the logpoint for a program
line where you are interested to know which call units
(methods, functions, forms, or events) are the callers. So,
in particular, you want to know which different call stacks
lead to the program line for which the logpoint is defined.
|
SQL Trace for Current Statement
|
Using this activity option, you can switch on the SQL
trace for an individual SQL statement in order to
analyze performance issues in detail.
To get the call stacks recorded in the SQL trace, in
addition check Include Call Stack.
|
Table Buffer Trace for Current Statement
|
Using this activity, you have the option to switch on the
table buffer trace This option is valid if the selected
code line comprises an Open SQL statement that refers to
a buffered database table.
To get the call stacks recorded in the buffer trace,
check Include Call Stack.
|
User-Defined Logging |
This option allows you to specify the logpoint using the
logpoint syntax for the following
Parameters:
Example:
|
Description
In the Description field, you have the option to
provide a text that describes the meaning or the usage context of the logpoint to be
created.
Tip Writing a description might especially be necessary
if you want to set multiple logpoints in a single program, or even multiple
logpoints for one and the same program line.
Activation
You can specify the following parameters for the activation of the
logpoint:
Parameter |
Meaning |
Status |
Active logpoints trigger log events during program
execution.
Inactive logpoints are ignored during program
execution.
|
Active for User |
You have the option to restrict logpoint activation for a
specific user in your system. Using this restriction you can
ensure that log entries will only be evaluated when the specific
user runs the corresponding program.
Default Value: * (activation for all users)
|
Active on Server
|
You have the option to activate the logpoint
- Globally, for all servers
- For specific server instances in the system
Default Value: All Servers
|
Active Until
|
Point of time when the logpoint will be deactivated automatically
(activation expiry)
Default Value: 24 h
NOTE: In addition to this implicit deactivation, you have
the option to deactivate the logpoint explicitly at any time:
See also: Deactivating Logpoints
|
Delete Logpoint After Deactivation [days]
|
For an active logpoint: number of days after activation
expirywhen the logpoint will be deleted automatically.
For an inactive logpoint: the period starts with the day of the
last logpoint change.
Default Value: 7 days
NOTE: In addition to this implicit deletion, you have the
option to delete the logpoint explicitly: See also: Deleting
Logpoints
|
Max. Log Events for Internal Session
|
To ensure stable system performance, you can limit the maximum
number of evaluations for the particular dynamic logpoint within
the current internal session (roll area). Evaluation then stops
after the maximum number of log events.
Default Value: depends on the activity selected
|
- Confirm your entries with Finish.
Results
You have set a dynamic logpoint that is active for the specified
code line. After the logpoint is created, a dedicated marker is visible in the ruler
of the source editor.
Figure 2:
Marker for the active logpoint(s) is displayed in the ruler of the source editor
In addition, the Logpoints view will be opened
where you can display and manage dynamic logpoints defined for each of your ABAP
projects.
Remember
This logpoint applies whenever you start the corresponding APAP program.