submit 后台运行代码
Posted 倩倩很happy
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了submit 后台运行代码相关的知识,希望对你有一定的参考价值。
if EX_TABLE-matnr is not initial and EX_TABLE-KUNDE is not initial.
wa_rspar-selname = ‘MATNR‘.
wa_rspar-kind = ‘S‘.
wa_rspar-sign = ‘I‘.
wa_rspar-option = ‘EQ‘.
wa_rspar-low = EX_TABLE-matnr.
APPEND wa_rspar TO rspar.
clear wa_rspar.
wa_rspar-selname = ‘KUNNR‘.
wa_rspar-kind = ‘S‘.
wa_rspar-sign = ‘I‘.
wa_rspar-option = ‘EQ‘.
wa_rspar-low = EX_TABLE-KUNDE.
APPEND wa_rspar TO rspar.
clear wa_rspar.
wa_rspar-selname = ‘ERDAT‘.
wa_rspar-kind = ‘S‘.
wa_rspar-sign = ‘I‘.
wa_rspar-option = ‘EQ‘.
wa_rspar-low = ‘‘.
APPEND wa_rspar TO rspar.
clear wa_rspar.
CALL FUNCTION ‘JOB_OPEN‘
EXPORTING
jobname = name
IMPORTING
jobcount = number
EXCEPTIONS
cant_create_job = 1
invalid_job_data = 2
jobname_missing = 3
OTHERS = 4.
IF sy-subrc = 0.
EXPORT ITAB TO MEMORY ID ‘itab‘.
SUBMIT ZSDR0011 TO SAP-SPOOL
SPOOL PARAMETERS print_parameters
WITHOUT SPOOL DYNPRO
VIA JOB name NUMBER number
with SELECTION-TABLE rspar
AND RETURN.
IMPORT ITAB FROM MEMORY ID ‘itab‘.
IF sy-subrc = 0.
CALL FUNCTION ‘JOB_CLOSE‘
EXPORTING
jobcount = number
jobname = name
strtimmed = ‘X‘
EXCEPTIONS
cant_start_immediate = 1
invalid_startdate = 2
jobname_missing = 3
job_close_failed = 4
job_nosteps = 5
job_notex = 6
lock_failed = 7
OTHERS = 8.
endif.
endif.
以上是关于submit 后台运行代码的主要内容,如果未能解决你的问题,请参考以下文章