12-01-2009 11:51 AM
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
12-01-2009 12:03 PM
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
12-01-2009 12:08 PM
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.
12-01-2009 12:53 PM
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
12-01-2009 1:09 PM
12-01-2009 1:35 PM
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
12-01-2009 1:59 PM
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