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

Screen Read using DYNP_VALUES_READ

Former Member
0 Likes
3,064

Hi Experts,

I am reading the screen using FM DYNP_VALUES_READ or RS_SELECTIONSCREEN_READ.

I am passing DYNAME = sy-repid. But I am getting exception "INVALID_DYNPRONAME".

Can anyone please tell what is the issue here???

Best Regards

Manas

14 REPLIES 14
Read only

Former Member
0 Likes
1,832

Hi Manas,

According to documentation of the function module it is better not to use SY-REPID. Try hard coding it .

Regards

Read only

Former Member
0 Likes
1,832

HI,

In the start of your program copy the sy-repid into g_repid and then use this variable where it is required.

data: g_repid types sy-repid.

g_repid = sy-repid.

regards,

Venkatesh

Read only

Former Member
0 Likes
1,832

hi,

because their domains will be diff. i mean check the data type , length or value table..

put name of program directly there and then check.

ex. DYNAME = 'zfdsghghsfsaf'

it will work for sure.

Read only

Former Member
0 Likes
1,832

Hi

try using DYNAME = SY-CPROG.

Read only

Former Member
0 Likes
1,832

Hi All,

I tried with all the given options. But same error persists...

Best Regards

Manas

Read only

0 Likes
1,832

Hi Manas,

Can you please the code for your selection screen and the fm call , it can help us find the real íssue .

Regards

Arun

Read only

Former Member
0 Likes
1,832

Hi Arun,

Here is the code...

DATA: it_DYNPREAD TYPE STANDARD TABLE OF DYNPREAD.

DATA: gd_prg TYPE D020S-PROG.

gd_prg = sy-repid.

CALL FUNCTION 'DYNP_VALUES_READ'

EXPORTING

DYNAME = gd_prg

DYNUMB = '1000'

  • TRANSLATE_TO_UPPER = ' '

  • REQUEST = ' '

  • PERFORM_CONVERSION_EXITS = ' '

  • PERFORM_INPUT_CONVERSION = ' '

  • DETERMINE_LOOP_INDEX = ' '

TABLES

DYNPFIELDS = it_DYNPREAD

  • 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

.

The selection screen is PNP.

BR/Manas

Read only

0 Likes
1,832

Hi Manas ,

Please check the following

1. The FM is called in the AT SELECTION - SCREEN or its varaint events .

2. In the table it_DYNPREAD , populate the field fieldname with the name of the selection screen object in UPPER CASE .

Please check the following and test the progam , if you still have problem please revert back .#

Regards

Arun

Read only

0 Likes
1,832

Append the field that you want to read into the table it_DYNPREAD before calling the funtion module to read screen.

REFRESH : it_DYNPREAD.
  CLEAR wa_dynp.
  wa_dynp-fieldname = 'S_WORKQ-LOW'.
  APPEND wa_dynp TO it_DYNPREAD.

where is the selection screen field that you want to read.

regards,

Jinson

Read only

0 Likes
1,832

Hi

i have used the same code it is working fine.just check this

here p_table is in selection screen.

data : lt_tabfile type filetable,

l_subrc type sy-subrc,

lt_fields type table of dynpread with header line,

lv_value type char30.

lt_fields-fieldname = 'P_TABLE'.

append lt_fields.

clear lt_fields.

call function 'DYNP_VALUES_READ'

exporting

dyname = sy-cprog

dynumb = sy-dynnr

tables

dynpfields = lt_fields

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.

read table lt_fields with key fieldname = 'P_TABLE'.

move lt_fields-fieldvalue to lv_value.

Read only

0 Likes
1,832

Hi,

try this...

data: gd_prg  like d020s-prog value 'TESTPROG'

here TESTPROG is program name and make sure it should be in capitals only.

Read only

Former Member
0 Likes
1,832

I tried the same thing it's working fine.

check out this code..

hope it will help U.

CALL FUNCTION 'DYNP_VALUES_READ'

EXPORTING

DYNAME = SY-CPROG

DYNUMB = SY-DYNNR

TRANSLATE_TO_UPPER = 'X'

TABLES

DYNPFIELDS = IT_DYNP

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.

READ TABLE IT_DYNP WITH KEY FIELDNAME = 'P_CUST'.

IF SY-SUBRC = 0.

V_CUST = IT_DYNP-FIELDVALUE.

ENDIF.

ENDIF.

Regards

Sekhar.C

Read only

Former Member
0 Likes
1,832

Thank you so much.

Read only

0 Likes
1,832

I have the same problem with the FM 'DYNP_VALUES_READ'. I use the FM into a BADI.

this is my code :

dyname = sy-cprog.

wa_dynpfields-fieldname = 'MATNR'.

APPEND wa_dynpfields TO dynpfields.

CALL FUNCTION 'DYNP_VALUES_READ'

EXPORTING

dyname = dyname

dynumb = '0110'

translate_to_upper = 'X'

TABLES

dynpfields = dynpfields

EXCEPTIONS

invalid_abapworkarea = 01

invalid_dynprofield = 02

invalid_dynproname = 03

invalid_dynpronummer = 04

invalid_request = 05

no_fielddescription = 06

undefind_error = 07.

Can you tell me how i can solve the problem ?

Thanks.