From b6d2c806de1e45b997b694fd3e484367f532cadc Mon Sep 17 00:00:00 2001 From: danrega <16720986+danrega@users.noreply.github.com> Date: Mon, 17 Jul 2023 13:17:40 +0200 Subject: [PATCH] Update content --- 01_Internal_Tables.md | 4 +- 02_Structures.md | 8 +- 03_ABAP_SQL.md | 64 +++---- 05_Constructor_Expressions.md | 4 +- 12_AMDP.md | 2 +- 16_Data_Types_and_Objects.md | 77 ++++++--- README.md | 14 +- src/zcl_demo_abap_amdp.clas.abap | 2 +- src/zcl_demo_abap_cds_ve.clas.abap | 2 +- src/zcl_demo_abap_constructor_expr.clas.abap | 2 +- src/zcl_demo_abap_dtype_dobj.clas.abap | 172 ++++++++++--------- src/zcl_demo_abap_dynamic_prog.clas.abap | 2 +- src/zcl_demo_abap_internal_tables.clas.abap | 6 +- src/zcl_demo_abap_objects.clas.abap | 2 +- src/zcl_demo_abap_prog_flow_logic.clas.abap | 2 +- src/zcl_demo_abap_rap_draft_ln_m.clas.abap | 2 +- src/zcl_demo_abap_rap_ext_num_m.clas.abap | 2 +- src/zcl_demo_abap_rap_ext_num_u.clas.abap | 2 +- src/zcl_demo_abap_sql.clas.abap | 2 +- src/zcl_demo_abap_sql_group_by.clas.abap | 2 +- src/zcl_demo_abap_string_proc.clas.abap | 2 +- src/zcl_demo_abap_structures.clas.abap | 6 +- src/zcl_demo_abap_unit_test.clas.abap | 4 +- 23 files changed, 210 insertions(+), 175 deletions(-) diff --git a/01_Internal_Tables.md b/01_Internal_Tables.md index c548ee1..81c7c98 100644 --- a/01_Internal_Tables.md +++ b/01_Internal_Tables.md @@ -1,8 +1,8 @@ -# Working with Internal Tables +# Internal Tables -- [Working with Internal Tables](#working-with-internal-tables) +- [Internal Tables](#internal-tables) - [Internal Tables ...](#internal-tables-) - [Basic Properties of Internal Tables](#basic-properties-of-internal-tables) - [Excursion: Table Keys in Internal Tables (Primary, Secondary, Standard, Empty)](#excursion-table-keys-in-internal-tables-primary-secondary-standard-empty) diff --git a/02_Structures.md b/02_Structures.md index 2437a5e..bd2c5b7 100644 --- a/02_Structures.md +++ b/02_Structures.md @@ -1,6 +1,6 @@ -# Working with Structures +# Structures -- [Working with Structures](#working-with-structures) +- [Structures](#structures) - [Structures ...](#structures-) - [Creating Structures and Structured Types](#creating-structures-and-structured-types) - [Variants of Structures](#variants-of-structures) @@ -554,7 +554,7 @@ SELECT SINGLE FROM @itab AS itab_alias ``` ... using a `READ TABLE` statement. The code snippet below shows the reading of a line into a [work area](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenwork_area_glosry.htm "Glossary Entry"), a [field symbol](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenfield_symbol_glosry.htm "Glossary Entry"), and a [data reference variable](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abendata_reference_variable_glosry.htm "Glossary Entry"), all of which represent structured data objects that are declared inline. In the following example, a line is read based on the line number by -specifying `INDEX`. For more details, see the section *Determining the target area* in the cheat sheet [Working with Internal Tables](01_Internal_Tables.md#). +specifying `INDEX`. For more details, see the section *Determining the target area* in the cheat sheet [Internal Tables](01_Internal_Tables.md#). ``` abap READ TABLE itab INTO DATA(wa) INDEX 1. @@ -630,7 +630,7 @@ MODIFY dbtab FROM @( VALUE #( comp1 = ... comp2 = ... ) ). internal table, `INSERT` can be used to add lines at a specific position in the table. If you do not specify the position, the lines are also added at the bottom of the table. However, unlike `APPEND`, `INSERT` does not set `sy-tabix`. - `MODIFY` changes the content of an internal table entry. - Statements using the `VALUE` operator to directly create and populate the structures are also possible. For more information and code -snippets, see the [Working with Internal Tables](01_Internal_Tables.md#) cheat sheet. +snippets, see the [Internal Tables](01_Internal_Tables.md#) cheat sheet. ``` abap INSERT struc INTO TABLE itab. diff --git a/03_ABAP_SQL.md b/03_ABAP_SQL.md index 19ae64d..bf7cc0c 100644 --- a/03_ABAP_SQL.md +++ b/03_ABAP_SQL.md @@ -9,11 +9,17 @@ - [Using SELECT for Multiple Purposes](#using-select-for-multiple-purposes) - [Clause Variations and Additions in SELECT Statements](#clause-variations-and-additions-in-select-statements) - [More Clauses](#more-clauses) - - [Excursion: Operands and Expressions in ABAP SQL Statements](#excursion-operands-and-expressions-in-abap-sql-statements) - - [Excursion: SQL Conditions](#excursion-sql-conditions) - - [Selecting Data by Evaluating the Content of other Tables](#selecting-data-by-evaluating-the-content-of-other-tables) + - [Operands and Expressions in ABAP SQL Statements](#operands-and-expressions-in-abap-sql-statements) + - [SQL operands](#sql-operands) + - [SQL Expressions](#sql-expressions) + - [Elementary Expressions](#elementary-expressions) + - [SQL Functions](#sql-functions) + - [More SQL Expressions](#more-sql-expressions) + - [Window Expressions](#window-expressions) + - [SQL Conditions](#sql-conditions) + - [Selecting Data by Evaluating the Content of Other Tables](#selecting-data-by-evaluating-the-content-of-other-tables) - [Combining Data of Multiple Database Tables](#combining-data-of-multiple-database-tables) - - [Excursion: Using Common Table Expressions (CTE)](#excursion-using-common-table-expressions-cte) + - [Common Table Expressions (CTE)](#common-table-expressions-cte) - [Changing Data in Database Tables](#changing-data-in-database-tables) - [Using `INSERT`](#using-insert) - [Using `UPDATE`](#using-update) @@ -22,7 +28,6 @@ - [More Information](#more-information) - [Executable Example](#executable-example) - ## ABAP SQL Intro - [ABAP SQL](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abensql_glosry.htm) is a subset of [SQL](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abensql_glosry.htm "Glossary Entry") @@ -168,7 +173,7 @@ SELECT FROM source "What database table or view to read from internal tables as targets, the resulting table is a standard table and has an empty key which might have an impact when further processing the internal table entries. Find more information in the - ABAP cheat sheet [Working with Internal Tables](01_Internal_Tables.md). In newer ABAP releases, the declaration operator [`FINAL`](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenfinal_inline.htm) can be used to declare immutable variables. + ABAP cheat sheet [Internal Tables](01_Internal_Tables.md). In newer ABAP releases, the declaration operator [`FINAL`](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenfinal_inline.htm) can be used to declare immutable variables.

(back to top)

@@ -528,7 +533,7 @@ SELECT FROM dbtab

(back to top)

