当前程序:ZFIR039
被调程序:ZFIR038
ZFIR038执行结果
ZFIR039中获取ZFIR038的ALV值,程序段
**********************************************************************
* 获取程序ZFIR038 输出内表GT_OUT值
FIELD-SYMBOLS:<lt_data> TYPE STANDARD TABLE.
"SUBMIT前屏蔽ALV GRID的显示
CALL METHOD cl_salv_bs_runtime_info=>set(
display = space
metadata = space
data = 'X' ).
SUBMIT zfir038 WITH p_rbukrs = p_rbukrs
WITH s_date IN s_date
WITH s_aufnr IN s_aufnr
AND RETURN.
TRY.
cl_salv_bs_runtime_info=>get_data_ref(
IMPORTING r_data = DATA(ls_data) ).
ASSIGN ls_data->* TO <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( ).
处理读取到的ALV数据,程序段
**********************************************************************
* 读取上步骤的值
DATA: ls_out_r104 TYPE ty_out_r104.
CLEAR: gt_out_r104.
LOOP AT <lt_data> ASSIGNING FIELD-SYMBOL(<fs_data>).
ASSIGN COMPONENT 'FIELD1' OF STRUCTURE <fs_data> TO FIELD-SYMBOL(<fd_val_1>).
ASSIGN COMPONENT 'FIELD2' OF STRUCTURE <fs_data> TO FIELD-SYMBOL(<fd_val_2>).
CHECK <fd_val_1> IS ASSIGNED AND <fd_val_2> IS ASSIGNED.
"ACTION
CLEAR: ls_out_r104.
UNASSIGN:<fd_val_1>,
<fd_val_2> .
ENDLOOP.
原创文章,作者:奋斗,如若转载,请注明出处:https://blog.ytso.com/17914.html