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: 

select particular rows in ALV display and update ztable

former_member442210
Active Participant
0 Kudos

Hello,

I my alv grid display ( using CL_GUI_ALV_GRID) , i should be able to select only particular rows where one field is having a particular value.

Upon selection of these rows which match the criteria, i should update a Ztable.

please let me know how this could be done?

2 REPLIES 2

Former Member
0 Kudos


  x_layout-box_fieldname          = 'BOX'.                   " This will allow for Row Selection in ALV

  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      i_callback_program       = sy-repid
      i_callback_pf_status_set = 'STATUS'(008)
      i_callback_user_command  = 'USER_COMMAND'(009)
      i_grid_title             = 'Delivery Split'(010)
      is_layout                = x_layout
      it_fieldcat              = t_fieldcat
    TABLES
      t_outtab                 = t_final_alv
    EXCEPTIONS
      program_error            = 1
      OTHERS                   = 2.


*To select the Row Data

Loop at t_final_alv where BOX = 'X'.

Endloop.

Former Member
0 Kudos

hi,

use method get_selected_rows to get the selected of the ALV .

then read the final ITAB get the data update the ztable.

CALL METHOD C_ALV->GET_SELECTED_ROWS

IMPORTING

ET_ROW_NO = IT_SELECTED_ROWS.