Ansicht
Dokumentation

ABENABAP_SQL_COLUMNS - ABAP SQL COLUMNS

ABENABAP_SQL_COLUMNS - ABAP SQL COLUMNS

BAL Application Log Documentation   RFUMSV00 - Advance Return for Tax on Sales/Purchases  
This documentation is copyright by SAP AG.
SAP E-Book

- col

... $[data_source$|tabalias~$]colname
  $| $[data_source$|tabalias~$]sql_path-element ...


Variants:

1. ... colname

2. ... sql_path-element

Addition:

... data_source$|tabalias~

Effect

Specifies a column of a data source of a query or the target of a write in an statement.

Columns can be specified as elementary SQL expressions in all operand positions in which SQL expressions are possible. However, they can also occur in specific operand positions in which no SQL expressions are possible.

Variant 1

... colname


Effect

Specifies a column of a data source of a query or of the target of a write directly using its name colname (as defined as a component of the associated DDIC structure).

Note

For a column specification, the actual names of the components must be used for a DDIC database table that contains an include structure, and not the names of any groups defined in the ABAP Dictionary.

Example

Direct column specification carrid, carrname, and url in the clauses of a SELECT statement.

Variant 2

... sql_path-element


Effect

Specifies an element of a data source of a CDS view entity or of a after a path expression sql_path. This can be specified in SELECT statements where path expressions can be used in all places where a column can be specified, unless otherwise indicated.

The element element closes the path expression constructed from CDS associations or CTE associations, for which the structure component selector - is used. This element must be an element of the association target of the final association in the path.

Notes

  • Statements that use the CDS entity to access a CDS view in which the used associations are exposed for use from outside.

  • If an element is specified after the path expression, this represents a column specified of the join created implicitly for the path expression. Left outer joins (LEFT OUTER JOIN) are created for path expressions in specified columns.
  • source~ can be used to prefix the path expression with the unit from which its first association is exposed.
  • When a column is specified using a path expression, the syntax check is performed in a strict mode, which handles the statement more strictly than the regular syntax check.

Example

A SELECT statement accesses the CDS view demo_cds_assoc_scarr that exposes a CDS association _spfli. As its association target, this CDS association uses a view that exposes the CDS associations _sflight and _sairport. The columns specified in the SELECT statement include any path expressions created by these CDS associations. See also the associated executable example.

Addition

... data_source$|tabalias~

Effect

The column selector ~ can be used to prefix every specified column directly with the name of the associated data source of a query or of the target of a write (as data_source or as an alias name tabalias).

The data source must be specified in the following cases:

  • If multiple data sources in an statement are edited and the column name is not unique.

Example

Use of the name scarr of a data source and the alias name connections of a different data source in front of the column selector ~ of specified columns.






Fill RESBD Structure from EBP Component Structure   BAL Application Log Documentation  
This documentation is copyright by SAP AG.

Length: 7480 Date: 20240426 Time: 185049     sap01-206 ( 86 ms )