Sunday, August 24, 2014

ABAP TIP : check if background job is ended or not

  DATA: L_JOBNAME TYPE BTCJOB.

  CONCATENATE 'job_name' INTO L_JOBNAME.

  SELECT COUNT(*)
    FROM TBTCO
   WHERE JOBNAME = L_JOBNAME
     AND STATUS  = 'R'.

  IF SY-DBCNT > 1.
    MESSAGE S001 WITH 'Batch Job is still executing.'.
  ENDIF.

No comments:

Post a Comment