-### Excursion: Operands and Expressions in ABAP SQL Statements +### Operands and Expressions in ABAP SQL Statements ABAP offers plenty of [SQL operands](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abensql_operand_glosry.htm "Glossary Entry") @@ -544,7 +549,7 @@ overview of important operand positions in ABAP SQL [here](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abensql_operand_positions_oview.htm). Due to the rich variety of options, the cheat sheet covers a selection. -**SQL operands** +#### SQL operands - Are elementary operands in an ABAP SQL statement - Can be database table or view columns, a @@ -608,7 +613,7 @@ SELECT FROM zdemo_abap_flsch "UP TO @( 10 - 7 ) ROWS. "Host expression ``` -**SQL Expressions** +#### SQL Expressions - Expressions in an ABAP SQL statement that are passed to the database system for evaluation. @@ -619,7 +624,7 @@ SELECT FROM zdemo_abap_flsch [here](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abapsql_expr.htm) and the subtopics there. -**Elementary expressions** +##### Elementary Expressions - An elementary expression represents one of the four mentioned operands above: A value from the database (the column name) or @@ -629,7 +634,7 @@ SELECT FROM zdemo_abap_flsch - See more information [here](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abensql_elem.htm). -**SQL functions** +##### SQL Functions - You can use built-in functions in ABAP SQL. - Result: Value with the associated dictionary type. @@ -890,7 +895,7 @@ SELECT INTO TABLE @DATA(agg_exp). ``` -**More SQL Expressions** +##### More SQL Expressions - [Arithmetic expressions](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abensql_arith.htm) @@ -959,9 +964,9 @@ WHERE carrid = 'AA' INTO @DATA(more_sql_expr). ``` -[Window expressions](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenwindow_expression_glosry.htm "Glossary Entry") +##### Window Expressions -How they work: +How [window expressions](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenwindow_expression_glosry.htm "Glossary Entry") work: - Defines a subset of the result set (i. e. the "[window](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenwindow_glosry.htm "Glossary Entry")") @@ -1056,7 +1061,7 @@ SELECT carrid, currency, fldate, INTO TABLE @DATA(result). ``` -### Excursion: SQL Conditions +### SQL Conditions You can formulate conditions in ABAP SQL statements, i. e. [logical expressions](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenlogical_expression_glosry.htm "Glossary Entry"), @@ -1069,20 +1074,19 @@ conditions. For more information, see the subtopics of the [SQL Conditions](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenasql_cond.htm) topic. - | Operator | Meaning | |----------|:-------------:| - | `=`, `EQ` | The content of two operands is equal.| +| `=`, `EQ` | The content of two operands is equal.| | `<>`, `NE` | The content of two operands is not equal.| - | `<`, `LT` | The content of one operand is less than the content of the other operand.| - | `>`, `GT` | The content of one operand is greater than the content of the other operand.| - | `<=`, `LE` | The content of one operand is less than or equal to the content of the other operand.| - | `>=`, `GE` | The content of one operand is greater than or equal to the content of the other operand.| - | `... [NOT] BETWEEN ... AND ...` | The value of an operand is (not) between the value of the two other operands.| - | `... [NOT] LIKE ...` | The content of an operand matches (does not match) a specified pattern. The pattern can be specified by using wildcard characters. `%` stands for any character string, including an empty string. `_` stands for any character.| - | `... IS [NOT] INITIAL ...` | The value of an operand is (not) the initial value of its built-in dictionary type.| - | `... EXISTS ...` | Checks the result set of a [subquery](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abensubquery_glosry.htm "Glossary Entry"). The expression is true if the result set contains at least one row. See more information [here](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenwhere_logexp_subquery.htm).| - | `... [NOT] IN ( ... )` | Checks whether the operands on the left side match a value from a set of values specified in parentheses. On the left side, a single operand or an operand list are possible. On the right side, a comma-separated lists or subqueries can be specified.| +| `<`, `LT` | The content of one operand is less than the content of the other operand.| +| `>`, `GT` | The content of one operand is greater than the content of the other operand.| +| `<=`, `LE` | The content of one operand is less than or equal to the content of the other operand.| +| `>=`, `GE` | The content of one operand is greater than or equal to the content of the other operand.| +| `... [NOT] BETWEEN ... AND ...` | The value of an operand is (not) between the value of the two other operands.| +| `... [NOT] LIKE ...` | The content of an operand matches (does not match) a specified pattern. The pattern can be specified by using wildcard characters. `%` stands for any character string, including an empty string. `_` stands for any character.| +| `... IS [NOT] INITIAL ...` | The value of an operand is (not) the initial value of its built-in dictionary type.| +| `... EXISTS ...` | Checks the result set of a [subquery](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abensubquery_glosry.htm "Glossary Entry"). The expression is true if the result set contains at least one row. See more information [here](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenwhere_logexp_subquery.htm).| +| `... [NOT] IN ( ... )` | Checks whether the operands on the left side match a value from a set of values specified in parentheses. On the left side, a single operand or an operand list are possible. On the right side, a comma-separated lists or subqueries can be specified.| > **💡 Note**
>You can combine multiple logical expressions into one @@ -1130,7 +1134,7 @@ SELECT * INTO TABLE @DATA(itab_where). ``` -### Selecting Data by Evaluating the Content of other Tables +### Selecting Data by Evaluating the Content of Other Tables [`FOR ALL ENTRIES`](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenwhere_all_entries.htm) addition: @@ -1221,9 +1225,9 @@ UNION INTO ... ``` -#### Excursion: Using Common Table Expressions (CTE) +#### Common Table Expressions (CTE) -When used: +When to use [Common Table Expressions (CTE)](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abencommon_table_expression_glosry.htm): - Whenever you need intermediate results in a `SELECT` statement and especially if you need them more than once. @@ -1244,7 +1248,7 @@ How it works: e. a `SELECT` statement accesses the result of the expressions. -Setup of a statement with CTEs: +Setup of a statement with CTE: - Introductory keyword `WITH` - A comma-separated list with at least one definition of a CTE diff --git a/05_Constructor_Expressions.md b/05_Constructor_Expressions.md index e709bff..874c96b 100644 --- a/05_Constructor_Expressions.md +++ b/05_Constructor_Expressions.md @@ -1,8 +1,8 @@ -# Working with Constructor Expressions +# Constructor Expressions -- [Working with Constructor Expressions](#working-with-constructor-expressions) +- [Constructor Expressions](#constructor-expressions) - [Introduction](#introduction) - [VALUE](#value) - [CORRESPONDING](#corresponding) diff --git a/12_AMDP.md b/12_AMDP.md index 84f35f8..787fc4b 100644 --- a/12_AMDP.md +++ b/12_AMDP.md @@ -66,7 +66,7 @@ in the ABAP Keyword Documentation. >- The use of AMDP is not recommended if the same task can be achieved using [ABAP SQL](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenabap_sql_glosry.htm "Glossary Entry"). ->- AMDP classes can only be edited with the [ABAP Development Tools +>- AMDP classes can only be edited with the [ABAP development tools for Eclipse (ADT)](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenadt_glosry.htm "Glossary Entry"). ## AMDP Classes diff --git a/16_Data_Types_and_Objects.md b/16_Data_Types_and_Objects.md index f9ca121..9009887 100644 --- a/16_Data_Types_and_Objects.md +++ b/16_Data_Types_and_Objects.md @@ -87,7 +87,6 @@ For an overview, see the [ABAP Type Hierarchy](https://help.sap.com/doc/abapdocu

(back to top)

- ### Complex Data Types - Are composed of other types. @@ -111,7 +110,8 @@ For an overview, see the [ABAP Type Hierarchy](https://help.sap.com/doc/abapdocu - The typical syntax element is `... REF TO ...`. > **💡 Note**
-> There are [generic ABAP types](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abengeneric_abap_type_glosry.htm). Generic data types are types that do not define all of the properties of a data object. They can only be used for the typing [formal parameters](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenformal_parameter_glosry.htm) and [field symbols](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenfield_symbol_glosry.htm). When you declare reference types and data reference variables, you can use the generic ABAP type `data`. +> There are [generic ABAP types](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abengeneric_abap_type_glosry.htm). Generic data types are types that do not define all of the properties of a data object. They can only be used for the typing [formal parameters](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenformal_parameter_glosry.htm) and [field symbols](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenfield_symbol_glosry.htm). +The only generic types that can be used after `TYPE REF TO` are `data`, for the generic typing of data references, and `object`, for the generic typing of object references.

(back to top)

@@ -247,7 +247,7 @@ TYPES tt_another_type TYPE tt_w_like. TYPES ts_type_line TYPE LINE OF tt_w_like. TYPES ts_like_line LIKE LINE OF itab_local_ts. -"Internal table type with internal table as line type +"Internal table typed with internal table as line type TYPES tt_like_table LIKE TABLE OF itab_local_ts. "Referring to global types @@ -274,7 +274,7 @@ Reference types: TYPES tr_i TYPE REF TO i. TYPES tr_str TYPE REF TO string. TYPES tr_ddic_tab TYPE REF TO zdemo_abap_carr. -"Using a generic type as static type +"Using the generic type data as static type TYPES tr_data TYPE REF TO data. "Referring to an existing reference type @@ -295,7 +295,7 @@ TYPES tr_like_ref2str LIKE REF TO str. "Reference table types TYPES tr_tab_ref_i TYPE TABLE OF REF TO i. DATA itab_str TYPE TABLE OF string. -TYPES tr_like_table_ref LIKE TABLE OF ref TO itab_str. +TYPES tr_like_table_ref LIKE TABLE OF REF TO itab_str. ```

(back to top)

