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

type mismatch

Former Member
0 Likes
941

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

7 REPLIES 7
Read only

Former Member
0 Likes
881

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

Read only

Former Member
0 Likes
881

hi

it is giving dump error bcoz u r doing type casting of CHAR to DEC type which is not permitted.

Read only

Former Member
0 Likes
881

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.

Read only

Former Member
0 Likes
881

Hi Pavan,

U can use

WRITE A TO B AS DECIMEL.

instead of

move to b.

Thanks Arjun

Read only

Former Member
0 Likes
881

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

Read only

Former Member
0 Likes
881

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

Read only

Former Member
0 Likes
881

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