需求:根据输入条件,动态显示输出的列。
REPORT ZMM001.
TABLES:rsddstat_olap, rsddstatheader .
DATA:lv_infoprov(30),
lv_objname(30),
lv_name_first(40),
lv_name_last(40).
TYPES:BEGIN OF is_datail, "明细
uname TYPE rsddstat_olap-uname, "用户ID
uname_l(80), "用户名称
calday TYPE rsddstat_olap-calday, "运行日期
utime TYPE rsddstat_olap-utime, "运行时间
infoprov TYPE rsddstat_olap-infoprov,"信息提供者
objname TYPE rsddstat_olap-objname, "QURRY ID
txtlg TYPE rszelttxt-txtlg, "QURRY 名称
END OF is_datail.
DATA: ls_detail TYPE is_datail,
wa_detail TYPE is_datail,
lt_detail TYPE TABLE OF is_datail,
lt_out TYPE TABLE OF is_datail.
TYPES:BEGIN OF is_total,
objname TYPE rsddstat_olap-objname, "QURRY ID
txtlg TYPE rszelttxt-txtlg, " QURRY 名称
uname TYPE rsddstat_olap-uname, "用户ID
uname_l(80), "用户名称
calday TYPE rsddstat_olap-calday, "运行日期
utime TYPE rsddstat_olap-utime, "运行时间
infoprov TYPE rsddstat_olap-infoprov,"信息提供者
END OF is_total.
DATA:ls_total TYPE is_total,
lt_total TYPE TABLE OF is_total.
DATA:fieldcat TYPE slis_t_fieldcat_alv WITH HEADER LINE,
layout TYPE slis_layout_alv.
DATA lv_repid LIKE sy-repid value sy-repid.
TYPES:BEGIN OF is_period,"汇总数据包含的月份期间
period(6), "期间
pertx(10), "期间描述
END OF is_period.
DATA:ls_period TYPE is_period,
lt_period TYPE TABLE OF is_period.
TYPES:BEGIN OF is_compid,
compid TYPE v_rep_join-compuid, "QURRY ID
txtlg TYPE rszelttxt-txtlg, "QURRY 名称
END OF is_compid.
DATA:lt_compid TYPE TABLE OF is_compid.
DATA: lv_year(4),
lv_line TYPE i,
lv_index TYPE i,
lv_last TYPE i.
DATA:dy_table TYPE REF TO data,
dy_line TYPE REF TO data,
ls_fieldcat TYPE lvc_s_fcat,
lt_fieldcat TYPE lvc_t_fcat.
FIELD-SYMBOLS: <it_table> TYPE STANDARD TABLE,
<wa_table>,
<wa_field>,
<wa_sum>.
SELECT-OPTIONS:s_calday FOR rsddstat_olap-calday OBLIGATORY,"运行日期
s_uname FOR rsddstat_olap-uname, "用户名
s_oname FOR rsddstatheader-objname. "Query ID
PARAMETERS:r_total RADIOBUTTON GROUP g1 DEFAULT 'X', "显示汇总
r_detail RADIOBUTTON GROUP g1. "显示明细
INITIALIZATION.
CONCATENATE 'Z' '%' INTO lv_infoprov.
CONCATENATE 'Z' '%' INTO lv_objname.
"搜索帮助
AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_oname-low.
CLEAR:lt_compid.
SELECT compid txtlg
INTO CORRESPONDING FIELDS OF TABLE lt_compid
FROM v_rep_join
INNER JOIN rsze