‎2009 Mar 04 12:14 PM
Hi All,
I want to convert the customer number from external format to internal format.(i.e) to add leading zeros to make it to 10 characters.
I tried using the conversion exit 'CONVERSION_EXIT_ALPHA_INPUT' which is attached to the domain KUNNR but the output value is of length more than 10 characters.
Please let me know the proper conversion exit to be used.
Regards,
Sivasubramanian
‎2009 Mar 04 12:19 PM
Hi,
I tried this FM and it is working fine. It is giving only 10char in the output also.
DATA: l_kunnr type kunnr value '9123',
l_kunnr1(10) type c.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = l_kunnr
IMPORTING
output = l_kunnr.
l_kunnr1 = l_kunnr.
write:/ l_kunnr1.
Hope this will help u.
Keerthi
Edited by: Keerthy K on Mar 4, 2009 1:23 PM
‎2009 Mar 04 12:22 PM
You can use do and enddo loop to add the number of zeroes how much you want...
n = number of characters
Do n times
concatenate '0' with the field.
enddo .
‎2009 Mar 04 12:22 PM
Hi Dude,
For any field you want to find out the conversion rotine : Process is :
first go to the data element -> domain their u will find the converion rotine at definition tab..If you find any rotine then double click that you will find the FM..
CONVERSION_EXIT_ALPHA_INPUT Conversion exit ALPHA, external->internal
CONVERSION_EXIT_ALPHA_OUTPUT Conversion exit ALPHA, internal->external
‎2009 Mar 04 12:31 PM
The simplest way to do this :
REPORT test.
DATA: kunnr type char10 value '1234'."Use type char10 instead of KUNNR
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = kunnr
IMPORTING
OUTPUT = kunnr
.
write:kunnr.
‎2009 Mar 04 12:34 PM
Hi,
things to remember while using this FM.
1) all the characters of kunnr must be in numbers.
2) if their are any alphabates . this FM do not work.