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

Fieldcatalog: column width

Former Member
0 Likes
4,311

Dear experts,

I try to set the width of one column in my fieldcatalog in this way:

CLEAR wa_field_catalog_detail.

     wa_field_catalog_detail-fieldname = 'MAKTX'.

     wa_field_catalog_detail-ref_field = 'MAKTX'.

     wa_field_catalog_detail-ref_table = 'MAKT'.

      wa_field_catalog_detail-outputlen = '40'.

     wa_field_catalog_detail-scrtext_s text-t09.

     wa_field_catalog_detail-edit = abap_false.

     APPEND wa_field_catalog_detail TO ta_field_catalog_detail.

But for some reason the column is onl that width as the description of it, but note 40 as I would like to have....

What could be a reason for it?

Thanks in advance!

Denis

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,456

Hi, Denis!

Haven't you used layout-colwidth_optimize (OR cwidth_opt - depending on what type of ALV you have) flag?

5 REPLIES 5
Read only

Former Member
0 Likes
2,457

Hi, Denis!

Haven't you used layout-colwidth_optimize (OR cwidth_opt - depending on what type of ALV you have) flag?

Read only

0 Likes
2,456

Hi!

I did use:

wa_layout_detail-cwidth_opt = 'X'.


But the width is enough only for column title and not for column content

Read only

0 Likes
2,456

Hi! I've played with sample ALV and it seems that cwidth_opt overrides outputlen definition. Try to  switch off cwidth_opt temporarily and test it.

Read only

Former Member
0 Likes
2,456

Hello Denis,

I guess, if you set outputlen to 30, then it would only show the forst 30 characters. So I thinki it is about showing x characters and not the default width of the field.

Best regards,

Thomas Wagner

Read only

former_member201275
Active Contributor
0 Likes
2,456

Column Optimize takes preference over Column Ouput Width.