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: 

How to download ALV to excel, based on variant?

former_member456271
Participant
0 Kudos

Hello All,

Requirement: Need to download an excel to local machine(to my computer) and fields should be there same as variant selected.

I have tried to download ALV to excel based on variant selected. But couldn't get any expected output, I have used CALL FUNCTION 'LT_FC_LOAD' and ALV_IMPORT_FROM_BUFFER_LVC (or ALV_IMPORT_FROM_BUFFER_KKBLO) but still couldn't get any selected layout. Selection screen has been attached here, where variant is passing in Layout selection.

4 REPLIES 4

raymond_giuseppi
Active Contributor
0 Kudos

Did you try to use class cl_salv_bs_runtime_info to prevent display of alv grid and get data (internal table data) and metadata (layout, field catalog, sort, filter criteria) back to your wrapper progam.

0 Kudos

To download ALV to Excel based on a variant, you can follow these steps:

Execute the ALV report in the SAP system.

In the ALV display, select the variant you want to download to Excel.

Click on the "Download" button from the ALV toolbar.

In the "Download" dialog box, select the "Spreadsheet" option.

In the "Spreadsheet" dialog box, select the appropriate download format (e.g., Excel).

Select the "Variant" option and select the variant that you want to use for the download.

Click on the "Download" button.

This will download the ALV report to Excel based on the variant you have selected. You can then save the Excel file to your local system for further analysis or sharing.

Regards,

Rachel Gomez

0 Kudos

Hi Rachel,

Thanks for replay, we are not expecting traditional way to download ALV to excel. We are expecting in direct execution to download excel with respect to columns in VARIANT saved

Sandra_Rossi
Active Contributor
0 Kudos

I guess one important information is that you don't want to display the ALV and the download must be done immediately after pressing the EXECUTE button?