DATA lr_data TYPE REF TO data.
FIELD-SYMBOLS: <lt_data> TYPE ANY TABLE.
cl_salv_bs_runtime_info=>set(
EXPORTING display = abap_false
metadata = abap_false
data = abap_true ). "初始化報表記錄
SUBMIT rkkbkis1
WITH p_se1 = 'X' "啟用物料成本估算
WITH p_werks = '' "工廠
WITH p_matnr = '' "物料
WITH p_klvar = '' "成本計算變式
WITH p_tvers = '' "成本計算版本
WITH p_kadky = '' "成本計算日期
WITH p_sich1 = '01' "成本視件檢視
WITH p_disso = 'X' "展開bom
WITH p_maton = 'X' "僅物料項目
WITH p_losgr = '1' "成本基數
AND RETURN.
* or call transaction * CALL TRANSACTION 'SM20N' USING bdcdata OPTIONS FROM lw_opt MESSAGES INTO messtab.
TRY.
*get r_data
cl_salv_bs_runtime_info=>get_data_ref(
IMPORTING r_data = lr_data ).
*get t_data
cl_salv_bs_runtime_info=>get_data_ref(
IMPORTING r_data_descr = DATA(lr_data_descr) ).
CREATE DATA lr_data TYPE HANDLE lr_data_descr.
ASSIGN lr_data->* TO <lt_data>.
cl_salv_bs_runtime_info=>get_data(
IMPORTING t_data = <lt_data> ).
CATCH cx_salv_bs_sc_runtime_info.
MESSAGE `Unable to retrieve ALV data` TYPE 'E'.
ENDTRY.
cl_salv_bs_runtime_info=>clear_all( ).