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: 

Alv-grid column width

Former Member
0 Kudos

Hi Experts,

In my ALv Grid . i have a long text like Total In Document Currency So i cant see full text in the column. So what shall i do to acheive it.

Correct answers will be appriciated with good points.

Regards,

Sunita.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Experts,

Thanks for your answers but its not working out. any more inputs.

Correct answers will be fully rewarded.

Regards,

Sunita.

15 REPLIES 15

Former Member
0 Kudos

Hi,

In yur fieldcatlog add this ..

If amt field disply len 15.

wa_fieldcat1-outputlen = '15'.

Reward if useful..

Thanks,

Durai.V

Edited by: Durai V on Jul 14, 2008 5:43 AM

kiran_k8
Active Contributor
0 Kudos

Sunitha,

data: gd_layout TYPE slis_layout_alv,

gd_layout-colwidth_optimize = 'X'.

K.Kiran.

Former Member
0 Kudos

HI sunita,

in Fieldcat-outputlen u just increase the length

other wise after executing u increase the length whatever u want then u create a variant for the layout. use it as a default layout.

hope it will useful..

Former Member
0 Kudos

Hi Sunita,

If you want to increase the width of the column in ALV then you need to increase the fieldcatalog outputlen when you declare the field catalog

fieldcatalog-outputlen = 25.

here is the Example.....

fieldcatalog-fieldname = 'PERNR'.

fieldcatalog-seltext_m = 'Personnel No.'.

fieldcatalog-col_pos = 1.

fieldcatalog-outputlen = 25.

fieldcatalog-emphasize = 'X'.

fieldcatalog-key = 'X'.

fieldcatalog-do_sum = 'X'.

fieldcatalog-no_zero = 'X'.

append fieldcatalog to fieldcatalog.

clear fieldcatalog.

I hope this will sort out your problem...

Thanks & Regards

Ashu Singh

Former Member
0 Kudos

hi,

while building the fieldcatalog use this

DATA: i_fcat TYPE TABLE OF slis_fieldcat_alv,

wa_fcat TYPE slis_fieldcat_alv.

wa_fcat-seltext_l = 'Total In Document Cuurency'.

wa_fcat-outputlen = 30.

APPEND wa_fcat TO i_fcat.

Reward points if helpfull,

Regards,

Krishna Prasad.K

Former Member
0 Kudos

Hi Sunita,

you need to increase the width of the output length when you are defining field catalog...

Here is the example...

fieldcatalog-fieldname = 'PERNR'.

fieldcatalog-seltext_m = 'Personnel No.'.

fieldcatalog-col_pos = 0.

fieldcatalog-outputlen = 25.

fieldcatalog-emphasize = 'X'.

fieldcatalog-key = 'X'.

fieldcatalog-do_sum = 'X'.

fieldcatalog-no_zero = 'X'.

append fieldcatalog to fieldcatalog.

clear fieldcatalog.

I hope this will help you.

Thanks & Regards

Ashu Singh.

Former Member
0 Kudos

Hi, SUNITA REDDY

First, define the wa of slis_layout_alv.

wa_alv_layout TYPE slis_layout_alv,

Then, you can define the field colwidth_optimize as 'X'.

wa_alv_layout-colwidth_optimize = 'X'.

Hope it will be helpful.

Best Regards,

Stephanie

Former Member
0 Kudos

Hi Experts,

Thanks for your answers but its not working out. any more inputs.

Correct answers will be fully rewarded.

Regards,

Sunita.

0 Kudos

Hi,

In yur LAYOUT

Comment this below line.

i_layout-colwidth_optimize = abap_true.

Change live below.

PERFORM fill_fields USING: 'Customer Number' 'KUNNR' '10',

'Customer Name' 'NAME1' '35',

'Document Number' 'BELNR' '10',

'Document Date' 'BLDAT' '10',

'Due Date' 'DAYS' '10',

'Total In Document Currency' 'WRBTR' '15',

'Currency' 'WAERS' '7',

'Total In Reporting Currency' 'DMBTR' '15',

