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

Decimial places changing

Former Member
0 Likes
705

Hello experts .please tell me how to change the decimal places. My statement is like this.

absmg type ce1whas-absmg. (absmg is quantity field with 3 decimal places. I want to make it only 2 decimal places).Thanks for all the replies.

4 REPLIES 4
Read only

amit_khare
Active Contributor
0 Likes
647

try using the DEIMALS extension of the WRITE statement.

data: menge type menge_D value '1234'.

write:/ menge decimals 2.

Regards,

Amit

Reward all helpful replies

Read only

Former Member
0 Likes
647

Hi,

You can change the decimal placing as follows:

System - User Profile - Own Data

In the Defaults tab set the Decimal Notation required ....

Reward points if useful.

Read only

Former Member
0 Likes
647

Hi Shiva,

You can use the following's program logic 2 if you want to round up to ceiling.

If you notice that assigning it to the following logic 1 it will only round up to ceiling if the last digit is more than or equal to 5.

    • Logic 1

Data : l_value type p decimals 2.

l_value = menge.

Write : / l_value.

-


    • Logic 2

data: l_value type p decimals 3,

l_temp type n,

l_len type n,

l_string type string.

parameters : menge type menge_D.

l_value = menge.

l_string = l_value.

l_len = strlen( l_string ) - 2.

l_temp = l_string+l_len(1).

if l_temp > 0.

l_string = l_value + '0.01'.

endif.

write : / l_string(l_len).

Hope the above helps.

Br,

Loo

Read only

sreeramkumar_madisetty
Active Contributor
0 Likes
647

Hi Shiva

You can change the decimal placing as follows:

<b>System - User Profile - Own Data</b>

Give your Decimal places notation here.

Regards,

Sree