说明:给屏幕输入设置F4.
“ 声明变量
DATA t_returntab TYPE TABLE OF ddshretval WITH HEADER LINE."用于动态提取搜索帮助数据
” 屏幕设计时
” 查询工厂是否存在,否则提示报错; 消息类 ZIEB01 ,e209——工厂&,系统不存在,请确认!
AT SELECTION-SCREEN ON p_werks.
CLEAR t001w.
SELECT SINGLE * FROM t001w WHERE werks = p_werks.
CHECK sy-subrc <> 0.
MESSAGE e209 WITH p_werks.
“ 设置F4
AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_zhtbh-low.
PERFORM frm_get_zhtbh.
FORM frm_get_zhtbh .
REFRESH: t_htbh,t_returntab,t_htbh.
SELECT DISTINCT zhtbh INTO TABLE t_htbh FROM ziebckcp.
DELETE t_htbh WHERE zhtbh = ''.
IF t_htbh[] IS INITIAL.
MESSAGE s000 WITH '系统中没有此合同号! '.
LEAVE SCREEN.
ENDIF.
SORT t_htbh BY zhtbh DESCENDING.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'zhtbh' "返回字段=F1
value_org = 'S'
TABLES
value_tab = t_htbh
return_tab = t_returntab
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
READ TABLE t_returntab INDEX 1.
s_zhtbh-low = t_returntab-fieldval.
ENDFORM. " FRM_GET_ZHTBH