‎2008 Mar 13 6:29 AM
Hello..
here is a simple program.
DATA: a TYPE y_minvalue, "pre-defined type DEC
b TYPE ddb_c04-atwrt VALUE '9,4'. "type CHAR(30)
*a = b.
MOVE b TO a.
WRITE:/ a,b.
I want to assign the value of 'b' to 'a'. here it is giving dump. can anyone help me.
in the user setting i have maintain the Decimal notation as 1.234.567,89. (the first option)
regards,
pavan,
Edited by: pavan jhawar on Mar 13, 2008 12:02 PM
‎2008 Mar 13 6:35 AM
Hi,
Is it mandatory to have 'a' declared as DEC. Else, u can declare 'a' as field symbol type any and move contents of 'b' to 'a'.
Reward if helpful.
Regards,
Ramya
‎2008 Mar 13 6:38 AM
hi
it is giving dump error bcoz u r doing type casting of CHAR to DEC type which is not permitted.
‎2008 Mar 13 6:40 AM
Hi
try this it is working fine
DATA: a TYPE d, "pre-defined type DEC
b TYPE ddb_c04-atwrt VALUE '9.4'. "type CHAR(30)
MOVE b TO a.
WRITE:/ a.
‎2008 Mar 13 6:42 AM
Hi Pavan,
U can use
WRITE A TO B AS DECIMEL.
instead of
move to b.
Thanks Arjun
‎2008 Mar 13 6:42 AM
Hi
You need to convert the ddb_c04 into either DEC or the DEC to char
and use the FM to convert the same
ISM_CONVERT_CHAR_TO_DEC
Regards
Shiva
‎2008 Mar 13 6:50 AM
Pavan,
Even if you change the decinal notation settings the acceptable format that to convert char to P is 1,234,567.89
So it doesn't allow any other formats while type convertions.......
‎2008 Mar 13 6:54 AM
Try this way...
DATA: a TYPE ddb_c04-atwrt, "pre-defined type DEC
b TYPE ddb_c04-atwrt VALUE '9.4'. "type CHAR(30)
*a = b.
MOVE b TO a.
WRITE:/ a,b.
or else define the desired maximum length after the decimal point and try this way
DATA: a TYPE p decimals 5, "pre-defined type DEC
b TYPE ddb_c04-atwrt VALUE '9.4'. "type CHAR(30)
*a = b.
MOVE b TO a.
WRITE:/ a,b.
Regards,
sasi rekha
Edited by: sasi rekha on Mar 13, 2008 8:11 AM