Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Get runtime screen field value

Former Member
0 Likes
3,010

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
980

Hi,

Try using the FM DYNP_VALUES_READ

Thanks,

Naren

3 REPLIES 3
Read only

Former Member
0 Likes
981

Hi,

Try using the FM DYNP_VALUES_READ

Thanks,

Naren

Read only

0 Likes
980
  • 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.

Read only

Former Member
0 Likes
980

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