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

data type

Former Member
0 Likes
1,032

Hi friends,

I need to write the quantity field without decimal place. for example the below code result is 5.000 , but I need to the result as 5.

data labst like mard-labst.

labst = 5.

write labst.

Pls give me a solution

8 REPLIES 8
Read only

LucianoBentiveg
Active Contributor
0 Likes
990

write amount no-decimals.

Regards.

Read only

Former Member
0 Likes
990

DATA labst LIKE mard-labst.

labst = 5.

WRITE labst DECIMALS 0.

-Kiran

Read only

Former Member
0 Likes
990

Hello,

U can try like this.

data labst like mard-labst.

labst = 5,000.

write labst no-decimals.

If useful plz reward points.

Rgerads,

Vasanth

Read only

Former Member
0 Likes
990

data : v_amt type p decimals 0.

v_amt = labst

Read only

0 Likes
990

You can just move it to a intergar.

data: p type p decimals 3 value '1234.000'.
data: i type i.

i = p.

write:/ i.

Regards,

Rich Heilman

Read only

0 Likes
990

hi Karthik,

Just move that variable to an integer variable ...

i.e,

data : v_value type p decimals 3 value '34.000',
             v_res   type i.
       
         v_res = v_value.

Read only

Former Member
0 Likes
990

hi Kalimuthu,

You can write in two ways.

write amount no-decimals.

or declare a variable of type p with decimals as 0, assign the amount to this variable and write this variable. it will be written without decimal places.

data: var1 type p decimals 3.

var1 = amount.

write:/ var1.

Hope this is useful.

Regards,

Richa

Read only

Former Member
0 Likes
990

Hi,

Check this code..

REPORT  ZTEST  .
data: float type p decimals 3,
      int type i.
float = '5.000'.

int = floor( float ) .

write int.

Regards

vijay