Good afternoon, dear habrozhiteli!
As an ABAP developer, I want to contribute to improving the quality of custom SAP programs. To this end, I want to publish a cycle of translations of articles about interesting and most importantly useful and not very common techniques from the SAP knowledge base ( SAP community network ). Key concepts are hard enough to translate into Russian, various interpretations create confusion, therefore I cite them in English.From the Author:
Strange article title? I link the transaction SAAB and the third letter of the Latin alphabet (Charlie = C). In particular, the article will deal with Logpoints. The ABAP Logpoints are available from version NW2004s.
Since the introduction of this technology in 2005, the topic has been discussed several times on SCN, for example:
Despite all the advantages of using the checkpoint group, the technology is still not widely used in custom ABAP developments. One of the possible reasons is that developers lack the practice of using and realizing the benefits of technology. This article focuses on one of the possible logpoints application scenarios. Also consider a step by step example of using logpoints. Separately, I note that this is not a complete guide to the use of checkpoint group. For a full study of the topic I recommend to contact
help.sap.com . The ABAP program example also does not pretend to be a standard, this code is invented to study a specific example.
')
1. Usage scenario
Quite often, one encounters a recurring problem again and again. For example, an error occurs in a productive system that cannot be reproduced in either the test or the development system. Functional consultant nods at the developer, in turn, the developer is confident that the problem is with the configuration of the system (ie consultant). The developer compares the code in all systems and does not find any discrepancies. In the test, everything works correctly and the developer again refers to the consultant. The consultant, in turn, checks the configurations, and also does not find differences and considers that there is an error in the ABAP code. The circle is closed. The end user is very worried that his problem is still not resolved and requires urgent fix. The developer decides to consider the problem more deeply. After studying the application log, it can localize the location of the problem, but the reason for its appearance is still not clear. It would be very useful to find out what data the program operates with in order to compare it with another system, but debugging in production, for many reasons, turns out to be impossible.
2. Example
Below is an elementary example that allows you to understand how easy it is to use logpoints. The following describes how to declare the input and output parameters of an arbitrary method for logging (input to the Log). I recommend, for important methods, to state logging of incoming and outgoing parameters. Developers, in turn, may declare arbitrary variables for logging.
2.1 Program
Following the general idea of the article, a class was created with the BORDER_CONTROL method. The method declared input and output parameters (tables). The structure of the tables contains the fields name, description, nationality, date, and an arbitrary flag.


For testing, below is a program calling the table processing method:

2.2 Configuring Checkpoint Group
To be able to maintain Logpoint, you must create and activate a Checkpoint Group.

For the Logpoints parameter, let's change the state to Log

It is also possible to define a specific user for the log. The option is available after pressing the User button.

Click

and enter your username.

Save the checkpoint group. When saving, a dialog will be offered, where it is necessary to determine the period of activity of the group. The urgent recommendation is to activate the Log immediately before and deactivate immediately after the program has been processed. This recommendation occurs because Tables in which Log records are stored are not automatically serviced and can accumulate large amounts of data.

After activating the group, run the test program. After processing, a log will be created (tr. SAAP-> Checkpoint group-> Log tab)

Expanding the tree with log records it is possible to view the variables / tables specified for storage (FIELDS parameter for the LOG-POINT operator, see method code). In this example, the incoming and outgoing table of the BORDER_CONTROL method is set as parameters.

We can see the entries of the incoming table:

The outgoing table contains processed records with a flag:

Using this information, the developer can obtain an array of data with which to localize and find a possible problem, or reproduce the situation in another system for further debugging. The time spent on complementing your Logpoint code is minimal and the author is hopeful that the number of checkpoint groups used in custom development will increase.
In this article, the author described one of the examples illustrating the benefits of using Logpoints. There are many other possible uses not described in this example.
If you are already using checkpoint groups, please write your experience using the comments.
Information about Checkpoint Charlie (Checkpoint Charlie) can be found on the
link .
The original article can be found at the link .