To delete a background job explicitly, use:
You can select jobs according to all of the criteria available in the interactive background processing management system:
A job cannot delete itself. Also, a job that is currently running cannot be deleted. However, you can have it deleted automatically if it is completed successfully. See the DELANFREP parameter of JOB_OPEN.
Sample Program: Deleting a Background Job
* Data declarations: BP_JOB_SELECT
*
DATA JSELECT LIKE BTCSELECT.
DATA SEL_JOBLIST LIKE TBTCJOB OCCURS 100 WITH HEADER LINE.
* Sample selection criteria
*
JSELECT-JOBNAME = 'Name of job'.
JSELECT-USERNAME = SY-UNAME.
CALL FUNCTION 'BP_JOB_SELECT'
EXPORTING
JOBSELECT_DIALOG = BTC_NO
JOBSEL_PARAM_IN = JSELECT
IMPORTING
JOBSEL_PARAM_OUT = JSELECT
TABLES
JOBSELECT_JOBLIST = SEL_JOBLIST
EXCEPTIONS NO_JOBS_FOUND = 1
SELECTION_CANCELED = 2
OTHERS = 99.
*
* In this example, the program loops over the internal table
* SEL_JOBLIST and deletes each of the jobs that was selected.
*
* Alternative: Have the user select the job to be deleted
* with BP_JOBLIST_PROCESSOR. For an example, please see
*