‎2007 Sep 07 10:05 AM
Hi Experts,
can anybody plz suggest me any Function Module name for convering any quanttity field e.g '12543.012' to a round value fiend such as '12543'.
Thanks
Sangram
‎2007 Sep 07 10:08 AM
‎2007 Sep 07 10:08 AM
Simply assign it to a integer variable.
Data : l_dat type p decimals 2,
l_final type i.
l_dat = '12543.012'.
move l_dat to l_final.
‎2007 Sep 07 10:10 AM
hi,
assign the value '12543.012' to a variable of type i.
thanks,
‎2007 Sep 07 10:12 AM
Hi,
You can multiply the value, then the result is assigned to integer.
DATA l_result TYPE i.
l_result = 12543.012 * 1.
l_result will contain the round of the value.
‎2007 Sep 07 10:13 AM
DATA: X TYPE P DECIMALS 2 VALUE '123456.56'.
y = FLOOR x.
write y.
Hope u can use CEIL or FLOOR based on the result u want.
Regards
‎2007 Sep 07 10:14 AM
DATA: X TYPE P DECIMALS 2 VALUE '123456.56'.
y = FLOOR x.
write y.
Hope u can use CEIL or FLOOR based on the result u want.
refer
https://forums.sdn.sap.com/click.jspa?searchID=5091884&messageID=2092039
Regards
‎2007 Sep 07 10:14 AM
‎2007 Sep 07 11:16 AM
Hi,
Try with this code:
DATA pack TYPE p VALUE '12543.012'
DECIMALS 3.
WRITE pack DECIMALS 2.
WRITE: / pack DECIMALS 0.
WRITE: / pack ROUND -2,
/ pack ROUND -1,
/ pack ROUND 1,
/ pack ROUND 2.
Regards,
Bhaskar