@@ -344,7 +344,7 @@ DATA do_c. "Start values can be set for the data objects when they are declared. "Without the addition VALUE, data objects are filled with their type-specific initial values. "The start value can either be specified as a literal or as a predefined constant. -"Note: The value addition is not to be confused with the VALUE operator that can be used to +"Note: The VALUE addition is not to be confused with the VALUE operator that can be used to "construct the content of complex data objects as shown below. DATA do_c_l2 TYPE c LENGTH 2 VALUE 'hi'. DATA do_i_val TYPE i VALUE 123. @@ -391,7 +391,8 @@ DATA: BEGIN OF a_structure, END OF a_structure. "Creating a structure based on a global type. In this case, it is a DDIC database -"table whose line type is used. You can also use a CDS view, for example. +"table whose line type is used. You can also use a CDS view or a dedicated structured type +"from the DDIC, for example. DATA struc_ddic_tab TYPE zdemo_abap_carr. "Creating a structure as a constant. Providing values is mandatory. @@ -413,8 +414,8 @@ DATA struc_init_val LIKE con_struc VALUE IS INITIAL. DATA itab_ddic_tab TYPE TABLE OF zdemo_abap_carr WITH EMPTY KEY. "Based on an elementary type DATA itab_tab_i TYPE TABLE OF i. -"The elementary type is declared in a global interface -DATA itab_elem_type_from_itf TYPE zdemo_abap_get_data_itf=>carr_tab. +"The table type is declared in a global interface +DATA itab_tab_type_from_itf TYPE zdemo_abap_get_data_itf=>carr_tab. "Based on globally available DDIC internal table type; explicitly specifying as initial DATA itab_ddic_tab_type TYPE string_table VALUE IS INITIAL. "Based on locally available structured data object @@ -444,7 +445,7 @@ Data reference variables: DATA dref_int TYPE REF TO i. DATA dref_str TYPE REF TO string. DATA dref_ddic_tab TYPE REF TO zdemo_abap_carr. -"Using a generic type as static type +"Using generic type data as static type DATA dref_data TYPE REF TO data. "Referring to an existing reference type @@ -556,7 +557,8 @@ num = num + 1. "String expressions as source of the assignment str_a2 = str_a1 && ` blabla`. "Strings are appended using the && operator str_a2 = |{ str_a1 } some more bla.|. "String templates. Note: Data objects are specified - "in curly brackets. The content is converted to type string. + "in curly brackets. The content is converted to type string + "Note that it must be convertible to type string. "An elementary data object is assigned a component of a specific table line "using a table expression. @@ -574,7 +576,7 @@ str_a2 = some_itab[ 2 ]-carrname. An [inline declaration](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abeninline_declaration_glosry.htm) is made using the declaration operator [`DATA`](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abendata_inline.htm). It can be specified in any designated [declaration position](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abendeclaration_position_glosry.htm). The result of the declaration is used in the current operand position, is statically visible from the current position, and is valid in the current context. > **💡 Note**
-> - In an assignment, if the data object is declared inline on the left side, there are many options for what can be placed on the right side as shown in the previous section. The date type of the variable is determined by the operand type. It must be possible to derive this type completely statically. +> - In an assignment, if the data object is declared inline on the left side, there are many options for what can be placed on the right side as shown in the previous section. The data type of the variable is determined by the operand type. It must be possible to derive this type completely statically. > - For more information about the possible declaration positions, see [here](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abendeclaration_positions.htm). > - You can use the [`FINAL`](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenfinal_inline.htm) declaration operator to create [immutable variables](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenimmutable_variable_glosry.htm), as shown below. > - [Programming guidelines for inline declarations (F1 for Standard ABAP)](https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abendeclaration_inline_guidl.htm) @@ -616,7 +618,8 @@ TYPES: BEGIN OF ts_struc, "type specified before the parentheses. DATA(struc_b1) = VALUE ts_struc( comp1 = 1 comp2 = `A` ). "No components specified and values assigned means an initial structure. This syntax is also possible -"for declaring data objects with elementary types and explicitly specifiying initial values. +"for declaring data objects with elementary types and explicitly specifiying initial values, but only +"for initial values. See the CONV operator. DATA(struc_b2) = VALUE ts_struc( ). DATA(elem_init) = VALUE i( ). "Note that components that are not specified and assigned a value remain initial. @@ -642,22 +645,37 @@ DATA(itab_b2) = VALUE tt_b1( ( comp1 = 1 comp2 = `a` ) ( comp1 = 2 comp2 = `b` ) ( comp1 = 3 comp2 = `c` ) ). -"In the context of other ABAP statements such as LOOP, READ TABLE or ABAP SQL SELECT statements, -"inline declarations are useful for creating target variables with appropriate data types in place. -"A structure to hold the current internal table line is created inline. +"In the context of other ABAP statements such as LOOP, READ TABLE or ABAP SQL +"SELECT statements, inline declarations are useful for creating target variables with +"appropriate data types in place. This includes data reference variables and field +"symbols. Field symbols are not covered below. + +"A work area/structure to hold the current internal table line is created inline. LOOP AT itab_b2 INTO DATA(wa_b1). + wa_b1-comp1 = 12345. + ... +ENDLOOP. + +"Using the REFERENCE addition, a data reference variable can be created inline. +LOOP AT itab_b2 REFERENCE INTO DATA(wa_ref_b1). + wa_ref_b1->comp1 = 67890. ... ENDLOOP. "A structure to hold the internal table line read is created inline. READ TABLE itab_b2 INTO DATA(wa_b2) INDEX 2. +"Data reference variable +READ TABLE itab_b2 REFERENCE INTO DATA(wa_ref_b2) INDEX 2. "ABAP SQL statements "A structure as target data object is created inline. SELECT SINGLE * FROM zdemo_abap_carr INTO @DATA(struc_b5). +"NEW addition of the INTO clause creates a data reference variable +SELECT SINGLE * FROM zdemo_abap_carr INTO NEW @DATA(struc_ref). "Internal table as target data object is created inline. SELECT * FROM zdemo_abap_carr INTO TABLE @DATA(itab_b3). +SELECT * FROM zdemo_abap_carr INTO TABLE NEW @DATA(itab_ref). ```

(back to top)

