05-29-2006 7:35 AM
Hi All!
I have a situation where in i will be having a value like
1234909098
and i have to pad eight zeros in front of it like below
000000001234909098
Any FM to achieve this or any simple code to get this .
Regards
Praneeth
05-29-2006 7:43 AM
Hi,
check this code..
REPORT ZTEST_APLHA .
data: text(18).
text = '1234909098'.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = text
IMPORTING
OUTPUT = text
.
write text.
Regards
Vijay
05-29-2006 7:40 AM
hi
use converion exit here:
CONVERSION_EXIT_ALPHA_INPUT Conversion exit ALPHA, external->internal
CONVERSION_EXIT_ALPHA_OUTPUT Conversion exit ALPHA, internal->external
else
move it to string and then concatenate the zeros if u knwo the exact no of them...
reward points if it helps
gunjan
05-29-2006 7:43 AM
Hi
If the value is data object of a standard table, then check out the conversion rule for the object.
For instance, MATNR conversion rule is ALPHA and to pad zero's a FM called CONVERSION_EXIT_ALPHA_OUTPUT is used.
Navneet
PS: Please mark the helpful answers.
05-29-2006 7:43 AM
Hi,
check this code..
REPORT ZTEST_APLHA .
data: text(18).
text = '1234909098'.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = text
IMPORTING
OUTPUT = text
.
write text.
Regards
Vijay
05-29-2006 7:45 AM
05-29-2006 7:47 AM
05-29-2006 8:25 AM
data: a(10) type p value '1234909098'.
data: b(10) type c value '1234909098'.
data: c(18) type n.
move a to c.
write:/ c.
move b to c.
write:/ c.