cancel
Showing results for 
Search instead for 
Did you mean: 

To get all the field's value in Itab from the AL

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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.

Former Member
0 Kudos

Hi Lekha,

Let me know in details like R_PARAM ID as I have not have much hands-on on WD.

Thanks and regards

Gopal Gupta

Former Member
0 Kudos

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.

Former Member
0 Kudos

Hi Lekha,

since the event will be called by the system so how can i check the R_PARAM or if i want ot put the debugging where to put and one more thing if i have to modify the global Itab, I need to know the changes one ...

Hope my questions are valid..

Thanks and regards

Gopal Gupta

Former Member
0 Kudos

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.

Former Member
0 Kudos

Hi Lekha,

Thanks for giving me your time and urs suggestions helps me a lot and my one problem is solved.

@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.

Thanks once again.

Regards,

Gopal Gupta

Former Member
0 Kudos

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.

Former Member
0 Kudos

Hi Lekha,

Reading from the context node is not working for me, so I asked you. Writing the code is not the problem for sub-totaling but presenting in the excel as like standard is challenging.

So, please let me know if any ways are there.

Thanks

Gopal Gupta

Former Member
0 Kudos

How did you export the excel data...as per your original post how did you achieve the data download to excel.

For totals/sub totals you need to have XML coding to download it to excel.

Why standard excel is not used in your requirement.

Former Member
0 Kudos

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

Answers (0)