‎2010 Oct 06 7:22 AM
HI All,
I have a requirement, i am having a Table Control and 3 fields FIELD1, FIELD2, FIELD3.
Lets assume FIELD1 = '1002'. Now my requirement is to add a F4 help in FIELD2 based on FIELD1 = '1002' selected.
Unfortunatly the value of FIELD1 (1002) i couldnt able to retreive them in the Process On Value-Request (POV) of FIELD2 so that i can add this FIELD in my select statement.
Can anyony help me in resolving this issue ?
Thanks in advance,
Prem.
‎2010 Oct 06 7:32 AM
‎2010 Oct 06 7:47 AM
Hi,
Use the function module 'DYNP_VALUES_READ' to read the existing values on the screen into a internal table.
read that internal table with the field name that of on the screen which you want and you can get its corresponding value in fieldvalue column the internal table. see example below.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = sy-repid
dynumb = sy-dynnr
TABLES
dynpfields = gt_dynpfields
EXCEPTIONS
invalid_abapworkarea = 1
invalid_dynprofield = 2
invalid_dynproname = 3
invalid_dynpronummer = 4
invalid_request = 5
no_fielddescription = 6
invalid_parameter = 7
undefind_error = 8
double_conversion = 9
stepl_not_found = 10
OTHERS = 11.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ELSE.
READ TABLE gt_dynpfields INTO gs_dynpfields
WITH KEY fieldname = 'T012K-HBKID'.
IF sy-subrc = 0.
l_hbkid = gs_dynpfields-fieldvalue.
CLEAR gs_dynpfields.
ENDIF.
ENDIF.Regards
Gopi
‎2010 Oct 06 8:33 AM
HI All,
thanks for your quick reply. But still doesnt works.
PROCESS ON VALUE-REQUEST.
FIELD FIELD2 MODULE FIELD2_F4.
MODULE get_meter_preffix INPUT.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = sy-repid
dynumb = sy-dynnr " This is a sub screen and the field is one of field in the TABLE CONTROL
TABLES
dynpfields = lt_dyn.
" The table lt_dyn is empty.
ENDMODULE.
Need some more help.
Thanks in advance.
Cheers,
Prem.
‎2010 Oct 06 8:41 AM
Hi Prem,
Have you checked the link I gave earlier I have used the solution provided in this thread and worked also and I think it will be
better also than using 'DYNP_VALUES_READ' FM.
Regards,
Pawan
‎2010 Oct 06 8:43 AM
Hi,
You need to pass the fieldname to the table before calling the FM
CLEAR gs_dynpfields.
gs_dynpfields-fieldname = 'T012K-HBKID'.
APPEND gs_dynpfields TO gt_dynpfields.Then pass this table to the FM, which will return the filedvalues.
Regards
Gopi
‎2010 Oct 06 8:50 AM
HI All Thanks Once again for your quick reply,
Yes u treid the link and also the FM.
But surprisingly i found out that once the PAI is triggered the value is passed.
So is there a way to forcefully trigger the PAI to retrieve the value.
Thanks once again in advance.
Prem.
‎2010 Oct 06 12:39 PM