Application Development and Automation 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: 
Read only

TABLE CONTROL (URGENT)

Former Member
0 Likes
569

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.

4 REPLIES 4
Read only

Former Member
0 Likes
552

Hi Rajesh.

Have you defined SEL in the table control in Screen Painter?

Please check that.

Reward if useful!

Read only

Former Member
0 Likes
552

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

Read only

Former Member
0 Likes
552

Hi..

Try in this way..

Loop at itab where itab-sel ='X'.

Delete itab index sy-tabix.

Endloop.

Read only

Former Member
0 Likes
552

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.