‎2008 Jan 10 5:21 PM
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.
‎2008 Jan 10 5:23 PM
‎2008 Jan 10 5:23 PM
‎2008 Jan 10 5:35 PM
hi
its an alv report so how to suppress the decimal points.suggest me
‎2008 Jan 10 5:40 PM
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.
‎2008 Jan 10 5:40 PM
Hi Ramya,
Check this out..
http://help.sap.com/saphelp_erp2004/helpdata/en/ff/4649a6f17411d2b486006094192fe3/content.htm
Reward points if helpful..
Regards,
Goutham.
‎2008 Jan 11 7:23 AM
‎2008 Jan 10 5:32 PM
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.
‎2008 Jan 10 5:50 PM
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.
‎2008 Jan 10 6:02 PM
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.
‎2008 Jan 10 6:43 PM
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