为选择屏幕的字段设置F4帮助
在没有参考 数据元素,域和搜索帮助的情况下,自定义F4 帮助
1,PARAMETERS: p_bukrs(4) TYPE C MATCHCODE OBJECT H_T001.
2,AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_bukrs.
PERFORM frm_f4 CHANGING p_bukrs.
FORM frm_f4 CHANGING p_value.
CONSTANTS cns_retfield TYPE fieldname VALUE 'BUKRS'.
DATA: BEGIN OF lt_value OCCURS 0,
bukrs LIKE t001-bukrs, "公司代码
butxt LIKE t001-butxt, " 公司名称
END OF lt_value.
DATA: lt_retuen LIKE TABLE OF ddshretval WITH HEADER LINE.
SELECT bukrs butxt FROM t001 INTO TABLE lt_value.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = cns_retfield
value_org = 'S'
TABLES
value_tab = lt_value
return_tab = lt_retuen
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
IF sy-subrc = 0.
READ TABLE lt_retuen INDEX 1.
p_value = lt_retuen-fieldval.
ELSE.
ENDIF.
ENDFORM. "frm_f4_bukrs