Beruflich Dokumente
Kultur Dokumente
If changes are made to the code, then there is no guarantee that previous assumptions are satisfied. SAP ABAP
checkpoints can be used to make sure that program correctness is maintained. Under checkpoints, we consider
Assertions can be used to improve the quality of software. BREAK-POINT and LOG-POINT are used to
investigate program behaviour in case of problems. They help in understanding and maintain the code.
Checkpoint Group
The activation state of all checkpoints which can be activated is controlled by the checkpoint group.
Assertion
let us consider a scenario where money is transferred from one account to another. Here, sum of both
balances must be equal before and after transfer. With the help of assertion we can check this condition. It is
ASSERT logexpr.
During program execution if expression fails, execution can be stopped. Program execution can be stopped by
raising ASSERTION_FAILED.
the group.
Write simple code and execute in SE38.
REPORT zcheeck_pt.
INITIALIZATION.
START-OF-SELECTION .
lv1 = 'X'.
lv2 = 'Y'.
BREAK-POINT ID zcheck_pt.
Then go to transaction SAAB, select radio button Abort in Assertions frame and activate checkpoint group.
Again run the program. You will get dump describing the position where assertion is violated.
When you select Log option the occurrence of assertion will be logged. Run the Program again.
You can see the log details with Variable values, which would be useful in cases like where we can’t replicate
the scenarios in Quality or development box – To chase the mysterious missing values.
When you select Break option you will get following option.
In normal case program is interruption and debugger is started and in case of background processing it will
Same way BREAK-POINT and LOG-POINT can be activated by selecting Break and Log.
BREAK-POINT:
BREAK-POINT ID <Checkpoingroup>
Active break point behaves same as always active break point. In case of background processing activatable
break points are simply ignored. Run the Program, you can see the program stop by at line 30.
LOG-POINTS:
Log Point can be made active by writing following code in your program.
LOG-POINT ID <Checkpoingroup>
Logs can be used to identify or analyse the system behaviour. Variable values can be logged so that program
Run the program and go to transaction SAAB. Go to tab ‘LOG’. You will see following details which will help
Above statement log the value of field ‘log’. We can log up to 32 fields.
You can use SUBKEY addition to prevent production of huge amount of data in log. All log occurrences will
produce one record for same SUBKEY. Only last occurrence can be seen but counter will be incremented.
Personal Activation – Checkpoint group will be active for current user only.
User Level activation – Checkpoint group will be active for all defined users.
Server level Activation. – Same way we can define servers for which it will be active.