cancel
Showing results for 
Search instead for 
Did you mean: 

Selecting multiple Checkboxes to update ALV table is not working and is only updating the first row when I save changes in the table

Former Member
0 Kudos

HI,

I have a requirement to display an ALV table with checkbox as the first field. There are three options on the tool bar of the ALV table namely "Select All", "Deselect All" and "Save changes" . When I click "Save changes", the last field needs to be updated  with a value(New Supervisor). When I click select all option, checkboxes of all the rows need to be selected.  Select All works fine, but when I click on Save changes, it always updates the "first row only" irrespective of selecting other rows.

Below is the logic I've used in my webdynpro.

  • I wrote an event handler for the event "ON_CELL_ACTION" wherein the index of the row that has been selected is  passed. Then the  node is bound.
  • An event handler has been written for the event "ON_FUNCTION" wherein the logic is written to update the rows with checkboxes (which ever rows I've selected in the input). This contains code for "Select All" , "Deselect All" and "Save Changes" by passing event id = IF_SALV_WD_TABLE_FUNCTION->id where { this IF_SALV_WD_TABLE_FUNCTION->id would be 'SELECT' , 'DESELECT' and 'SAVE_BTN'} .

R_PARAM is delcared as type ref to IF_SALV_WD_TABLE_FUNCTION in the method parameters.

if r_param->id = 'SELECT'.

....

elseif r_param->id = 'DESELECT'.

...

elseif r_param->id = 'SAVE_BTN'.

....logic to update the last field for all the  selected rows...

endif.



Select and Deselect All are working fine. But, when I read the node within "Save changes" logic, it is always pointing to the first line if the table which is evident that the selection is not working fine.

P.S: Earlier, my webdynpro had "row-selector" option and multiple records were updated corrently. But, I had to  replace row-selector with Check box as per the user requirement and the logic doesn't seem to work.

Appreciate help or ideas  to update the selected rows instead of just updating the first row.

Thanks,

Pavan

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Binding the modified internal table to the node will take care of this. Closing the thread.

Answers (0)