SAP Virtual/Onsite Trainings

Document Categories:

What's New?

Contribute?

Sample Specs

What's Hot?

Web Dynpro for ABAP Tutorials 


Join the Mailing List
Enter name and email address below:
Name:
Email:
Subscribe  Unsubscribe 

Creating custom conversion routine and assigning to the domain

By Jayshree Santosh Mahajan, Cognizant

Introduction:

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.

Let’ say there is a date field and we want to display the date field 20121203 as 12/2012.

Here are the steps how this can be achieved.

Steps:

1.     Assume that we have created domain for the date field ZCRDAT and we need to assign the custom conversion routine to this particular domain.

2.     Go to the transaction code SE37, enter the function module name CONVERSION_EXIT_ZDATE_INPUT and click create.

3.     Below screen will appear. Enter the function group, short text and click save.

4.     Below screen will appear. Click continue.

5.     Enter the import parameter INPUT.

6.     Go to export tab and enter export parameter OUTPUT as below.

7.     Save and activate the function module.

8.     Similarly, create the function module CONVERSION_EXIT_ZDATE_OUTPUT.

9.     Enter the function group, short text and click save.

10.  Below pop up will appear.

11.  Enter the INPUT import parameter.

12.  Enter the OUTPUT export parameter.

13.  Now go to the source code tab, enter appropriate code here and activate the function module.

Click here to continue...

Please send us your feedback/suggestions at webmaster@SAPTechnical.COM 

HomeContribute About Us Privacy Terms Of Use • Disclaimer • SafeCompanies: Advertise on SAPTechnical.COM | Post JobContact Us  

Graphic Design by Round the Bend Wizards

footer image footer image