When you want to execute a standard program and run it in the background typically SAP will name the job with the same identification as the program name.
To compensate for this behaviour you can implement a badi [JOB_NAME_SELF] . Import parameters will include program name and export parameters will contain jobname.
To make the process more flexible you can enhance the functionality by prompting the user to populate the actual program name, here’s how you can accomplish that:
CALL FUNCTION ‘POPUP_TO_GET_VALUE’ EXPORTING FIELDNAME = 'JOBNAME' TABNAME = 'RSJOBINFO' TITEL = 'Enter the job name' VALUEIN = program IMPORTING VALUEOUT = jobname EXCEPTIONS FIELDNAME_NOT_FOUND = 1 OTHERS = 2.