'Current Date' 'CURRENT' '10',

'1-30 days' 'D30' '15',

'31-60 days' 'D60' '15',

'61-90 days' 'D90' '15',

'91-120 days' 'D120' '15',

'121-180 days' 'D180' '15',

'181-240 days' 'D240' '15',

'241-360 days' 'D360' '15',

'Above 365 days' 'DA365' '15'.

FORM fill_fields USING &01 &02 &03.

  • SORT

wa_fieldcat-tabname = 'T_OUTPUT'. "t_output_provgr

wa_fieldcat-fieldname = &02.

wa_fieldcat-reptext_ddic = &01.

wa_fieldcat-outputlen = &03.

  • wa_fieldcat-ref_fieldname = fieldname.

  • wa_fieldcat-ref_tabname = 'DMBTR'.

  • w_fieldcat-do_sum = &03.

  • wa_fieldcat-do_sum ='X'.

APPEND wa_fieldcat TO i_fieldcat.

CLEAR wa_fieldcat.

ENDFORM. "fill_fields

AND

Every filed u add like outputlen .

FORM fill_fieldcat_sum.

wa_fieldcat1-col_pos = '3'.

wa_fieldcat1-tabname = 'TG_DATA'. "t_output_provgr

wa_fieldcat1-seltext_m = 'Total In Reporting Currency'.

wa_fieldcat1-outputlen = '15'.

wa_fieldcat1-fieldname = 'DMBTR'.

wa_fieldcat1-do_sum = 'X'.

APPEND wa_fieldcat1 TO i_fieldcat1.

CLEAR wa_fieldcat1.

ENDFORM. "fill_fieldcat_sum

Surly it will work....

Reward if usefull..

Thanks,

Durai.V

0 Kudos

fieldcatalog-outputlen = 25.

Former Member
0 Kudos

hi Suneetha,

u have to customize ur fieldcatlog ....

pass requiered no as parameter to OUTPUTLEN

Assume ur column title may length of 10

EX :wa_fieldcat1-outputlen = '10'.

it works

try it out..

Regards.

Raju Mummidi

Former Member
0 Kudos

Hi Sunita,

If you want to increase the width of the colomn in ALV, just specify the length in the fielcatalog.

FORM field_catalog USING p_fcat TYPE slis_t_fieldcat_alv.

DATA: a_fcat TYPE slis_fieldcat_alv.

REFRESH p_fcat[].

CLEAR a_fcat.

a_fcat-col_pos = 5.

a_fcat-fieldname = 'MAKTX'.

a_fcat-tabname = 'IT_FINAL'.

a_fcat-seltext_l = 'Material Description'.

a_fcat-outputlen = 40.

APPEND a_fcat TO p_fcat.

CLEAR a_fcat.

Hope this will solve ur problem.

Reward points if it is helpful.

with regards,

sharmista.

former_member387317
Active Contributor
0 Kudos

Hi SUNITA REDDY,

First Checkout the Varible Type u r using... Make it as string type...

In ALV GRID coulmn width is restricted around 128 chars

So if your string is more then that say 150 chars then U can see only 128 chars in output...

1st Way...

U can split the String in two parts let's say

String1 = String+0(127)

string2 = String+127

and then u can show it in two different columns

2nd Way..

U can use ALV LIST instead of ALV GRID

in ALV LIST u can show the output upto 255 Char in one Column...

But if string exceeds 255 char then again u have to split it ...

Hope it will solve your problem..

Thanks & Regards

ilesh 24x7

Former Member
0 Kudos

Hi Sunita,

If you want to increase the width of the colomn in ALV, just specify the length in the fielcatalog.

if u increase the seltext length u will be getting full string u wish.

also take care u will provide enough field size .

FORM field_catalog USING p_fcat TYPE slis_t_fieldcat_alv.

DATA: a_fcat TYPE slis_fieldcat_alv.

REFRESH p_fcat[].

CLEAR a_fcat.

a_fcat-seltext_l = 'Material Description'.

Hope this will solve ur problem.

Reward points if it is helpful.

regards,

sri.