Filtering F4 Help Values in Table Control, Based On Other Field Value

原创 2015年11月19日 18:30:17

This BoK provides info on how to create an F4 help by filtering the values based on the value entered in another field (By capturing the values entered in the field without hitting the enter key) in a table control.
The regular procedure of fetching theF4 help values does help here But only when <enter> key is pressed after entering the value in the first field. To avoid hitting the <enter> key we need to capture the value entered in the first field dynamically.

Let's consider a scenario where I have two fields in my table control & the F4 help values for the second field depends on the value entered in the first field.

 1. Airline code (SFLIGHT-CARRID)

 2. Flight connection number (SFLIGHT-CONNID)

Let’s select an Airline code

Now the F4 help should be filtered for second field ‘Flight connection number’ based on the ‘Airline code’ selected (without hitting the enter key)

Before selecting the airline code:


After filtering,based on the value selected in first field

The procedure toaccomplish the same is detailed below

1.    In the PAI of the table control dynpro, Use the event 'Process onvalue-request'. Under this event use the syntax shown below.

                       FIELD <table control field name> MODULE <module name>


               FIELDwa_add-connid MODULE f4help.

                Where wa_add-connid is my tablecontrol field name.

Note: All thecode shown below is to be written in module ‘f4help’ as mentioned in theprevious step

2.    We need to determine the cursor position to know at which row the F4 help ispressed. To know the row index, use the Function module 'DYNP_GET_STEPL'. ThisFM returns the current line index (Row Index where the F4 help is pressed). Usethe following code in the POV module

             povstepl =v_index.   (v_index  is a  variable  to hold  the  index  value)

3.    To hold the current screen values i.e. the value entered in the first fieldCARRID, declare an internal table and a work area of type 'dynpread' structure.The ‘stepl’ field of the structure is used to store the row index where the f4help is needed and the field ‘fieldname’ is used to store the field name whosevalues are to be read dynamically.

4.    Pass the current line index to the work area field 'stepl' and the field name bywhich the f4 help needs to be filtered to 'fieldname' to the internal table(Code in f4help module).

    Wa_dynpread-stepl = v_index.

    Wa_dynpread-fieldname = 'WA_ADD-CARRID'.

    Append wa_dynpread TO it_dynpread.

5.    Use FM 'DYNP_VALUES_READ' by passing the report name: 'sy-repid' to dyname ,screen number : 'sy-dynnr' to dynumb and the dynpread internal table to'Tables' to read field contents on screen and transport field to help processor.

                     dyname              = sy-repid
                     dynumb              = sy-dynnr
                     translate_to_upper   = 'X'
                     dynpfields           = 
it_dynpread .

6.    The FM 'DYNP_VALUES_READ' fetches the value entered in the field 'Legreg'.  Select the flight connection number based onthe value in ‘FIELDVALUE’ in IT_DYNPREAD.

 READ TABLE it_dynpread INTO wa_dynpread WITH KEY stepl = v_dynindex.

   IF sy-subrc IS INITIAL.

     SELECTDISTINCT connid FROM sflight 

        INTO TABLE it_connid 

  WHERE carrid = wa_dynpread-fieldvalue


7.     Pass the internal table IT_CONNID to theFM 'F4IF_INT_TABLE_VALUE_REQUEST'.

             retfield    = 'CONNID'
             dynpprog    = sy-repid
              dynpnr       = sy-dynnr
              dynprofield ='WA_ADD-CONNID'
             value_org   = 'S'
             value_tab   = it_connid.

Now the f4 helpvalues for the field 'connid' will be filtered based on the value entered in'carrid'.





同源是指相同的协议、域名、端口,三者都相同才属于同域。不符合上述定义的请求,则称为跨域。 相信每个开发人员都曾遇到过跨域请求的情况,虽然情况不一样,但问题的本质都可以归为浏览器出于安全考虑下的同源策略...
  • freshlover
  • freshlover
  • 2015年03月12日 16:53
  • 57893


Lua的语法基础超级简单,非常易于上手,下面总结一些学习过程中的Lua语法基础:         在开始学习之前,先介绍一些最基本的概念,在Lua中具有一个代码块的概念,每个函数或者for循环等都是一...
  • eric_XJJ
  • eric_XJJ
  • 2013年07月02日 04:31
  • 14247


FindBugs是基于Bug Patterns概念,查找javabytecode(.class文件)中的潜在bug,主要检查bytecode中的bug patterns,如NullPoint空指针检查...
  • jdsjlzx
  • jdsjlzx
  • 2014年03月18日 17:37
  • 57395

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 in...
  • champaignwolf
  • champaignwolf
  • 2016年08月04日 21:07
  • 282

Refreshing One Column based on the value of Another Column in ADFdi Table

Refreshing One Column based on the value of Another Column in ADFdi Table  原文地址:RefreshingOne Colum...
  • luyushuang
  • luyushuang
  • 2012年03月14日 21:27
  • 582

【跟着stackoverflow学Pandas】Select rows from a DataFrame based on values in a column -pandas 筛选

Select rows from a DataFrame based on values in a column -pandas 筛选
  • tanzuozhev
  • tanzuozhev
  • 2017年08月05日 15:24
  • 7591


原文地址   F4IF_FIELD_VALUE_REQUEST主要功能是将表里...
  • JellyLin_SAP
  • JellyLin_SAP
  • 2012年09月04日 17:02
  • 2621

Value Ordering Heuristic for Solving Algorithm Based on the AC-4 Algorithm

  • 2010年10月15日 18:50
  • 254KB
  • 下载

Distributing Negative Messages in VANET Based on Meet-Table and Cloud Computing

  • 2018年01月10日 16:23
  • 13KB
  • 下载

The Research of Access Control Based on UCON in the Internet of Things

  • 2012年05月07日 08:47
  • 1.01MB
  • 下载
您举报文章:Filtering F4 Help Values in Table Control, Based On Other Field Value