‎2008 Jan 21 5:05 AM
why do we use conversion routines and when do we go for conversion routines
‎2008 Jan 21 5:10 AM
Hi,
Conversion routines are the routines which is used to convert data from external format to internal sap format and vice-versa.
These are used for padding zeros at the first and also filter zeros at end.we have to conversion routines,They are
1.converion_exit_alpha_input.
Conversion exit ALPHA, external->internal
ALPHA conversion is used especially with account numbers. During conversion from the external to the internal format, the system checks to see if input in the INPUT field is purely numeric, that is, if this input consists only of numbers, possibly with spaces before and after them. If this is the case, then the number string is inserted right- justified in the display field OUTPUT and all spaces to the left of the value are filled with zeroes ('0'). If the input is not purely numeric, it is inserted in the display field from left to right and all extra spaces are filled with blanks.
Example:
1. '1234 ' --> '00001234'
2. 'ABCD ' --> 'ABCD '
3. ' 1234 ' --> '00001234'
2.CONVERSION_EXIT_ALPHA_OUTPUT
Reversing conversion undertaken by function module CONVERSION_EXIT_ALPHA_INPUT. The contents of the INPUT field are converted to display format and placed in the OUTPUT field.
EX:
1.'00001234' -
> 1234.
regards,
Santosh Thorat
‎2008 Jan 21 5:10 AM
Hi,
Conversion routines are the routines which is used to convert data from external format to internal sap format and vice-versa.
These are used for padding zeros at the first and also filter zeros at end.we have to conversion routines,They are
1.converion_exit_alpha_input.
Conversion exit ALPHA, external->internal
ALPHA conversion is used especially with account numbers. During conversion from the external to the internal format, the system checks to see if input in the INPUT field is purely numeric, that is, if this input consists only of numbers, possibly with spaces before and after them. If this is the case, then the number string is inserted right- justified in the display field OUTPUT and all spaces to the left of the value are filled with zeroes ('0'). If the input is not purely numeric, it is inserted in the display field from left to right and all extra spaces are filled with blanks.
Example:
1. '1234 ' --> '00001234'
2. 'ABCD ' --> 'ABCD '
3. ' 1234 ' --> '00001234'
2.CONVERSION_EXIT_ALPHA_OUTPUT
Reversing conversion undertaken by function module CONVERSION_EXIT_ALPHA_INPUT. The contents of the INPUT field are converted to display format and placed in the OUTPUT field.
EX:
1.'00001234' -
> 1234.
regards,
Santosh Thorat
‎2008 Jan 21 5:11 AM
hi
conversion routines are which changes from display format to sap format and vice versa
As the name goes they are primarly used for converting the values from target variable to source variable.
They are mostly used to store the data differently in database. for this the function modules we use CONVERSION_EXIT_ALPHA_INPUT and CONVERSION_EXIT_ALPHA_OUTPUT which is used to remove or add leading zeros to the data variable before soting the data in the database.
what are conversion routines??
Depending on the data type of the field, there is a conversion when the contents of a screen field are converted from display format to SAP-internal format and vice versa. If this standard conversion is not suitable, it can be overridden by defining a conversion routine in the underlying domain.
Conversion routines are identified by a five-place name and are stored as a group of two function modules. The function modules have a fixed naming convention. The following function modules are assigned to conversion routine xxxxx:
CONVERSION_EXIT_xxxxx_INPUT
CONVERSION_EXIT_xxxxx_OUTPUT
The INPUT module converts from display format to internal format, and the OUTPUT module converts from internal format to display format.
When do use them??
If a screen field refers to a domain with a conversion routine, this conversion routine is executed automatically when entries are saved in this screen field or when values are displayed in this screen field. The conversion routine of the domain is also triggered when the field contents are output with the WRITE statement.
http://help.sap.com/saphelp_nw70/helpdata/en/cf/21ee19446011d189700000e8322d00/content.htm
http://help.sap.com/saphelp_nw04/helpdata/en/2b/e9a20d3347b340946c32331c96a64e/content.htm
‎2008 Jan 21 5:13 AM
Hi Naveen,
Sometimes you will see in ABAP that the format of some fields gets changes as for Example you are entering material Number of 10 digits and SAP internally changes it to 18 Digits appending 8 more 0's in it,in that case we use CONVERSION routines. These are FM's that you can get in DOMAIN of the fieldv in the definition TAB.
For example for MATNR it is MATN1 and the attached FM's are
CONVERSION_EXIT_MATN1_INPUT Material number conversion (INPUT)
CONVERSION_EXIT_MATN1_OUTPUT Material number conversion (OUTPUT)