Delete selected row in ALV

前端 未结 1 547
陌清茗
陌清茗 2021-01-25 04:18

I have ALV table and I made a custom button in the table toolbar. Whenever the button is pressed, I want to delete the selected row. Now there\'s just a message showing up so I

相关标签:
1条回答
  • 2021-01-25 04:41

    Here is the sample code for deleting selected row:

    CASE e_salv_function.
     WHEN 'MYFUNC1'.
      PERFORM delete_lines.
      ...
     ENDCASE.   
    
    form delete_lines.
      data: sav_tabix type lvc_index.
      clear row_table.
      call method grid1->get_selected_rows( et_index_rows = data(row_table) ).
    
          loop at gt_outtab.
            sav_tabix = sav_tabix + 1.
            read table row_table with key index = sav_tabix.
            if sy-subrc = 0.
              delete gt_outtab INDEX sav_tabix.
            endif.
          endloop.
    
      call method grid1->refresh_table_display.
      call method cl_gui_cfw=>flush.
    endform.    
    
    0 讨论(0)
提交回复
热议问题