Application Development 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: 

ABAP2XLSX and alv based CL_SALV_TABLE with alv layout

thw
Explorer
0 Kudos

Hello sap experts,

we are about to use abap2xlsx and try to create an include with different output option.

One option should be that an alv (based on CL_SALV_TABLE) and its layout should be converted to xlsx. That xlsx can than be send to direct display, frontend, backend or via email.

For me it looks like the conversion of the alv is only possible in background mode. Otherwise I get a dump because method GET_METADATA of CL_SALV_TABLE is called in method ZCL_EXCEL_WORKSHEET=>BIND_ALV... where I create the xlsx worksheet based on the alv.

Therefore I have this code.

So is there a possibility to have the alv output somehow hidden in online mode? Or are there any alternative solutions? I think it would be possible (but not user friendly) that the user displays the alv and goes back. Afterwards the xlsx object is created and processed.

Thank you in advance.

Best Regards

Thomas

1 ACCEPTED SOLUTION

Tomas_Buryanek
Active Contributor
0 Kudos

It looks like you are looking for class cl_salv_bs_runtime_info. Which allows you to set ALV to not-display.

Here is nice blog with explanation:

And there are some more tutorials and info all around...

-- Tomas --
3 REPLIES 3

Tomas_Buryanek
Active Contributor
0 Kudos

It looks like you are looking for class cl_salv_bs_runtime_info. Which allows you to set ALV to not-display.

Here is nice blog with explanation:

And there are some more tutorials and info all around...

-- Tomas --

0 Kudos

Thanks for your answer. I used CL_SALV_BS_RUNTIME_INFO=>SET and now the alv is not displayed after CR_ALV->DISPLAY( ) - yay

The alv is converted into XLSX with method BIND_ALV of class ZCL_EXCEL_WORKSHEET then, but the layout, that was set for this alv, is not applied in the XLSX file, allthough CLS_SALV_BS_RUNTIME=>GET_METADATA is showing the correct column order in the returning parameter.

Any ideas how to deal with this issue? Thanks.

0 Kudos

I can not help with ABAP2XLSX 😞 Don't have experience with it. Maybe someone else will know...

You can try debug it.

In standard ALV XLSX output (cl_salv_table->to_xml method) they use function LT_VARIANT_LOAD to apply layout, where might be problem with I_USER_SPECIFIC parameter (it is by default empty)...

-- Tomas --