cancel
Showing results for 
Search instead for 
Did you mean: 

ALV-Grid column width?

Former Member
0 Kudos

Hi

We've developed an ABAP program that uses an ALV-Grid to display some data for some specific months.

In the ALV-Grid we use sum-columns to sum up the values for the different months.

When I try to set a specific width of this column it is simply ignored, and when I show it through WebGui the columns get so narrow that I can't se the column-headers.

Btw we're using R/3 Enterprise 4.7 and ITS 6.20 patch 19 with hotfix.

Does anybody have an idea?

Cheers,

Jacob Vennervald

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Make sure CWIDTH_OPT is not set to 'X' in the layout structure (of type LVC_S_LAYO) that is passed to the ALV Grid during SET_TABLE_FOR_FIRST_DISPLAY method call as interface parameter IS_LAYOUT.

Also use OUTPUTLEN of the field catalog structure (LVC_S_FCAT) to set the width for the respective columns.

For ex,

LOOP AT t_fcat ASSIGNING <wa_fcat>.

IF <wa_fcat>-fieldname EQ 'VBELN'.

<wa_fcat>-outputlen = 10.

ENDIF.

ENDLOOP.

Hope this helps..

Sri

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Jacob,

Try this...

x_fieldcat TYPE lvc_s_fcat --- the structure for lvc_s_fcat

then for example say you want to increase the width of the column for MATNR field give

x_fieldcat-OUTPUTLEN = '18'

as the length of MATNR field is 18.

Hope this solution helps you.

Keep Rocking,

Tejus.

Former Member
0 Kudos

Hi jacob,

you can use fieldcat outputlen to reduce or incerease of the column in alv grid.

check this....

http://help.sap.com/saphelp_erp2004/helpdata/en/f8/38ed40fe5e702ae10000000a155106/frameset.htm

reward points for helpfull answers and close the thread if your query is sovled.

regards,

venu.

Former Member
0 Kudos

Thanks a lot guys.

That helped.

Cheers,

Jacob Vennervald