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

Grid display

Former Member
0 Likes
792

Hi all,

I am about to dispaly a table with the help of a grid. The table may contain a single attribute(column) or multiple. It depends on the selection.

For the first time of display it is wokring fine for both type of (single column and multiple columns) tables.

From second time onwards, the length of the column is being expanded to the length of the grid.

But in case of multiple columns, it is working fine....

Can you please tell me reason and the solution?

Thanking you very much..

Regards,

Balakrishna.N

1 ACCEPTED SOLUTION
Read only

dev_parbutteea
Active Contributor
0 Likes
769

Hi,

Refresh all your global data if you are re-populating them for each display.

6 REPLIES 6
Read only

dev_parbutteea
Active Contributor
0 Likes
770

Hi,

Refresh all your global data if you are re-populating them for each display.

Read only

0 Likes
769

Thank you very much for your quick response.

I did not get the meaning of "refresh all you global data". Can you please explain me in detail...

FYI.....

Grid length....20.

Table has one column and lengh is 10 and has one record.

For the first time it display the one record in the grid with the length of 10 chars.

I entered one more record into the grid and at the time refreshing the table onto the grid, it is being displayed with the length of 20 which is equal to full length of grid.

Thanks and Regards,

Balakrishna.N

Read only

0 Likes
769

IF you are using ALV grid, try to give


* declaration
DATA: LAYOUT TYPE slis_layout_alv.
 * after fieldcatalog give this stmt.
layout-colwidth_optimize = 'X'.  in layout. 

Dont forget to pass this LAYOUT in FM of grid.!

regards,

Padma

Edited by: Padmashree RamMaghenthar on Feb 4, 2009 11:59 AM

Read only

0 Likes
769

Can you please provide the part of your codes where you are displaying the output.

Regards.

Read only

0 Likes
769


  lwa_layout-colwidth_optimize = c_x.
  lwa_layout-zebra = c_x.
  lv_repid = sy-repid.

  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      i_callback_program = lv_repid
      is_layout          = lwa_layout
      it_fieldcat        = li_fieldcat
    TABLES
      t_outtab           = p_fs_final
    EXCEPTIONS
      program_error      = 1
      OTHERS             = 2.
Read only

Former Member
0 Likes
769

Hi Balakrishna,

what the FM you are using ?

there is something called colwidth_optimize in your layout, if you set this with 'X', it will optimize your colomn width.

Regards,

Gautham Paspala