Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Looking for a comprehensive explanation of 'edit_mask'

Former Member
0 Kudos

...to format output within ALV.

e.g. RR___________, V etc.

With samples.

4 REPLIES 4

Former Member
0 Kudos

Hi,

refer this thread:

this will giv u an idea.

rgds,

latheesh

Former Member
0 Kudos

Hi Rainer,

If you set a conversion exit (for example, conv = ' ==ALPHA ' for function module CONVERSION_EXIT_ALPHA_OUTPUT ), you enforce output conversion for the associated output field. (See also F1 help for WRITE edit option USING EDIT MASK) .

Using the Conversion Exit

Purpose

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 CONVERSIONEXIT_ALPHA_OUTPUT ) to suppress leading zeros of account numbers.

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

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.

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.

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

Process Flow

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.

former_member188685
Active Contributor
0 Kudos

Hi,

you can use it as for conversions.

  CALL FUNCTION 'DDIF_FIELDINFO_GET'
         EXPORTING
              TABNAME    = DDIC_TABNAME
              LFIELDNAME = DDIC_FIELDNAME
         IMPORTING
              DFIES_WA   = DDICFELD_INFO
         EXCEPTIONS
              OTHERS     = 0.
    IF DDICFELD_INFO-CONVEXIT NE SPACE.
      CONCATENATE '==' DDICFELD_INFO-CONVEXIT
             INTO X_FIELD_CAT-EDIT_MASK.
    ENDIF.

'==ALPHA' like this you can pass it to the edit_mask field.

Regards

vijay

Former Member
0 Kudos

Hai Rainer

Go through the following Links

ALV

http://www.geocities.com/mpioud/Abap_programs.html

http://www.geocities.com/mpioud/Z_DEMO_ALV_REFRESH_BUTTON.html

Thanks & Regards

Sreenivasulu P