Application Development 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: 

Sapscript removing 0 values

Former Member
0 Kudos

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.

7 REPLIES 7

SuhaSaha
Advisor
Advisor
0 Kudos

Hello,

Try this:

&V_MENGE(.0)&

BR,

Suhas

Former Member
0 Kudos

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.

0 Kudos

It is not working...otherwise u tell me abap code in se38

0 Kudos

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

0 Kudos

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

Mohamed_Mukhtar
Active Contributor
0 Kudos

Hi

it is used to omit leading zeros &V_MENGE(Z)&

Thanks

Edited by: Always Learner on Jan 21, 2009 11:45 AM

Former Member
0 Kudos

Very helpful ans