In this blog will discuss about conversion routines and in detail about alpha conversion routine
CONVERSION ROUTINES are also called as CONVERSION EXITS.
Conversion routines are used to convert the fields either from display format to SAP internal format or from SAP internal format to display format.
If this standard conversion is unsuitable, you can override it by specifying a conversion routine in the underlying domains.
Where these conversion routines exist?
1. At Info object level maintenance level
2. At Datasource level
Coming to conversion Types
TYPES OF CONVERSION ROUTINES:
ALPHA Conversion Routine
BUCAT Conversion Routine
EAN11 Conversion Routine
GJAHR Conversion Routine
ISOLA Conversion Routine
MATN1 Conversion Routine
NUMCV Conversion Routine
PER15 Conversion Routine
PER16 Conversion Routine
PER17 Conversion Routine
POSID Conversion Routine
PROJ Conversion Routine
REQID Conversion Routine
WBSEL Conversion Routine
SDATE Conversion Routine
IDATE Conversion Routine
ALPHA CONVERSION ROUTINE
An ALPHA conversion routine adds leading zeros if the character field only contains numbers.
ALPHA conversion routine is registered automatically when a characteristic is created. If you do not want to use this routine, you have to remove it manually
For every conversion routine, two function modules are available. You could use these modules without using the actual conversion routine setup, by calling them directly. The function modules for conversion routines are split up in output (internal to external) and input (external to internal).
Function modules for APLHA:
1) CONVERSION_EXIT_ALPHA_INPUT – converts any number into a string fill with zeroes-right.
Input = 123
output = 0000000000000…000000000000123.
2) CONVERSION_EXIT_ALPHA_OUTPUT – converts any number with zeroes-right into a simple integer
Input = 00000000000123
output = 123
Example of Alpha conversion routine
Created a info objects customer number (ZCN) with length 10 and conversion routine alpha as shown in below screen shot.
Now we can maintain the data 51 to the info object it is automatically converted to ‘0000000051’ as shown in below screen.
Now we can remove the alpha conversion to the above object ZCN and load the same data 51 as shown in below screen
Now the value 51 didn’t change it’s format as the conversion routine has been removed in info object general tab.
So instead of adding leading zeros it populate the orginal value(51) directly.
Follow my next Blog for GJAHR Conversion Routine