Update content

This commit is contained in:
danrega
2023-03-20 09:43:13 +01:00
parent f0200c859c
commit bc653258a9
7 changed files with 19 additions and 24 deletions

View File

@@ -159,9 +159,6 @@ CLASS zcl_demo_abap_cds_ve IMPLEMENTATION.
output->next_section( `4) Excursion: ABAP SQL and joins` ).
"The following ABAP SQL SELECT statements uses a CDS view entity as
"the data source. The sample CDS view entity contains multiple
"joins.
"The following ABAP SQL SELECT statements are intended to reproduce
"the different joins that are performed by the CDS view entity.
"Inner, left and right outer, and cross joins are covered. The data
@@ -170,8 +167,8 @@ CLASS zcl_demo_abap_cds_ve IMPLEMENTATION.
"- The prefix ~ is used in the ABAP SQL statements instead of . in
" the CDS view entity.
"- To demonstrate the handling of null values, some SELECT statements
"contain the coalesce function and CASE expressions similar to the
"CDS view entity.
" contain the coalesce function and CASE expressions similar to the
" CDS view entity.
output->display( `----- Inner join -----` ).
@@ -299,6 +296,7 @@ CLASS zcl_demo_abap_cds_ve IMPLEMENTATION.
" is used in the SELECT list of an ABAP SQL SELECT statement (where
" fields are specified), a LEFT OUTER JOIN is used by default.
"- The coalesce function is included for a field to handle null values.
SELECT carrier,
\_carr3-carrname,
coalesce( \_carr3-url, '###' ) AS cityto_lo
@@ -388,12 +386,12 @@ CLASS zcl_demo_abap_cds_ve IMPLEMENTATION.
"Without specifying the cardinality, the following warning
"occurs: Using association "_FLI" can increase the cardinality
"of the results set
"\_fli-fldate
"\_fli-fldate AS flightdate
\_fli[ (*) ]-fldate AS flightdate
"The specification above corresponds to the following specification
"that includes an explicit specification of LEFT OUTER
"\_fli[ (*) LEFT OUTER ]-fldate
"\_fli[ (*) LEFT OUTER ]-fldate AS flightdate
FROM zdemo_abap_cds_ve_assoc_e
ORDER BY carrid, connid, flightdate
INTO TABLE @DATA(assoc_attr_card).

View File

@@ -28,8 +28,8 @@ define view entity zdemo_abap_cds_ve_assoc
// 1) One use case of assocations, which is not covered here, can be the use in the FROM clause.
// - That is, you can use an association as data source by specifying a path expression.
// - For example, the CDS view entity zdemo_abap_cds_ve_assoc_e exposes an association
// _carr_exp1. Therefore, a FROM clause as follows is possible:
// ... as select from zdemo_abap_cds_ve_assoc_e._carr_exp1 as _flsch ...
// _carr_exp. Therefore, a FROM clause as follows is possible:
// ... as select from zdemo_abap_cds_ve_assoc_e._carr_exp as _flsch ...
// 2) Adding fields of an association target to the element list (of the same CDS view entity)
// - In this case, since data is requested, a join is carried out.
@@ -141,4 +141,4 @@ define view entity zdemo_abap_cds_ve_assoc
// - Maximum values greater than 1 can lead to syntax errors or warnings. Generally, a non-matching cardinality
// usually produces a warning.
// - If the cardinality is not specified, it is to one by default [x..1].
// - Compositions and to-parent associations are special kinds of CDS associations. They are not covered in the example.
// - Compositions and to-parent associations are special kinds of CDS associations. See the ABAP Keyword Documentation.

View File

@@ -14,7 +14,7 @@
// respective code sections (select the lines and choose CTRL + 7).
// - The example for inner joins is commented in by default. The relevant
// code sections are marked with "COMMENT IN/OUT ... START" and
// "COMMENT IN/OUT ... START" in both SELECT and element list
// "COMMENT IN/OUT ... END" in both SELECT and element list
// (inner joins -> 1a / 1b). To test the left outer joins, for example,
// comment out the respective sections of the inner join and comment in
// the sections for left outer joins (2a, 2b), and so on.

View File

@@ -28,7 +28,7 @@
@AccessControl.authorizationCheck: #NOT_REQUIRED
// Example for an entity annotation (annotations that can be used in all CDS entities)
// The following annotation provdes a translatable short text of the CDS entity.
// The following annotation provides a translatable short text of the CDS entity.
@EndUserText.label: 'CDS view entity: Operands/Expressions'
define view entity zdemo_abap_cds_ve_sel
with parameters
@@ -107,8 +107,6 @@ define view entity zdemo_abap_cds_ve_sel
// The following example uses the prefix $projection. which defines reuse expressions.
// That is, you can refer to an element defined previously in the SELECT list of the same CDS view entity.
// Note that this is only possible in dedicated positions. One of them is a cast expression.
//cast( $projection.date_lit as abap.int4 ) as cast_dats,
//cast( $projection.curr as abap.int4 ) as cast_curr,
cast( $projection.date_lit as abap.char(8) ) as cast_dats2c,
// -------- Arithmetic expressions --------