We have a function that sends an email with a program name and message if the program encounters an error. This program can be run in batch mode by a job or in the foreground through SE38 or SE80.
If the program was executed as a step in a job is there a system field that contains the job name so that we can have this information in the email as well?
Example:
Job u2013 SCHEDULED_JOB
Step 1 u2013 Z_ABAP_PROGRAM
When Z_ABAP_PROGRAM is running SY-REPID contains Z_ABAP_PROGRAM.
From within Z_ABAP_PROGRAM is there any way to see job SCHEDULED_JOB
Looking in the dictionary and debugging a runnign job the SYST table does not appear to have this information.