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

FUNCTION 'DYNP_VALUES_READ'

Former Member
0 Likes
1,053

Hi!

I'm using this function to get the plant from VL32N but I got invalid_dynproname = 3 (EXCEPTION).

What could be the reason? THANKS

The code is:

DATA: BEGIN OF dynpfields OCCURS 1.

INCLUDE STRUCTURE dynpread.

DATA: END OF dynpfields.

***

CLEAR dynpfields.

REFRESH dynpfields.

dynpfields-fieldname = 'LIPS-WERKS'.

APPEND dynpfields.

CALL FUNCTION 'DYNP_VALUES_READ'

EXPORTING

dyname = 'SAPMV50A' "my_prog

dynumb = '1202' "my_dnum

TABLES

dynpfields = 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.

>>>>****HERE SY-SUBRC = 3????????????

CHECK sy-subrc EQ 0.

READ TABLE dynpfields INDEX 1.

8 REPLIES 8
Read only

Manohar2u
Active Contributor
0 Likes
960

I think we need to send screen program name. Could you check whether this ia screen program name.

Regds

Manohar

Read only

Former Member
0 Likes
960

I did. It is. So I don't understand why??

Read only

nishanthbhandar
Contributor
0 Likes
960

Where have you placed your code .. ?You can read the screen values of the program in which you have called this.If you are trying to execute a stand alone pgm then the FM will throw error cos it will not identify the external screen-name.

Message was edited by: Nishanth Bhandar

Read only

0 Likes
960

Nishanth Bhandar ,

My code is in the IQSM0008 Enhancement. I run VL32N first

and when I enter a serial number the IQSM0008 runs.

I just checked that the 'DYNP_VALUES_READ' returns the Inbound deliv. number but not the plant. I think it because the plant is in Items Data Level and the Inbound deliv. number is in Header Data. So the FM can't read it?

Thank you.

DIANA

Read only

0 Likes
960

I just placed the same code in IQSM0008.Seems like everythin is OK.If you are want the plant level data then press F1 on that field and specify the screen number of this screen to your FM.The read will then return the plant value.

Read only

0 Likes
960

Nishanth Bhandar ,

Thats what I did but I got the EXCEPTION.

Did you put the same code?? Did you see the value of the plant: dynpfields-fieldvalue= ???

Read only

0 Likes
960

Hi

Try this:

DATA: BEGIN OF X_LIPS.

INCLUDE STRUCTURE LIPSVB.

DATA: END OF T_LIPS.

FIELD-SYMBOLS: <T_LISPS> TYPE TABLE.

DATA: FIELD_DYNPRO(20) VALUE '(SAPMV045A)XLIPS[]'.

ASSIGN (FIEL_DYNPRO) TO <T_LIPS>.

LOOP AT <T_LIPS> INTO X_LIPS.

ENDLOOP.

Max

Read only

0 Likes
960

Diana,

Please try the code which Max has posted in his message.I guess the problem is that inside the exit the screen is not getting identified.But the value is present in the SAP memory.SO if you use field symbols and assign the memory location of the field then it should work.Give it a try and hope it works.