Skip to content

ABAP Keyword Documentation →  ABAP − Reference →  Obsolete Language Elements →  Obsolete Processing of External Data →  Obsolete Database Access →  Obsolete ABAP SQL →  Obsolete Short Forms in ABAP SQL 

SELECT - Short Form

Quick Reference

Other versions: 7.31 | 7.40 | 7.54

Obsolete Syntax

SELECT [SINGLE] * FROM { dbtab | *dbtab } ...
  ...
ENDSELECT.

Effect

This statement is a short form of the following ABAP SQL statement for accessing an individual database table dbtab:

SELECT [ SINGLE] *  FROM dbtab INTO { dbtab | *dbtab } ...
  ...
ENDSELECT.

The explicit specification of a work area is not required in an INTO clause. A table work area dbtab or dbtab is used implicitly as the work area. The table work area must be declared using TABLES. If the name dbtab is used instead of the name of the database table dbtab, dbtab is accessed, but the additional table work area is used.

The short form can only be used to read all columns of a database table if * is specified in the SELECT list. When individual columns or aggregate functions are read, the work area must always be specified explicitly. The only exception here is when count( * ) is used to specify "nothing", if no alias name has been defined and no GROUP BY clause has been specified.


Note

This short form is forbidden in classes and in the strict mode of the syntax check from Release 7.40, SP05. An explicit work area must be used instead.

Bad Example

TABLES scarr. 

SELECT * 
       FROM scarr. 
  ... 
ENDSELECT.

Good Example

DATA wa TYPE scarr. 

SELECT * 
       FROM scarr 
       INTO @wa. 
  ... 
ENDSELECT.

Good Example

SELECT * 
       FROM scarr 
       INTO @DATA(wa). 
  ... 
ENDSELECT.