F4的实现方式

(1)在屏幕编辑器的layout中,指定屏幕元素所使用的search help
(2)使用函数的方法,在选择屏幕上实现F4.
所使用的函数为:F4IF_INT_TABLE_VALUE_REQUEST
   REPORT  ZTEST03.
types : begin of t_s_werks,
          werks type t001w-werks,
          name1 type t001w-name1,
          name2 type t001w-name2,
          stras type t001w-stras,
          ort01 type t001w-ort01,
        end of t_s_werks .
types : t_i_werks  type standard table of t_s_werks .

data : l_it_werks  type t_i_werks.
parameters : p_werks(4type c .
at selection-screen on VALUE-REQUEST FOR   p_werks .
   SELECT WERKS    "
         NAME1    "
         NAME2    " 2
         STRAS    "/-
         ORT01    "
    FROM T001W
    INTO CORRESPONDING FIELDS OF TABLE L_IT_WERKS.

     call function  'F4IF_INT_TABLE_VALUE_REQUEST'
        exporting
            retfield 'WERKS' "返回的表中的字段值,一定要是大写
            dynpprog sy-repid
            dynpnr   sy-dynnr
            dynprofield 'P_WERKS' "填充的是屏幕上的哪个字段
            value_org 'S'  "Cell by cell
         tables
            value_tab L_IT_WERKS "F4中要显示的值,放到这个内表中
         exceptions
            parameter_error 1
            no_value_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.
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值