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

How to decrease the row height in ALV Grid (OOPS).

former_member307726
Participant
0 Likes
1,879

HI Experts,

I have displayed ALV Grid using CL_GUI_ALV_GRID=>SET_TABLE_FOR_DISPLAY.

I want to decrease the row height and width.

Can any one suggest how to do this?

Regards,

Kumar.

1 ACCEPTED SOLUTION
Read only

MarcinPciak
Active Contributor
0 Likes
1,287

Hi Kumar,

Row height it predefined and you won't change it, but you can adjust column width.

For that use field COL_OPT of layout structure ( type LVC_SLAYO ) to optimize all columns width, or set explicit width using field catalog, setting field OUTPUTLEN for certain column.

Regards

Marcin

6 REPLIES 6
Read only

MarcinPciak
Active Contributor
0 Likes
1,288

Hi Kumar,

Row height it predefined and you won't change it, but you can adjust column width.

For that use field COL_OPT of layout structure ( type LVC_SLAYO ) to optimize all columns width, or set explicit width using field catalog, setting field OUTPUTLEN for certain column.

Regards

Marcin

Read only

0 Likes
1,287

Hi..

Thank You for your answer.

I am able to decrease width upto one character space. Any apossibilities to decrease furthur.

And any other way to decrease to Row Height.

Thanks & Regards,

Kumar

Read only

0 Likes
1,287

Hai,

There's a method called SET_RESIZE_ROWS in the class CL_GUI_ALV_GRID, which is a protected one. So create a subclass of CL_GUI_ALV_GRID and then access this method. Give it a try.

Best Regards,

rama

Read only

0 Likes
1,287

Hi,

SET_RESIZE_ROWS is protected method,

I am unable to use.

Thanks,

Kumar.

Read only

0 Likes
1,287

Hi, newtoAbap

Can you explain in more datail how to use method SET_RESIZE_ROWS ?

Thanks.

Edited by: Gabtia on Dec 29, 2009 10:56 AM

Read only

Former Member
0 Likes
1,287

In my case I did not want to display the whole textfield content, only the beginning.

When trying to restrict output length of a cell i found out that:

cwidth_opt ALV setting (e.g. ls_layout-cwidth_opt = 'X'.) overrules

outputlen setting on cell level (e.g. <fieldcat>-outputlen = 10.)