Using the Conversion Exit
Use
You use a conversion exit to define a jump to a conversion routine for a column of your output table. As the exit you specify the <conv> part of a function module called CONVERSION_EXIT_<conv>_OUTPUT. For example, you can use conversion exit ALPHA (see function module CONVERSION_EXIT_ALPHA_OUTPUT) to suppress leading zeros of account numbers.
Prerequisites
The internal and external length of the field must be known before the ALV Grid Control can carry out the conversion. This is the length before and after the conversion.
The column width (which can be set using the current layout) does not depend on these values. The width does not have to be adjusted.
Process
-
Declare the internal and the external length of the field to the ALV Grid Control.
-
For fields with DDIC reference, the ALV Grid Control automatically uses the internal and the external length.
-
For fields without DDIC reference, you must specify the internal length using field INTLEN and the external length using field DD_OUTLEN of the field catalog (see Parameters for Fields Without DDIC Reference).
-
-
Specify the conversion exit using field EDIT_MASK of the field catalog (see Formatting Column Contents).
-
Pass the field catalog with method set_table_for_first_display before the list is displayed for the first time.
Result
The values of the columns are run through the conversion routine before display.