10-17-2007 5:53 AM
hi,
How to add leading zeros to a particular value.
There is any syntax, Plz send me.
Points will be awarded.
Regards,
Jayasimha
10-17-2007 5:54 AM
you can use FM
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = value
IMPORTING
OUTPUT = value.
This will add leading zeros
FUNCTION MODULES
http://www.erpgenie.com/abap/functions.htm
http://www.sapdevelopment.co.uk/fmodules/fmssap.htm
http://www.erpgenie.com/abap/index.htm
http://www.geocities.com/victorav15/sapr3/abapfun.html
Rewards if useful................
Minal
Message was edited by:
Minal Nampalliwar
10-17-2007 5:55 AM
Use the function.
data: tknum type vttk-tknum value '99156'.
call function 'CONVERSION_EXIT_ALPHA_INPUT'
exporting
input = tknum
importing
output = tknum.
Thanks & Regards
ilesh 24x7
10-17-2007 5:56 AM
10-17-2007 5:57 AM
data: txt(10) type c.
txt = ' 123'.
overlay txt with '0000000000'.
write txt.
10-17-2007 6:06 AM
Hi Jayasimha,
Use conversion_exit_alpha_input which adds Leading zero's to your particular value.
10-17-2007 6:07 AM
10-17-2007 6:07 AM
hi jayasimha,
following FM will help you :
CONVERSION_EXIT_ALPHA_INPUT converts any number into a string fill with zeroes, with the number at the extreme right
Example:
input = 123
output = 0000000000000...000000000000123
CONVERSION_EXIT_ALPHA_OUTPUT converts any number with zeroes right into a simple integer
Example:
input = 00000000000123
output = 123
plz reward if useful..
10-17-2007 6:11 AM
hi,
u can do it many ways.
1. use fm CONVERSION_EXIT_ALPHA_INPUT and pass the variable to it n reference variable.
2. declare dat variable as Numeric then by default it will add zeros for u.
ex: data: pmatnr(8) type n.
if u give value as 8 the o/p would be like this 00000008.
if helpful reward some points.
with regards,
Suresh Aluri.