11-08-2006 10:01 AM
Hi All,
Please can any one help me .
i have one field <b>char 6</b> ,i need to add zeros to this field.
ex:1) field value is 1 i need to do like 000001.
2) field value is 20 i need to make it 000020.
kindly give me solution for this.
Thanks in Advance .
Thanks & Regards.
Ramu.
11-08-2006 10:03 AM
Can you just define a variable of type n with the same length and initialise the value into it.
lnum(6) type n.
lnum = lfield1.
lnum would have the value with leading zeroes,
OR you can use the below.
llen = 6 - strlen(lfield1).
concatenate lfield1 '000000' into lfield1.
shift lfield1 circular by llen places.
Message was edited by: Anurag Bankley
11-08-2006 10:04 AM
use the command unpack.
or
use fm conversion_exit_alpha_input
santhosh
11-08-2006 10:05 AM
hi,
use the FM CONVERSION_EXIT_ALPHA_INPUT
call function 'CONVERSION_EXIT_ALPHA_INPUT'
exporting
input = var1
importing
output = var1.
hope this helps,
do reward if it helps,
Priya.
11-08-2006 10:06 AM
11-08-2006 10:12 AM
hi
use FM
CONVERSION_EXIT_ALPHA_output for display and
CONVERSION_EXIT_ALPHA_input for input
regs
Manas Ranjan Panda
11-08-2006 10:14 AM
hi
good
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
thanks
mrutyun^
11-08-2006 10:28 AM
hi,
just use this ..
data : val like lips-posnr value '20'.
write:/ val.
regards,
vijay
11-08-2006 10:41 AM
Hi,
use the function module:
<b>CONVERSION_EXIT_ALPHA_INPUT</b>
converts any number into a string fill with zeroes, with the number at the extreme right
Example:
input = 123
output = 0000000000000...000000000000123
Hope it helps.
reward if helpful.
Regards,
Sipra
11-08-2006 11:35 AM
hi Ramu,
you could do the following.
-
data: c1(6) type c.
data: d1(6) type n.
c1 = '10'.
d1 = c1.
-
now d1 would have value 000010
cheers,
Aditya.