Process documentationUsing the Conversion Exit Locate this document in the navigation structure

 

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.

Note Note

The conversion exit is implemented through WRITE addition USING EDIT MASK.

End of the note.

Prerequisites

So that the ALV Grid Control can perform the conversion, it must know the internal and the external length of the field, which is the same as the length before and the length after the conversion.

Example Example

The following example that uses editing template EDIT MASK for the WRITE command shows you how these lengths are specified:

DATA TIME TYPE T VALUE '154633'.

WRITE (8) TIME USING EDIT MASK '__:__:__'.

"Output: 15:46:33

In this example, the internal length (of type T) is six characters, while the output length is eight.

End of the example.

The column width (which can be set using the current layout) does not depend on these values and needs not be adjusted accordingly.

Process

  1. 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).

  2. Specify the conversion exit using field EDIT_MASK of the field catalog (see Formatting Column Contents).

  3. 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.