‎2009 Aug 10 7:42 AM
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.
‎2009 Aug 10 7:45 AM
Hi,
Just expand the column width in the excel, you will be able to see the entire column description.
‎2009 Aug 10 7:59 AM
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).
‎2009 Aug 10 8:08 AM
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
‎2009 Aug 10 10:30 AM
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.
‎2009 Aug 11 12:30 PM
check the following blogs
/people/alvaro.tejadagalindo/blog/2009/02/05/excel-ole-and-abap--create-fancy-reports
‎2009 Aug 26 10:50 AM
‎2009 Aug 26 10:50 AM
‎2011 Jan 20 5:01 AM
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.
‎2013 May 14 9:53 AM
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
‎2013 May 14 9:57 AM
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
‎2013 Jun 18 11:24 AM
Do not pass header name in seltext_s and seltext_m in the fieldcatalog. Pass it only in seltext_l.