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

help me....

former_member438956
Active Participant
0 Likes
835

can anyone tell me what the function module 'CONVERSION_EXIT_ALPHA_INPUT' do with an example.

Thanks

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
798

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.

6 REPLIES 6
Read only

Former Member
0 Likes
799

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.

Read only

Former Member
0 Likes
798

Hi

Hope it will help you.

Reward if help.

What is Conversion Programs?

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 xxxxx:

CONVERSION_EXIT_xxxxx_INPUT

CONVERSION_EXIT_xxxxx_OUTPUT

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.

FU CONVERSION_EXIT_ALPHA_INPUT

____________________________________________________

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.

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

Read only

0 Likes
798

Thanks ramesh and deepankar and i have rewarded the same for the answer.

Read only

Former Member
0 Likes
798

conversion exits are to change the format of the input as per the database format.

'CONVERSION_EXIT_ALPHA_INPUT' is used to change the format of input text as per the text displayed in database.

Eg. if u enter material number as '1234' but actually in database its 10 digits so this function module will change it to 10 digits by appending 6 zeros before it. i.e. '0000001234' .

Hope this is enough for ur understanding.

Pl reward if its helpful to u.

Read only

former_member438956
Active Participant
0 Likes
798

HII

Edited by: Anil Nautiyal on Jun 19, 2008 10:53 AM

Read only

Former Member
0 Likes
798

DATA: LV2(3) TYPE c,

LV3(2) TYPE c,

CLEAR: LV2,

LV3.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

INPUT = T_DRAW-DOKTL1 " input is zero

IMPORTING

OUTPUT = LV2. " output is double zero

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

INPUT = T_DRAW-DOKVR1 "input is zero

IMPORTING

OUTPUT = LV3. " output is triple zero

SELECT SINGLE * FROM DRAW into DRAW WHERE DOKNR = T_DRAW-DOKNR1

AND DOKAR = T_DRAW-DOKAR1

AND DOKTL = LV2

AND DOKVR = LV3.

in above select stmt

i want pass 000 for DOKTL

i want pass 00 for DOKVR Througt excel sheet.

but we can not enter 000 , 00 in excel ssheet.

if we enter 000 it will take 0 only,

but in our program we have to pass 000 to DOKTL.

so we convert 0 to 000

that time we have to use 'CONVERSION_EXIT_ALPHA_INPUT'

pls give points if it usefull.