submit的幾種情況
1、最普通的用法
*code used to execute a report
submit zreport.
2、帶select-options程式的submit的用法
*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.
endloop.
submit zreport with selection-table seltab
via selection-screen.
3、帶parameters程式的submit的用法
*code used to populate 'parameters' & execute report
submit zreport with p_param1 = 'value'
with p_param2 = 'value'.
4、其他情況
*submit report and return to current program afterwards
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)
databegin of itab_list occurs 0.
include structure abaplist.
dataend 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.
5、submit為後台執行
*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 job
starttime-sdlstrtdt = sy-datum + 1.
starttime-sdlstrttm = '220000'.
call function 'job_close'
exporting
event_id= starttime-eventid
event_param= starttime-eventparm
event_periodic= starttime-periodic
jobcount= jobcount
jobname= jobname
laststrtdt= starttime-laststrtdt
laststrttm= starttime-laststrttm
prddays= 1
prdhours= 0
prdmins= 0
prdmonths= 0
prdweeks= 0
sdlstrtdt= starttime-sdlstrtdt
sdlstrttm= starttime-sdlstrttm
strtimmed= starttimeimmediate
targetsystem= host
exceptions
cant_start_immediate = 01
invalid_startdate= 02
jobname_missing= 03
job_close_failed= 04
job_nosteps= 05
job_notex
= 06
lock_failed= 07
others= 99.
if sy-subrc eq 0.
"error processing
endif.
RS OPEN SQL,CONN,A,B的幾種情況
rs.open sql,conn,a,b a adopenforwardonly 0 唯讀,且當前資料記錄只能向下移動 adopenkeyset 1 唯讀,當前資料記錄可自由移動 adopendynamic 2 可讀寫,當前資料記錄可自由移動 adopenstatic 3 可讀寫,當前資料記錄可自由...
索引無效的幾種情況
檢查被索引的列或組合索引的首列是否出現在pl sql語句的where子句中,這是 執行計畫 能用到相關索引的必要條件。看採用了哪種型別的連線方式。oracle的共有sort merge join smj hash join hj 和nested loop join nl 在兩張表連線,且內錶的目標列...
函式返回的幾種情況
1.返回區域性變數的值 可以有兩種情況 返回區域性自動變數和區域性靜態變數,比如,int func 區域性變數temp儲存在棧中,函式返回時會自動複製乙份temp的copy給呼叫者,沒有問題。int func 區域性變數a儲存在靜態 全域性 儲存區中,從初始化後一直有效直到程式結束,僅分配一次記憶體...