Filtering F4 Help Values in Table Control, Based On Other Field Value
来源:互联网 发布:sql求和保留两位小数 编辑:程序博客网 时间:2024/05/23 14:36
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 fieldwithout 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.
PROCESS ON VALUE-REQUEST.
FIELD <table control field name> MODULE <module name>
Example:
PROCESS ON VALUE-REQUEST.
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
CALL FUNCTION 'DYNP_GET_STEPL'
IMPORTING
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.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = sy-repid
dynumb = sy-dynnr
translate_to_upper = 'X'
TABLES
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
ENDIF.
7. Pass the internal table IT_CONNID to theFM 'F4IF_INT_TABLE_VALUE_REQUEST'.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'CONNID'
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield ='WA_ADD-CONNID'
value_org = 'S'
TABLES
value_tab = it_connid.
Now the f4 helpvalues for the field 'connid' will be filtered based on the value entered in'carrid'.
- Filtering F4 Help Values in Table Control, Based On Other Field Value
- Get the F4 help of a field based on the value of another field in the selction screen(联动的搜索帮助)
- F4 help functionality for a dynpro screen field using the PROCESS ON VALUE-REQUEST statement
- F4 help functionality for a dynpro screen field using the PROCESS ON VALUE-REQUEST statement
- Get the F4 help of a fiel based on the avlue of another help For Mulitple selection Field(联动的搜索帮助)
- update records in one table based on values in another table
- How to show/hide a control in the Column's DataItemTemplate based on the value of another control
- Refreshing One Column based on the value of Another Column in ADFdi Table
- table control里面的f4
- TC(Table Control)自定义F4
- TC(Table Control)自定义F4
- Field error in object 'xxx' on field 'XXX': rejected value [];
- Table Control中自定义 F4 帮助
- f4 OF DATE FIELD IN DYNPRO PROGRAME
- Movie recommendation based on collaborative filtering method
- Movie recommendation based on collaborative filtering method
- Fast Median Filtering Based on FPGA
- 在SSM框架中出现Field error in object 'xxx' on field 'XXX': rejected value [];错误
- Android应用程序基础
- java插入排序方法
- HDOJ 1272 小希的迷宫
- Webdriver - Firefox 设置地理位置信息相关测试
- Mac上的抓包工具Charles
- Filtering F4 Help Values in Table Control, Based On Other Field Value
- Android webview使用详解
- java二分查找方法
- 下载数据库mysql压缩包地址
- ubuntu14.04,安装rpm程序!!
- 《linux shell》笔记之date
- Android 利用Properties进行authority管理
- 微软算法100道题-----输入一颗二元查找树,将该树转换为它的镜像, 即在转换后的二元查找树中,左子树的结点都大于右子树的结点
- lightoj 1341 算术基本定理