1. 程式人生 > >呼叫CALL TRANSACTION的三種方法

呼叫CALL TRANSACTION的三種方法

導讀:
  
  1.使用螢幕傳入
  REFRESH BDCDATA.
  CLEAR BDCDATA.
  BDCDATA-PROGRAM = 'SAPLCSDI'. "Programm St點kliste
  BDCDATA-DYNPRO = '0100'. "Dynpro
  BDCDATA-DYNBEGIN = 'X'. "Sofort starten
  APPEND BDCDATA.
  CALL FUNCTION 'CONVERSION_EXIT_MATN1_OUTPUT' "HW 81070
  EXPORTING
  INPUT = H_MATNR
  IMPORTING
  OUTPUT = H_MATNR
  EXCEPTIONS
  OTHERS = 0.
  CLEAR BDCDATA.
  BDCDATA-FNAM = 'RC29N-MATNR'. "Material
  BDCDATA-FVAL = H_MATNR.
  APPEND BDCDATA.
  CLEAR BDCDATA.
  BDCDATA-FNAM = 'RC29N-WERKS'. "Werks
  BDCDATA-FVAL = H_WERKS.
  APPEND BDCDATA.
  CLEAR BDCDATA.
  BDCDATA-FNAM = 'RC29N-STLAN'. "Verwendung
  BDCDATA-FVAL = H_STLAN.
  APPEND BDCDATA.
  *
  ** IF NOT H_STLAL IS INITIAL.
  ** CLEAR BDCDATA.
  ** BDCDATA-FNAM = 'RC29N-STLAL'. "Stl.Alternative
  ** BDCDATA-FVAL = H_STLAL.
  ** APPEND BDCDATA.
  ** ENDIF.
  *
  CLEAR BDCDATA.
  BDCDATA-PROGRAM = 'SAPLCSDI'. "Programm St點kliste
  BDCDATA-DYNPRO = '0150'. "Dynpro
  BDCDATA-DYNBEGIN = 'X'. "Sofort starten
  APPEND BDCDATA.
  * Umwandeln in Anzeigemodus 黚er BDC_OKCODE
  CLEAR BDCDATA.
  BDCDATA-FNAM = 'BDC_OKCODE'.
  BDCDATA-FVAL = '/BDA'.
  APPEND BDCDATA.
  
  * Verzweig in St點klistenanzeige 黚er Batchinput-Tabelle
  CALL TRANSACTION 'CS03' USING BDCDATA MODE 'E'.
  2.使用parameter
  SET PARAMETER ID 'MAT' FIELD P_MATNR.
  SET PARAMETER ID 'WRK' FIELD P_WERKS.
  SET PARAMETER ID 'CSV' FIELD P_STLAN.
  
  CALL TRANSACTION 'CS03' AND SKIP FIRST SCREEN.
  3.使用memory (這個方法和第二種方式的區別是可以傳輸複選框的值)
  data:
  wfbomcom type rc29n.
  move-corresponding bom_key to wfbomcom. "#EC ENHOK "note0526541
  wfbomcom-aennr = display_aennr.
  wfbomcom-datuv = display_datuv.
  wfbomcom-datub = display_datub.
  export wfbomcom to memory id 'WFBOMCOM'.
  * display bom
  call transaction 'CS03' and skip first screen.
  Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=1062128
  [收藏到我的網摘] [傳送Trackback] Jack發表於 2006年08月14日 12:38:00

本文轉自
http://blog.csdn.net/compassbutton/archive/2006/08/14/1062128.aspx