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

Sapscript display problem

Former Member
0 Likes
755

Hi all,

I have a number displayed on form as 3 decimals and want to display this number as 2 decimals only.

How can I do that?

Thanks.

deniz.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
644

Hi,

Display the field as &field(10.2)&

where 10 is length of field before decimals.

Regards

Manasa

5 REPLIES 5
Read only

Former Member
0 Likes
644

Hi Deniz,

You need to manually define a Character variable in the driver program.

and in the sap script you need to use the PERFORM....END PERFORM and pass the decimal value and do the changes in the subroutine and pass the 2 decimal data to the variable which you have declared and passed the perform and subroutine.

Now displya the character variable which is returing you the 2 decimal value.

Thanks,

Chidanand

Read only

Former Member
0 Likes
645

Hi,

Display the field as &field(10.2)&

where 10 is length of field before decimals.

Regards

Manasa

Read only

former_member156446
Active Contributor
0 Likes
644

hi you can use some thing like this :

&p_NTGEW(10)& only the 10 characters will be visible length

or in the print program find out the filed

data: p_ntgew type p decimal 3. change it to

VVVVVV

data: p_ntgew type p decimal 2.

Read only

Former Member
0 Likes
644

Hi,

use (.2) as a prefix after the Variable to display upto 2 decimal places.

For eg: &net_price(.2)& will be used to print the net price value till two places of decimal.

as a general rule (.n) will be used as a prefix after the variable to display upto n decimal places, where n=0 , for no decimal places.

Read only

0 Likes
644

Ok.. I got to raise this

think the value is 218.509
                525.589
                528.893
total : 1272.991.

and we show 218.50
             525.58
             528.89

total: 1272.97