cancel
Showing results for 
Search instead for 
Did you mean: 

to delete the row for the corresponding checked rows in alv

Former Member
0 Kudos

hi,

i have a alv report with check boxes,

can any one say how to delete the row for the corresponding checked rows.

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member188685
Active Contributor
0 Kudos

hi,

place your own button in tool bar, and handle it in the user_command.

delete the entries from itab where checkbox is checked.

Regards

vijay

Former Member
0 Kudos

hi

give In REUSE_ALV_LIST_DISPLAY

I_CALLBACK_USER_COMMAND = P_USER_COMMAND

FORM F_USER_COMMAND USING R_UCOMM LIKE SY-UCOMM

RS_SELFIELD TYPE SLIS_SELFIELD.

IF R_UCOMM = C_DELETE. where CONSTANTS : C_DELETE(6) TYPE C VALUE 'DELETE',

READ TABLE IT_ITAB WITH KEY REC_SEL = C_X.

LOOP AT IT_MARA WHERE REC_SEL = 'X'.

MOVE-CORRESPONDING IT_ITAB TO IT_TEMP.

APPEND IT_TEMP.

CLEAR IT_TEMP.

ENDLOOP.

where it_temp IT_TEMP TYPE STANDARD TABLE OF itab WITH HEADER LINE,

DELETE ITAB FROM TABLE IT_TEMP.

HOPE THIS HELPS

PRIYA

Former Member
0 Kudos
write user command

I_CALLBACK_USERCOMMAND = 'USERCOMMAND'.

FORM USERCOMMAND.

  when 'DELETE'.
 
   Loop at itab where chk = 'X'.
     delete itab index sy-tabix.
   Endloop.
ENDFORM>
Former Member
0 Kudos

Charles,

As your Check Box is a part of the internal table,

you can simply use

DELETE ITAB WHERE COLUMN (Check Box) = 'X'.

After that refresh the table display, by REFRESH_TABLE_DISPLAY if you using OO ALV, or call the REUSE function again to refresh the data on the screen.

Regards,

Ravi

Note : Please mark the helpful answers