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: 

Page Up and Page down functionality in table control

Former Member
0 Kudos

Hi,

I want to add two pushbuttons in the module pool screen which has a table control that fetches data from the transparent table. One pushbutton is for the page up and other is for page down. If my table control <say tab_ctrl1> has 75 records in total with shows 25 at time so with a single page down it should show next 25 rows of the data.

thanks

ekta

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Ekta if table has entries more than the visible rows of table control , then vertical scroll bar will apperar automatically.

If it doesnt appera then u can put a statement <Table Control Name>-lines = 10000 (u can put any value here ) in PBO of screen where table control is.

It will have same functionlity as page up & down that too without writing code for page up or page down separately.

Regards

Sushil

9 REPLIES 9

0 Kudos

Hi,

Use the function module SCROLLING_IN_TABLE.

For ok_code pass P- for previous page and P+ for next page.

Example:


   DATA L_TC_NEW_TOP_LINE     TYPE I.
     CALL FUNCTION 'SCROLLING_IN_TABLE'
          EXPORTING
               ENTRY_ACT             = Table_Control-TOP_LINE
               ENTRY_FROM            = 1
               ENTRY_TO              = Table_Control-LINES
               LAST_PAGE_FULL        = 'X'
               LOOPS                 = 25
               OK_CODE               = 'P+'
               OVERLAPPING           = 'X'
          IMPORTING
               ENTRY_NEW             = L_TC_NEW_TOP_LINE
          EXCEPTIONS
*              NO_ENTRY_OR_PAGE_ACT  = 01
*              NO_ENTRY_TO           = 02
*              NO_OK_CODE_OR_PAGE_GO = 03
               OTHERS                = 0.

   Table_Control-TOP_LINE = L_TC_NEW_TOP_LINE.

Regards,

Sesh

Former Member
0 Kudos

Ekta if table has entries more than the visible rows of table control , then vertical scroll bar will apperar automatically.

If it doesnt appera then u can put a statement <Table Control Name>-lines = 10000 (u can put any value here ) in PBO of screen where table control is.

It will have same functionlity as page up & down that too without writing code for page up or page down separately.

Regards

Sushil

Former Member
0 Kudos

in the end of your loop at internal table in PAI write

LINE_JUMP = SY-LOOPC.

instead of hard coding it like

LINE_JUMP = 25.

and in your module user command write code like this

CASE OK_CODE.

WHEN 'P+'.

CLEAR OK_CODE.

CONTROL_DATA-TOP_LINE = CONTROL_DATA-TOP_LINE + LINE_JUMP.

IF CONTROL_DATA-TOP_LINE GT CONTROL_DATA-LINES.

CONTROL_DATA-TOP_LINE = CONTROL_DATA-LINES - LINE_JUMP + 1.

ENDIF.

WHEN 'P--'.

CLEAR OK_CODE.

CONTROL_DATA-TOP_LINE = 1.

WHEN 'P-'.

CLEAR OK_CODE.

CONTROL_DATA-TOP_LINE = CONTROL_DATA-TOP_LINE - LINE_JUMP.

WHEN 'P++'.

CLEAR OK_CODE.

CONTROL_DATA-TOP_LINE = CONTROL_DATA-LINES - LINE_JUMP + 1.

assign P++ to page Last icon, P-- for first page, P+ for next page,P- for previous page

Reward points if useful, get back in case of query...

Cheers!!!

Message was edited by:

Tripat Pal Singh

0 Kudos

hi

your suggestion helped me a lot....please can you help me in finding this out...

f i press page up and page down of the keyboard...it should do the same functionality as page-up and page-down push buttons are doing.

actually i want to know what is the standard value of the page down and page up keys in the module pool.

thanks ekta

Former Member
0 Kudos

IN data declaration i have taken a data N TYPE I VALUE '16',

instead of hard coding we can have character declaration even as c_16 or any other value.

for page up i have used function code as '&PUP'

and for page down i have used function code as '&PDN'

in PAI module

case for the ok_code is as:

WHEN '&PUP'.

tab_ctrl1-top_line = tab_ctrl1-top_line - n.

WHEN '&PDN'.

tab_ctrl1-top_line = tab_ctrl1-top_line + n.

thanks for all the experts who helped me in getting this thread solved

0 Kudos

Thanks and i am ending this thread up

Former Member
0 Kudos

Hi all,

if i press page up and page down of the keyboard...it should do the same functionality as page-up and page-down push buttons are doing.

actually i want to know what is the standard value of the page down and page up keys in the module pool.

thanks...

please help me in solving the problem

Former Member
0 Kudos

HI ALL

the issue is been resolved.

in PBO

index_t = tab_ctrl1-top_line.

index_d = tab_ctrl1-top_line + n.

set cursor field 'WA_MATERIAL_DATA-MATNR' line N OFFSET INDEX_T.

thanks

ekta

former_member841895
Discoverer
0 Kudos

Can anyone also provide the same for Find and Find next button please .?