F4 help functionality for a dynpro screen field using the PROCESS ON VALUE-REQUEST statement

Pressing the F4 button on a dynpro screen field brings up a list of possible values you can enter into that field. This list of values is usually derived from the domain of the data dictionary definition the screen field is based on. Alternatively if you do not want this to happen or if the field does not reference a data dictionary field the F4 help functionality can be created manually. This is done by creating your own bespoke ABAP code and via the PROCESS ON VALUE-REQUEST event assigning it to the relevant screen field.

The below code shows you how to activate the PROCESS ON VALUE-REQUEST event for a specific field's F4 value help functionality. It then shows you how to point this event to your bespoke ABAP code, which will display the value help to the user. Finally it shows you how to return the value select by the user to the dynpro screen field.

* Screen flow logic........
 
process before output.
*MODULE PBO_MODULE.
 
process after input.
*MODULE PAI_MODULE.
 
process on value-request. "F4
  field ekpo-ebelp module help_ekpo.
 
* populate screen field from within PROCESS ON VALUE-REQUEST(F4) call
*&------------------------------------------------------------------*
*&      Module  help_responsibility  INPUT
*&------------------------------------------------------------------*
*       text
*-------------------------------------------------------------------*
  MODULE help_ekpo INPUT.
 
**Transport values to table dynpro/screen table control
  DATA: l_stepl LIKE  sy-stepl,
        l_indx  LIKE  sy-stepl.
  DATA: dynpfields        LIKE dynpread OCCURS 5 WITH HEADER LINE.
 
* Adjust for scroling within table control
  CALL FUNCTION 'DYNP_GET_STEPL'
    IMPORTING
      povstepl        = l_stepl
    EXCEPTIONS
      stepl_not_found = 0
      OTHERS          = 0 .
 
  l_indx = tc_ekpotable-top_line + l_stepl - 1 .
  "tc_ekpotable should already have been declared
 
  REFRESH dynpfields.
  CLEAR   dynpfields.
  dynpfields-fieldname  = 'EKPO-EBELN' .
  dynpfields-fieldvalue = '00010'    "wa_ekpo-ebeln.
  DYNPFIELDS-STEPL      = L_STEPL.
  APPEND dynpfields.
  dynpfields-fieldname  = 'EKPO-EBELP' .
  dynpfields-fieldvalue = '00020'    "wa_ekpo-ebelp.
  DYNPFIELDS-STEPL      = L_STEPL.
  APPEND dynpfields.
 
  CALL FUNCTION 'DYNP_VALUES_UPDATE'
    EXPORTING
      dyname     = 'SAPLZZ_EKKO'     "Program name
      dynumb     = '0100'            "Screen number
    TABLES
      dynpfields = dynpfields
    EXCEPTIONS
      OTHERS     = 0 .
ENDMODULE.                 " help_ekpo  INPUT
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

ChampaignWolf

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值