Application Development 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: 

Conversion Routines

Former Member
0 Kudos

Hi,

How can you check whether a field has a conversion routine attached to it?What is meant by a conversion routine?can you site one example of a field which has a conversion routine attached to it?

1 ACCEPTED SOLUTION

varma_narayana
Active Contributor
0 Kudos

Hi Sourav...

We can find the Conversion Routine of any field in its Domain.

For eg : MARA-MATNR

Open its domain MATNR .

You can find the Conversion routine MATN1 is assigned here.

<b>Conversion Routine</b> It is used to Convert data from SAP internal format to Display format and Vice versa.

Every Conversion Routine is a Set of Two Function modules

Naming:

CONVERSION_EXIT_<name>_INPUT

This FM converts the Data from External display format to internal Storage Format. (For eg Adding with LEADING ZERO)

CONVERSION_EXIT_<name>_OUTPUT

This FM converts the Data from internal Storage Format TO External display format (For eg Removing LEADING ZERO)

For Eg: Conversion Routine ALPHA.

CONVERSION_EXIT_ALPHA_INPUT

CONVERSION_EXIT_ALPHA_OUTPUT

<b>Reward if Helpful</b>

5 REPLIES 5

Former Member
0 Kudos

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.

Regards,

Reema

FredericGirod
Active Contributor
0 Kudos

Conversion routine is link to the domain.

A domain is link to a data element

A field of a table could be link to the data element.

So take a field of a table: for example MARA-MATNR. Go in the data element (SE11 -> Table : MARA; Display; double-click on the data element corresponding of the field MATNR (MATNR also)).

You could show the domain of the data element, and double click on it (MATNR also).

Now in the screen of the domain (you could access directly using SE11 --> domain : MATNR), you show a converrsion routine : MATN1. If you double click; they give you 4 functions.

Now, what is a conversion routine : It's only the transformation of what you see and what is really in the database. MATNR is a good example, because you show a material number for example 123456 bu in fact, in the database, it's store as 00000000000123456.

The function CONVERSION_EXIT_MATN1_INPUT convert 123456 to 000000000000123456

-> Conversion of what a user ask to SAP to what SAP need to use in the database.

The function CONVERSION_EXIT_MATN1_OUTPUT convert 000000000000123456 to 123456.

-> Conversion of what SAP used to what the user must see.

If you go in SE16, you could select in the parameters user; to show or not the field exit, that means, if you select, you will show the long version of the material number if you unselect your will show the short one.

Fred

varma_narayana
Active Contributor
0 Kudos

Hi Sourav...

We can find the Conversion Routine of any field in its Domain.

For eg : MARA-MATNR

Open its domain MATNR .

You can find the Conversion routine MATN1 is assigned here.

<b>Conversion Routine</b> It is used to Convert data from SAP internal format to Display format and Vice versa.

Every Conversion Routine is a Set of Two Function modules

Naming:

CONVERSION_EXIT_<name>_INPUT

This FM converts the Data from External display format to internal Storage Format. (For eg Adding with LEADING ZERO)

CONVERSION_EXIT_<name>_OUTPUT

This FM converts the Data from internal Storage Format TO External display format (For eg Removing LEADING ZERO)

For Eg: Conversion Routine ALPHA.

CONVERSION_EXIT_ALPHA_INPUT

CONVERSION_EXIT_ALPHA_OUTPUT

<b>Reward if Helpful</b>

Former Member
0 Kudos

Hi

Conversion routines are attached to the domain of a field.

Just go to the domain and there you will see under the Output Characterstics block, the conversion routine for that domain.

For ex, mara has Conv routine MATN1 attached to it.

Conversion Routine

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.

Regards

Vivek

<b>

Reward if useful</b>

Former Member
0 Kudos

Hi,

Please test the below Function module(SM37) how it works for the field Material

CONVERSION_EXIT_MATN1_INPUT Function Module for Material Number Conversion (INPUT)

CONVERSION_EXIT_MATN1_OUTPUT Function Module for Material Number Conversion (OUTPUT)

With regards,

K K V