JDBG - Job Debug
This is basically for the job has finished execution. This will simulate the exact background scenario with the same selection screen values as used in the job and sy-batch set to 'X'.
1:Use SM37 to get list of jobs, put the cursor on the job, type JDBG in the command line ( without '/' ), and press ENTER
You are in debug mode now.
2:Step through SAP program (press F7 couple of times) until you get to code you need.