on 12-04-2009 2:44 PM
Hi,
I have WD ALV report with EXPORT button (since standard button was not working properly i just hide that and added custom one) & standard dropdown to choose layout. Out of 20 columns user may choose n number of columns, the same number of columns i need to transfer to xls. How to export only selected columns to xls. Any method or FM to filter number of columns being transfer to xls. please advise
Rgds
sudhanshu
does the user selecs teh SETTINGS->HIDE column options tp hide the columns...
If yes,then you can see only the current columns and when you write the export functionality you need to get these columns..and convert it to xml format and then export to excel..
usually there are GET_COLUMNS method of if_salv_wd-column_settings for that alv..
Regards,
Lekha.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI,
We have SETTINGS options for ALV right where we can hide/unhide teh columns right..
In the cl_salv_wd_config_table(alv instance)->if_salv_wd_column_settings we can get that method.
It may require some R&D to achieve the same.
I guess some where in the forum the same question was asked..
Regards,
Lekha.
Hi,
Where exactly we are (or going to be) using this reference i.e., CL_SALV_WD_CONFIG_TABLE. Im passing contents, filename & MIME type as:
call function 'SCMS_STRING_TO_XSTRING'
exporting
TEXT = TEXT
importing
BUFFER = XTEXT.
WDR_TASK=>CLIENT_WINDOW->CLIENT->ATTACH_FILE_TO_RESPONSE(
**path to the word file
I_FILENAME = 'WDP.xls'
String Variable
I_CONTENT = XTEXT
File Type
I_MIME_TYPE = 'EXCEL' ).
In CL_SALV_WD_CONFIG_TABLE we have few methods related to column settings however not sure where exactly we will be using this class reference. can you please give some idea so that i can do some r&d in that.
Rgds
Sudhanshu
Hi,
That is fine but the issue is: at run time how do we know which column user has been added and which he been removed (by using diffrent layouts). Infact each layout will be having diffrent set of fields, now how can we pass only those fields to xls. for e.g., user can set a diffrent layout in WD output where only PRICE field is being displayed. now i need to send only PRICE field to xls. In case of standard "export to excel" button it worked fine but in case of custom button how do we get this functionality.
Hope you understand the issue.
Rgds
sudhanshu
Hi,
While debugging the SALV_WD_LAYOUT_UI (part of component SALV_WD_TABLE) component it is generating the list of selected fields need to be displaye in the WD output via. method UPDATE_ACTIVE_TAB. Inside this method internal table lt_slelected is having fields excluding the those i have hide via. settings. Now the issue is: how to make this internal table visible to our custom method (ONACTIONEXPORTTOEXCEL). Is there any way to do so. please let me know if any.
Rgds
sudhanshu
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.