Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

'CONVERSION_EXIT_ALPHA_INPUT'

Former Member
0 Likes
103,850

can any body help me out in finding out the functionality of the function module 'CONVERSION_EXIT_ALPHA_INPUT'? what exactly does this FM does?

1 ACCEPTED SOLUTION
Read only

Former Member
30,399

Hi,

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:

(Input field and output field are both eight characters in length)

1. '1234 ' --> '00001234'

2. 'ABCD ' --> 'ABCD '

3. ' 1234 ' --> '00001234'

Conversion from the internal to the external format (function module CONVERSION_EXIT_ALPHA_OUTPUT) is undertaken in exactly the opposite manner.

Reward Points If it helps

regards

Gunjan

9 REPLIES 9
Read only

Former Member
30,399

Hi Kiran,

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:

(Input field and output field are both eight characters in length)

1. '1234 ' --> '00001234'

2. 'ABCD ' --> 'ABCD '

3. ' 1234 ' --> '00001234'

Conversion from the internal to the external format (function module CONVERSION_EXIT_ALPHA_OUTPUT) is undertaken in exactly the opposite manner.

Thanks and Regards,

Bharat Kumar Reddy.V

Read only

0 Likes
30,399

HI,

Why is it unable to convert "*00" or "@46"

of this type.

Read only

Former Member
30,400

Hi,

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:

(Input field and output field are both eight characters in length)

1. '1234 ' --> '00001234'

2. 'ABCD ' --> 'ABCD '

3. ' 1234 ' --> '00001234'

Conversion from the internal to the external format (function module CONVERSION_EXIT_ALPHA_OUTPUT) is undertaken in exactly the opposite manner.

Reward Points If it helps

regards

Gunjan

Read only

0 Likes
30,399

when u enter the same while viewing data from a database table the value entered in the field , are internally converted and based on that 0s are appended in the front and hence result is displayed..

Read only

0 Likes
30,399

Will it take Decimal values like 15.000 ?

Read only

Former Member
0 Likes
30,399

Hi

CONVERSION_EXIT_ALPHA_INPUT is mostly used when you input values, say MATNR. This is a character type field of length 18. So, if the value of MATNR is 1, it is stored as '00000000000000001'.

In order to pad 0's, we use this FM.

Regards,

Navneeth

PS: Reward points if useful

Read only

Former Member
0 Likes
30,399

Hi Kiran

In most cases when we fetch data from an external system and use the same for processing, say selecting a data from SAP it can fail as it is not in the format the way ABAP wants. For example checking an order is valid or not,

V_Order = '2000000010'.

SELECT SINGLE AUFNR FROM AUFK INTO V_AUFNR WHERE AUFNR = V_Order.

the above query can fail as the Order Number is not in the required format.

Now if we pass and convert the same variable using the FM CONVERSION_EXIT_ALPHA_INPUT we will get the V_Order as '002000000010'. This is the internal format.

There are other converion exits for Date that will change

20060617 to 17.06.2006 and Vice versa.

Search using CONVERSION_EXIT* you will get a lot of info.

Cheers

Kathir

Read only

Former Member
0 Likes
30,399

<b>What is Conversion Programs?</b>

Conversion takes place when converting the contents of a screen field from display format to SAP-internal format and vice versa and when outputting with the ABAP statement WRITE, depending on the data type of the field.

If standard conversion is not suitable, it can be overridden by specifying a conversion routine in the underlying domain.

A conversion routine is identified by its five-place name and is 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 <b>xxxxx</b>:

<b>CONVERSION_EXIT_xxxxx_INPUT

CONVERSION_EXIT_xxxxx_OUTPUT</b>

The INPUT module performs the conversion from display format to internal format. The OUTPUT module performs

the conversion from internal format to display format.

If a screen field refers to a domain with a conversion routine, this conversion routine is executed automatically each time an entry is made in this screen field or when values are displayed with this screen field.

Eg. refer to the vbak table.

Go to SE11 -> VBAK -> Display mode -> double click on the data element VBELN_VA

Double click on the domain VBELN

You can find the conversion routine in the Output characteristics.

This is the FM Documentation.

<b>FU CONVERSION_EXIT_ALPHA_INPUT</b>

____________________________________________________

Text

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.

<b>Example:</b>

(Input field and output field are both eight characters in length)

1. '1234 ' --> '00001234'

2. 'ABCD ' --> 'ABCD '

3. ' 1234 ' --> '00001234'

Conversion from the internal to the external format (function module CONVERSION_EXIT_ALPHA_OUTPUT) is undertaken in exactly the opposite manner.

Regards,

Arun Sambargi.

Message was edited by: Arun Sambargi

Read only

RaymondGiuseppi
Active Contributor
0 Likes
30,399

The main purpose of this conversion-exit is to enable coexistence and correct sorting of alphabetic (text) and numeric values in a single field. So text field (not only numbers and space) are left adjusted with space trainling padding, when numeric values are right adjusted with zero leading padding, and nothing more.

When converting from an external into an internal format this checks whether the entry in the INPUT field is wholly numerical, whether it consists of digits only, possibly with blank spaces before and/or after.   If yes, the sequence of digits is copied to the OUTPUT field, right-aligned, and the space on the left is filled with zeros (‘0’). Otherwise the sequence of digits is copied to the output field from left to right and the space to the right remains blank.

Regards,

Raymond