Code: Alles auswählen.
CALL FUNCTION 'JOB_OPEN'
EXPORTING
* DELANFREP = ' '
* JOBGROUP = ' '
jobname = lv_jobname
* SDLSTRTDT = NO_DATE
* SDLSTRTTM = NO_TIME
* JOBCLASS =
IMPORTING
jobcount = lv_jobnumber
* CHANGING
* RET =
EXCEPTIONS
cant_create_job = 1
invalid_job_data = 2
jobname_missing = 3
OTHERS = 4.
IF sy-subrc EQ 0.
* ein bis n SUBMIT für die Job-Steps
SUBMIT rsparam
WITH alsousub = space
USER sy-uname
VIA JOB lv_jobname
NUMBER lv_jobnumber
TO SAP-SPOOL.
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
* AT_OPMODE = ' '
* AT_OPMODE_PERIODIC = ' '
* CALENDAR_ID = ' '
* EVENT_ID = ' '
* EVENT_PARAM = ' '
* EVENT_PERIODIC = ' '
jobcount = lv_jobnumber
jobname = lv_jobname
* LASTSTRTDT = NO_DATE
* LASTSTRTTM = NO_TIME
* PRDDAYS = 0
* PRDHOURS = 0
* PRDMINS = 0
* PRDMONTHS = 0
* PRDWEEKS = 0
* PREDJOB_CHECKSTAT = ' '
* PRED_JOBCOUNT = ' '
* PRED_JOBNAME = ' '
* SDLSTRTDT = NO_DATE
* SDLSTRTTM = NO_TIME
* STARTDATE_RESTRICTION = BTC_PROCESS_ALWAYS
* STRTIMMED = ' '
* TARGETSYSTEM = ' '
* START_ON_WORKDAY_NOT_BEFORE = SY-DATUM
* START_ON_WORKDAY_NR = 0
* WORKDAY_COUNT_DIRECTION = 0
* RECIPIENT_OBJ =
* TARGETSERVER = ' '
* DONT_RELEASE = ' '
* TARGETGROUP = ' '
* DIRECT_START =
* IMPORTING
* JOB_WAS_RELEASED =
* CHANGING
* RET =
EXCEPTIONS
cant_start_immediate = 1
invalid_startdate = 2
jobname_missing = 3
job_close_failed = 4
job_nosteps = 5
job_notex = 6
lock_failed = 7
invalid_target = 8
OTHERS = 9.
IF sy-subrc EQ 0.
CALL FUNCTION 'JOB_SUBMIT'
EXPORTING
* ARCPARAMS =
authcknam = sy-uname
* COMMANDNAME = ' '
* OPERATINGSYSTEM = ' '
* EXTPGM_NAME = ' '
* EXTPGM_PARAM = ' '
* EXTPGM_SET_TRACE_ON = ' '
* EXTPGM_STDERR_IN_JOBLOG = 'X'
* EXTPGM_STDOUT_IN_JOBLOG = 'X'
* EXTPGM_SYSTEM = ' '
* EXTPGM_RFCDEST = ' '
* EXTPGM_WAIT_FOR_TERMINATION = 'X'
jobcount = lv_jobnumber
jobname = lv_jobname
* LANGUAGE = SY-LANGU
* PRIPARAMS = ' '
* REPORT = ' '
* VARIANT = ' '
* IMPORTING
* STEP_NUMBER =
* EXCEPTIONS
* BAD_PRIPARAMS = 1
* BAD_XPGFLAGS = 2
* INVALID_JOBDATA = 3
* JOBNAME_MISSING = 4
* JOB_NOTEX = 5
* JOB_SUBMIT_FAILED = 6
* LOCK_FAILED = 7
* PROGRAM_MISSING = 8
* PROG_ABAP_AND_EXTPG_SET = 9
* OTHERS = 10
.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ELSE.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDIF.
Code: Alles auswählen.
call method cl_umg_list_batchjobs=>find_job
exporting
im_jobname = rdd_jobname
importing
ex_found = lv_found.