‎2006 Jun 04 9:38 AM
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.
‎2006 Jun 04 9:47 AM
I think we need to send screen program name. Could you check whether this ia screen program name.
Regds
Manohar
‎2006 Jun 04 9:49 AM
‎2006 Jun 04 9:52 AM
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
‎2006 Jun 04 10:02 AM
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
‎2006 Jun 04 10:16 AM
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.
‎2006 Jun 04 10:43 AM
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= ???
‎2006 Jun 04 11:11 AM
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
‎2006 Jun 04 1:20 PM
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.