2008 Jun 08 11:45 AM
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
2008 Jun 08 12:14 PM
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.
2008 Jun 08 12:14 PM
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.