2007 Jun 21 6:13 AM
Hi experts,
I have created a table control and retrieved the data from the database into that table. After that, I kept a delete button on the screen and wrote this code for deletion of the rows in that table.
read table itab (with headerline) with key sel = 'x'. "here sel is the part of internal table type c.
delete itab where sel = 'x'.
Here, when we are trying to debug, we are not getting the sel value into the itab ie X, so we are not able to delete the selected row in the table control.
So, please tell us the solution for this.
Regards,
Rajesh.k.
Hi experts,
I have created a table control and retrieved the data from the database into that table. After that, I kept a delete button on the screen and wrote this code for deletion of the rows in that table.
read table itab (with headerline) with key sel = 'x'. "here sel is the part of internal table type c.
delete itab where sel = 'x'.
Here, when we are trying to debug, we are not getting the sel value into the itab ie X, so we are not able to delete the selected row in the table control.
So, please tell us the solution for this.
Regards,
Rajesh.k.
2007 Jun 21 6:15 AM
Hi Rajesh.
Have you defined SEL in the table control in Screen Painter?
Please check that.
Reward if useful!
2007 Jun 21 6:19 AM
Hi
It seems that the Selection of records is not functioning properly, check it
from the table control internal table Separate the selected records into another internal table
then when DELETE is pressed just modify the Db/internal tab with that internal table of deleted/selected records
Reward points for useful Answers
Regards
Anji
2007 Jun 21 6:20 AM
Hi..
Try in this way..
Loop at itab where itab-sel ='X'.
Delete itab index sy-tabix.
Endloop.
2007 Jun 21 6:21 AM
hi,
instead of this use this code.
case sy-ucomm.
when 'DELE'.
move lfa1 to itab.
append itab.
delete from lfa1 where lifnr = lfa1-lifnr.
if sy-subrc = 0.
message i000(0) with 'deleted'.
else.
message e001(0) with 'not deleted'.
endif.
endcase.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |