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

ALV Cannot change Column Width in Field Catalog

Former Member
0 Likes
5,320

Hi,

I have an ALV report where I want to specifically set the field widths of the columns because some of the standard domain lengths are very large (e.g. 255 chars).

I am building the field catalog like this:

  CLEAR gs_fieldcat.
  gs_fieldcat-col_pos      = 1.
  gs_fieldcat-fieldname    = 'NAME_ORG1'.
  gs_fieldcat-scrtext_m    = 'Employer Name'.
  gs_fieldcat-dd_outlen = 40.
  APPEND gs_fieldcat TO gt_fieldcat.

then calling the ALV like this:


  CALL METHOD go_alv->set_table_for_first_display
    CHANGING
      it_outtab                     = gt_evm_pm_data
      it_fieldcatalog               = gt_fieldcat .

gt_fieldcat is based on structure LVC_S_FCAT.

However, this has no effect on the column widths.

What am I doing wrong?

Regards

David

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,843

use

gs_fieldcat-outputlen = '20'.

Thanks

Hi,

I have an ALV report where I want to specifically set the field widths of the columns because some of the standard domain lengths are very large (e.g. 255 chars).

I am building the field catalog like this:

  CLEAR gs_fieldcat.
  gs_fieldcat-col_pos      = 1.
  gs_fieldcat-fieldname    = 'NAME_ORG1'.
  gs_fieldcat-scrtext_m    = 'Employer Name'.
  gs_fieldcat-dd_outlen = 40.
  APPEND gs_fieldcat TO gt_fieldcat.

then calling the ALV like this:


  CALL METHOD go_alv->set_table_for_first_display
    CHANGING
      it_outtab                     = gt_evm_pm_data
      it_fieldcatalog               = gt_fieldcat .

gt_fieldcat is based on structure LVC_S_FCAT.

However, this has no effect on the column widths.

What am I doing wrong?

Regards

David

4 REPLIES 4
Read only

Former Member
0 Likes
1,844

use

gs_fieldcat-outputlen = '20'.

Thanks

Read only

0 Likes
1,843

Thanks. I did look for that in the structure and couldn't see it.

Read only

0 Likes
1,843

Hi,

please try with that.

It will surely work.

gs_fieldcat-outputlen = '25'.

    • In quotation u can use any length whateveer u wish to display

Thanks

JAyati

Read only

GauthamV
Active Contributor
0 Likes
1,843

Use this.

gs_fieldcat-outputlen = '40'.