Update content
This commit is contained in:
@@ -1390,7 +1390,7 @@ DELETE ADJACENT DUPLICATES FROM it.
|
||||
|
||||
DELETE ADJACENT DUPLICATES FROM it COMPARING ALL FIELDS.
|
||||
|
||||
"Only lines are delete with matching content in specific fields
|
||||
"Only lines are deleted with matching content in specific fields
|
||||
|
||||
DELETE ADJACENT DUPLICATES FROM it COMPARING a c.
|
||||
|
||||
|
||||
@@ -322,12 +322,6 @@ SELECT dbtab~*
|
||||
WHERE ...
|
||||
INTO ...
|
||||
|
||||
"Data source explicitly specified, all fields
|
||||
SELECT dbtab~*
|
||||
FROM dbtab
|
||||
WHERE ...
|
||||
INTO ...
|
||||
|
||||
"Alias names
|
||||
"Consider the following: You want to read data from a database table into a target data
|
||||
"object but, for example, a name in the target is different. Provided that there will
|
||||
@@ -335,7 +329,7 @@ SELECT dbtab~*
|
||||
"specify an alias name for the database column to match a component's name in the target data object.
|
||||
|
||||
SELECT FROM dbtab
|
||||
FIELDS comp1 AS comp_a, comp2 AS comp_b, comp3 AS comp_b
|
||||
FIELDS comp1 AS comp_a, comp2 AS comp_b, comp3 AS comp_c
|
||||
WHERE ...
|
||||
INTO CORRESPONDING FIELDS OF TABLE @itab.
|
||||
|
||||
@@ -520,7 +514,7 @@ SELECT FROM dbtab
|
||||
>- If `ORDER BY` and `GROUP BY` clauses are used, all columns specified after `ORDER BY` must also be specified after `GROUP BY`.
|
||||
>- If aggregate functions are specified after `SELECT`, all columns that are specified after `ORDER BY` and that do not have an alias name for an aggregate function must also be specified after `SELECT` and after the `GROUP BY` clause which is required in this case, too.
|
||||
|
||||
[`WHERE`](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abapwhere.htm) clause: Restricts the number of rows that are included in the result set using a logical expression. See further information on them in the following sections.
|
||||
[`WHERE`](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abapwhere.htm) clause: Restricts the number of rows that are included in the result set using logical expressions. See further information on them in the following sections.
|
||||
``` abap
|
||||
SELECT FROM dbtab
|
||||
FIELDS comp1, comp2, comp3
|
||||
@@ -587,7 +581,7 @@ SELECT FROM zdemo_abap_flsch
|
||||
"Column selector ~ can be used to prefix every specified column.
|
||||
"Here, it is optional. It is non-optional, e. g., if multiple data
|
||||
"sources in an ABAP SQL statement are edited and the column name
|
||||
"is not unique. ]
|
||||
"is not unique.
|
||||
zdemo_abap_flsch~cityto,
|
||||
|
||||
'Lufthansa' AS name, "Untyped literal
|
||||
|
||||
@@ -1156,7 +1156,7 @@ The RAP LUW is divided into two phases during the runtime of a RAP BO, while the
|
||||

|
||||
|
||||
[RAP interaction phase](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenrap_int_phase_glosry.htm):
|
||||
- [RAP handler method](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenabp_handler_method_glosry.htm) are called in a [RAP handler class](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenabp_handler_class_glosry.htm) that inherits from `CL_ABAP_BEHAVIOR_HANDLER`.
|
||||
- [RAP handler methods](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenabp_handler_method_glosry.htm) are called in a [RAP handler class](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenabp_handler_class_glosry.htm) that inherits from `CL_ABAP_BEHAVIOR_HANDLER`.
|
||||
- New data, i.e. RAP BO instances, are created in the [RAP transactional buffer](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abentransactional_buffer_glosry.htm), or persisted data is retrieved and inserted into the transactional buffer for further processing.
|
||||
- The state of the data may become inconsistent in the transactional buffer during this phase. However, the data remains consistent in the database because changes are made only in the transactional buffer.
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ ENDIF.
|
||||
- The components of such relational expressions can be [comparisons](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abencomparison_glosry.htm) or [predicates](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenpredicate_glosry.htm). Note that for [comparison expressions](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abencomparison_expression_glosry.htm),
|
||||
the comparisons are carried out according to [comparison rules](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenlogexp_rules.htm).
|
||||
|
||||
The following code snippet shows a selection of possible expressions and operands of such expressions using a big `IF` statement. Certainly, such a huge statement is far from ideal. Here, it is just meant to touch on many syntax options in one go for demonstration purposes.
|
||||
The following code snippet shows a selection of possible expressions and operands of such expressions using a big `IF` statement. Certainly, such a huge statement is far from ideal. Here, the intention is to just cover many syntax options in one go for demonstration purposes.
|
||||
|
||||
```abap
|
||||
"Some declarations to be used in the IF statement below
|
||||
@@ -426,7 +426,7 @@ Further keywords for defining loops are as follows. They are not dealt with here
|
||||
|
||||
- [`LOOP ... ENDLOOP`](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abaploop_at_itab.htm) statements are meant for loops across internal tables. See also the cheat sheet on internal tables.
|
||||
- In contrast to the loops above, the system field `sy-index` is not set. Instead, the system field `sy-tabix` is set and which contains the table index of the current table line in the loop pass.
|
||||
- You can also realize loops using iteration expressions with `VALUE` and `REDUCE`. See the cheat sheet example on internal tables, too.
|
||||
- You can also realize loops using iteration expressions with `VALUE` and `REDUCE`. See the example class for the internal table cheat sheet.
|
||||
- [`SELECT ... ENDSELECT`](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abapselect.htm) statements loop across the result set of a database access. See also the cheat sheet on ABAP SQL.
|
||||
|
||||
<p align="right">(<a href="#top">back to top</a>)</p>
|
||||
@@ -496,8 +496,8 @@ Regarding the exiting of procedures, note the hint mentioned above. The use of `
|
||||
"In the following CATCH block, the predefined exception class cx_sy_arithmetic_error
|
||||
"is specified. cx_sy_zerodivide is derived from cx_sy_arithmetic_error.
|
||||
"Hence, cx_sy_arithmetic_error can be specified and handle the exception, too.
|
||||
"Basically, using the exception root class cx_root would be possible, too, however,
|
||||
"that would not be ideal(see the notes further down).
|
||||
"Basically, using the exception root class cx_root would be also possible. However,
|
||||
"choosing an appropriate exception class is recommended. See further down.
|
||||
|
||||
CATCH cx_sy_arithmetic_error.
|
||||
... "CATCH block
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* - Example to demonstrate CDS view entities. See the CDS view entities
|
||||
* that are used in the example for more details.
|
||||
* - Topics covered: Operands, expressions, and built-in functions in the
|
||||
* SELECT list of CDS view entities, input parameters, joins,
|
||||
* element list of CDS view entities, input parameters, joins,
|
||||
* associations
|
||||
* - Note: In ADT, check out the CDS view entities used in this example
|
||||
* by holding down CTRL and clicking on the CDS view entity. This will
|
||||
|
||||
@@ -22,14 +22,14 @@ define view entity zdemo_abap_cds_ve_agg_exp
|
||||
|
||||
{
|
||||
|
||||
// The SELECT list intentionally includes few fields only to focus on the effect of aggregate expressions.
|
||||
// The element list intentionally includes few fields only to focus on the effect of aggregate expressions.
|
||||
key carrid,
|
||||
currency,
|
||||
|
||||
// -------- Aggregate expressions --------
|
||||
// - Aggregate expressions can be used as elements of a SELECT list. Other positions are possible.
|
||||
// - Aggregate expressions can be used as elements of an element list. Other positions are possible.
|
||||
// - An alias name must be specified.
|
||||
// - A GROUP BY clause is required. It must list all non-aggregated fields from the SELECT list.
|
||||
// - A GROUP BY clause is required. It must list all non-aggregated fields from the element list.
|
||||
// - Additions: If ALL is used, all rows in the result set are respected. This the default setting.
|
||||
// If DISTINCT is used, only distinct values of an argument are respected.
|
||||
|
||||
@@ -55,7 +55,7 @@ define view entity zdemo_abap_cds_ve_agg_exp
|
||||
//e.g. if 3 is returned, it means there are 3 different plane types among the result set
|
||||
|
||||
}
|
||||
//GROUP BY clause that lists all non-aggregated fields from the SELECT list
|
||||
//GROUP BY clause that lists all non-aggregated fields from the element list
|
||||
group by
|
||||
carrid,
|
||||
currency
|
||||
|
||||
@@ -62,7 +62,7 @@ define view entity zdemo_abap_cds_ve_joins
|
||||
// - The join selects all entries on the left side. Entries that match the ON condition have the same content as in the inner join.
|
||||
// In entries that do not match the ON condition, the elements on the right side have the null value.
|
||||
// - To demonstrate the effect, the table zdemo_abap_carr contains entries for carrid that are not present in zdemo_abap_flsch.
|
||||
// - Example in the SELECT list:
|
||||
// - Example in the element list:
|
||||
// - The coalesce function can be used to prevent null values in the result set.
|
||||
// - In the example, the function is used for an element to prevent null values.
|
||||
|
||||
@@ -75,7 +75,7 @@ define view entity zdemo_abap_cds_ve_joins
|
||||
// - The join selects all entries on the right side. Entries that match the ON condition have the same content as in the inner join.
|
||||
// In entries that do not match the ON condition, the elements on the left side have the null value.
|
||||
// - To demonstrate the effect, the table zdemo_abap_carr contains entries for carrid that are not present in zdemo_abap_flsch.
|
||||
// - Example in the SELECT list:
|
||||
// - Example in the element list:
|
||||
// - Instead of the coalesce function, you can also use a CASE expression using a logical expression with IS [NOT] NULL
|
||||
// to prevent null values in the result set.
|
||||
// - In the example, a CASE expression is used for an element to prevent null values.
|
||||
|
||||
@@ -38,7 +38,7 @@ define view entity zdemo_abap_cds_ve_sel
|
||||
as select from zdemo_abap_fli //Selection from a demo database table;
|
||||
//an alias name can be also specified ... as _fli, for example
|
||||
|
||||
// The following SELECT list demonstrates possible elements, operands and expressions.
|
||||
// The following element list demonstrates possible elements, operands and expressions.
|
||||
// Note: Many of the operands and expressions demonstrated below can occur in multiple positions.
|
||||
// Refer to the ABAP Keyword Documentation for the details.
|
||||
{
|
||||
@@ -105,7 +105,7 @@ define view entity zdemo_abap_cds_ve_sel
|
||||
cast( price as abap.dec(15,2) ) as cast_curr2dec,
|
||||
|
||||
// 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.
|
||||
// That is, you can refer to an element defined previously in the element 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.char(8) ) as cast_dats2c,
|
||||
|
||||
|
||||
Reference in New Issue
Block a user