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: 

PageUP/PageDown logic on a screen.

Former Member
0 Kudos
389

I need to populate 5 records each time when I hit page up or page down button. In last page the DOWN button should not work and in first page the UP button should not work. I have all the data of the contenta of the screen in an internal table in PBO of screen. Can anyone help me out the logic for populating this data on the screen based on page down/up buttons. Step loop is being used on the screen for population.

Thanks

1 ACCEPTED SOLUTION

Former Member
0 Kudos
122

Hi,

use the function module SCROLLING_IN_TABLE for scrolling in the table control..

OK - try something like:

CASE sy-ucomm.

WHEN 'P+' OR

'P++' OR

'P-' OR

'P--'.

CALL FUNCTION 'SCROLLING_IN_TABLE'

EXPORTING

entry_act = tc-top_line

entry_to = tc-lines

last_page_full = 'X'

loops = loops

ok_code = sy-ucomm

overlapping = 'X'

IMPORTING

entry_new = tc-top_line

EXCEPTIONS

no_entry_or_page_act = 1

no_entry_to = 2

no_ok_code_or_page_go = 3

OTHERS = 4.

ENDCASE.

Thanks,

Naren

4 REPLIES 4

Former Member
0 Kudos
122

check this sample program <b>DEMO_DYNPRO_TABCONT_LOOP_AT</b>

regards

prabhu

Former Member
0 Kudos
123

Hi,

use the function module SCROLLING_IN_TABLE for scrolling in the table control..

OK - try something like:

CASE sy-ucomm.

WHEN 'P+' OR

'P++' OR

'P-' OR

'P--'.

CALL FUNCTION 'SCROLLING_IN_TABLE'

EXPORTING

entry_act = tc-top_line

entry_to = tc-lines

last_page_full = 'X'

loops = loops

ok_code = sy-ucomm

overlapping = 'X'

IMPORTING

entry_new = tc-top_line

EXCEPTIONS

no_entry_or_page_act = 1

no_entry_to = 2

no_ok_code_or_page_go = 3

OTHERS = 4.

ENDCASE.

Thanks,

Naren

0 Kudos
122

Hi Naren,

IAm using step loop for the screen as I can not use table control due to screen width restrictions. Could you please suggest me the solution for this.

Thanks

Usha

0 Kudos
122

Hi

Your flow screen should be like this:

PROCESS PBO.

MODULE INIT_PAGE.

LOOP.
  MODULE READ_ITAB.
ENDLOOP.

PROCESS PAI.

LOOP.
  MODULE GET_ROWS_DISPLAED.
  MODULE MODIFY_ITAB.
ENDLOOP.

MODULE GET_TOT_LINE.

-----------------------------------------

MODULE INIT_PAGE.
  IF TOP_LINE = 0.
     TOP_LINE = 1.
  ENDIF.
ENDMODULE.

MODULE READ_ITAB.
  CURSOR = TOP_LINE + SY-STEPL - 1.
  READ TABLE ITAB INDEX CURSOR.
  IF SY-SUBRC <> 0.
     CLEAR ITAB.
  ENDIF.
ENDMODULE.

-------------------------------------------------------------

MODULE GET_TOT_LINE.
  DESCRIBE TABLE ITAB LINES TOT_LINE.
ENDMODULE.

MODULE GET_ROWS_DISPLAED.
  DISP_LINE = SY-LOOPC.
ENDMODULE.

MODULE MODIFY_ITAB.
  CURSOR = TOP_LINE + SY-STEPL - 1.
  MODIFY ITAB INDEX CURSOR.
ENDMODULE.



MODULE USER_COMMAND.

MODULE USER_COMMAND.
  CASE OK_CODE.
     WHEN 'PG_DW'.
         TOP_LINE = TOP_LINE - DISP_LINE.
         IF TOP_LINE < 1. TOP_LINE = 1. ENDIF.
     WHEN 'PG_UP'.
         TOP_LINE = TOP_LINE + DISP_LINE.
         IF TOP_LINE > DISP_LINE. TOP_LINE = DISP_LINE. ENDIF

ENDCASE.

ENDMODULE.