Ok, thanks for advice, but it doesn't work for me for some reason.
When I call it before SET_TABLE_FOR_FIRST_DISPLAY, it ends with error 0K534 saying that it lost the output table (no wonder, it will be set in set_table_for_first_display).
I also tried it AFTER the set_table_for_first_display and it didn't crash, but insead of the ALV it showed directly a blank Excel sheet...
Apparently, I'm doing something wrong...