Skip to Content
0

[abap2xlsx] zcl_excel_writer_2007 - > only visible columns

Jan 12 at 07:58 AM

50

avatar image
Former Member

Hi guys. Converting ALV to xlsx is a nice function and works well most of the time. Now we are using ALV variants to select only columns which should be shown to the user and filter only relevant lines. The resulting xlsx is mailed to external contacts.
The filter works fine. Only relevant lines are included in the xlsx file. However the selection on columns does not work well. All columns are taken over.

How can I solve this issue? I thought about retrieving the ALV variant with sort, filter, and fieldcat and create the internal table by abap code. But this is a hell to do.

any ideas?

see also

https://github.com/ivanfemia/abap2xlsx/issues/513

[I am sorry, but tagging abap2xlsx was not possible]

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
avatar image
Former Member Jan 12 at 08:42 AM
0

well. the debugger is my best friend. issue solved

SPAN { font-family: "Courier New"; font-size: 10pt; color: #000000; background: #FFFFFF; } .L0S31 { font-style: italic; color: #808080; } .L0S52 { color: #0000FF; } .L0S55 { color: #800080; } .L0S70 { color: #808080; }

* Handling of hidden columns
* abap_false. " We make hiden columns visible
* abap_true. " We convert column and hide it.
* abap_undefined. " We don't convert hiden columns
ls_conv_opt-hidenc = abap_undefined.

CREATE OBJECT lo_converter.
TRY.
lo_converter->convert(
EXPORTING
is_option = ls_conv_opt
io_alv = lo_grid

Share
10 |10000 characters needed characters left characters exceeded