CL_APL_ECATT_LOG - eCatt Log

CL_GUI_FRONTEND_SERVICES - Frontend Services   SUBST_MERGE_LIST - merge external lists to one complete list with #if... logic for R3up  
This documentation is copyright by SAP AG.

Functionality

The methods in class CL_APL_ECATT_LOG provide the following functions:

1. Writing of log entries by the interpreter

2. Reading of log entries for the log output

3. Deletion of log entries

4. Management of log entries

Currently the first two functions are implemented as follows:

(partly):

1. Writing of log entries

1.1 After opening the class the method INIT_NEW_LOG is called with the parameter IM_LOG_KEY = 0.
In this parameter the next free log ID is assigned using the private method GET_NEXT_LOG_KEY. The headerrecord is defined in table ECLOG_HEAD in the database. In the log object the next log object is initialized for the block for writing the subsequent procedures to level 1.

1.2 Test case data (at level 1) and for each script line (from level 2 on ) are transferred via method ADD_ENTRY.
The structure parameter LOG_SCR type ETLOG_LINE contains the script data
The table parameter LOG_CNT contains the script extra lines, at present messages.
The table parameter LOG_DAT type ETLOG_DATA_TABTYPE contains values and script subsequent data.
Thescript data and the script subsequent lines are entered in the current block at the highest position.The values and the script subsequent data are transferred to the initialized data objects of class CL_APL_ECATT_LOG_DATA with the method ADD_LOG_DATA.
The interface for TESTCASE and REF are passed to the log object by two additional quasi script functions IMPORT and EXPORT.
The field SCR_EXPAND in parameter LOG_SCR controls whether the next script entry is in the same object or whether, for example, with IF, it is continued in a new block.
The field FUNC in parameter LOG_SCR controls whether (for TESTCASE or REF) a new data block has to be initialized.
If an error occurs in a script line that is passed to the log object via an error code > 0, this willalso be entered as an error back to all upper levels via the export parameter ERRCODE, based on therecursive call of method ADD_ENTRY. This is the case provided that an error has not already been entered from a script line processed earlier.

Therefore at each level only the first error that occurs is entered until the top of the procedure level.The messages associated with the error are also returned as subsequent script lines and entered in the log objects.

1.3 The method CLOSE_BLOCK closes a block from the interpreter, if, for example, all the statementsfrom an IF block have been processed and the subsequent statement. ENDIF and others from the level above this are continued.
As the statements belonging to the block can no longer be changed later, method SAVE_BLOCK_TO_DB isused to save the entire block together with the data of the associated data objects onto the database.The parameter LOG_MOD can be used to modify log data passed in parameter LOG_VDATA and belonging to the superordinate log entry The data is modifed in the entry attached to the block.

This is only possible with the EXPORT following a REF.
At the end of the method the entry for the subsequent script line is initialized and entered by the interpreter with ADD_ENTRY again.

2. Reading from log entries

2.1 After opening the class, the method INIT_NEW_LOG is called with the parameter IM_LOG_KEY = Log-Id (not equal to 0).
The data of the required procedure is imported in the log object.

2.2 Starting from a specific log line, method GET_BLOCK supplies a subordinate block of script lines.For example, the script lines running after IF and before ENDIF following a successful IF condition.
The parameters OBJ_LNR (number of current procedure) and SCR_LNR (current script number) controls whichscript line the subsequent block is requested for. Via (0, 0), the subsequent block is requested forthe activity at level 1 with the procedure data. Via (1,0) the highest level script blockis requested for the first procedure.
The script lines of the block are returned in (table) parameter LOG_SCR type ETLOG_LINE_TABTYPE.

2.3 Method GET_DATA returns the script data and value data of a log line.
The call is controlledvia LOG_SCR and SCR_LNR in the same way as with GET_BLOCK. The script entry itself is also returned in (structure) parameter LOG_SCR.
From a value data entry you can determine if XML data exists.

2.4 Method GET_XML_DATA returns XML data for a value data entry of a log line.
The call is controlled for GET_DATA via LOG_SCR and SCR_LNR. The file number of the XML file is stated in parameter FIL_LNR.

Relationships

obj scr ptr     obj scr ptr     obj scr ptr

+-----------+   +-----------+   +-----------+

| 0 | 0 |-> |-> | 3 | 0 |-> |-> | 3 | 7 |   |<--current entry

+---+---+---+   +---+---+---+   +---+---+---+

               | 2 | 0 |-> |   | 3 | 6 |   |    obj scr ptr

               +---+---+---+   +---+---+---+   +---+---+---+

               | 1 | 0 |-> |   | 3 | 2 |-> |-> | 3 | 5 |   |

               +---+---+---+   +---+---+---+   +---+---+---+

Level 0                       | 3 | 1 |   |   | 3 | 4 |   |

Procedure                     +---+---+---+   +---+---+---+

                Level 1                       | 3 | 3 |   |

                Test cases                   +---+---+---+

                                Level 2  ff

                                Script commands of a test case

Example

Notes

Further information



PERFORM Short Reference   ABAP Short Reference  
This documentation is copyright by SAP AG.


Length: 8079 Date: 20120526 Time: 084310     triton ( 240 ms )