‎2007 Feb 13 5:24 PM
Hi
I need to get a screen field value at runtime
I tried to use LOOP AT SCREEN statement, but i have only the name, groups, input/output, ... attributes of screen fields
i saw some post in this forum, their suggest some FM like F4IF_INT_TABLE_VALUE_REQUEST and FC_SET_DYNPRO_GET_VALUES, but does not work for me.
How I can get the value?
Thanks
‎2007 Feb 13 6:04 PM
‎2007 Feb 13 6:04 PM
‎2007 Feb 13 6:39 PM
Local internal table for screen fields
data: begin of i_dynpfields occurs 0.
include structure dynpread.
data: end of i_dynpfields.
clear i_dynpfields.
refresh i_dynpfields.
i_dynpfields-fieldname = 'RD_ASERV'.
append i_dynpfields.
call function 'DYNP_VALUES_READ'
exporting
dyname = sy-cprog
dynumb = sy-dynnr
tables
dynpfields = i_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
others = 10.
if sy-subrc <> 0.
message i398 with 'Unable to read the selection screen values'(003).
else.
read table i_dynpfields index 1.
if sy-subrc = 0.
move i_dynpfields-fieldvalue to rd_aserv.
endif.
endif.
Award points if it helps.
‎2007 Feb 13 6:39 PM
Hi,
In the AT selection screen event you need to use this code, if you are working with screens then use it in PAI
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = progname
dynumb = dynnum
translate_to_upper = 'X'
TABLES
dynpfields = dynpro_values.Regards
Sudheer