Application Development and Automation 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: 
Read only

column width in alv

Former Member
0 Likes
979

HI,

IS there a way to fix the width of ca loumns in ALV even while displaying vertical seperators,

Regards,

Tarun Bahal

6 REPLIES 6
Read only

Former Member
0 Likes
868

Hi,

use it in Layout

layout-no_vline = 'X'.

L.Velu

Read only

Former Member
0 Likes
868

Hi,

use

wa_layout-colwidth_optimize = 'X'.

this will adjust the output according to the data

Read only

Former Member
0 Likes
868

Hi Tarun,

TO fix the column length,

you need to select the field

if gs_fieldcat-fieldname = 'ERDAT'

GS_FIELDCAT-OUTPUTLEN = '9'.

modify gt_fieldcat from gs_fieldcat.

endif.

As though ERDAT length is 10 characters,but ot remove the blank spaces

give the outputlength to be 9 .

It will show only that length.

Regards,

Read only

0 Likes
868

with all these options ..............user can still change the column width manually...

Regards,

Tarun Bahal

Read only

0 Likes
868

hi,

there is no way to freeze column...

u can optimize its width but user can always change its width...

Read only

former_member269694
Discoverer
0 Likes
868

Hi, Dears.

I want to inform that it is possible to fix the width of columns in ALV.

It is necessary to create new class <lcl_my_grid > inheriting from  cl_gui_alv_grid.

In this new class you should create method set_no_resize.

   METHOD set_no_resize.

     CALL METHOD me->set_resize_cols

       EXPORTING

         enable = 0

       EXCEPTIONS

         error  = 1

         OTHERS = 2.

   ENDMETHOD.

Call this method  to prevent the user to change the column size.

You can find more information here

Tentactics - A Simple Puzzle Game | SCN