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: 

How to create custom conversion exit

former_member224404
Active Participant
0 Kudos

Hi,

I have created a custom domain for my custom table. There I want to use one conversion exit for a requirement. Can you guys

help me out step by step how to create a custom conversion exit and assign it to my domain?

Thanks,

Mainak

6 REPLIES 6

Former Member
0 Kudos

Hi,

For ur req, U can assign a 5 length unique characters to ur domain [Example: ZABC1].

Then create 2 function modules in a custom function grp.

Here ZABC1 is key

CONVERSION_EXIT_ZABC1_INPUT

CONVERSION_EXIT_ZABC1_OUTPUT

More help on this from documentation

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.

Thanks & Regards,

Bhargava

Former Member
0 Kudos

Hi

First Create the two funcation modules example.

CONVERSION_EXIT_ZMAT1_INPUT

CONVERSION_EXIT_ZMAT1_OUTPUT

Implement u r logic in this FM.

once the FM are created, go to Domain in that assign ZMAT1 to Convers. Routine field.

Now double click on the ZMAT1 the above two created FM will appear,Select that.

Regards,

Raghu.

raymond_giuseppi
Active Contributor
0 Kudos

Read the SAP online documentation at [Conversion Routines |http://help.sap.com/abapdocu_70/en/ABENCONVERSION_EXITS.htm] everything you need to know is there.

Regards,

Raymond

Clemenss
Active Contributor
0 Kudos

Hi Mainak,

why do you ask? Just do it.

Regards,

Clemens

former_member224404
Active Participant
0 Kudos

Thanks very much. I have done this. But when I see any standard conversion routine, I find one statement like-

CALL 'CONVERSION_EXIT_ALPHA_INPUT' ID 'INPUT' FIELD INPUT

ID 'OUTPUT' FIELD OUTPUT.

Can you help me what this command does. Or can you provide the documentation for this command.

Thanks,

Mainak

0 Kudos

Not every conversion exit look like ALPHA, this one use a "C" program to convert data from internal to external format and reverse. (Look at [CALL - Call a System Function|http://help.sap.com/abapdocu_70/en/ABAPCALL-.htm])

Regards,

Raymond