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

Delete line from table control

Former Member
0 Likes
847

Hi friends,

How to delete a line from the table using table control. ie., I have created a check box in the table control and whenever the check box is clicked, and when I press a delete button, the line should get delete from the screen and also the corresponding line should be deleted from the database table.

Kindly guide me.

TIA.

Regards,

Mark K

8 REPLIES 8
Read only

Former Member
0 Likes
814

Hi,

Get the values of the field by using get cursor and delete the record from the DB table and refresh ur table control and pass the values again.

Read only

Former Member
0 Likes
814

i think better u wud have added a one char field to ur table control and in the properties of table control ,go to W/ Sel Column - give this fieldname here like itab1-ch.

now u have to just select the row and press delete ..

demo code is as follows-

module USER_COMMAND_0300 input.

case ok_code.

when 'DELETE'.

READ TABLE tabcontrl-cols INTO cols WITH KEY screen-input = '1'.

if sy-subrc = 0.

LOOP AT itab2 INTO itab1 WHERE CH = 'X'.

DELETE itab2.

ENDLOOP.

endif.

CLEAR OK_CODE.

ENDCASE.

endmodule. " USER_COMMAND_0300 INPUT

Read only

jayanthi_jayaraman
Active Contributor
0 Likes
814

Hi,

Check this link.

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/documents/a1-8-4/table%20c...

This will give you some idea eventhough I am not using checkbox there.

Read only

Former Member
0 Likes
814

Hi ,

Give me ur mail id . i will send a pdf file . It is very useful .

Regards ,

Senthil

Read only

0 Likes
814

Hi Senthil,

My mail id is vincent_as2004@yahoo.com.

Regards,

Read only

0 Likes
814

Hi Senthi,

My email id is vincent_as2004@yahoo.com.

Thanks & regards,

Read only

Former Member
0 Likes
814

Hi ,

I sent a mail to ur id .

Regards ,

Senthil

Read only

Former Member
0 Likes
814

hi,

I sent an example to ur id.