@@ -670,7 +688,7 @@ SELECT * FROM zdemo_abap_carr INTO TABLE @DATA(itab_b3). ```abap "Declaring data reference variables with static types -"At this stage, initial references variables contain null references. +"At this stage, initial reference variables contain null references. DATA dref_1_i TYPE REF TO i. DATA dref_2_str TYPE REF TO string. "Generic type as static type @@ -685,7 +703,7 @@ DATA dref_3_data TYPE REF TO data. DATA do_number TYPE i VALUE 987. DATA do_string TYPE string VALUE `abc`. -"After the assignment the data reference variable points to the values. +"After the assignment, the data reference variable points to the values. "The data type is derived (dynamic type). dref_1_i = REF #( do_number ). "Dynamic type is the same as the static type in this case dref_2_str = REF #( do_string ). "Dynamic type is the same as the static type in this case @@ -711,10 +729,10 @@ DATA(dref_6_i) = REF #( do_number ). "- Assignment operator used: = "- Note that the operators for downcasts can also be used explicitly here, but it is usually not needed. "- In this example, elementary data types are covered. An upcast works ... -" - if the data types have identical type properties (i.e. the built-in type match as well as length and decimal places). +" - if the data types have identical type properties (i.e. the built-in types match as well as length and decimal places). " - the static type of the source variable is completely typed, and the static type of the target variable is generic. -"The following upcasts work. Both are of type i or string. +"The following upcasts work. Both point to data objects of type i or string. dref_1_i = dref_6_i. "The source on the right side is completely typed (type i), "the target on the left side is a generic type (type data). @@ -723,7 +741,7 @@ dref_3_data = dref_1_i. "Downcasts "- The static type of the target variable is more specific than the static type of the source variable. "- The assignability is not checked until runtime. -"- Must always be performed explicitly using the casting operator ?= and the casting operator CAST. +"- Must always be performed explicitly using the casting operator ?= or the more modern casting operator CAST. "The following example would result in a syntax error due to type incompatibility. "dref_1_i = dref_3_data. @@ -734,12 +752,12 @@ dref_3_data = dref_1_i. "Note: "- The assignability is still not checked. This is done at runtime. " In this example, it works since the dynamic type of the source is also of type i. -"- An advantage of the CAST operator compared to ?= is that the operator enables downcasts in operand positions, +"- An advantage of the CAST operator compared to ?= is that the operator enables downcasts in operand positions, " which helps reduce helper variables. dref_1_i = CAST #( dref_3_data ). "If not caught, the following would result in a runtime error. -"dref_3_data points to a reference of type i, the static type is dref_2_str is string. +"dref_3_data points to a data object of type i, the static type is dref_2_str is string. "So, the downcast does not work. TRY. dref_2_str = CAST #( dref_3_data ). @@ -751,7 +769,7 @@ ENDTRY. dref_1_i ?= dref_3_data. "For upcasts, the operators can be used, too, but they are usually not necessary. -"So, an assignment as follows is possible but not needed. +"So, an assignment as follows is possible but not needed. Only using = is sufficient. dref_1_i = CAST #( dref_6_i ). ``` @@ -761,7 +779,7 @@ dref_1_i = CAST #( dref_6_i ). [Anonymous data objects](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenanonymous_data_object_glosry.htm) are a topic related to data reference variables. These data objects are [unnamed data objects](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenunnamed_data_object_glosry.htm). -Most of the data objects in the snippets above are named data objects, meaning that they can be addressed by a specific name. Unnamed data objects are literals and anonymous data objects. Anonymous data objects can be addressed using data reference variables. +Most of the data objects in the snippets above are named data objects (excluding the data reference variables), meaning that they can be addressed by a specific name. Unnamed data objects are literals and anonymous data objects. Anonymous data objects can be addressed using data reference variables. Unlike data objects created with the `DATA` statement, anonymous data objects are created at runtime. Data objects declared with `DATA` are created when the program is loaded. There are several ways to create anonymous data objects: @@ -780,7 +798,7 @@ DATA dref_7_str TYPE REF TO string. CREATE DATA dref_7_str. "Note: If you want to assign a value to the data object, this can't be done directly. -"The data reference variable must be dereferenced first using using the dereferencing operator. +"The data reference variable must be dereferenced first using the dereferencing operator. dref_7_str->* = `hi`. "Creating an anonymous data object with an explicitly specified data type @@ -982,6 +1000,11 @@ DATA: BEGIN OF struc_a, DATA do_d_i TYPE i. "Field symbols typed with generic data types +"Note: A field symbol is a symbolic name for a data object to which actual +"memory can be assigned at runtime. A field symbol can be used as a placeholder +"for a data object at an operand position. For more information, see the ABAP +"Cheat Sheet on dynamic programming. Field symbols are used in this example +"to demonstrate generic types other than just data. FIELD-SYMBOLS TYPE clike. FIELD-SYMBOLS TYPE data. @@ -1163,7 +1186,7 @@ TYPES: BEGIN OF ENUM t_enum, d, END OF ENUM t_enum. -"a) Explicit base type is specified and start values provided using the VALUE addition +"b) Explicit base type is specified and start values provided using the VALUE addition " Note that one value must be initial. TYPES: basetype TYPE c LENGTH 2, diff --git a/README.md b/README.md index 702df8e..63877de 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ ABAP cheat sheets[^1] ... ## 🏗️ How to Use 1. **ABAP syntax info**: Get info in a nutshell on ABAP syntax and concepts related to various ABAP topics in the [ABAP cheat sheets](#-abap-cheat-sheets-overview). -2. **Demo examples**: Import the ABAP development objects of this repository into your system using [abapGit](https://abapgit.org/) as described [here](#-getting-started-with-the-examples) and run the demo classes by choosing `F9` in the [ABAP Development Tools (ADT)](https://tools.eu1.hana.ondemand.com/) for checking out the ABAP syntax in action. +2. **Demo examples**: Import the ABAP development objects of this repository into your system using [abapGit](https://abapgit.org/) as described [here](#-getting-started-with-the-examples) and run the demo classes by choosing `F9` in the [ABAP development tools for Eclipse (ADT)](https://tools.eu1.hana.ondemand.com/) for checking out the ABAP syntax in action.
@@ -58,11 +58,11 @@ ABAP cheat sheets[^1] ... | Cheat Sheet | Topics Covered | Demo Example | | ------------- | ------------- | ----- | |[Data Types and Data Objects](16_Data_Types_and_Objects.md)| Contains basic information about data types and data objects in ABAP | [zcl_demo_abap_dtype_dobj](./src/zcl_demo_abap_dtype_dobj.clas.abap) | -|[Working with Internal Tables](01_Internal_Tables.md)| Creating, filling, reading from, sorting, modifying internal tables | [zcl_demo_abap_internal_tables](./src/zcl_demo_abap_internal_tables.clas.abap) | -|[Working with Structures](02_Structures.md)| Creating structures and structured types, variants of structures, accessing components of structures, filling structures, clearing structures, structures in use in the context of tables | [zcl_demo_abap_structures](./src/zcl_demo_abap_structures.clas.abap) | +|[Internal Tables](01_Internal_Tables.md)| Creating, filling, reading from, sorting, modifying internal tables | [zcl_demo_abap_internal_tables](./src/zcl_demo_abap_internal_tables.clas.abap) | +|[Structures](02_Structures.md)| Some basics when working with structures | [zcl_demo_abap_structures](./src/zcl_demo_abap_structures.clas.abap) | |[ABAP SQL in Use](03_ABAP_SQL.md)| Reading from database tables using `SELECT`, changing data in database tables using `INSERT`, `UPDATE`, `MODIFY` and `DELETE` | [zcl_demo_abap_sql](./src/zcl_demo_abap_sql.clas.abap) | |[ABAP Object Orientation](04_ABAP_Object_Orientation.md)| Working with objects and components, concepts like inheritance, interfaces, and more | [zcl_demo_abap_objects](./src/zcl_demo_abap_objects.clas.abap) | -|[Working with Constructor Expressions](05_Constructor_Expressions.md)| Operators `VALUE`, `CORRESPONDING`, `NEW`, `CONV`, `EXACT`, `REF`, `CAST`, `COND`, `SWITCH`, `FILTER`, `REDUCE`, iteration expressions with `FOR`, `LET` expressions | [zcl_demo_abap_constructor_expr](./src/zcl_demo_abap_constructor_expr.clas.abap) | +|[Constructor Expressions](05_Constructor_Expressions.md)| Covers constructor expressions with operators such as `VALUE`, `CORRESPONDING`, `NEW`, `CONV`, `EXACT`, `REF`, `CAST`, `COND`, `SWITCH`, `FILTER`, `REDUCE`, iteration expressions with `FOR`, `LET` expressions | [zcl_demo_abap_constructor_expr](./src/zcl_demo_abap_constructor_expr.clas.abap) | |[Dynamic Programming](06_Dynamic_Programming.md)| Covers field symbols and data references as supporting elements for dynamic programming, dynamic ABAP syntax components, runtime type services (RTTS), i. e. runtime type identification (RTTI) and runtime type creation (RTTC) | [zcl_demo_abap_dynamic_prog](./src/zcl_demo_abap_dynamic_prog.clas.abap) | |[String Processing](07_String_Processing.md)| Creating strings and assigning values, chaining strings, string templates, concatenating, splitting, modifying strings, searching and replacing, regular expressions | [zcl_demo_abap_string_proc](./src/zcl_demo_abap_string_proc.clas.abap) | |[ABAP for RAP: Entity Manipulation Language (ABAP EML)](08_EML_ABAP_for_RAP.md)| Setting EML in the context of RAP, standard (create, read, update, delete) and non-standard operations (actions) | | @@ -95,7 +95,7 @@ The executable examples are designed to be imported into the SAP BTP ABAP enviro **Prerequisites** - [x] You have access to an SAP BTP ABAP Environment instance (see [here](https://blogs.sap.com/2018/09/04/sap-cloud-platform-abap-environment) for additional information). -- [x] You have downloaded and installed the ABAP Development Tools (ADT). Make sure that you are using the latest version, as indicated on the [installation page](https://tools.hana.ondemand.com/#abap). +- [x] You have downloaded and installed the ABAP development tools for Eclipse (ADT). Make sure that you are using the latest version, as indicated on the [installation page](https://tools.hana.ondemand.com/#abap). - [x] Before importing the code, you have performed a system-wide search for classes named `ZCL_DEMO_ABAP*`, for example, so that you do not run into errors when you try to import the code. If someone has already imported the content into the system, you can simply check out that imported version and proceed to the step *3) Run the code*. - [x] You have created an ABAP cloud project in ADT that allows you to access your SAP BTP ABAP Environment instance (see [here](https://help.sap.com/viewer/5371047f1273405bb46725a417f95433/Cloud/en-US/99cc54393e4c4e77a5b7f05567d4d14c.html) for more information). Your login language is English. - [x] You have installed the [abapGit](https://github.com/abapGit/eclipse.abapgit.org) plug-in for ADT from the [update site](http://eclipse.abapgit.org/updatesite/). @@ -140,7 +140,7 @@ https://github.com/SAP-samples/abap-cheat-sheets.git **Prerequisites** - [x] It is assumed that you are running the latest [ABAP release](https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abennews-75.htm). Note that the RAP examples, for example, require at least ABAP version 7.56. - [x] Before importing the code, you have performed a system-wide search for classes named `ZCL_DEMO_ABAP*`, for example, to avoid errors when you try to import the code. If someone has already imported the content into the system, you can simply check out that imported version and proceed to the step *3) Run the code*. -- [x] You have downloaded and installed the ABAP Development Tools (ADT). Make sure that you are using the latest version, as indicated on the [installation page](https://tools.hana.ondemand.com/#abap). +- [x] You have downloaded and installed the ABAP development tools for Eclipse (ADT). Make sure that you are using the latest version, as indicated on the [installation page](https://tools.hana.ondemand.com/#abap). - [x] You have created an ABAP project in ADT that allows you to access your application server as mentioned above. Your login language is English. - [x] You have downloaded and installed the standalone version of the abapGit report. Make sure you are using the latest version, as indicated on the [installation page](https://docs.abapgit.org/). You can create a report, for example, `zabapgit_standalone`, and copy and paste [this code](https://raw.githubusercontent.com/abapGit/build/main/zabapgit_standalone.prog.abap) into the program. @@ -172,7 +172,7 @@ Use the standalone version of the abapGit report to import the demo examples of 3) Run the code
-- Open the package you created containing the imported ABAP artifacts in the ABAP Development Tools (ADT). +- Open the package you created containing the imported ABAP artifacts in the ABAP development tools for Eclipse (ADT). - Open one of the ABAP cheat sheet example classes listed in the [ABAP Cheat Sheets Overview](#-abap-cheat-sheets-overview) section, for example, `zcl_demo_abap_string_proc`. The classes are located in the `Source Code Library` → `Classes` folder. - Choose `F9` to run the class. Alternatively, choose `Run` → `Run As` → `2 ABAP Application (Console)` from the menu. - Check the console output. diff --git a/src/zcl_demo_abap_amdp.clas.abap b/src/zcl_demo_abap_amdp.clas.abap index 04b21c4..d5ff267 100644 --- a/src/zcl_demo_abap_amdp.clas.abap +++ b/src/zcl_demo_abap_amdp.clas.abap @@ -19,7 +19,7 @@ * for more details and examples. * * ----------------------- GETTING STARTED ----------------------------- -* - Open the class with the ABAP Development Tools (ADT). +* - Open the class with the ABAP development tools for Eclipse (ADT). * - Choose F9 to run the class. * - Check the console output. * - To understand the context and the ABAP syntax used, check the notes diff --git a/src/zcl_demo_abap_cds_ve.clas.abap b/src/zcl_demo_abap_cds_ve.clas.abap index 98a2938..ac7dddb 100644 --- a/src/zcl_demo_abap_cds_ve.clas.abap +++ b/src/zcl_demo_abap_cds_ve.clas.abap @@ -14,7 +14,7 @@ * preview. * ----------------------- GETTING STARTED ----------------------------- -* - Open the class with the ABAP Development Tools (ADT). +* - Open the class with the ABAP development tools for Eclipse (ADT). * - Choose F9 to run the class. * - Check the console output. * - To understand the context and the ABAP syntax used, refer to the diff --git a/src/zcl_demo_abap_constructor_expr.clas.abap b/src/zcl_demo_abap_constructor_expr.clas.abap index 32ee00f..c9df014 100644 --- a/src/zcl_demo_abap_constructor_expr.clas.abap +++ b/src/zcl_demo_abap_constructor_expr.clas.abap @@ -9,7 +9,7 @@ * LET expressions * * ----------------------- GETTING STARTED ----------------------------- -* - Open the class with the ABAP Development Tools (ADT). +* - Open the class with the ABAP development tools for Eclipse (ADT). * - Choose F9 to run the class. * - Check the console output. * - To understand the context and the ABAP syntax used, refer to the diff --git a/src/zcl_demo_abap_dtype_dobj.clas.abap b/src/zcl_demo_abap_dtype_dobj.clas.abap index cdc157e..a888746 100644 --- a/src/zcl_demo_abap_dtype_dobj.clas.abap +++ b/src/zcl_demo_abap_dtype_dobj.clas.abap @@ -13,7 +13,7 @@ * information. * * ----------------------- GETTING STARTED ----------------------------- -* - Open the class with the ABAP Development Tools (ADT). +* - Open the class with the ABAP development tools for Eclipse (ADT). * - Choose F9 to run the class. * - Check the console output. * - To understand the context and the ABAP syntax used, refer to the @@ -84,8 +84,7 @@ CLASS zcl_demo_abap_dtype_dobj DEFINITION d, END OF ENUM t_enum. - - "a) For the following enumerated type, an explicit base type is specified and start values provided using the VALUE addition + "b) For the following enumerated type, an explicit base type is specified and start values provided using the VALUE addition " Note that one value must be initial. TYPES: basetype TYPE c LENGTH 2, @@ -278,7 +277,7 @@ CLASS zcl_demo_abap_dtype_dobj IMPLEMENTATION. TYPES ts_type_line TYPE LINE OF tt_w_like. TYPES ts_like_line LIKE LINE OF itab_local_ts. - "Internal table type with internal table as line type + "Internal table typed with internal table as line type TYPES tt_like_table LIKE TABLE OF itab_local_ts. "Referring to global types @@ -292,7 +291,7 @@ CLASS zcl_demo_abap_dtype_dobj IMPLEMENTATION. "Internal table type based on internal type that exists in a gloabl interface TYPES tt_tab_type_from_itf TYPE zdemo_abap_get_data_itf=>carr_tab. - "Internal table types with an elementary line type based globally available types + "Internal table types with an elementary line type based on globally available types "Elementary table type TYPES tt_strtab TYPE string_table. "Elementary line type; the type is available in a global interface @@ -310,7 +309,7 @@ CLASS zcl_demo_abap_dtype_dobj IMPLEMENTATION. TYPES tr_i TYPE REF TO i. TYPES tr_str TYPE REF TO string. TYPES tr_ddic_tab TYPE REF TO zdemo_abap_carr. - "Using a generic type as static type + "Using the generic type data as static type TYPES tr_data TYPE REF TO data. "Referring to an existing reference type @@ -356,7 +355,7 @@ CLASS zcl_demo_abap_dtype_dobj IMPLEMENTATION. " are covered below. "- In ADT and because of the many type declarations, you may want to press F2 on " the types to get more information. - "- The examples show a selection. For more information, chheck out the ABAP + "- The examples show a selection. For more information, check out the ABAP " Keyword Documentation. output->display( `4) Declaring data objects based on elementary data types` ). @@ -394,7 +393,7 @@ CLASS zcl_demo_abap_dtype_dobj IMPLEMENTATION. "Without the addition VALUE, data objects are filled with their type-specific "initial values. The start value can either be specified as a literal or as a "predefined constant. - "Note: The value addition is not to be confused with the VALUE operator that + "Note: The VALUE addition is not to be confused with the VALUE operator that "can be used to construct the content of complex data objects as shown below. DATA do_c_l2 TYPE c LENGTH 2 VALUE 'hi'. DATA do_i_val TYPE i VALUE 123. @@ -453,7 +452,8 @@ CLASS zcl_demo_abap_dtype_dobj IMPLEMENTATION. END OF a_structure. "Creating a structure based on a global type. In this case, it is a DDIC database - "table whose line type is used. You can also use a CDS view, for example. + "table whose line type is used. You can also use a CDS view or a dedicated structured type + "from the DDIC, for example. DATA struc_ddic_tab TYPE zdemo_abap_carr. "Creating a structure as a constant. Providing values is mandatory. @@ -475,8 +475,8 @@ CLASS zcl_demo_abap_dtype_dobj IMPLEMENTATION. DATA itab_ddic_tab TYPE TABLE OF zdemo_abap_carr WITH EMPTY KEY. "Based on an elementary type DATA itab_tab_i TYPE TABLE OF i. - "The elementary type is declared in a global interface - DATA itab_elem_type_from_itf TYPE zdemo_abap_get_data_itf=>carr_tab. + "The table type is declared in a global interface + DATA itab_tab_type_from_itf TYPE zdemo_abap_get_data_itf=>carr_tab. "Based on globally available DDIC internal table type; explicitly specifying as initial DATA itab_ddic_tab_type TYPE string_table VALUE IS INITIAL. "Based on locally available structured data object @@ -505,7 +505,7 @@ CLASS zcl_demo_abap_dtype_dobj IMPLEMENTATION. DATA dref_int TYPE REF TO i. DATA dref_str TYPE REF TO string. DATA dref_ddic_tab TYPE REF TO zdemo_abap_carr. - "Using a generic type as static type + "Using the generic type data as static type DATA dref_8_dataa TYPE REF TO data. "Referring to an existing reference type @@ -609,7 +609,7 @@ CLASS zcl_demo_abap_dtype_dobj IMPLEMENTATION. some_struc = some_itab[ 2 ]. "Calculation expressions as source of the assignment - "arithmetic expressions + "Arithmetic expressions num = 1 + 2. "A calculation assignment as follows num += 1. @@ -619,8 +619,9 @@ CLASS zcl_demo_abap_dtype_dobj IMPLEMENTATION. "String expressions as source of the assignment str_a2 = str_a1 && ` blabla`. "Strings are appended using the && operator - str_a2 = |{ str_a1 } some more bla.|. "String templates. + str_a2 = |{ str_a1 } some more bla.|. "String templates "Note: Data objects are specified in curly brackets. The content is converted to type string. + " It must be convertible to type string. "An elementary data object is assigned a component of a specific table line using "a table expression. Note: In the following case, the types of source and target are not @@ -638,7 +639,7 @@ CLASS zcl_demo_abap_dtype_dobj IMPLEMENTATION. output->display( `8) Creating data objects by inline declaration` ). "The declaration operator DATA can be specified in any designated declaration position. - "The date type of the variable is determined by the operand type. It must be possible + "The data type of the variable is determined by the operand type. It must be possible "to derive this type completely statically. "Note: "- In newer ABAP releases, the FINAL declaration operator is available for creating @@ -683,7 +684,8 @@ CLASS zcl_demo_abap_dtype_dobj IMPLEMENTATION. DATA(struc_b1) = VALUE ts_struc( comp1 = 1 comp2 = `A` ). "No components specified and values assigned means an initial structure. "This syntax is also possible for declaring data objects with elementary types - "and explicitly specifiying initial values. + "and explicitly specifiying initial values, but only for initial values. + "See the CONV operator below. DATA(struc_b2) = VALUE ts_struc( ). DATA(elem_init) = VALUE i( ). "Note that components that are not specified and assigned a value remain initial. @@ -711,8 +713,8 @@ CLASS zcl_demo_abap_dtype_dobj IMPLEMENTATION. "In the context of other ABAP statements such as LOOP, READ TABLE or ABAP SQL "SELECT statements, inline declarations are useful for creating target variables with - "appropriate data types in place. A structure to hold the current internal table line - "is created inline. + "appropriate data types in place. In the following example, a structure to hold the + "current internal table line is created inline. LOOP AT itab_b2 INTO DATA(wa_b1). ... ENDLOOP. @@ -742,9 +744,8 @@ CLASS zcl_demo_abap_dtype_dobj IMPLEMENTATION. " to any objects. This means that it does not have a data type or a class as " a dynamic type. - "Declaring data reference variables with static types - "At this stage, initial references variables contains null references. + "At this stage, initial reference variables contain null references. DATA dref_1_i TYPE REF TO i. DATA dref_2_str TYPE REF TO string. "Generic type as static type @@ -753,13 +754,13 @@ CLASS zcl_demo_abap_dtype_dobj IMPLEMENTATION. "References in data reference variables can point to existing data objects. "For assigning the reference, you can use the REF operator. "There is also an ABAP statement available doing the same: GET REFERENCE. - "It should not be used anymore, especially in ABAP for Cloud development + "It should not be used anymore, especially in ABAP for Cloud development. "Creating data objects to refer to and providing a start value DATA do_number TYPE i VALUE 987. DATA do_string TYPE string VALUE `abc`. - "After the assignment the data reference variable points to the values. + "After the assignment, the data reference variable points to the values. "The data type is derived (dynamic type). dref_1_i = REF #( do_number ). "Dynamic type is the same as the static type in this case dref_2_str = REF #( do_string ). "Dynamic type is the same as the static type in this case @@ -792,7 +793,7 @@ CLASS zcl_demo_abap_dtype_dobj IMPLEMENTATION. " - the static type of the source variable is completely typed, and the static type " of the target variable is generic. - "The following upcasts work. Both are of type i or string. + "The following upcasts work. Both point to data objects of type i or string. dref_1_i = dref_6_i. "The source on the right side is completely typed (type i), "the target on the left side is a generic type (type data). @@ -802,8 +803,8 @@ CLASS zcl_demo_abap_dtype_dobj IMPLEMENTATION. "- The static type of the target variable is more specific than the static type of the " source variable. "- The assignability is not checked until runtime. - "- Must always be performed explicitly using the casting operator ?= and the casting - " operator CAST. + "- Must always be performed explicitly using the casting operator ?= or the more + " modern casting operator CAST. "The following example would result in a syntax error due to type incompatibility. "dref_1_i = dref_3_data. @@ -814,12 +815,12 @@ CLASS zcl_demo_abap_dtype_dobj IMPLEMENTATION. "Note: "- The assignability is still not checked. This is done at runtime. " In this example, it works since the dynamic type of the source is also of type i. - "- An advantage of the CAST operator compared to ?= is that the operator enables downcasts + "- An advantage of the CAST operator compared to ?= is that the operator enables downcasts " in operand positions, which helps reduce helper variables. dref_1_i = CAST #( dref_3_data ). "If not caught, the following would result in a runtime error. - "dref_3_data points to a reference of type i, the static type of dref_2_str is string. + "dref_3_data points to a data object of type i, the static type of dref_2_str is string. "So, the downcast does not work. TRY. dref_2_str = CAST #( dref_3_data ). @@ -831,7 +832,7 @@ CLASS zcl_demo_abap_dtype_dobj IMPLEMENTATION. dref_1_i ?= dref_3_data. "For upcasts, the operators can be used, too, but they are usually not necessary. - "So, an assignment as follows is possible but not needed. + "So, an assignment as follows is possible but not needed. Only using = is sufficient. dref_1_i = CAST #( dref_6_i ). output->display( `No output for this section. Check out the code, ` @@ -867,7 +868,7 @@ CLASS zcl_demo_abap_dtype_dobj IMPLEMENTATION. CREATE DATA dref_7_str. "Note: If you want to assign a value to the data object, this can't be done directly. - "The data reference variable must be dereferenced first using using the dereferencing operator. + "The data reference variable must be dereferenced first using the dereferencing operator. dref_7_str->* = `hi`. "Creating an anonymous data object with an explicitly specified data type @@ -882,7 +883,8 @@ CLASS zcl_demo_abap_dtype_dobj IMPLEMENTATION. "Using the LIKE addition to refer to an existing internal table CREATE DATA dref_8_data LIKE it. - "Using the anonymous data object as target in the INTO clause of a SELECT statement + "Using the anonymous data object as target in the INTO clause of a SELECT statement. + "As above, note the dereferencing. SELECT * FROM zdemo_abap_carr INTO TABLE @dref_8_data->*. @@ -944,9 +946,9 @@ CLASS zcl_demo_abap_dtype_dobj IMPLEMENTATION. ********************************************************************** - output->display( `Excursions: Type conversions with elementary types: ...` ). + output->display( `Excursions: Elementary types and type conversions` ). - output->display( `11) ... Implicit and explicit conversion` ). + output->display( `11) Implicit and explicit conversion` ). "Implicit conversions are performed in assignments using the assignment operator = "The content of a data object is converted according to the associated conversion rules. @@ -1003,7 +1005,7 @@ CLASS zcl_demo_abap_dtype_dobj IMPLEMENTATION. output->display( input = do_8_i name = `do_8_i` ). "CONV operator for creating data objects inline with elementary data types - "Assume, you want a data object type with decfloat34. + "Assume, you want a data object typed with decfloat34. "The following example assigns a text field literal to the left side. DATA(do_9_c4) = '4.56'. "It is type c @@ -1141,7 +1143,8 @@ CLASS zcl_demo_abap_dtype_dobj IMPLEMENTATION. output->display( `16) Type conversion rules` ). "The purpose of this example is to emphasize the conversion rules - "that should be noted when performing conversions. + "that should be noted when performing conversions. The example + "uses only a selection of elementary data types. "The result of the conversion may be unexpected or surprising. "For all the details, check the ABAP Keyword Documentation. "In the following example, a structured type is created. @@ -1151,10 +1154,9 @@ CLASS zcl_demo_abap_dtype_dobj IMPLEMENTATION. "- If there is a conversion error, the conv_err* components hold " the error message. "An internal table is created based on this structured type. - "For the data objects to be created, several data objects are - "inserted into the internal table. - "This table is looped over. Implicit conversions are performed - "using the assignment operator. + "Several data objects are inserted into the internal table, on the + "basis of which a conversion is performed. The table is looped over. + "Implicit conversions are performed using the assignment operator. "Some noteworthy type conversions: "Conversion of d to decfloat34 and i: @@ -1229,62 +1231,62 @@ CLASS zcl_demo_abap_dtype_dobj IMPLEMENTATION. ( to_be_converted = REF #( `12345` ) type = `STRING` ) ). - LOOP AT tt_conv_tab ASSIGNING FIELD-SYMBOL(). + LOOP AT tt_conv_tab INTO DATA(wa_con). TRY. - -conv_c_len2 = -to_be_converted->*. - -conv_err_c_len2 = `-`. + wa_con-conv_c_len2 = wa_con-to_be_converted->*. + wa_con-conv_err_c_len2 = `-`. CATCH cx_root INTO err. - -conv_err_c_len2 = err->get_text( ). + wa_con-conv_err_c_len2 = err->get_text( ). ENDTRY. - IF -type = `T`. - -conv_err_d = `Move error: T to D. Otherwise, a runtime error is caused.`. + IF wa_con-type = `T`. + wa_con-conv_err_d = `Move error: T to D. Otherwise, a runtime error is caused.`. ELSE. TRY. - -conv_d = -to_be_converted->*. - -conv_err_d = `-`. + wa_con-conv_d = wa_con-to_be_converted->*. + wa_con-conv_err_d = `-`. CATCH cx_root INTO err. - -conv_err_d = err->get_text( ). + wa_con-conv_err_d = err->get_text( ). ENDTRY. ENDIF. TRY. - -conv_n_len3 = -to_be_converted->*. - -conv_err_n_len3 = `-`. + wa_con-conv_n_len3 = wa_con-to_be_converted->*. + wa_con-conv_err_n_len3 = `-`. CATCH cx_root INTO err. - -conv_err_n_len3 = err->get_text( ). + wa_con-conv_err_n_len3 = err->get_text( ). ENDTRY. - IF -type = `D`. - -conv_err_t = `Move error: D to T. Otherwise, a runtime error is caused.`. + IF wa_con-type = `D`. + wa_con-conv_err_t = `Move error: D to T. Otherwise, a runtime error is caused.`. ELSE. TRY. - -conv_t = -to_be_converted->*. - -conv_err_t = `-`. + wa_con-conv_t = wa_con-to_be_converted->*. + wa_con-conv_err_t = `-`. CATCH cx_root INTO err. - -conv_err_t = err->get_text( ). + wa_con-conv_err_t = err->get_text( ). ENDTRY. ENDIF. TRY. - -conv_decfl34 = -to_be_converted->*. - -conv_err_decfl34 = `-`. + wa_con-conv_decfl34 = wa_con-to_be_converted->*. + wa_con-conv_err_decfl34 = `-`. CATCH cx_root INTO err. - -conv_err_decfl34 = err->get_text( ). + wa_con-conv_err_decfl34 = err->get_text( ). ENDTRY. TRY. - -conv_i = -to_be_converted->*. - -conv_err_i = `-`. + wa_con-conv_i = wa_con-to_be_converted->*. + wa_con-conv_err_i = `-`. CATCH cx_root INTO err. - -conv_err_i = err->get_text( ). + wa_con-conv_err_i = err->get_text( ). ENDTRY. TRY. - -conv_str = -to_be_converted->*. - -conv_err_str = `-`. + wa_con-conv_str = wa_con-to_be_converted->*. + wa_con-conv_err_str = `-`. CATCH cx_root INTO err. - -conv_err_str = err->get_text( ). + wa_con-conv_err_str = err->get_text( ). ENDTRY. ENDLOOP. @@ -1344,10 +1346,10 @@ CLASS zcl_demo_abap_dtype_dobj IMPLEMENTATION. DATA rtti_tab TYPE TABLE OF ts_rtti WITH EMPTY KEY. - LOOP AT tt_conv_tab ASSIGNING FIELD-SYMBOL(). + LOOP AT tt_conv_tab REFERENCE INTO DATA(wa_ref). DATA(rtti) = CAST cl_abap_datadescr( - cl_abap_typedescr=>describe_by_data( -to_be_converted->* ) ). + cl_abap_typedescr=>describe_by_data( wa_ref->to_be_converted->* ) ). APPEND VALUE #( absolute_name = rtti->absolute_name kind = rtti->kind @@ -1446,6 +1448,11 @@ CLASS zcl_demo_abap_dtype_dobj IMPLEMENTATION. DATA do_d_i TYPE i. "Field symbols typed with generic data types + "Note: A field symbol is a symbolic name for a data object to which actual + "memory can be assigned at runtime. A field symbol can be used as a placeholder + "for a data object at an operand position. For more information, see the ABAP + "Cheat Sheet on dynamic programming. Field symbols are used in this example + "to demonstrate generic types other than just data. FIELD-SYMBOLS TYPE clike. FIELD-SYMBOLS TYPE data. @@ -1592,7 +1599,7 @@ CLASS zcl_demo_abap_dtype_dobj IMPLEMENTATION. CONSTANTS con_b_str TYPE string VALUE `hi`. "Unnamed data objects - "Literal that is output. It is cannot be addressed via a dedicated name. + "Literal that is output. It cannot be addressed via a dedicated name. output->display( `I'm a literal...` ). "Anonymous data object created using the NEW operator @@ -1619,11 +1626,11 @@ CLASS zcl_demo_abap_dtype_dobj IMPLEMENTATION. "A generic data type is an incomplete type specification that covers multiple "complete type specifications. "This example demonstrates generic ABAP types in the context of formal parameters - "of methods. The use with field symbols has been touched above. + "of methods. "Unlike data objects, where the data type has a specific property and is always "completely known, formal parameters and field symbols that are generically typed "receive their complete data type only when an actual parameter is passed in a method - "call (or when a memory area is assigned using ASSIGN). + "call, or, regarding field symbols, when a memory area is assigned. "In the following example, a method is called that has two importing parameters typed "with the generic type numeric. An internal table is filled with values on whose basis "the method is provided with actual parameters. Intentionally, various numeric values @@ -1642,10 +1649,10 @@ CLASS zcl_demo_abap_dtype_dobj IMPLEMENTATION. ( num1 = NEW i( 11 ) num2 = NEW decfloat34( '10.621' ) ) ( num1 = NEW string( `nope` ) num2 = NEW string( `does not work` ) ) ). - LOOP AT tab_num ASSIGNING FIELD-SYMBOL(). + LOOP AT tab_num INTO DATA(fp). TRY. - -result = addition_with_generic_num( num1 = -num1->* num2 = -num2->* ). + fp-result = addition_with_generic_num( num1 = fp-num1->* num2 = fp-num2->* ). CATCH cx_sy_dyn_call_illegal_type INTO DATA(error). ENDTRY. @@ -1660,7 +1667,7 @@ CLASS zcl_demo_abap_dtype_dobj IMPLEMENTATION. output->display( `21) Built-in data objects` ). - "This example demonstrates the availability of built-in data objects in ABAP.. + "This example demonstrates the availability of built-in data objects in ABAP. "System fields are filled by the ABAP runtime framework and can be used in an ABAP "program to query various things. @@ -1742,11 +1749,11 @@ CLASS zcl_demo_abap_dtype_dobj IMPLEMENTATION. output->display( `22) Declaration context` ). - "The declaration context of data objects can be problematic. - "The example deals with local declarations and control structures. - "A data object of type i is declared within the control structure. - "However, it is valid globally in this ABAP program, i.e. in the whole method - "here. + "The purpose of this example is to emphasize the importance of where + "data objects are decalred. The example deals with local declarations + "and control structures. A data object of type i is declared within + "the control structure. However, it is valid globally in this ABAP + "program, i.e. in the whole method here. "The value of the data object is not set to 10 in each loop pass. "Furthermore, the data object can also be used in the second DO loop. @@ -1846,7 +1853,7 @@ CLASS zcl_demo_abap_dtype_dobj IMPLEMENTATION. WHEN b. output = b. WHEN OTHERS. - output = `Either c or d : ` && char. + output = `Either c or d: ` && char. ENDCASE. ENDMETHOD. @@ -1886,7 +1893,7 @@ CLASS zcl_demo_abap_dtype_dobj IMPLEMENTATION. DATA(str_from_enum) = |{ a }{ b }{ c }{ d }|. APPEND |str_from_enum: { str_from_enum }| TO output. - "Note that only the enumerated type itself is relevant. Usually, the contents + "Note that only the enumerated type itself is relevant. Usually, the content "of an enumerated object is not of interest. "The enumerated value in the base type can be accessed using the constructor "operators CONV and EXACT only. The base type is i in this case. @@ -1905,7 +1912,6 @@ CLASS zcl_demo_abap_dtype_dobj IMPLEMENTATION. "The following example shows raising an exception. DATA dobj TYPE t_enum. - dobj = a. TYPES t_int_tab TYPE TABLE OF i WITH EMPTY KEY. DATA(int_tab) = VALUE t_int_tab( ( 0 ) ( 1 ) ( 2 ) ( 3 ) ( 4 ) ). @@ -1920,9 +1926,9 @@ CLASS zcl_demo_abap_dtype_dobj IMPLEMENTATION. ENDTRY. ENDLOOP. - APPEND `------------- Output for str_tab -------------` TO output. + APPEND `------------- START: Output for str_tab -------------` TO output. APPEND LINES OF str_tab TO output. - APPEND `^^^^^^^^^^^^^ Output for str_tab ^^^^^^^^^^^^^` TO output. + APPEND `^^^^^^^^^^^^^ END: Output for str_tab ^^^^^^^^^^^^^` TO output. "An enumerated variable can be set to the initial value of its base type "using CLEAR. @@ -1975,6 +1981,7 @@ CLASS zcl_demo_abap_dtype_dobj IMPLEMENTATION. DATA mem_string TYPE string. + "For output purposes, the table content is put in a string. LOOP AT enum_descr->members ASSIGNING FIELD-SYMBOL(). mem_string = mem_string && ` / Name: ` && -name && `; Value: ` && -value. ENDLOOP. @@ -1991,6 +1998,7 @@ CLASS zcl_demo_abap_dtype_dobj IMPLEMENTATION. APPEND ` type_kind: ` && enum_descr->type_kind TO output. APPEND ` base_type_kind: ` && enum_descr->base_type_kind TO output. + "For output purposes, the table content is put in a string. LOOP AT enum_descr->members ASSIGNING . mem_string = mem_string && ` / Name: ` && -name && `; Value: ` && -value. ENDLOOP. diff --git a/src/zcl_demo_abap_dynamic_prog.clas.abap b/src/zcl_demo_abap_dynamic_prog.clas.abap index 462468d..000a0d8 100644 --- a/src/zcl_demo_abap_dynamic_prog.clas.abap +++ b/src/zcl_demo_abap_dynamic_prog.clas.abap @@ -17,7 +17,7 @@ * in the end is random. * * ----------------------- GETTING STARTED ----------------------------- -* - Open the class with the ABAP Development Tools (ADT). +* - Open the class with the ABAP development tools for Eclipse (ADT). * - Choose F9 to run the class. * - Check the console output. * - To understand the context and the ABAP syntax used, refer to the diff --git a/src/zcl_demo_abap_internal_tables.clas.abap b/src/zcl_demo_abap_internal_tables.clas.abap index c9b9192..ffbf294 100644 --- a/src/zcl_demo_abap_internal_tables.clas.abap +++ b/src/zcl_demo_abap_internal_tables.clas.abap @@ -1,6 +1,6 @@ *********************************************************************** * -* ABAP cheat sheet: Working with internal tables +* ABAP cheat sheet: Internal tables * * -------------------------- PURPOSE ---------------------------------- * - Example to demonstrate various syntactical options for working with @@ -9,7 +9,7 @@ * internal tables * * ----------------------- GETTING STARTED ----------------------------- -* - Open the class with the ABAP Development Tools (ADT). +* - Open the class with the ABAP development tools for Eclipse (ADT). * - Choose F9 to run the class. * - Check the console output. * - To understand the context and the ABAP syntax used, refer to the @@ -181,7 +181,7 @@ CLASS ZCL_DEMO_ABAP_INTERNAL_TABLES IMPLEMENTATION. DATA(output) = NEW zcl_demo_abap_display( out ). - output->display( `ABAP Cheat Sheet Example: Working with Internal Tables` ). + output->display( `ABAP Cheat Sheet Example: Internal Tables` ). output->display( `Filling and Copying Internal Table Content` ). output->display( `1) Adding single lines using APPEND/INSERT` ). diff --git a/src/zcl_demo_abap_objects.clas.abap b/src/zcl_demo_abap_objects.clas.abap index faaa89a..5ed1478 100644 --- a/src/zcl_demo_abap_objects.clas.abap +++ b/src/zcl_demo_abap_objects.clas.abap @@ -17,7 +17,7 @@ * the concept of friendship * * ----------------------- GETTING STARTED ----------------------------- -* - Open the class with the ABAP Development Tools (ADT). +* - Open the class with the ABAP development tools for Eclipse (ADT). * - Choose F9 to run the class. * - Check the console output. * - To understand the context and the ABAP syntax used, refer to the diff --git a/src/zcl_demo_abap_prog_flow_logic.clas.abap b/src/zcl_demo_abap_prog_flow_logic.clas.abap index 2c5b72d..eee371e 100644 --- a/src/zcl_demo_abap_prog_flow_logic.clas.abap +++ b/src/zcl_demo_abap_prog_flow_logic.clas.abap @@ -13,7 +13,7 @@ * - Handling exceptions * * ----------------------- GETTING STARTED ----------------------------- -* - Open the class with the ABAP Development Tools (ADT). +* - Open the class with the ABAP development tools for Eclipse (ADT). * - Choose F9 to run the class. * - Check the console output. * - To understand the context and the ABAP syntax used, refer to the diff --git a/src/zcl_demo_abap_rap_draft_ln_m.clas.abap b/src/zcl_demo_abap_rap_draft_ln_m.clas.abap index 8565d76..0666bec 100644 --- a/src/zcl_demo_abap_rap_draft_ln_m.clas.abap +++ b/src/zcl_demo_abap_rap_draft_ln_m.clas.abap @@ -23,7 +23,7 @@ * ----------------------- GETTING STARTED (1) ------------------------- * ----------------- Using this class as RAP BO consumer --------------- * -* - Open the class with the ABAP Development Tools (ADT). +* - Open the class with the ABAP development tools for Eclipse (ADT). * - Choose F9 to run the class. * - Check the console output. * - To understand the context and the ABAP syntax used, check the notes diff --git a/src/zcl_demo_abap_rap_ext_num_m.clas.abap b/src/zcl_demo_abap_rap_ext_num_m.clas.abap index 1fd37c6..9c4b643 100644 --- a/src/zcl_demo_abap_rap_ext_num_m.clas.abap +++ b/src/zcl_demo_abap_rap_ext_num_m.clas.abap @@ -20,7 +20,7 @@ * - ABP for this scenario: zbp_demo_abap_rap_ro_m * * ----------------------- GETTING STARTED ----------------------------- -* - Open the class with the ABAP Development Tools (ADT). +* - Open the class with the ABAP development tools for Eclipse (ADT). * - Choose F9 to run the class. * - Check the console output. * - To understand the context and the ABAP syntax used, check the notes diff --git a/src/zcl_demo_abap_rap_ext_num_u.clas.abap b/src/zcl_demo_abap_rap_ext_num_u.clas.abap index 24b079b..95f159f 100644 --- a/src/zcl_demo_abap_rap_ext_num_u.clas.abap +++ b/src/zcl_demo_abap_rap_ext_num_u.clas.abap @@ -20,7 +20,7 @@ * - ABP for this scenario: zbp_demo_abap_rap_ro_u * * ----------------------- GETTING STARTED ----------------------------- -* - Open the class with the ABAP Development Tools (ADT). +* - Open the class with the ABAP development tools for Eclipse (ADT). * - Choose F9 to run the class. * - Check the console output. * - To understand the context and the ABAP syntax used, check the notes diff --git a/src/zcl_demo_abap_sql.clas.abap b/src/zcl_demo_abap_sql.clas.abap index 998bf34..9ee02e8 100644 --- a/src/zcl_demo_abap_sql.clas.abap +++ b/src/zcl_demo_abap_sql.clas.abap @@ -9,7 +9,7 @@ * data in database tables using INSERT, UPDATE, MODIFY and DELETE * * ----------------------- GETTING STARTED ----------------------------- -* - Open the class with the ABAP Development Tools (ADT). +* - Open the class with the ABAP development tools for Eclipse (ADT). * - Choose F9 to run the class. * - Check the console output. * - To understand the context and the ABAP syntax used, refer to the diff --git a/src/zcl_demo_abap_sql_group_by.clas.abap b/src/zcl_demo_abap_sql_group_by.clas.abap index 6cbdf19..5834caf 100644 --- a/src/zcl_demo_abap_sql_group_by.clas.abap +++ b/src/zcl_demo_abap_sql_group_by.clas.abap @@ -6,7 +6,7 @@ * Example to demonstrate syntax options when grouping internal tables. * * ----------------------- GETTING STARTED ----------------------------- -* - Open the class with the ABAP Development Tools (ADT). +* - Open the class with the ABAP development tools for Eclipse (ADT). * - Choose F9 to run the class. * - Check the console output. * - To understand the context and the ABAP syntax used, refer to the diff --git a/src/zcl_demo_abap_string_proc.clas.abap b/src/zcl_demo_abap_string_proc.clas.abap index 67dd869..b8c8f80 100644 --- a/src/zcl_demo_abap_string_proc.clas.abap +++ b/src/zcl_demo_abap_string_proc.clas.abap @@ -10,7 +10,7 @@ * and replacing, regular expressions * * ----------------------- GETTING STARTED ----------------------------- -* - Open the class with the ABAP Development Tools (ADT). +* - Open the class with the ABAP development tools for Eclipse (ADT). * - Choose F9 to run the class. * - Check the console output. * - To understand the context and the ABAP syntax used, refer to the diff --git a/src/zcl_demo_abap_structures.clas.abap b/src/zcl_demo_abap_structures.clas.abap index b1559bc..b57d89a 100644 --- a/src/zcl_demo_abap_structures.clas.abap +++ b/src/zcl_demo_abap_structures.clas.abap @@ -1,6 +1,6 @@ *********************************************************************** * -* ABAP cheat sheet: Working with structures +* ABAP cheat sheet: Structures * * -------------------------- PURPOSE ---------------------------------- * - Example to demonstrate various syntactical options for working with @@ -10,7 +10,7 @@ * clearing structures, structures in use in the context of tables * * ----------------------- GETTING STARTED ----------------------------- -* - Open the class with the ABAP Development Tools (ADT). +* - Open the class with the ABAP development tools for Eclipse (ADT). * - Choose F9 to run the class. * - Check the console output. * - To understand the context and the ABAP syntax used, refer to the @@ -114,7 +114,7 @@ CLASS zcl_demo_abap_structures IMPLEMENTATION. DATA(output) = NEW zcl_demo_abap_display( out ). - output->display( `ABAP Cheat Sheet Example: Working with Structures` ). + output->display( `ABAP Cheat Sheet Example: Structures` ). ********************************************************************** diff --git a/src/zcl_demo_abap_unit_test.clas.abap b/src/zcl_demo_abap_unit_test.clas.abap index f875e88..94fb722 100644 --- a/src/zcl_demo_abap_unit_test.clas.abap +++ b/src/zcl_demo_abap_unit_test.clas.abap @@ -9,7 +9,7 @@ * back door injection, test seams) * * ----------------------- RUN ABAP UNIT TEST--------------------------- -* - Open the class with the ABAP Development Tools (ADT). +* - Open the class with the ABAP development tools for Eclipse (ADT). * - Choose Ctrl/Cmd + Shift + F10 to launch all tests in the class. * You can also right-click somewhere in the class and choose * Run as -> ABAP Unit Test. @@ -23,7 +23,7 @@ * what code is tested and what not. * * ----------------------- RUN CLASS ----------------------------- -* - Open the class with the ABAP Development Tools (ADT). +* - Open the class with the ABAP development tools for Eclipse (ADT). * - Choose F9 to run the class. * - Check the console output. * - To understand the context and the ABAP syntax used, check the notes