ABAP Keyword Documentation →  ABAP − Reference →  SAP GUI User Dialogs → 

Conversion Routines

A conversion routine (also known as a conversion exit) uses a self-written implementation to override standard conversions (where values are passed from an ABAP data object to a dynpro field or from a dynpro field to an ABAP data object and in the formatting of data using the statements WRITE and WRITE TO).

Properties of Conversion Routines

A conversion routine has a five-character name, CNVRT, used to

From a technical perspective, a conversion routine consists of two function modules. The function modules are associated with the conversion routine using a naming convention:

Executing Conversion Routines

Conversion routines are executed as follows:

The function modules can of course be called and tested in the usual way.

Function Modules for Conversion Routines

As well as the naming conventions, the function modules must meet the following requirements:

In the INPUT conversion, the parameter INPUT must be generic, and in the OUTPUT conversion, the parameter OUTPUT must be generic. This is because the type of the assigned dynpro field or ABAP field can change depending on how it is used.

Any exceptions raised in conversion routines always terminate the program. Conversion routines can only be debugged using the two-process debugger.

Notes

Example

The function modules CONVERSION_EXIT_SDURA_INPUT and CONVERSION_EXIT_SDURA_OUTPUT of the conversion routine SDURA. In its output, this conversion routine transforms seconds to minutes or minutes to hours, and in its input minutes to seconds or hours to minutes.