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

Deleting selected rows

Former Member
0 Likes
2,310

Hi all,

I am displayed database table records in a table created

using "screen painter" .

My request is if i select one record and press delete button

means then the selected record should be deleted.

I did this but the data was not deleted, because i dont

know how to set 'X' to "Mark" variable. i have created this

Mark in screen painter.

Can any one help me how to set 'X' to a selected row and delete the corresponding row....

regards

Ranjith

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,489

Hi,

Deleting a set of lines

LOOP AT TAB_DEST WHERE K = KVAL.

DELETE TAB_DEST.

ENDLOOP

DELETE TAB_DEST WHERE K = KVAL.

Deleting a sequence of lines

DO 101 TIMES.

DELETE TAB_DEST INDEX 450.

ENDDO.

DELETE TAB_DEST FROM 450 TO 550.

Reward Points if useful

Raghunath.S

9986076729

Hi all,

I am displayed database table records in a table created

using "screen painter" .

My request is if i select one record and press delete button

means then the selected record should be deleted.

I did this but the data was not deleted, because i dont

know how to set 'X' to "Mark" variable. i have created this

Mark in screen painter.

Can any one help me how to set 'X' to a selected row and delete the corresponding row....

regards

Ranjith

8 REPLIES 8
Read only

Former Member
0 Likes
1,489

hi,

Refer to the link.

Regards

Sumit Agarwal

Read only

Former Member
0 Likes
1,489

hi,

set the internal table field to the mark field. so that when ever u mark it then the field in the internal table will be updated to X . so by reading u can delete the record from internal table.

rgds.,

subash

Read only

Former Member
0 Likes
1,490

Hi,

Deleting a set of lines

LOOP AT TAB_DEST WHERE K = KVAL.

DELETE TAB_DEST.

ENDLOOP

DELETE TAB_DEST WHERE K = KVAL.

Deleting a sequence of lines

DO 101 TIMES.

DELETE TAB_DEST INDEX 450.

ENDDO.

DELETE TAB_DEST FROM 450 TO 550.

Reward Points if useful

Raghunath.S

9986076729

Read only

Former Member
0 Likes
1,489

Use the Demo Program for Reference

RSDEMO02

Read only

Former Member
0 Likes
1,489

hi ranjith,

You created mark in the screen painter means you also included that field in the internal table, if not you a include a field called mark in the internal table ,

DATA : Begin of i_tab occurs o,

mark type c,

end of i_tab.

Then follow like this ,

when you select the field that record automatically updated by X in the interal table so after that what you do is

case sy-ucomm.

when 'DELETE'

LOOP AT I_TAB WHERE MARK = 'X'.

DELETE IT_TAB.

ENDLOOP.

hope this wil solve your problem,

Reward if it is usefull,

Regards,

KP

Read only

Former Member
0 Likes
1,489

Hi

Go through the link given below :

With Regards

Nikunj shah

Read only

Former Member
0 Likes
1,489

hiiii

you can use delete statement for internal table and its records like follows

LOOP AT ITAB WHERE MARK = 'X'.
        DELETE ITAB.
  ENDLOOP.

or if you want to delete record at particular index then use

DELETE itab INDEX wa_index.

regards

twinkal

Read only

Former Member
0 Likes
1,489

Hi,

Check this link

Same problem is solved here-

Regards,

Sujit