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 error?

Former Member
0 Likes
446

In my table control the user enter to create few details.Now if we wish to delete the same it is not allowed.

Every time it give error.

How to do so if by mistake 5 line items entry & wish to delete one

Regads,

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
430

use some coding similar to the below lines.

GET CURSOR LINE line1. (declare the cursors in the include)

delete * from table1 where table1-current_line = line1.

call the code in PAI :

case sy-ucomm. (check sy-ucomm in debugging)

when 'DEL'.

GET CURSOR LINE line1. (declare the cursors in the include)

delete * from table1 where table1-current_line = line1.

Declaring cursor: (in include)

DATA : cursor1 TYPE i.

Hope it aws helpful,

saipriya

3 REPLIES 3
Read only

Former Member
0 Likes
430

Try to add a another column that will represent the selected row and delete the wanted line using the delete button

Read only

0 Likes
430

Hi,

To delete the record you need to tell the table control what field you want to delete. To acieve this first add the property called w/ SelColumn into the table control and give the name to the column say SEL. Add the same field SEL of type CHAR1 into the internal table or structure. So at runtime when you press this column then by default it will set to 'X'

Now into the PAI, into the loop of the table control modify the internal table with the value 'X'.

Into the module USER_COMMAND delete the record where SEL = 'X'.

It will work perfectely.

Please let me know if anything else requires.

Cheers,

Prashant

Read only

Former Member
0 Likes
431

use some coding similar to the below lines.

GET CURSOR LINE line1. (declare the cursors in the include)

delete * from table1 where table1-current_line = line1.

call the code in PAI :

case sy-ucomm. (check sy-ucomm in debugging)

when 'DEL'.

GET CURSOR LINE line1. (declare the cursors in the include)

delete * from table1 where table1-current_line = line1.

Declaring cursor: (in include)

DATA : cursor1 TYPE i.

Hope it aws helpful,

saipriya