abap submit 的使用方法 不一樣狀況

abap submit 的使用方法 不一樣狀況

上一篇 / 下一篇  2009-06-23 15:30:48 / 我的分類:ABAP開發技術javascript

一、最普通的用法php

*Code used to execute a report
SUBMIT Zreport.
java

二、帶select-options程序的Submit的用法app

*Code used to populate 'select-options' & execute report
DATA: seltab type table of rsparams,
      seltab_wa like line of seltab.

  seltab_wa-selname = 'PNPPERNR'.
  seltab_wa-sign    = 'I'.
  seltab_wa-option  = 'EQ'.

* load each personnel number accessed from the structure into
* parameters to be used in the report
  loop at pnppernr.
    seltab_wa-low = pnppernr-low.
    append seltab_wa to seltab.
  endloop.
  SUBMIT zreport with selection-table seltab
                                via selection-screen.
ide

三、帶parameters程序的Submit的用法oop

*Code used to populate 'parameters' & execute report
ui

SUBMIT zreport with p_param1 = 'value'
with p_param2 = 'value'.

四、其餘狀況spa

*Submit report and return to current program afterwards
.net

SUBMIT zreport AND RETURN.

*Submit report via its own selection screen
SUBMIT zreport VIA SELECTION-SCREEN.

*Submit report using selection screen variant
SUBMIT zreport USING SELECTION-SET 'VARIANT1'.

*Submit report but export resultant list to memory, rather than
*it being displayed on screen
SUBMIT zreport EXPORTING LIST TO MEMORY.
* Once report has finished and control has returned to calling
* program, use function modules LIST_FROM_MEMORY, WRITE_LIST and
* DISPLAY_LIST to retrieve and display report.


*Example Code (Retrieving list from memory)
DATA BEGIN OF itab_list OCCURS 0.
INCLUDE STRUCTURE abaplist.
DATA END OF itab_list.

DATA: BEGIN OF vlist OCCURS 0,
filler1(01) TYPE c,
field1(06) TYPE c,
filler(08) TYPE c,
field2(10) TYPE c,
filler3(01) TYPE c,
field3(10) TYPE c,
filler4(01) TYPE c,
field4(3) TYPE c,
filler5(02) TYPE c,
field5(15) TYPE c,
filler6(02) TYPE c,
field6(30) TYPE c,
filler7(43) TYPE c,
field7(10) TYPE c,
END OF vlist.

SUBMIT zreport EXPORTING LIST TO MEMORY.

CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = itab_list
EXCEPTIONS
not_found = 4
OTHERS = 8.

CALL FUNCTION 'LIST_TO_ASCI'
EXPORTING
list_index = -1
TABLES
listasci = vlist
listobject = itab_list
EXCEPTIONS
empty_list = 1
list_index_invalid = 2
OTHERS = 3.

IF sy-subrc NE '0'.
WRITE:/ 'LIST_TO_ASCI error !! ', sy-subrc.
ENDIF.

五、Submit爲後臺執行orm

*Submit report as job(i.e. in background)

data: jobname like tbtcjob-jobname value
' TRANSFER TRANSLATION'.
data: jobcount like tbtcjob-jobcount,
host like msxxlist-host.
data: begin of starttime.
include structure tbtcstrt.
data: end of starttime.
data: starttimeimmediate like btch0000-char1.

* Job open
call function 'JOB_OPEN'
exporting
delanfrep = ' '
jobgroup = ' '
jobname = jobname
sdlstrtdt = sy-datum
sdlstrttm = sy-uzeit
importing
jobcount = jobcount
exceptions
cant_create_job = 01
invalid_job_data = 02
jobname_missing = 03.
if sy-subrc ne 0.
"error processing
endif.

* Insert process into job
SUBMIT zreport and return
with p_param1 = 'value'
with p_param2 = 'value'
user sy-uname
via job jobname
number jobcount.
if sy-subrc > 0.
"error processing
endif.

* Close jobstarttime-sdlstrtdt = sy-datum + 1.starttime-sdlstrttm = '220000'.call function 'JOB_CLOSE'exportingevent_id = starttime-eventidevent_param = starttime-eventparmevent_periodic = starttime-periodicjobcount = jobcountjobname = jobnamelaststrtdt = starttime-laststrtdtlaststrttm = starttime-laststrttmprddays = 1prdhours = 0prdmins = 0prdmonths = 0prdweeks = 0sdlstrtdt = starttime-sdlstrtdtsdlstrttm = starttime-sdlstrttmstrtimmed = starttimeimmediatetargetsystem = hostexceptionscant_start_immediate = 01invalid_startdate = 02jobname_missing = 03job_close_failed = 04job_nosteps = 05job_notex = 06lock_failed = 07others = 99.if sy-subrc eq 0."error processingendif.
 
相關文章
相關標籤/搜索