02-25-2009 10:24 AM
hi all,
i have to read ascreen field of type NUM(8) and when i pass it to FM Dynp_values_read
the field FIELDVALUE in DYNPREAD structure is of character type.now after coming out of this FM my fieldvalue is of type character and not of type.NUM8.
DATA: dyname LIKE d020s-prog VALUE 'Z_PREMRP',
dynumb LIKE d020s-dnum VALUE '1000'.
DATA: BEGIN OF dynpfields OCCURS 3.
INCLUDE STRUCTURE dynpread.
DATA: END OF dynpfields.
MOVE 'PROJECT-LOW' TO dynpfields-fieldname.
APPEND dynpfields.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = dyname
dynumb = dynumb
TABLES
dynpfields = dynpfields.
READ TABLE dynpfields WITH KEY fieldname = 'PROJECT-LOW'.
IF sy-subrc = 0.
dynpfields-fieldvalue = pspnr1(type num 8).
pspnr1 = dynpfields-fieldvalue .
ENDIF.
i want the fieldvalue to be in num8 any help wud be appreciated
02-25-2009 10:32 AM
After U get the value from the FM 'DYNP_VALUES_READ'
use FM CONVERSION_EXIT_ALPHA_INPUT to get the 0's padded in front and pass this to
the field of type NUM
02-25-2009 10:53 AM
thanks for your reply but clearly my issue is
im passing fieldvalue : NE-005 to FM DYNP_VALUES_READ
and it is getting converted to : 00000005
now how do i convert it back to the same value.
Thanks in advance,
Naren
Edited by: naren on Feb 25, 2009 12:22 PM
02-25-2009 11:37 AM
a variable of type N cannot hold a char ..
In your case (NE-005) cannot be assigned to a numeric variable ..
02-25-2009 12:41 PM
any help wud be greatfull. Srinivaas.
im waiting for replies friends.
thanks.
02-25-2009 12:50 PM
Hi,
To my understanding, If Num holds 00000005 then you need to get 5 in a CHAR Variable. If this is the case then make sure that the CHAR Var is of length similar to Num. Move Num to VAR then use SHIFT statement to remove all the 0's.
If this is not the case then breif your requirement.
Thanks,
Prashanth
02-25-2009 10:32 AM
Hi,
Check by moving the Field from Function Module to a Variable of type NUM(8).
Hope this would work.
Thanks,
Prashanth
02-25-2009 10:32 AM
02-25-2009 10:39 AM
Hi friend,
See FM 'MOVE_CHAR_TO_NUM' .
Use FM 'MOVE_CHAR_TO_NUM' after 'DYNP_VALUES_READ'.
Thanks..
Edited by: Sap Fan on Feb 25, 2009 11:39 AM
Edited by: Sap Fan on Feb 25, 2009 11:40 AM