01-21-2009 10:20 AM
HI,
I am working on sapscript. that output i having like this 6.000 (field MENGE). but i want only 6
How to remove the .000 value in sapscript.
01-21-2009 10:24 AM
01-21-2009 10:25 AM
Hi Dorothy,
If you want to do in SAPscript, use the decimal formatting option.
&EKPO-MENGE(.0)& will give no decimal places
&EKPO-MENGE(.2)& will give two decimal places
Regards,
Nitin.
01-21-2009 10:34 AM
01-21-2009 10:39 AM
Hello,
To get the integer & decimals places you can use TRUNC & FRAC stmts respectively.
V_INT = TRUNC(V_MENGE).
V_DEC = FRAC(V_MENGE).
IF V_DEC = 0.
CLEAR V_MENGE
V_MENGE = V_INT.
ENDIF.
WRITE: V_MENGE.
Hope this helps.
BR,
Suhas
01-21-2009 10:42 AM
hi Dorothy..
in ur se38 prog declare a global variable type Int n den read the value of MENGE into tht n pass this variable to sapscript
like this
in SE38
data: gv_menge_int type i.
where wver u get data into the V_MENGE.. der insert thsi code
gv_menge_int = v_menge
in ur sapscript
use gv_menge_int instead of v_menge
readin decimal value into integer variable will remove the decimal part frm the value and will give just the iterger part
01-21-2009 10:44 AM
Hi
it is used to omit leading zeros &V_MENGE(Z)&
Thanks
Edited by: Always Learner on Jan 21, 2009 11:45 AM
01-22-2009 4:50 AM