1. 程式人生 > >ABAP程式呼叫之SUBMIT

ABAP程式呼叫之SUBMIT

(1) 呼叫其他程式:

  SUBMIT zpcppmd001_idoc AND RETURN.

(2) 呼叫其他程式引數傳遞引數:

 當被呼叫的程式的螢幕有輸入引數時:

       SUBMIT zreport with p_param1 = 'value1'
                              with p_param2 = 'value2'.
   注:p_param1、p_param2 為被調程式parameter 或者select-option中定義的東西

當要傳遞一個內表到被呼叫的程式時,需要用SAP MEMORY或者ABAP MEMORY:

在呼叫的程式中:EXPORT

 it_tab TO MEMORY 'Z_MEMORY'.

在被呼叫的程式中:IMPORT T_ITAB FROM MEMORY 'Z_MEMORY'.

 (3) 更復雜一點的可以用檔案臨時儲存資料:

 帶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.
    append seltab_wa to seltab.
  endloop.
  SUBMIT zreport with selection-table seltab
                                via selection-screen.
其他情況
*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'.