cancel
Showing results for 
Search instead for 
Did you mean: 

How to remove Extra Zeros from the Quantity Field

Former Member
0 Kudos

Dear ABAPers,

I would like to remove the Extra zeros in the quantity field and i want to print only one decilmal in the

Quantity field.How to do this can anybody help me.

Thanks & Regards,

Ashok.

Accepted Solutions (0)

Answers (6)

Answers (6)

Former Member
0 Kudos

Hi Ashok,

You can use Function module FM CONVERSION_EXIT_ALPHA_OUTPUT to suppress leading zeroes from the field.

To suppress extra zeroes from end try the below given code:-

DATA:wf_field(20) type c.

wf_field = wf_matnr.

SHIFT wf_field left DELETING LEADING '0'.

Also try &MATNR(Z)& . This will supress zeros.

Former Member
0 Kudos

hi,

try this.



data : qty type fkimg.

data lv_qty type p decimal 1.

move qty to lv_qty
or 
lv_qty = qty.

Function module              CONVERSION_EXIT_ALPHA_INPUT

  Import parameters               Value

  INPUT                              lv_qty


  Export parameters               Value

  OUTPUT                          lv_newqty

Former Member
0 Kudos

Hi Ashok,

For deleting leading zeros from a variable of quantity field you need to maintain variable &symbol(Z)& in the form.

Hope this will solve your problem.

Revert back if you have any issues.

Regards,

Vijay

Former Member
0 Kudos

Hello Ashok,

Try to create a variable type p with 1 decimal place and move the quantity field to this variable created.

this will also round the decimal place. fro e.g

if you have 8.563

you will get 8.6

hope it helps.....

kind regards

Edited by: Devi on Apr 7, 2009 12:18 PM

Former Member
0 Kudos

Hi,

In the Text field of form use &Quan.field(CZ)& it compresses the Zeros and if u want to remove the Decimals decalre a Gobal Data field type P decimals 0 and pass the Quan. field to the variable.

OR

Use the Function Module FTR_CORR_SWIFT_DELETE_ENDZERO to supress the decimal zeros

Regards,

Vijaya Lakshmi.T

Edited by: Vijaya Lakshmi on Apr 7, 2009 12:16 PM

Former Member
0 Kudos

hi,

To suppress the leading zeroes here's the syntax.

&field(z)&

Regards

Sharath