Application Development 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: 

Capture selected row values

Former Member
0 Kudos

Hai Experts,

How to get the selected row values in table control. In my scenario i have n number of rows in table control. In that if i select the particular row, then that selected row should be deleted. so how to capture the index of the selected row in table control. If index cannot be retrieved, then how to find the field values of the selected row from the table control?

Regards,

Harish

1 ACCEPTED SOLUTION

Former Member
0 Kudos

add a selection column to the table control. (in the element attributes in Screen painter)

name it e.g. mark, declare it also a field mark type c.

DATA: mark type c.

loop at the table control tc with module tc-evaluate ( in the screen flow logic)

LOOP WITH CONTROL tc.

MODULE tc_evaluate.

ENDLOOP.

declare integer position for storing the line of the table control

data: pos type i.

data: lines-tc type i.

MODULE tc_evaluate INPUT.

lines_tc = sy-loopc.

if mark = 'X'.

pos = tc-current_line.

endif.

ENDMODULE. " tc_evaluate INPUT

so, you get the line number in the field pos.

1 REPLY 1

Former Member
0 Kudos

add a selection column to the table control. (in the element attributes in Screen painter)

name it e.g. mark, declare it also a field mark type c.

DATA: mark type c.

loop at the table control tc with module tc-evaluate ( in the screen flow logic)

LOOP WITH CONTROL tc.

MODULE tc_evaluate.

ENDLOOP.

declare integer position for storing the line of the table control

data: pos type i.

data: lines-tc type i.

MODULE tc_evaluate INPUT.

lines_tc = sy-loopc.

if mark = 'X'.

pos = tc-current_line.

endif.

ENDMODULE. " tc_evaluate INPUT

so, you get the line number in the field pos.