SAP SQL EXPR OVER LEAD LAG ABEXA



Get Example source ABAP code based on a different SAP table
  



ABAP_SQLWIN - Window Functions LEAD and LAG
This example demonstrates window expressions with the window functions LEAD and LAG.

ABAP_SOURCE_CODE
DEMO CL_DEMO_SELECT_OVER_LEAD_LAG

ABAP_DESCRIPTION
The example shows results of the window functions LEAD and LAG to which all three possible arguments are passed. Like in the executable example, the windows are determined for window expressions with sorting.
The first argument determines the result as a character-like representation of the column NUM1 of the row determined by the second argument.
The second argument determines the rows to be evaluated using differently sized distances.
The third argument is a literal returned instead of the null value if the row to be evaluated is not in the current window.