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: 

how to get the line number from table control which has more thatn one page

Former Member
0 Kudos
1,219

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.

7 REPLIES 7

Former Member
0 Kudos
403

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

former_member223537
Active Contributor
0 Kudos
403

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

Former Member
0 Kudos
403

Hi,

try sy-loopc.

Regards

Amole

Former Member
0 Kudos
403

Hi,

data ctrl_1520 type tableview using screen

1520.

use <b>ctrl_0200-current_line</b> to get current page index.

Regards

amole

Former Member
0 Kudos
403

HI,

if vctrl is the table control

then vctrl-CURRENT_LINE is the current index of the

table control.

Former Member
0 Kudos
403

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

Former Member
0 Kudos
403

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