2014 Mar 01 9:06 AM
Hi,
I have created one module pool program with table control. There I have inserted on push button where some logic is deployed.
Logic :-
If I push button on current line or any line, that line should be selected in the program. So that I can move that line to next internal table.
But, it always shows first line.
Please suggest the same.
2014 Mar 01 9:35 AM
hi amol,
GET CURSOR only works on the number of table control lines that can be displayed on screen at any one time. So, if your screen can display only 4 lines, all you'll ever get from GET CURSOR is a number 1 to 4.
But your screen also knows which of your table control records is currently displayed as the top line of your table control. This information is held in field TC_ITEMS-TOP_LINE (where TC_ITEMS is the name of your table control). By combining these two bits of information, you can find the correct line number of your selected record.
For example in the case you describe where you are clicking on line 5 but GET CURSOR thinks it is line 4 because your screen has moved down a record, I would think that TC_ITEMS-TOP_LINE would be 2. Add 4 and 2 together, subtract 1 and you'll get your correct line number.
hope it helps,
vikas
2014 Mar 03 7:11 AM
Hi,
Please follow the following steps.
1) Add a field "SEL" of type char 01 to the structure you will be using in the module pool programming in the include.
2) In the layout of the table control use the same structure for the table control design.
3)Add the layout there will be a new column in the beginning of the table control.
4)In the properties of the table control at the end of the properties window there is a field w/sel. Add the structure-fieldname(SEL) to that.(The one you created in the first step).
5)Go for the radio button according to your need.
6)Now when you select a line, that particular line will be marked as structure-sel = 'X'.
using which you can do SQL operation that.
Regards