cancel
Showing results for 
Search instead for 
Did you mean: 

Column width in ALV

Former Member
0 Kudos

Hi All,

How to calculate the column width indepenedent of the content.

SET_RESIZABLE method of ALV column is used but it is of no use.

If I set the width of the column, if the content exceeds the width, then the table is getting adjusted automatically. I don't want this to happen.

Do I need to give the width on trail and error basis.

For Ex: If the field has CHAR48 how to set width independent of the content so that the data fits in exactly.

Appreciate your earliest replies.

Thomas: Any suggestions.

Regards,

Lekha.

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Lekha,

I am also now facing the same issue.. But I am unable to solve it..

I want to fix the column sizes in my ALV table..

Regards,

Yugesh

Former Member
0 Kudos

resolved by myself.

Former Member
0 Kudos

Hi lekha,

I have requirement..

i have reduce the width of the alv column..

I used the following code:

DATA: lr_col TYPE REF TO cl_salv_wd_column.

DATA: LV_RESIZE TYPE FLAG.

*Get ref to column whose width is to be set .

lr_col = lr_table1->get_column( 'NAME1' ).

*Set width.

LR_COL->GET_RESIZABLE( ).

LV_RESIZE = 'X'.

LR_COL->SET_RESIZABLE( LV_RESIZE ).

lr_col->SET_WIDTH( '15' )

But this works when i set the fixed table layout in the code

  • lr_table_settings1->SET_FIXED_TABLE_LAYOUT( 'X' ).

when i do this my standard setting such as fixed columns etc gets distotted..

Any advice.?

Former Member
0 Kudos

Hi Lekha,

Could you please tell me how did you set the width of ALV column independent of its content. I am on ECC 6.0 ENHP4. I tried all options available in Webdynpro but couldn't figure it out.

Thanks,

Tom

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Are you using the Fixed Table Layout option:

if_salv_wd_table_settings~set_fixed_table_layout

That is generally needed for having more fine control over the column widths. It is a requirement of the drag and drop resize of columns in 7.01 for instance.

Former Member
0 Kudos

Hi Thomas,

I'm not using the FIXED LAYOUT OPTION, If I use this then I need to specify the column width explicitly and every time I need to calculate the width based on the content of the cell of that column. How to avoid this.

Thomas: When I referred this link, it shows the column rezizalbe option

https://www.sdn.sap.com/irj/scn/elearn?rid=/library/uuid/d0760510-a2d5-2b10-de9f-d897679696e3&overri...

Im using EHP 4 for SAP ERP 6.0 /7.0 - Relase(701), Level(0002), Package(SAPKA70102).

But, In my application this option is not shown. Any reasons for this. What is missing.

Only for some applications it is shows the resizable option. How can we enable this feature for all the applications.

What are the pre-requisites to enable this feature. Does any patch problems have any effect on this.

Regards,

Lekha.

Edited by: Lekha on Jul 2, 2009 12:40 PM

Former Member
0 Kudos
Former Member
0 Kudos

Hi,

The link you gave is not related to WDA.

Thanks,

Lekha.