如图所示
开发中遇到了需要以不同的维度去查询,形成的alv也需要根据业务人员自己形成固定的布局
实现方式
控制is_variant参数
DATA: ls_variant TYPE disvariant.
IF c_kunnr IS NOT INITIAL.
ls_variant-report = sy-cprog.
ls_variant-handle = '1'.
ELSEIF c_matnr IS NOT INITIAL.
ls_variant-report = sy-cprog.
ls_variant-handle = '2'.
ELSE.
ls_variant-report = sy-cprog.
ls_variant-handle = '3'.
ENDIF.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
EXPORTING
i_callback_program = sy-repid
* i_callback_user_command = 'USER_COMMAND'
* i_callback_pf_status_set = 'SET_PF_STATUS'
is_layout_lvc = gs_layout
it_fieldcat_lvc = gt_fieldcat
i_save = 'A'
is_variant = ls_variant
TABLES
t_outtab = pt_outtab[]
EXCEPTIONS
program_error = 1
OTHERS = 2.
标签:sy,handle,多个,variant,cprog,ls,alv,屏幕
From: https://www.cnblogs.com/pnj-owowa/p/17190771.html