sel1 = select mandt, equnr,
ROW_NUMBER() OVER ( PARTITION BY equnr ORDER BY equnr, idate, itime, mdocm) as rnum,
to_date(idate) as idate,
cast(to_varchar(idate) || to_varchar(itime) as "$ABAP.type( TSTMP_BW_EXTRACT )" ) AS mytimestmp,
LEAD(cast(to_varchar(idate) || to_varchar(itime) as "$ABAP.type( TSTMP_BW_EXTRACT )" )) OVER ( ORDER
BY equnr, idate, itime, MDOCM) timdelta,
to_decimal('0.0',25,6) as mydiff,
VLCOD,
LEAD(vlcod, 1) OVER ( ORDER BY equnr,idate,itime,MDOCM) as nxtVlcod,
TO_DECIMAL('0.0',25,6) as T_PRESS_RUN,