2008 Feb 07 11:58 AM
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.
2008 Feb 07 12:40 PM
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.