Ansicht
Dokumentation

ABENOPEN_SQL_COLUMNS - OPEN SQL COLUMNS

ABENOPEN_SQL_COLUMNS - OPEN SQL COLUMNS

PERFORM Short Reference   SUBST_MERGE_LIST - merge external lists to one complete list with #if... logic for R3up  
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

When a column is specified, the actual names of the components must be used for a DDIC database table containing an include structure, and not the names of any groups defined in ABAP Dictionary.

Example

Columns carrid, carrname, and url specified directly in the clauses of a SELECT statement.

Variant 2

... sql_path-element


Effect

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

The element element closes the path expression (compiled 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

  • 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 by the SELECT statement cover 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 need to be edited and the column name is not unique.

Example

Using 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.






PERFORM Short Reference   Vendor Master (General Section)  
This documentation is copyright by SAP AG.

Length: 7636 Date: 20240426 Time: 092636     sap01-206 ( 135 ms )