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: 

Padding zeros

Former Member
0 Kudos

Hi friends,

I need a small help.

My requirement is like,I need to pad zeroes in front of a quantity value.

I am using CONVERSION_EXIT_ALPHA_INPUT.But,it is going into dump,because

I am passing a quantity field as input.

Can any one suggest any function module,to pad zeroes to a quantity value or decimal value.

Points guaranteed,

Imran

6 REPLIES 6

Former Member
0 Kudos

hi masood,

first Convert that Quantity field value into Char type and then pass it to conversion routine..

ex:

data: var(length) type c.

var = quantity field.

and then pass it to conversion routine.

<b>Reward points if useful</b>

Message was edited by:

Chandra

former_member404244
Active Contributor
0 Kudos

Hi,

take the quantity field as character and then pass to fm,it will work.

Regards,

nagaraj

Former Member
0 Kudos

HI

Set this attribute in the fieldcatalog

NO_ZERO

regards,

prasant

  • reward if helpful

Former Member
0 Kudos

No.it is not working that way.

It is not padding zeroes.Finally,output should be in decimal form with zeroes padded in front.

Former Member
0 Kudos

HI,

convert the variable into char.

Try to concatenate Zeros in the front of the variable like

concatenate ' 00' qty into qty.

then assign this into a decimal.

Former Member
0 Kudos

hi,

i hope this would solve ur problem

DATA: L_MATNR(18) TYPE N.

IF T_UPLOAD-MATNR CO '0123456789 '.

L_MATNR = T_UPLOAD-MATNR.

T_UPLOAD-MATNR = L_MATNR.

ENDIF.

regrds,

karthik