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: 

fix_column in ALV

Former Member
0 Kudos

hi all,

I have some problems while trying to set the fix_column option of ALV grid and tree ... I set this value in catalogue, but it seems it doesn't work, so can anybody please post me a piece of code he/she knows it works because he/she used with success.

Thanks

Gabriele

1 ACCEPTED SOLUTION

former_member203650
Participant
0 Kudos

I Know this quesiton is over 5 years old, but the question was never satisfactorily answered. Here's the answer; In order for FIX_COLUMN to work, ALL the columns to the left of the column you utimately want to prevent from scrolling horizontally must have their FIX_COLUMN fields set to 'X' (or, more appropriately, ABAP_TRUE) in the field catalog.

Cheers,

TerryB

17 REPLIES 17

Former Member
0 Kudos

Hi,

We need to pass this paramter to layout catalog, not to field catalog.

Regards,

Kumar

Former Member
0 Kudos

Hi,

In the layout Set wa_layout-colwidth_optimize = 'X'

Regards,

Nitin

Former Member
0 Kudos

>

> hi all,

> I have some problems while trying to set the fix_column option of ALV grid and tree ... I set this value in catalogue, but it seems it doesn't work, so can anybody please post me a piece of code he/she knows it works because he/she used with success.

> Thanks

> Gabriele

Please set the "KEY" field in the field catalog as 'X', by setting the value of KEY to 'X' the system will change the colour of the column and will not move the column while scrolling to the right. This option is generally used for the columnS on the extreme left, I don't know whether the column you want to fix is on the extreme left.

Edited by: Rajesh on Nov 28, 2008 1:47 PM

0 Kudos

I try everything you said:

1) in layout the fix_column is not present

2) the optimization for column adjust width, but does not fix it

3) I try to set KEY for one field but again .. it doesn't work

Can anybody please post me some code about that that works surely ?

0 Kudos

Hello,

Can you please paste the way you are building the fieldcatalog, also the code which you have used to display the ALV.

Thanks,

Jayant

0 Kudos
wa_field_catalog-fieldname = 'IMPH'.
    wa_field_catalog-coltext = 'Hardware Import'.
    wa_field_catalog-fix_column = 'X'.
    wa_field_catalog-key = 'X'.
    APPEND wa_field_catalog TO it_field_catalog.
 ....

 wa_layout-zebra = 'X'.
  " set title for the ALV view
  wa_layout-grid_title = 'local_table'.
  " hide the name of each columns
*  wa_layout-no_headers = 'X'.
  " hide toolbar from the grid
*  wa_layout-no_toolbar = 'X'.
  " set selection mode
  wa_layout-sel_mode = 'A'.
  " optimize columns width
  wa_layout-cwidth_opt = 'X'.
  wa_layout-info_fname = 'COLOR'.
  wa_layout-no_colexpd = 'X'.

The strange is that fix_column doesn't give error in catalogue ...

Regards

gabriele

Edited by: Gabriele Montori on Nov 28, 2008 3:28 PM

0 Kudos

Hello,

FIX_COLUMN will never give you a error in fieldcatalog because in it defined in TYPE GROUP SLIS, under structure for slis_fieldcat_main0, which is used for fieldcalalog.

in your fieldcalalog

wa_field_catalog-col_pos = 1. --> Try to pass this also.

wa_field_catalog-fieldname = 'IMPH'.

wa_field_catalog-coltext = 'Hardware Import'.

wa_field_catalog-fix_column = 'X'.

wa_field_catalog-key = 'X'.

APPEND wa_field_catalog TO it_field_catalog.

Also in the layout pass: wa_layout-colwidth_optimize = 'X'

instead of wa_layout-cwidth_opt = 'X'.

Hope this helps.

Thanks,

Jayant

Former Member
0 Kudos

Hi,

Fix_column (fix column): This parameter is used to fix certain columns in the output. All columns to be fixed must have this flag, starting from the left. If a column without this flag is output, only the columns to the left of this column are fixed. The user can change the column fixing interactively.

Value set: SPACE, 'X'.

'X' = column fixed (does not scroll horizontally).

Thanks & Regards,

Krishna..

0 Kudos

there are the setting I have for first column

...
    wa_field_catalog-fix_column = 'X'.
    wa_field_catalog-col_pos = 1.
    wa_field_catalog-key = 'X'.
...

and still doesn't work ... if I change any other properties of layout or catalogue it works ... but fix column doesn't work:

Former Member
0 Kudos

got the answer: no way to fix column in alv TREE

0 Kudos

Hi,

I'm having the same issue

   CLEAR gs_fcat.
   gs_fcat-fieldname   = 'FLAG'.
   gs_fcat-coltext     = 'flg'.
   gs_fcat-reptext     = 'flg'.
   gs_fcat-checkbox    = 'X'.
   gs_fcat-edit        = 'X'.
   gs_fcat-outputlen   = 3.
   gs_fcat-fix_column  = 'X'.
   gs_fcat-col_pos     = lv_pos.
   APPEND gs_fcat TO gt_fcat.

I am using REUSE_ALV_GRID_DISPLAY_LVC

seems abap is getting weird these days.

Former Member
0 Kudos

Hi

I tried to search but finally I gave up.. I don't think it's possible..

0 Kudos

Its is possible . it is working for me

Set

wa_fieldcat-Key       = 'X'.
wa_fieldcat-fix_column  = 'X'.

and don't forget to clear the work area after append ,otherwise it will be set for all columns and it will not work.

Example

wa_fieldcat-fieldname 'USER'.
   wa_fieldcat-Key       = 'X'.
   wa_fieldcat-fix_column  = 'X'.
   wa_fieldcat-col_opt   = 'X'.
   wa_fieldcat-inttype = 'C'.
   wa_fieldcat-coltext 'USER'.


   APPEND wa_fieldcat TO it_fieldcat.
   CLEAR wa_fieldcat.

former_member203650
Participant
0 Kudos

I Know this quesiton is over 5 years old, but the question was never satisfactorily answered. Here's the answer; In order for FIX_COLUMN to work, ALL the columns to the left of the column you utimately want to prevent from scrolling horizontally must have their FIX_COLUMN fields set to 'X' (or, more appropriately, ABAP_TRUE) in the field catalog.

Cheers,

TerryB

0 Kudos

Hi Terry,

You are correct. But when we have more columns and when we want to prevent scrolling horizontally away fro the last column if we use fix_colum = 'X' for all the columns left to the last column. Then the scroll bar disappears. We will be not able to scroll at all.

Do you have any suggestions ?

Regards,

Dilip

0 Kudos

The thread that never dies! Well, it makes sense that if you've fixed all the columns in the grid except the right-most column, then there's no scrolling allowed. Of course, if your output doesn't fit horizontally on one screen, that would be a problem. How about if you make that right-most column the LEFT-most column instead, and fix only that column? It seems to me that you are experiencing a "design" problem, not a technical problem.

Cheers,

TerryB

0 Kudos

Hi Terry,

I tried the way you mentioned. But it did not worked. Any how we gave another solution to client.

Thank you.