‎2007 Nov 29 11:48 AM
Hi Experts!,
<b> I want to increment the numbers by padding zeros on the left. for example 00000001, 00000002,...... 00000010 with max of 8 digits, could any one answer me with the correct answer. Helpful answers will be rewarded.
Thanks and regards,
Sunil</b>
‎2007 Nov 29 11:50 AM
Hi,
First declare that variable as type Currency, it will work
Regards,
Prashant
‎2007 Nov 29 11:53 AM
Hi,
Thanks for your reply, could you pass the codes to me, that will be more helpful for me.
regards,
Sunil
sapsuni@gmail.com
‎2007 Nov 29 11:58 AM
Hi,
Use conversion_exit_alpha_input to pad the zero's.
so first increment the number and then call this FM..u work will be done
Reagrds,
Nagaraj
‎2007 Nov 29 12:11 PM
data: NUMBER(8) VALUE 0, "Original number without zeros
NUMBER2(8). "numbers with zeros
*Incrementing value.
NUMBER = NUMBER + 1.
*Padding zeros
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = NUMBER
IMPORTING
OUTPUT = NUMBER2.
WRITE: / 'Number 1 ', NUMBER,
'Number 2 ', NUMBER2.
‎2007 Nov 29 1:02 PM
REPORT ZTEST_USERCOMMAND .
*data: count type c,
count1 type c.
data: NUMBER(8) VALUE 0, "Original number without zeros
NUMBER2(8). "numbers with zeros
do 10 times.
number = number + 1.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = NUMBER
IMPORTING
OUTPUT = NUMBER2.
write:/ number2.
it is workin iam checked
‎2007 Nov 29 1:32 PM
Hi Experts!,
Thanks for the reply, by your codes I am able to generate the output as 0000001 and 000000005. so on.. but when I m storing it in Z-TABLE. Its not at all incrementing, so could any one tel how to do it, I have used
CALL FUNCTION 'NUMBER_GET_NEXT'
EXPORTING
nr_range_nr = lc_number_range
object = lc_cond_object
IMPORTING
number = c_knumv.
but its generating numbers without zeros, so could please elaborate your answers so that I can solve the issue.
regards,
Sunil
‎2007 Nov 29 4:06 PM
Hi sunil,
Try to change in abap dictionary SE11, the data type to "NUMC" size 8
Regards
Balbino
‎2007 Nov 29 4:07 PM
hi sunil,
change the Domain of ur field to "NUMC"...
maybe it's solve ur problem
Regards
Allan Cristian