A report that runs once a day as a job and completely clears a database table with temporary records can be written in just a few lines of ABAP. A “DELETE FROM”-statement does the actual work. With that, the core functionality is already implemented.
It gets interesting when you question the testability of such a report. This is only possible using real data in the database table to be cleared. This means that for testing, you first have to set up the appropriate data constellation. After the successful execution of a test, the test data is unfortunately gone, which the test is supposed to prove.
To solve this, you need unit tests and the ABAP SQL Test Double Framework. As soon as you implement both, the small report turns into a significantly larger report thanks to local classes including at least one test class. In return, you get testability, which is definitely worth it.
