SAP SQL EXPR OVER WIN FRAME ABEXA



Get Example source ABAP code based on a different SAP table
  



ABAP_SQLWIN - Window Frame Specification
The example demonstrates how different window functions are applied to frames inside a window.

ABAP_SOURCE_CODE
DEMO CL_DEMO_SELECT_OVR_WIN_FRM_SPE

ABAP_DESCRIPTION
count sorts the rows by the column ID and counts the number of rows from the first row of the window to the current row. The result is the same as that returned by the ROW_NUMBER( ) function.
count_reverse sorts the rows by the column ID and counts the number of rows from the current row to the last row of the window. The result is reverse numbering.
average sorts the rows by the column ID and calculates the rolling averages of a subset of rows from column COL1. The subset consists of the current row plus one preceding and one following row. With this function, it is possible, for example, to calculate the <(>3-day-average<)> temperature for every day from a list of temperature data.
accumulate sorts the rows by the column ID and accumulates the values from the first row of the window up to the current row, thus computing the running total of column COL1.