2006 Sep 25 10:28 AM
In module pool program i am having a table control which will hold the data from internal table and when a line in table control is selected and changed the same is modified into the internal table.
The problem is when i give page down and select say 2nd line in this 2nd page, in get cursor i am getting only 2 as the value, but i want 24 lines in first page + 2 in this page i.e.,26 how could i get this.
Thanks in advance.
2006 Sep 25 10:32 AM
Hi
IF V_LINE is the index obtained by GET CURSOR statament, the record of internal table'll be:
TABINDEX = <TABLE CONTROL>-TOP_LINE + V_LINE - 1.
So if you have 24 line per page and you select the econd line of second page:
TABINDEX = 25 + 2 - 1 = 26
Anyway you can find that value in <TABLE CONTROL>-CURRENT_LINE
Max
2006 Sep 25 10:35 AM
Hi,
In the PBO :
PROCESS BEFORE OUTPUT.
LOOP AT it_mat INTO wa_mat
WITH CONTROL tc_mat
CURSOR tc_mat-current_line .
MODULE disable_column.
ENDLOOP.
PROCESS AFTER INPUT.
LOOP AT it_mat.
ENDLOOP.
In PAI, You can check the value of tc_mat-current_line . It will return the required value.
Best regards,
Prashant
2006 Sep 25 10:36 AM
2006 Sep 25 10:39 AM
Hi,
data ctrl_1520 type tableview using screen
1520.
use <b>ctrl_0200-current_line</b> to get current page index.
Regards
amole
2006 Sep 25 10:43 AM
HI,
if vctrl is the table control
then vctrl-CURRENT_LINE is the current index of the
table control.
2006 Sep 25 10:49 AM
Hi Charles,
Just go thru these examples in SE38
demo_dynpro_tabcont_loop
demo_dynpro_tabcont_loop_at
Hope these examples will give you the right solution.
Reward points if helpful.
Regards,
Harini.S
2007 May 09 12:48 PM
Hi,
This method works even when we scroll.
Put this piece of code in one of ur PAI module.
Here " test " is the tableview control.
**********CODE*****************
CLEAR cursorline. "Cursor line
CLEAR curline. "Current top line of the window
CLEAR wa_z2604. "Work area to get the exact record where cursor is placed
curline = test-current_line.
GET CURSOR LINE cursorline.
IF curline NE 1.
IF cursorline NE 1.
cursorline = cursorline - 1.
curline = curline + cursorline.
ENDIF.
ELSE.
curline = cursorline.
ENDIF.
READ TABLE it_z2604 INTO wa_z2604 INDEX curline.
************END********************
Thank you.
Message was edited by:
Shafiq