10-17-2014 9:59 PM
Hello Experts,
Hope you people are doing good.
I am facing an issue which i would like to mention below.
I am displaying a ZTABLE data by using an ALV GRID,in the GRID where I have a check box option to DELETE the selected rows..But the problem what I am facing is "If I select the multiple records by using the check box option and then when I tried to DELETE **only one record is deleting**..
I am providing my code below....Please help me out...
WHEN 'DELETE'.
READ TABLE t_zbacklog INTO wa_zbacklog INDEX rs_selfield-tabindex.
DELETE zbacklog FROM wa_zbacklog.
IF sy-subrc = 0.
MESSAGE 'Data Deleted successfully, Please Refresh it' TYPE 'I'.
ENDIF.
*******and this is how I created the check box in Field catalog********
w_fcat-col_pos = 0.
w_fcat-tabname = 'T_ZBACKLOG'.
w_fcat-fieldname = 'CHKBX'.
w_fcat-checkbox = 'X'.
w_fcat-edit = 'X'.
w_fcat-outputlen = 2.
APPEND w_fcat TO t_fcat.
CLEAR w_fcat.
Regards,
Naveen.
10-17-2014 11:05 PM
Friends,
If any watch this querry please help me out with the correct solution because as it is high priority report for me..
10-17-2014 11:22 PM
in the user command exit:
DELETE zbacklog WHERE chkbox IS NOT INITIAL.
rs_selfield-refresh = abap_true.
10-17-2014 11:32 PM
WHEN 'DELETE'.
DELETE zbacklog WHERE chkbx is NOT INITIAL.
rs_selfield-refresh = abap_true.
I tried like this but it is showing "Unable to interpret "WHERE".Possible causes:Incorrect spelling or comma error.
10-17-2014 11:51 PM
Sorry,
it is
DELETE t_zbacklog WHERE chkbx is NOT INITIAL.
rs_selfield-refresh = abap_true.
Regards,
Clemens
10-18-2014 12:01 AM
No buddy it's not working.Now even one record also not deleting as I commented this:READ TABLE t_zbacklog INTO wa_zbacklog INDEX rs_selfield-tabindex.
I wrote like this as you said.
WHEN 'DELETE;.
DELETE t_zbacklog WHERE chkbx is NOT INITIAL.
rs_selfield-refresh = 'X'.
10-18-2014 7:51 AM
Hi Naveen,
Try this,
When 'DELETE'.
call the method 'CHECK_CHANGED_DATA' using the grid object, then delete them using the solution provided by Clemens Li.
Regards,
FB