05-31-2007 4:16 AM
Hi Guys,
FYI, im having a table control with field Plant and Material. I have defaulted the <b>std search help</b> to field <u>Material</u> at the screen painter. Meaning system will call up the search help for Material once i press F4.
Since the search help for field Material is a collective search help, and there is a <u>Plant</u> field available for Material filtering. Thus i may need to get the Plant's value from of same row of the table control to Populate into the Material's search help.
I have already tried to create a new module under the LOOP...ENDLOOP at PAI's flow logic. And try to use parameter id to set the value for plant, purpose is to populate it to Material's search help when i click F4 on material field. The problem is the new module that i coded under LOOP...ENDLOOP will never trigger when i click F4. Because there is NO event to trigger my module.
Other than the above, i tried to code it under POV. But it doesn't work as well, because there is more than 1 record under table control and i can not determine the during runtime which row of F4 for material being click.
Please comment on this above on how to solve the problem.
Thanks in advance.
05-31-2007 6:08 PM
Hi,
You can call standard collective search help [say for Eg:<b>MAT1</b>] through Process on value-request event and set the paramenter id of Plant field before calling the funtion module <b>'HELP_START'</b>.Then we can get the materials specific to the PLANT in the corresponding row of the TABLE CONTROL.
To get which row of the table control is clicked use <b>Get Cursor Line</b> Statement as i mentioned below.
Flow logic:
PROCESS ON VALUE-REQUEST.
FIELD x_marc-matnr MODULE mat_shelp.
Module definition:
MODULE mat_shelp INPUT.
DATA:v_help_info LIKE help_info,n TYPE i,
it_dyselect LIKE TABLE OF dselc WITH HEADER LINE,
it_dyvaltab LIKE TABLE OF dval WITH HEADER LINE.
REFRESH it_dyselect.
it_dyselect-fldname = 'MANDT'.
it_dyselect-dyfldname = 'SY-MANDT'.
APPEND it_dyselect.
it_dyselect-fldname = 'MATNR'.
it_dyselect-dyfldname = 'X_MARC-MATNR'.
APPEND it_dyselect.
v_help_info-call = 'M'.
v_help_info-object = 'F'.
v_help_info-program = sy-repid. "'ZVIG_MOD_TABLE_CONTROL_1'.
v_help_info-dynpro = sy-dynnr. "'9001'.
v_help_info-tabname = 'MARC'.
v_help_info-fieldname = 'MATNR'.
v_help_info-fieldtype = 'CHAR'.
v_help_info-keyword = 'MATNR'.
v_help_info-fieldlng = 18.
v_help_info-fldvalue = ''.
v_help_info-mcobj = 'MAT1'.
v_help_info-spras = 'E'.
v_help_info-menufunct = 'HC'.
v_help_info-title = 'SAP'.
v_help_info-dynprofld = 'X_MARC-MATNR'. <b>----
> Give ur screen field name</b>
v_help_info-tcode = sy-tcode. "'ZTC1'.
v_help_info-pfkey = 'MEN'.
v_help_info-docuid = 'FE'.
v_help_info-pov = 'N'.
v_help_info-curow = '2'.
v_help_info-cucol = '1'.
v_help_info-dynpprog = sy-repid. " ZVIG_MOD_TABLE_CONTROL_1
v_help_info-stepl = '1'.
v_help_info-selectart = 'A'.
GET CURSOR LINE n.
READ TABLE it_marc INTO x_marc INDEX n.
SET PARAMETER ID 'WRK' FIELD X_MARC-WERKS .
CALL FUNCTION 'HELP_START'
EXPORTING
help_infos = v_help_info
TABLES
dynpselect = it_dyselect
dynpvaluetab = it_dyvaltab .
ENDMODULE. " mat_shelp INPUT
05-31-2007 3:07 PM
Dear all,
Need your opinion for the above problem.
Thanks in advance.
05-31-2007 3:20 PM
Can this be coded under the search help exit option...
Regards,
Goutham
05-31-2007 5:28 PM
to solve this probelm....inside the POV....call the following function-module.
after the f4if_...FM.
"dynp_values_update"
in the FM in tables section....u hve tp pass a internal table of type dynpread....in this dynpread.....there is a field "stepl" to which pass the value current_line.....
so u can then now fill the value for a partcular row in table control
05-31-2007 6:08 PM
Hi,
You can call standard collective search help [say for Eg:<b>MAT1</b>] through Process on value-request event and set the paramenter id of Plant field before calling the funtion module <b>'HELP_START'</b>.Then we can get the materials specific to the PLANT in the corresponding row of the TABLE CONTROL.
To get which row of the table control is clicked use <b>Get Cursor Line</b> Statement as i mentioned below.
Flow logic:
PROCESS ON VALUE-REQUEST.
FIELD x_marc-matnr MODULE mat_shelp.
Module definition:
MODULE mat_shelp INPUT.
DATA:v_help_info LIKE help_info,n TYPE i,
it_dyselect LIKE TABLE OF dselc WITH HEADER LINE,
it_dyvaltab LIKE TABLE OF dval WITH HEADER LINE.
REFRESH it_dyselect.
it_dyselect-fldname = 'MANDT'.
it_dyselect-dyfldname = 'SY-MANDT'.
APPEND it_dyselect.
it_dyselect-fldname = 'MATNR'.
it_dyselect-dyfldname = 'X_MARC-MATNR'.
APPEND it_dyselect.
v_help_info-call = 'M'.
v_help_info-object = 'F'.
v_help_info-program = sy-repid. "'ZVIG_MOD_TABLE_CONTROL_1'.
v_help_info-dynpro = sy-dynnr. "'9001'.
v_help_info-tabname = 'MARC'.
v_help_info-fieldname = 'MATNR'.
v_help_info-fieldtype = 'CHAR'.
v_help_info-keyword = 'MATNR'.
v_help_info-fieldlng = 18.
v_help_info-fldvalue = ''.
v_help_info-mcobj = 'MAT1'.
v_help_info-spras = 'E'.
v_help_info-menufunct = 'HC'.
v_help_info-title = 'SAP'.
v_help_info-dynprofld = 'X_MARC-MATNR'. <b>----
> Give ur screen field name</b>
v_help_info-tcode = sy-tcode. "'ZTC1'.
v_help_info-pfkey = 'MEN'.
v_help_info-docuid = 'FE'.
v_help_info-pov = 'N'.
v_help_info-curow = '2'.
v_help_info-cucol = '1'.
v_help_info-dynpprog = sy-repid. " ZVIG_MOD_TABLE_CONTROL_1
v_help_info-stepl = '1'.
v_help_info-selectart = 'A'.
GET CURSOR LINE n.
READ TABLE it_marc INTO x_marc INDEX n.
SET PARAMETER ID 'WRK' FIELD X_MARC-WERKS .
CALL FUNCTION 'HELP_START'
EXPORTING
help_infos = v_help_info
TABLES
dynpselect = it_dyselect
dynpvaluetab = it_dyvaltab .
ENDMODULE. " mat_shelp INPUT