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: 

concept of paging

Former Member
0 Kudos

FORM PAGING USING CODE.

DATA: I TYPE I.

J TYPE I.

CASE CODE.

WHEN 'P--'. FLIGHTS-TOP_LINE = 1.

WHEN 'P-'. FLIGHTS-TOP_LINE = FLIGHTS-TOP_LINE - LINE_COUNT.

IF FLIGHTS-TOP_LINE LE 0.

FLIGHTS-TOP_LINE = 1. ENDIF.

WHEN 'P+'. I = FLIGHTS-TOP_LINE + LINE_COUNT.

J = FLIGHTS-LINES - LINE_COUNT + 1.

IF J LE 0.

J = 1. ENDIF.

IF I LE J.

FLIGHTS-TOP_LINE = I.

ELSE. FLIGHTS-TOP_LINE = J.

ENDIF.

WHEN 'P++'. FLIGHTS-TOP_LINE = FLIGHTS-LINES - LINE_COUNT + 1.

IF FLIGHTS-TOP_LINE LE 0.

FLIGHTS-TOP_LINE = 1. ENDIF.

ENDCASE.

ENDFORM.

WHAT'S STAND FOR P+, P, P--, P-. HERE IN THIS EXAMPLE WRITEN IN SAP LIBRARY.

NOTE: WHAT IS FLIGHTS-LINES HERE.

1 REPLY 1

Former Member
0 Kudos

P+, P, P--, P-. I would think would be the user commands associated with scrolling or using the page up and page down icons (ok_codes that you define in the status bar,

P+ would be scroll down one page

P++ would be scroll to the end

P- would be scroll up one page

P-- would be go back to the beginning

Form the looks of the code, I suspect flight_lines would be the total number of lines in your internal table so that the rpogramcan decide from which line it should show the data if in a table control.

Hope this helps.