I have a program that outputs some logs to the spool log via WRITE statements. When I run the program in foreground those WRITEs are plainly visible on the screen but if I run the program with the same parameters in background (via F9 from the selection screen) or plan it in a background job, SM37 indicates that no output list is available for the job in the spool.
If I check table TBTCP ("Background Job Step Overview") I find that the LISTIDENT field is empty for my job. However, an output list was sent to the spool as I can find it in transaction SP01 (table TSP01).
Further investigation shows that this only occurs when I process a ROLLBACK WORK statement in my program.