2014 Apr 10 8:21 AM
Hi,
When downloading ALV output to excel, the headings the getting truncated.
Program is using CL_SALV_TABLE for ALV processing.
Can any one help on how to fix this.
In general fieldcatalog there is a field - DDICTXT by which we can pass 'L'/'M'/'S' - is there any thing available in OO ALV so that to fix this issue.
Thanks,
Chandra.
Hi,
When downloading ALV output to excel, the headings the getting truncated.
Program is using CL_SALV_TABLE for ALV processing.
Can any one help on how to fix this.
In general fieldcatalog there is a field - DDICTXT by which we can pass 'L'/'M'/'S' - is there any thing available in OO ALV so that to fix this issue.
Thanks,
Chandra.
2014 Apr 10 9:30 AM
have you tried:
lr_columns->set_optimize( if_salv_c_bool_sap=>true ).
2014 Apr 10 10:22 AM
Hi Glen,
I tried, but still headings truncated in excel. Is there any DDICTXT equal method.
2014 Apr 10 12:41 PM
2014 Apr 10 10:29 AM
Hi Chandra sekhar ,
Paste the code for ALV displaying.
Are headings getting displayed as short text or actually getting truncated ?
Regards ,
Giri
2014 Apr 10 10:39 AM
Hi Giri,
Actually I tried with short text with more that 10 chars, but its getting truncated to 10 chars. only.
2014 Apr 10 11:05 AM
Hi Chandra,
Are you downloading the data of ALV in program or from the ALV output you are selecting the download option.
If it is through program then please share your code.
Regards,
Rafi
2014 Apr 10 11:06 AM
Hi Chandra,
If it is through program then try to set the column text as below
gr_column ?= gr_columns->get_column( lv_col_text ).
gr_column->set_medium_text( lv_med_text ).
gr_column->set_long_text( lv_lng_text ).
gr_column->set_short_text( lv_shrt_txt ).
This will set the text to the column of ALV for a respective field.
Regards,
Rafi
2014 Apr 10 11:13 AM
hi ,
Try passing null to short and medium.
TRY.
gr_column ?= gr_columns->get_column( lv_field ).
gr_column->set_long_text( lv_long ).
gr_column->set_medium_text(' ').
gr_column->set_short_text(' ').
CATCH cx_salv_not_found .
ENDTRY.
Regards,
Giri
2014 Apr 10 11:20 AM
Hi - It is directly through output download icon option - standard.
2014 Apr 10 11:52 AM
Hi Chandra,
When you are downloading complete data of ALV by selecting the icon, why can't you write the download code in the program. When you click on 'BACK' button of ALV download the data to the respective path with column names.
Regards,
Rafi
2014 Apr 10 5:29 PM
Hi.
Try setting the field outputlen at the correct length.
hope this helps.
2021 Feb 09 2:17 AM
Hi,
I read you thread and solve the problem like this:
- I Set the column optimize;
- After getting the column data as in your code, I set the short and midium text with empty value;
-Then I used the method set_fixed_header_text to make a similar efect as the "wa_fieldcat-ddictxt = 'L'", but thinking right now I made so many tests that I am not sure that this part is realy necessary, please try without it and check if you get the excel with the complete text of the header.
I hope this helps you.
*** columns settings
lo_columns = lo_alv->get_columns( ).
lo_columns->set_optimize( ).
lo_col_ref = lo_columns->get( ).
LOOP AT lo_col_ref ASSIGNING <fs_col_ref>.
<fs_col_ref>-r_column->set_short_text( '' ).
<fs_col_ref>-r_column->set_medium_text( '' ).
CALL METHOD <fs_col_ref>-r_column->set_fixed_header_text
EXPORTING
value = 'L'.
ENDLOOP.