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'.




Table Control中自定义 F4 帮助

部分一:根据屏幕已有信息获取帮助信息,填充到内表 SPAN {font-family: "Courier New";font-size: 10pt;color: #000000;background:...
  • sunfeng8848
  • sunfeng8848
  • 2008年12月05日 09:39
  • 3187

关于SAP F4 Search Help Exit Module

1. 机能作用                   Search Help Exit是用于对标准帮助进行扩充,以便与更加灵活的使用.2. 使用场合标准的Search Help其本身就可以进行一些简单的...
  • Chuckth
  • Chuckth
  • 2010年07月15日 12:50
  • 3652

阅读图像显著性检测论文四:Saliency Filters Contrast Based Filtering for Salient Region Detection

这是出自CVPR 2012年的一篇文章,目前谷歌学术引用次数500+,与前面提取特征或者转到频率域做的方法不同,这篇文章使用了非常直观的对比度来描述显著性,笔者认为是非常符合人类视觉系统的认知方式的,...
  • xbcReal
  • xbcReal
  • 2016年12月14日 11:11
  • 1327

Dynpro F4的实现测试

  • zhongguomao
  • zhongguomao
  • 2015年02月10日 14:32
  • 1021

图像显著性论文(六)—Saliency Filters Contrast Based Filtering for Salient Region Detection

  • chenjiazhou12
  • chenjiazhou12
  • 2014年10月30日 14:48
  • 7609

Get the F4 help of a field based on the value of another field in the selction screen(联动的搜索帮助)

  • fengyan5022
  • fengyan5022
  • 2013年10月15日 08:32
  • 569


题目:《Collaborative filtering and deep learning based recommendation system for cold start items》 摘要结...
  • twinkle_star1314
  • twinkle_star1314
  • 2017年01月09日 11:57
  • 149

[论文笔记]Item-based collaborative filtering recommendation algorithms

作者:Badrul Sarwar, George Karypi, Joseph Konstan, John Riedl 内容概要 1. 协同过滤: 目标:推荐TOP N item 类别:...
  • inte_sleeper
  • inte_sleeper
  • 2012年04月16日 17:05
  • 1719

TC(Table Control)自定义F4

原文出自:    REPORT z_barry_tc_f4 . CONTROLS: tc...
  • zhongguomao
  • zhongguomao
  • 2015年06月11日 09:33
  • 873

ABAP 中 Table Control例子

实现了Table Control的主要的一些功能,可以作为例子参考,实现的功能有是否可编辑切换,选择某一条记录点击按钮显示详细信息,新增记录,删除记录,选择所有记录,选择光标所有记录,取消选择所有,排...
  • champaignwolf
  • champaignwolf
  • 2013年09月06日 07:15
  • 4241
您举报文章:Filtering F4 Help Values in Table Control, Based On Other Field Value