1,下拉列表
TYPE-POOLS VRM.
FM : VRM_SET_VALUES
2,SearchHelp
(1) FM : F4IF_INT_TABLE_VALUE_REQUEST
GET_DYNP_VALUE
4,读取变量
TYPE-POOLS VRM.
FM : VRM_SET_VALUES
2,SearchHelp
(1) FM : F4IF_INT_TABLE_VALUE_REQUEST
(2) Selection : MATCHCODE OBJECT <search_help>
GET_DYNP_VALUE
3,屏蔽 F8
CONSTANTS fcode TYPE sy-ucomm VALUE 'ONLI'.
DATA lt_exclude TYPE TABLE OF sy-ucomm.
APPEND fcode TO td_exclude.
CALL FUNCTION 'RS_SET_SELSCREEN_STATUS'
EXPORTING
p_status = sy-pfkey
TABLES
p_exclude = lt_exclude.
4,读取变量
DATA: l_report LIKE rsvar-report,
l_varia LIKE rsvar-variant,
l_rc LIKE sy-subrc.
DATA: lt_variant_values LIKE rsparams OCCURS 0 WITH HEADER LINE,
wa_techn_data LIKE varid.
"假设为用户ID命名的变量
l_report = sy-repid.
CONCATENATE 'U' sy-uname INTO l_varia SEPARATED BY '_'.
CALL FUNCTION 'RS_VARIANT_EXISTS'
EXPORTING
report = l_report
variant = l_varia
IMPORTING
r_c = l_rc
EXCEPTIONS
not_authorized = 1
no_report = 2
report_not_existent = 3
report_not_supplied = 4
OTHERS = 5.
CHECK l_rc = 0.
CALL FUNCTION 'RS_VARIANT_VALUES_TECH_DATA'
EXPORTING
report = l_report
variant = l_varia
TABLES
variant_values = lt_variant_values
EXCEPTIONS
variant_non_existent = 1
variant_obsolete = 2
OTHERS = 3.
LOOP AT lt_variant_values WHERE sign <> space.
CASE lt_variant_values-selname.
WHEN 'S_WERKS' .
s_werks-sign = lt_variant_values-sign.
s_werks-option = lt_variant_values-option.
s_werks-low = lt_variant_values-low.
s_werks-high = lt_variant_values-high.
APPEND s_werks.
CLEAR s_werks.
WHEN OTHERS.
"......
ENDCASE.
ENDLOOP.