cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the Columns of Webdynpro ALV custom variants selected by users

vikas_shetty_k
Explorer
0 Kudos

Hi All,

we have a Webdynpro report where we have a custom button to download the ALV output to excel, so one thing we need to consider for this is the 'View' or variant that a customer may setup for themselves. So if they have selected their own variant then while downloading we need to only consider the columns that they have selected. I have been able to identify the variant selected by them onscreen using the IWCI_SALV_WD_TABLE and method GET_CONFIG_DATA. But I have been unable to then get the columns which are included in this variant and thus being able to reduce the output file to only those columns. Any input on how to achieve this would be helpful. Thank you

Accepted Solutions (0)

Answers (1)

Answers (1)

turkaj
Active Participant
0 Kudos

Hello Vikas,

If you use the standard WebDynpro Excel download function, then in my opinion it is not possible to influence the list. What you can do is to implement the download function yourself, so you have more control over the download.

Procedure:

  • Insert a new button
  • Define action and implement logic
  • Hide standard ecxel function

Regards
Jim

vikas_shetty_k
Explorer
0 Kudos

Hi Jim,

Thank you for your reply, we have already implemented custom download option just the way you have suggested since standard excel download function was timing out while downloading huge data. Our issue now is that user is expecting the custom download to also include only those columns that they have selected and set up using the ALV view option. So to achieve this we have to find out which variant has been selected by the user on the screen (which we have been able to do) and then also find out what columns are included in that variant. This is where we are stuck as we have been so far unable to find any way to find this, we have the option to get all the columns but not only those which are included in the variant. So if you know anyway that we can get this info then that would help us out massively. Thank you!!

turkaj
Active Participant

Okay, I get it.

The configurations are stored in the WDY_CONF_USER table. However, the configurations are stored as a blob (as XSTRING), so they have to be read again. In class CL_WDR_CFG_PERSISTENCE_UTILS and method COMP_XML_TO_TABLES a WD table is rebuilt. This table also contains information about the visibility of a column.

This is all a bit complicated. I would try to read the ALV component and the context on download, i.e. all the fields that are displayed to the user are displayed in the context node. On download, you would have to read the context node from the WD component into which you have integrated the WD ALV and adjust the Excel download.

vikas_shetty_k
Explorer
0 Kudos

Thank you for your reply again, will check the solutions you have suggested.