cancel
Showing results for 
Search instead for 
Did you mean: 

Identify selection of sub-total line in ALV grid

sagar-acharya
Participant
0 Kudos

Hi folks,

Is there a way to identify in the report if the user has selected any sub-total line in an ALV grid? Both for REUSE_ALV_GRID_DISPLAY and CL_GUI_ALV_GRID.

Thanks

Sagar

Accepted Solutions (0)

Answers (2)

Answers (2)

sagar-acharya
Participant
0 Kudos

I recall that we convinced the user not to have this functionality Instead the user will select all the necessary rows "manually".

Former Member
0 Kudos

Hi Sagar,

In CL_GUI_ALV_GRID,

you can get the selected row by calling method

GET_SELECTED_ROWS

Parameter ET_ROW_NO gives the index of the selected row,

based on this yiu have to put some logic to determine whether sub total row is selected or not.

Regards,

Raghavendra

sagar-acharya
Participant
0 Kudos

Hi Raghavendra,

Thats exactly the problem. When you select a sub-total line, the ET_ROW_NO does not return a valid row number.

Thanks

Sagar

-

Former Member
0 Kudos

Sagar,

What is the point in identifying the sub-total line, can you explain your requirement?

Regards,

Ravi

sagar-acharya
Participant
0 Kudos

Hi Ravi,

When the user selects the sub-total line and presses a button (lets say 'Post'), I should process all the lines for which the sub-total has been calculated.

eg.

Line1 - 1500

Line2 - 100

Line3 - 200

Subtotal - 1800

Now, if the user selects the subtotal line then I need to process all the 3 lines.

Thanks

Sagar

Former Member
0 Kudos

Sagar,

1. I don't think its good design, if you want to process those three lines, you should ask the user to select those 3 rows and process them.

2. If you have no choice, tyr these methods, these might give you some info

GET_SORT_CRITERIA

GET_SUBTOTALS

These methods might give you the info you are looking for. Try it out.

regards,

Ravi

sagar-acharya
Participant
0 Kudos

Hi Ravi,

1. Yes it is not a good design but what if the user insists?! Anyway I have to check out the possibilities.

2. I don't think these two methods will be of any help. They do not give any information about <i>what the user has selected</i>.

Thanks anyway

Sagar