Application Development 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: 

plz help

Former Member
0 Kudos

Hi all,

i ahve a filed temp of type dec lenght 3 decimal 1.

now i have to assign 100.000000 (this comes from user, i ahve no control over it )to temp;

finally i want 100.0 in temp.

this is urgent for me.

Thanks in advacne

Amarender Reddy B

6 REPLIES 6

Former Member
0 Kudos

Hi,

DATA : TEMP1(3) TYPE P DECIMALS 3 VALUE '100.000000',
           TEMP2(3) TYPE P DECIMALS1.


TEMP2 = TEMP1.

WRITE :TEMP2.

Thanks.

former_member188827
Active Contributor
0 Kudos

try:

data temp type p LENGTH 3 DECIMALS 1.

data zval2 TYPE p DECIMALS 7 value '100.000000'.

temp = zval2.

WRITE / temp.

0 Kudos

the value which comes from user of length 16 decimal 6, this can any value

i ahve to assign this to length 3 deimal 1.

if i use = operator i am getting a short dump (runtime error) .

plz help

0 Kudos

data : a(16) type p decimals 3,

b(3) type p decimals 1.

a = '100.000000'.

b = a.

write 😕 b.

This code is not giving short dump...just check it....!!!!

0 Kudos

Hi,

if your input is allways a 16 lenght field with this structuter:

nnnnnnnnn.nnnnnn

you can use this:

data : c0(16),

c1(3) type p decimals 1.

c0 = '123456789.123456'.

c1 = c0+6(5).

write 😕 c0.

write 😕 c1.

Regards, Dieter

Former Member
0 Kudos

Hi,

try this:

data: DEC0 type p decimals 6.

data: dec1 type p decimals 1.

*

dec0 = '100.000000'.

dec1 = dec0.

*

write:/ dec0.

write:/ dec1.

or this:

data: dec1 type p decimals 1.

*

dec1 = '100.000000'.

*

write:/ dec1.

Regards, Dieter