Application Development and Automation 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: 
Read only

Padding zeros

Former Member
0 Likes
893

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
Read only

Former Member
0 Likes
805

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

Read only

former_member404244
Active Contributor
0 Likes
805

Hi,

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

Regards,

nagaraj

Read only

Former Member
0 Likes
805

HI

Set this attribute in the fieldcatalog

NO_ZERO

regards,

prasant

  • reward if helpful

Read only

Former Member
0 Likes
805

No.it is not working that way.

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

Read only

Former Member
0 Likes
805

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.

Read only

Former Member
0 Likes
805

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