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

decimal point conversion

Former Member
0 Likes
1,386

hi,

How to remove decimal points. The field in my program is a quantity field. In the o/p list display it is displayed as for example as 24,000.00. But i dont want to display .00(decimal point) it should be displayed as 24,000.

How to do this. Is there anyway to do this plz help me out.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,250

If it is NOT ALV...


WRITE  itab-menge DECIMALS 0. 

9 REPLIES 9
Read only

Former Member
0 Likes
1,251

If it is NOT ALV...


WRITE  itab-menge DECIMALS 0. 

Read only

0 Likes
1,250

hi

its an alv report so how to suppress the decimal points.suggest me

Read only

0 Likes
1,250

in field catalogue you can do like this...


fieldcatalog-fieldname   = 'MENGE'.
fieldcatalog-seltext_m   = 'PO quantity'.
fieldcatalog-decimals_out   = 0.

another way in internal table declaration...you change like this..


*menge LIKE itab-menge.  
menge(16) TYPE p DECIMALS 0.

Read only

0 Likes
1,250

Hi Ramya,

Check this out..

http://help.sap.com/saphelp_erp2004/helpdata/en/ff/4649a6f17411d2b486006094192fe3/content.htm

Reward points if helpful..

Regards,

Goutham.

Read only

0 Likes
1,250

hi perez,

u solved my issue. Thank u very much.

Read only

Former Member
0 Likes
1,250

Hi Ramya,

You can use the Function Module 'MURC_ROUND_FLOAT_TO_PACKED'.

Or you can also use the following code to round up:

DATA: num1 TYPE f, num2 TYPE p.

num1 = '1.666666'.

num2 = num1.

WRITE num2.

Reward points if helpful..

Regards,

Goutham.

Read only

0 Likes
1,250

hi,

Actually the quantiy field which i am using in the program is

msl like zupi5t-msl "quantity

data type of this field is QUAN.

the values in the zupi5t table are with decimal points as

720.000-, 50,059.000-, 94.000- etc.

Now how can i suppress the decimal point so that i can display the o/p as 720, 50,059, 94.

The fn module which u mentioned MURC_ROUND_FLOAT_TO_PACKED how to pass the parameters.Is this is useful in my case?

plz suggest i need this urgently.

Read only

0 Likes
1,250

Hi Ramya,

DATA: num1 TYPE f value '19567.468323'.

num2 TYPE p .

(using 'Pattern' button which is beside 'pretty printer' button, call the function..)

CALL FUNCTION 'MURC_ROUND_FLOAT_TO_PACKED'

EXPORTING

if_float = num1

IF_SIGNIFICANT_PLACES = 15

IMPORTING

EF_PACKED = num2

write num2.

Reward points if helpful..

Regards,

Goutham.

Read only

Former Member
0 Likes
1,250

Hi Ramya,

Here is a sample code to remove the decimals:

data: test type p decimals 2 ,

test1 type p.

test = '24000.00'.

test1 = test.

write test1.

Here test1 is declared of type p with no decimals.

So when test is moved into test1,the decimals are automatically removed.

Reward if helpfull.

Thanks,

Kashyap