Skip to content

ABAP Keyword Documentation →  ABAP − Reference →  Processing External Data →  ABAP Database Access →  ABAP SQL →  ABAP SQL - Reads →  SELECT 

ENDSELECT

Quick Reference

Other versions: 7.31 | 7.40 | 7.54

Syntax


ENDSELECT. 

Effect

The ABAP SQL statement ENDSELECT closes a loop started using SELECT.


Example

SELECT loop. The INTO clause used here cannot be written to a tabular result, which means that, in multirow results sets, a loop is opened that must be closed using ENDSELECT.

SELECT carrid, connid, SUM( seatsocc ) AS seatsocc 
       FROM sflight 
       GROUP BY carrid, connid 
       ORDER BY carrid, connid 
       INTO (@DATA(carrid),@DATA(connid),@DATA(seatsocc)). 
  ... 
ENDSELECT.