09-14-2014 6:52 PM
Hi Experts,
I am using a table control to display and edit internal table data with two fields 'Characteristic. and 'Value'. Here I want display provide the F4 for "Value" field based on field 'Characteristic' value. Suppose if 'Characteristic' is Material then F4 on 'Value' field should Material list and if Characteristic is date then F4 on value field should be date.
Characteristic | Value |
---|---|
Material | 12345678 |
Date | 05/06/1983 |
Could you please let me know how can I do this?
09-15-2014 4:18 AM
09-15-2014 4:47 AM
Hi Shoban,
The values in the field characteristic "Material"/ "Date" are entered by the user in the screen right.
If yes,
The solution is,
In the screen there is an event called Process on Value request.
under this event create module for each field.
for example
PROCESS ON VALUE-REQUEST
Field tablecontrolname-value module f4_value.
logic in the module
Use the FM DYNP_VALUES_READ to read the value in the screen
populate the table DYNPFIELDS with the following fields
DYNPFIELDS-FIELDNAME = 'tablecontrolname-characteristic'
DYNPFIELDS-STEPL = line number (Use GET CURSOR FIELD to get the line number and pass it)
pass the export parameters DYNAME and DYNUMB with values program name(SY-REPID) and screen number (SY-DYNNR) .
once the FM is executed the value is populated in the table DYNPFIELDS. read the table using the field name and the field DYNPFIELDS-FIELDVALUE will have the value mentioned in the screen.
Use this value to check if it is Material/ Date. Based on the value fetch the required data and display the F4 help for the value field.
for example, if the value is material then fetch the data from MARA for all materials and display the list of materials in the F4 help.
Hope this solution will help you and let me know in case of any questions.
Regards,
Phani
09-15-2014 5:19 AM
Hi Shoban,
1) Please use 'Process On Value Request' Event for this
2) Use following FM:
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'MATNR'
dynpprog = progname
dynpnr = dynnum
dynprofield = 'FIELDNAME'
value_org = 'S'
TABLES
value_tab = it_F4_help
thanks,
vidyasagar.