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

Problem while exporting ALV column header to excel sheet.

Former Member
0 Likes
3,288

Hi,

I am able to export an ALV grid details to an excel sheet. But the ALV column headers when exported to excel sheet are getting truncated.

For eg: if my column header in ALV grid is displayed as 'Material' then the column header in excel sheet is 'Mater' only. Remaining portion is getting truncated.

How can I view the entire column header text?

Kindly assist.

Thanks.

11 REPLIES 11
Read only

Former Member
0 Likes
1,878

Hi,

Just expand the column width in the excel, you will be able to see the entire column description.

Read only

0 Likes
1,878

I am able to view the ALV column header in the ALV by expanding the column. The problem doesn't lie here.

After exporting the ALV grid to excel sheet, the individual column header text is getting truncated in the excel sheet (And not in the grid itself).

Read only

0 Likes
1,878

Hi,

Well i asked you to expand the column width in the excel after exporting the ALV to the excel. What you mean by trunctated? Is "Material" is only being displayed as "Mater" within column width or the value getting exported itself is 'Mater"?

Regards,

Vik

Read only

0 Likes
1,878

Hi Vik,

I have expanded the column width in excel but the result is the same. Unable to view the complete column header.

Any idea what can be done?

Thanks.

Read only

Former Member
0 Likes
1,878

check the following blogs

/people/alvaro.tejadagalindo/blog/2009/02/05/excel-ole-and-abap--create-fancy-reports

Read only

Former Member
0 Likes
1,878

-

Read only

Former Member
1,878

-

Read only

0 Likes
1,878

I have the same problem with you, when user export to excel. I fixed it by using

w_layo-colwidth_optimize = 'X'. <<<<<<<<<<<<This

perform generate_fcat_reftab
    using 'PRUEFLOS' 'T_INPUT' '' '' 'Inspection Lot' 0.

form generate_fcat_reftab  using    p_fieldname
                                    p_tabname
                                    p_ref_tabname
                                    p_ref_fieldname
                                    p_output_text
                                    p_output_lenght.
  clear w_fcat.
  w_fcat-fieldname = p_fieldname.
  w_fcat-tabname   = p_tabname.
  w_fcat-ref_fieldname = p_ref_fieldname.
  w_fcat-ref_tabname = p_ref_tabname.
  w_fcat-seltext_s = p_output_text.
  w_fcat-seltext_m = p_output_text.
  w_fcat-seltext_l = p_output_text.
  w_fcat-outputlen = p_output_lenght.
  w_fcat-ddictxt = 'L'. <<<<<<<<<<<<<<<<<<This
  append w_fcat to t_fcat.

endform.

Read only

0 Likes
1,878

Thanks Pen-ek,

I was facing the same issue:

Doing this

w_layo-colwidth_optimize = 'X'. <<<<<<<<<<<<This

and this

w_fcat-ddictxt = 'L'. <<<<<<<<<<<<<<<<<<This

It solved.

Regards,

Ani

Read only

Former Member
0 Likes
1,878

Hi,

You are right. It happens in excel. For that you need to pass the refrence field and refrence table to the fieldcat and also small medium and large text. This will surely solve your problem.

  w_fcat-ref_fieldname = p_ref_fieldname.

  w_fcat-ref_tabname = p_ref_tabname.

  w_fcat-seltext_s = p_output_text.

  w_fcat-seltext_m = p_output_text.

  w_fcat-seltext_l = p_output_text.

  w_fcat-outputlen = p_output_lenght.

Regards -

Makarand

Read only

Former Member
0 Likes
1,878

Do not pass header name in seltext_s and seltext_m in the fieldcatalog. Pass it only in seltext_l.