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: 
Read only

Page Up and Page down functionality in table control

Former Member
0 Likes
4,873

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
Read only

Former Member
0 Likes
2,623

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

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

9 REPLIES 9
Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
2,623

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

Read only

Former Member
0 Likes
2,624

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

Read only

Former Member
0 Likes
2,623

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

Read only

0 Likes
2,623

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

Read only

Former Member
0 Likes
2,623

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

Read only

0 Likes
2,623

Thanks and i am ending this thread up

Read only

Former Member
0 Likes
2,623

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

Read only

Former Member
0 Likes
2,623

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

Read only

former_member841895
Discoverer
0 Likes
2,623

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