Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

GET_SELECTED_ROWS ans COLUMNS method not working for menu function code in ALV outpt

former_member244346
Participant
0 Kudos
1,340

buttons-function-codes.pngbuttons.pngHi Experts,

I have a requirement in alv output screen to add standard menu button in alv output to display row wise history data and column wise history data. I have added that menu button on left top corner of ALV output.Now the issue is i have to use method GET_SELECTED_ROWS for row selection and for column GET_SELECTED_COLUMNS using this two method i can current selected and current column but in alv report method is blank but i press any application layer button i method giving selected row and column.

Anybody having idea how to get selected row and columns in ALV output and i am using CL_GUI_ALV_GRID alv.

I have attached here both menu button and application button screen shots for better understand purpose, Please help on this.

Thanks,

1 ACCEPTED SOLUTION

michael_piesche
Active Contributor
581

Did you check out the test report BCALV_GRID_05 "Add a Self-Defined Button to the Toolbar", I think it does exactly what you need. I assume you have set up the event-handling appropriatly?

Logic from the report BCALV_GRID_05:

  • adds a button "Detail" with function/user-command "BOOKINGS" to the ALV Toolbar
  • method handle_user_command within the calling programm is registered for the event user_command from the ALV-Grid
  • When event user_command is triggered within ALV-Grid, the method handle_user_command is called and the programm checks for the user-command "BOOKINGS"
  • the selected rows are read (get_selected_rows) and displayed in another ALV-Grid (Pop-up)

If you go by that Demo-Report, you should get your problem solved. Otherwise, please be more specific with your issue.

4 REPLIES 4

Sandra_Rossi
Active Contributor
0 Kudos
581

What means "but in alv report method is blank"?

NB: there shouldn't be any difference in processing the ALV Grid, whatever the function is started from the ALV Grid toolbar or from the menu or the application toolbar (remember that in the latter case, the ALV Grid control is to be stored in a global variable so that to be able to interact with it).

michael_piesche
Active Contributor
582

Did you check out the test report BCALV_GRID_05 "Add a Self-Defined Button to the Toolbar", I think it does exactly what you need. I assume you have set up the event-handling appropriatly?

Logic from the report BCALV_GRID_05:

  • adds a button "Detail" with function/user-command "BOOKINGS" to the ALV Toolbar
  • method handle_user_command within the calling programm is registered for the event user_command from the ALV-Grid
  • When event user_command is triggered within ALV-Grid, the method handle_user_command is called and the programm checks for the user-command "BOOKINGS"
  • the selected rows are read (get_selected_rows) and displayed in another ALV-Grid (Pop-up)

If you go by that Demo-Report, you should get your problem solved. Otherwise, please be more specific with your issue.

former_member244346
Participant
581

Hi Experts,

Thanks for your reply issue was in my program, in method handle_change_finish FOR EVENT data_changed_finished my screen was getting refreshed, so i was not able to get the information from GET_SELECTED_ROW method.

Thanks.

0 Kudos
581

Thanks. Please close your question (and mark the best answer if any).