on 02-01-2012 6:31 AM
Hi All,
I am using the salv_wd_table used component for reporting in Wd and I have disabled the export to excel icon and instead of that i am using my custom buttons for the same purpose. The reason behind to do so was exporting some header info into the excel. I have achieved this. For normal case its working fine but when I am clicking on the sorting in the header, the fields gets subtotal, and when the same I am exporting to excel it is always taking the Old value ie w/o subtotaling etc.
Since for exporting I am using my old Itab, thats why the problem is.
So, can anybody knows how to get the currently values in itab as displayed in wd Alv.
Thanks in advance,
Gopal Gupta
Consider a global internal table in the view.
When you apply the sort as this is one of the standard function there is a event that gets triggered check the R_PARAM ID for this, update this global internal table (ON STD FUNCTION AFTER) check for relevant name.
When the EXPORT is clicked pass this global internal table.
Hope this solves your issue.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
First under the Methods tab of that view,
check for the ALV events (ONSTD AFTER) and implement that as this method will return that r_param id.
Check in the debugging after the SORT is clicked, you wiil get to the value.
Once you get it in the same method , write the logic.
CASE R_PARAM->ID.
when ' '. "Get the id from debugging
update the global internal table or get the context node relevant table information.
ENDCASE.
Hope this helps.
Go to the METHODS tab-> create a method and under EVENT HANDLER select the ALV event from F4 help (choose on STD FUNCTION) check for the list you will find.
now once this is created.. check the importing parameters you will have r_param reference object. put a external break point in this, you break point will be triggered when SORT is clicked then you can know the value right.
gopal wrote -
@Just let me know if is possible to physically store the values in Itab after clicking on sorting. As on clicking the same sub-totaling happens.
What you want to store...read the context node in this method and check if you are getting any totals.
Or you have to read that total row through some coding, update the global table and when export button is clicked pass this global table.
Hi Lekha,
My requirement is to export the header info along with the table data, but till now I Have the notion that standard didnt support it, thats why I am going for custom but If I am going to custom for everything I need to write the code like Total, sub-totaling, grouping and formating of the excel at the same time. Thats why I am searching for some better solutions.
Thanks & Regards,
Gopal Gupta
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.