Programming notes 

The following program development notes can make the creation of test procedures easier.

Transaction batch-input-compatibility

CATT can only currently model transactions which are not batch-input-compatible, with restrictions, so you should program transactions batch-input-compatible as far as possible.

From Release 4.0 CATT can continue a transaction after a COMMIT WORK with the ‘no COMMIT WORK end’ mode. In other modes COMMIT WORK cancels the transaction for batch input and CATT. If an extra COMMIT WORK is necessary before the logical end of transaction, the function module DB_COMMIT can be used (see function module DB_COMMIT documentation). This does not apply to a COMMIT WORK at the end of the transaction.

In many cases the transaction which has just ended is called again with LEAVE TO TRANSACTION, as a simple means of returning to the initial screen and ensuring that all work fields are cleared. To end the transaction for CATT, it is sufficient to enter the command COMMIT WORK immediately before the LEAVE TO TRANSACTION.

Transactions with different screen sequences in online and batch input modes

CATT call in session ‘with COMMIT WORK termination’:

CATT uses the same interface as the batch input procedure to execute transactions. To ensure that the online version is tested when the screen sequence differs in online and batch input, the application transaction must contain the following MEMORY read call where SY-BINPT = "X" indicates batch input:

DATA: CATTACTIVE (1) TYPE C.

IMPORT CATTACTIVE FROM MEMORY ID 'CATT'.

IF SY_SUBRC = 0 AND CATTACTIVE = 'X'.

This causes the online alternative to be executed in test runs.

CATT call in ‘without COMMIT WORK termination’ mode:

Both the system field SY-BINPT and the memory flag CATTACTIVE have their initial values. The system flag CATTNEU in the Memory ID 'CATTNEU' is set to ‘X’ to indicate that the transaction is running in a CATT procedure. The system flag CATTNEU is in the memory ID 'CATTNEU':

DATA: CATTNEW (1) TYPE C.

IMPORT CATTNEW FROM MEMORY ID 'CATTNEU'.