0% found this document useful (0 votes)
82 views3 pages

Conversion Exit

Conversion routines are used to implement non-standard conversions between display and internal formats. They consist of two ABAP function modules with names following a convention of CONVERSION_EXIT_xxxxx_INPUT and CONVERSION_EXIT_xxxxx_OUTPUT. These modules are automatically executed during input and output to screens when the field refers to a domain with a conversion exit defined. The modules must have precisely two parameters, INPUT and OUTPUT, and cannot include statements that could interrupt processing.

Uploaded by

Mousumi Maiti
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
82 views3 pages

Conversion Exit

Conversion routines are used to implement non-standard conversions between display and internal formats. They consist of two ABAP function modules with names following a convention of CONVERSION_EXIT_xxxxx_INPUT and CONVERSION_EXIT_xxxxx_OUTPUT. These modules are automatically executed during input and output to screens when the field refers to a domain with a conversion exit defined. The modules must have precisely two parameters, INPUT and OUTPUT, and cannot include statements that could interrupt processing.

Uploaded by

Mousumi Maiti
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 3

Input and Output Conversions

Depending on the data type of the field, conversion takes place when a screen field is transferred
from display format to SAP-internal format or vice-versa and when a screen field is output with
the ABAP command WRITE.

Conversion Exit

Non-standard conversions from display format to SAP-internal format and vice versa are
implemented with so-called conversion routines. Conversion routines are identified by a five-
position name and are stored as a group of two ABAP function modules. The function modules
have a fixed naming convention. The following ABAP function modules are assigned to the
conversion xxxxx:

CONVERSION_EXIT_xxxxx_INPUT
CONVERSION_EXIT_xxxxx_OUTPUT

The INPUT module carries out the conversion from display format to internal format, while the
OUTPUT module converts from internal format to display format. If required, new conversion
routines can be added. However, the corresponding function modules must adhere to the above
naming conventions and to the conventions defined below. We recommend that the two modules
be combined to form a function group for input and output conversions.

When is a Conversion Exit Executed?

If a screen field refers to a domain with a conversion exit, this conversion exit is executed
automatically each time an entry is made in this screen field or when values are displayed in this
screen field.

A conversion routine can also be triggered automatically directly in the program by specifying its
five-place name in the attributes of a field in the Screen Painter or by adding "USING EDIT
MASK'==<Name of the conversion exit>' " in the WRITE command.
Parameters

The two function modules of a conversion routine must have precisely two parameters with the
names INPUT and OUTPUT for the value to be converted and the converted value.

In particular, the INPUT parameter in the INPUT conversion and the OUTPUT parameter in the
OUTPUT conversion should not have any reference field because the screen or ABAP field
assigned in the call could have a different length than that expected because a matchcode input
is expected, for example.

Messages

During output conversion, only A messages are meaningful, but during input conversion, A, E and
S messages can be triggered (although S messages are not very meaningful here). E messages
result in an error message. Exceptions are not intercepted in the call.

ABAP Statements

All ABAP statements that result in an interrupt are not permitted in conversion routines. These
are the following statements:

• BREAK-POINT

• CALL SCREEN

• CALL DIALOG

• CALL TRANSACTION

• SUBMIT

• COMMIT WORK

• ROLLBACK WORK

• COMMUNICATION RECEIVE EXIT FROM STEP-LOOP

• MESSAGE I

• MESSAGE W

Further Comments

• The output conversion is also triggered with WRITE and WRITE TO. The conversion
routine may therefore occur very frequently with lists. The output conversion should
therefore be programmed to be as efficient as possible.

• No external performs should be used in conversion routines because the table work
areas of the first calling main program are also used in externally called programs. With
conversion routines, this could result in errors that cannot be analyzed because they are
sometimes included in the program flow at unexpected times.

You might also like