diff --git a/01_Internal_Tables.md b/01_Internal_Tables.md
index c97b366..9d3b9cb 100644
--- a/01_Internal_Tables.md
+++ b/01_Internal_Tables.md
@@ -21,8 +21,13 @@
- [Reading a Single Line Using Table Keys](#reading-a-single-line-using-table-keys)
- [Reading a Single Line Using a Free Key](#reading-a-single-line-using-a-free-key)
- [Addressing Individual Components of Read Lines](#addressing-individual-components-of-read-lines)
- - [Checking the Existence and the Index of a Line in an Internal Table](#checking-the-existence-and-the-index-of-a-line-in-an-internal-table)
+ - [Obtaining Information about Internal Tables, Table Lines, Table Types](#obtaining-information-about-internal-tables-table-lines-table-types)
+ - [Checking the Existence of a Line in an Internal Table](#checking-the-existence-of-a-line-in-an-internal-table)
+ - [Checking the Index of a Line in an Internal Table](#checking-the-index-of-a-line-in-an-internal-table)
+ - [Checking How Many Lines Exist in an Internal Table](#checking-how-many-lines-exist-in-an-internal-table)
+ - [Getting Table (Type) Information and Creating Internal Tables and Types at Runtime](#getting-table-type-information-and-creating-internal-tables-and-types-at-runtime)
- [Processing Multiple Internal Table Lines Sequentially](#processing-multiple-internal-table-lines-sequentially)
+ - [Restricting the Area of a Table to Be Looped Over](#restricting-the-area-of-a-table-to-be-looped-over)
- [Iteration Expressions](#iteration-expressions)
- [Operations with Internal Tables Using ABAP SQL SELECT Statements](#operations-with-internal-tables-using-abap-sql-select-statements)
- [Internal Tables as Target Data Objects](#internal-tables-as-target-data-objects)
@@ -32,11 +37,11 @@
- [Deleting Internal Table Content](#deleting-internal-table-content)
- [Deleting Adjacent Duplicate Lines](#deleting-adjacent-duplicate-lines)
- [Deleting the Entire Internal Table Content](#deleting-the-entire-internal-table-content)
+ - [Grouping Internal Tables](#grouping-internal-tables)
- [Excursions](#excursions)
- [Improving Read Performance with Secondary Table Keys](#improving-read-performance-with-secondary-table-keys)
- [Searching and Replacing Substrings in Internal Tables with Character-Like Data Types](#searching-and-replacing-substrings-in-internal-tables-with-character-like-data-types)
- [Ranges Tables](#ranges-tables)
- - [Getting Table Type Information and Creating Internal Tables at Runtime](#getting-table-type-information-and-creating-internal-tables-at-runtime)
- [Comparing Content of Compatible Internal Tables](#comparing-content-of-compatible-internal-tables)
- [More Information](#more-information)
- [Executable Example](#executable-example)
@@ -885,7 +890,7 @@ default line in case of an unsuccessful read operation, which can also be anothe
``` abap
DATA(line1) = VALUE #( itab[ 6 ] OPTIONAL ).
-DATA(line2) = VALUE #( itab[ 7 ] DEFAULT itab[ 8 ] ).
+DATA(line2) = VALUE #( itab[ 7 ] DEFAULT itab[ 1 ] ).
```
⬆️ back to top
@@ -975,7 +980,7 @@ READ TABLE itab WITH KEY ... BINARY SEARCH ...
- Using the `BINARY SEARCH` addition is particularly more efficient for larger tables when accessing data often.
- The table must be sorted in ascending order based on the keys being searched.
- `BINARY SEARCH` is suitable for standard tables that do not have a secondary key defined and when you need to make multiple read accesses to the table (however, note the costs of a previous sorting)
- - `BINARY SEARCH` can only be used with index tables and not with hashed tables. If the table is sorted and the read access uses a free key, the addition can only be applied when the initial part of the table key is specified. I.e. if key components are `a`, `b`, and `c`, the addition can be used by specifying `a` alone, `a` and `b`, or `a`, `b`, and `c`. Not working (for example): `b` and `c` without `a`, or any other non-key component (because it cannot be sorted according to the non-key component).
+ - `BINARY SEARCH` can only be used with index tables and not with hashed tables. If the table is sorted and the read access uses a free key, the addition can only be applied when the initial part of the table key is specified. I.e. if key components are `a`, `b`, and `c`, the addition can be used by specifying `a` alone, `a` and `b`, or `a`, `b`, and `c`. However, it is just that the syntax "works", the `BINARY SEARCH` specifiation has no effect and is redundant. Syntactically not possible with `BINARY SEARCH` (for example): `b` and `c` without `a`, or any other non-key component (because it cannot be sorted according to the non-key component).
- Depending on the number of times you need to access the internal table, it is recommended to work with sorted tables or tables with secondary keys. If you only need to read one or a few data sets, consider the administrative costs of setting up the index.
- Note: The `BINARY SEARCH` addition is not available for table expressions. If `KEY ...` is specified, an optimized search is performed by default. There are no performance differences between using the `READ TABLE` statement and table expressions.
@@ -1097,12 +1102,17 @@ DATA(comp3) = -c.
READ TABLE it REFERENCE INTO DATA(dref) WITH KEY b = 2.
DATA(comp4) = dref->c.
-"Note: The syntax dref->*-c is also possible.
+
+"It is also possible to specify the dereferencing operator
+"with the component selector.
+DATA(comp5) = dref->*-c.
```
⬆️ back to top
-### Checking the Existence and the Index of a Line in an Internal Table
+## Obtaining Information about Internal Tables, Table Lines, Table Types
+
+### Checking the Existence of a Line in an Internal Table
This is relevant if you are not interested in the content of a table
line, but only want to find out whether a line exists that matches to the
@@ -1144,22 +1154,51 @@ IF line_exists( it[ 1 ] ).
ENDIF.
```
+⬆️ back to top
+
+### Checking the Index of a Line in an Internal Table
+
If you want to find out about the index of a line in an internal table, you can also make use of the `READ TABLE` statement above. If
the line is found, the system field `sy-tabix` is set to the number of the index. Otherwise, the built-in function
[`line_index( )`](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenline_index_function.htm) can be used. It returns the index of the found line or 0 if the line does not exist.
``` abap
-DATA(idx) = line_index( it[ b = 2 ] ).
+DATA(itab) = VALUE string_table( ( `aaa` ) ( `bbb` ) ).
+READ TABLE itab WITH KEY table_line = `bbb` TRANSPORTING NO FIELDS.
+"2
+DATA(tabix) = sy-tabix.
+
+"1
+DATA(idx) = line_index( itab[ table_line = `aaa` ] ).
```
+⬆️ back to top
+
+### Checking How Many Lines Exist in an Internal Table
+
`lines( )` is another built-in function that you can use to check how many lines exist in an internal table. It returns an integer value.
``` abap
-DATA(number_of_lines) = lines( it ).
+DATA(itab) = VALUE string_table( ( `a` ) ( `b` ) ( `c` ) ( `d` ) ( `e` ) ).
+
+"5
+DATA(number_of_lines) = lines( itab ).
```
⬆️ back to top
+### Getting Table (Type) Information and Creating Internal Tables and Types at Runtime
+
+Using [Runtime Type Services (RTTS)](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenrun_time_type_services_glosry.htm "Glossary Entry")
+you can ...
+- get type information on internal tables and table types at runtime ([Runtime Type Identification (RTTI)](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenrun_time_type_identific_glosry.htm "Glossary Entry")).
+- define and create new internal tables and table types as [type description objects](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abentype_object_glosry.htm) at runtime ([Runtime Type Creation (RTTC)](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenrun_time_type_creation_glosry.htm "Glossary Entry")).
+
+For more information, see the [Dynamic Programming](06_Dynamic_Programming.md) cheat sheet.
+
+⬆️ back to top
+
+
## Processing Multiple Internal Table Lines Sequentially
If you are interested not only in single table lines, but in the entire
@@ -1218,7 +1257,7 @@ line. This is not true for hashed tables. There, `sy-tabix` is `0`.
- Note that if you want to work with the value of `sy-tabix`, you
should do so immediately after the `LOOP` statement to avoid possible overwriting in statements contained in the loop block.
-*Restricting the area of the table to be looped over*
+### Restricting the Area of a Table to Be Looped Over
The additions of `LOOP` statements come into play when you want to restrict the table content to be respected by the loop because
you do not want to loop over the entire table. Note that the examples only show work areas as target objects to hold the table line read.
@@ -1489,6 +1528,7 @@ SELECT it_alias1~a, it_alias2~b
easier to understand and can prevent unwanted sorting results,
especially with tables with standard key.
+
*Sorting by primary table key*
``` abap
"Implicit sorting by primary table key and in ascending order by default
@@ -1717,7 +1757,7 @@ ENDLOOP.
"The following, similar example (uneven numbers are deleted) uses a
"table which is looped over by specifying the addition USING KEY.
"In this case (using LOOP ... USING KEY ...), the short form of the
-"DELETE statement cannot be use. Use the DELETE statement with the
+"DELETE statement cannot be used. Use the DELETE statement with the
"addition USING KEY loop_key to delete the current first line.
"loop_key is a predefined name to be used with DELETE and within
"loops that specify LOOP ... USING KEY .... No other key name is
@@ -1793,6 +1833,12 @@ it_ref = NEW #( ).
```
⬆️ back to top
+## Grouping Internal Tables
+
+Find more information in the [Internal Tables: Grouping](11_Internal_Tables_Grouping.md) cheat sheet and a code snippet in the [Constructor Expressions](05_Constructor_Expressions.md#grouping-lines-in-internal-tables-with-valuereduce) cheat sheet.
+
+⬆️ back to top
+
## Excursions
### Improving Read Performance with Secondary Table Keys
@@ -1997,17 +2043,6 @@ SELECT * FROM @inttab AS tab
⬆️ back to top
-### Getting Table Type Information and Creating Internal Tables at Runtime
-
-Using [Runtime Type Services (RTTS)](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenrun_time_type_services_glosry.htm "Glossary Entry")
-you can ...
-- get type information on data objects, data types or [instances](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abeninstance_glosry.htm "Glossary Entry") at runtime ([Runtime Type Identification (RTTI)](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenrun_time_type_identific_glosry.htm "Glossary Entry")).
-- define and create new data types as [type description objects](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abentype_object_glosry.htm) at runtime ([Runtime Type Creation (RTTC)](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenrun_time_type_creation_glosry.htm "Glossary Entry")).
-
-For more information, see the [Dynamic Programming](06_Dynamic_Programming.md) cheat sheet.
-
-⬆️ back to top
-
### Comparing Content of Compatible Internal Tables
Using the methods of the `CL_ABAP_DIFF` class, you can compare the content of two compatible index tables.
diff --git a/03_ABAP_SQL.md b/03_ABAP_SQL.md
index 3668a15..75bd54a 100644
--- a/03_ABAP_SQL.md
+++ b/03_ABAP_SQL.md
@@ -22,10 +22,11 @@
- [Combining Data of Multiple Database Tables](#combining-data-of-multiple-database-tables)
- [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)
- - [Using `MODIFY`](#using-modify)
- - [Using `DELETE`](#using-delete)
+ - [Using INSERT](#using-insert)
+ - [Using UPDATE](#using-update)
+ - [Using MODIFY](#using-modify)
+ - [Using DELETE](#using-delete)
+ - [RAP-Specific ABAP SQL Variants](#rap-specific-abap-sql-variants)
- [More Information](#more-information)
- [Executable Example](#executable-example)
@@ -1524,13 +1525,14 @@ SELECT *
## Changing Data in Database Tables
-### Using [`INSERT`](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abapinsert_dbtab.htm)
+### Using INSERT
- Inserts one or more rows into a database table specified.
- The rows to be inserted are taken from a structure, an internal table, or the result set of an embedded subquery.
- As mentioned above, structures and internal tables from which to insert content should be specified as host variables (with `@`) or host
expressions (with `@( ... )`).
- The system fields `sy-subrc` (0 = single row or all rows inserted successfully, 4 = row not or not all rows inserted) and `sy-dbcnt` (number of rows that are inserted) are set.
+- More information: [`INSERT`](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abapinsert_dbtab.htm)
``` abap
"Inserting a single row into a database table
@@ -1564,9 +1566,11 @@ INSERT dbtab FROM ( SELECT ... ).
⬆️ back to top
-### Using [`UPDATE`](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abapupdate.htm)
+### Using UPDATE
+
- Changes the content of one or more rows of a database table specified.
- Similar to `INSERT`, `sy-subrc` and `sy-dbcnt` are set.
+- More information: [`UPDATE`](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abapupdate.htm)
``` abap
"Changing content by overwriting entire rows based on a structure
@@ -1610,9 +1614,11 @@ UPDATE dbtab SET comp2 = ... .
⬆️ back to top
-### Using [`MODIFY`](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abapmodify_dbtab.htm)
+### Using MODIFY
+
- Inserts one or more rows into a database table specified or overwrites existing ones.
- As above, `sy-subrc` and `sy-dbcnt` are set.
+- More information: [`MODIFY`](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abapmodify_dbtab.htm)
``` abap
"Inserting a single row into a database table or changing an existing row
@@ -1634,9 +1640,11 @@ MODIFY dbtab FROM ( SELECT ... ).
⬆️ back to top
-### Using [`DELETE`](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abapdelete_dbtab.htm)
+### Using DELETE
+
- Deletes one or more rows from a database table specified.
- As above, `sy-subrc` and `sy-dbcnt` are set.
+- More information: [`DELETE`](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abapdelete_dbtab.htm)
``` abap
"Variant DELETE FROM ...: Either all rows are deleted or restricted
@@ -1662,6 +1670,12 @@ DELETE dbtab FROM TABLE @( VALUE #( ( comp1 = ... )
⬆️ back to top
+### RAP-Specific ABAP SQL Variants
+
+Find more information in the [ABAP for RAP: Entity Manipulation Language (ABAP EML)](08_EML_ABAP_for_RAP.md#abap-sql-statements-with-bdef-derived-types) cheat sheet.
+
+⬆️ back to top
+
## More Information
- Note that ABAP SQL statements offer syntax options for dynamic programming. For example, you can specify the data source to read from dynamically. See more information in the ABAP Keyword Documentation or the [ABAP cheat sheet on dynamic programming](06_Dynamic_Programming.md).
```abap
diff --git a/04_ABAP_Object_Orientation.md b/04_ABAP_Object_Orientation.md
index 0fd6d7f..2da537b 100644
--- a/04_ABAP_Object_Orientation.md
+++ b/04_ABAP_Object_Orientation.md
@@ -13,7 +13,7 @@
- [Defining Components](#defining-components)
- [Class Attributes](#class-attributes)
- [Methods](#methods)
- - [Method Parameter Interface](#method-parameter-interface)
+ - [Parameter Interface](#parameter-interface)
- [Constructors](#constructors)
- [Working with Objects and Components](#working-with-objects-and-components)
- [Declaring Reference Variables](#declaring-reference-variables)
@@ -23,6 +23,7 @@
- [Calling Methods](#calling-methods)
- [Method Chaining](#method-chaining)
- [Self-Reference me](#self-reference-me)
+ - [Example Class](#example-class)
- [Inheritance](#inheritance)
- [Additions: ABSTRACT and FINAL](#additions-abstract-and-final)
- [Redefining Methods](#redefining-methods)
@@ -93,13 +94,13 @@ You can either create local or global classes:
| Local classes |
- - can be defined within an ABAP program
- can only be used in the ABAP program in which the class is defined
|
+ - can be defined within an ABAP program such as in the CCIMP include of global classes (Local Types tab in ADT) or in executable programs ("reports"; in Standard ABAP only)
- can only be used in the ABAP program in which the class is defined
|
| Global
classes |
- are defined as
- global types, i. e. they are visible as a repository object - in contrast to local classes. As a global type, they can be used - as the name implies - globally in other ABAP programs or global classes
- are declared in class pools that can contain a CCIMP include and other include programs
|
+ global types, i. e. they are visible as a repository object - in contrast to local classes. As a global type, they can be used - as the name implies - globally in other ABAP programs or global classesare declared in class pools that contain a CCIMP include and other include programs
@@ -214,7 +215,7 @@ CLASS zcl_demo_test IMPLEMENTATION.
METHOD if_oo_adt_classrun~main.
- "---- The method called uses type declarations in the CCDEF include ----
+ "---- The method called has formal parameters using type declarations from the CCDEF include ----
TRY.
DATA(result1) = calculate( num1 = 10 operator = '+' num2 = 4 ).
out->write( data = result1 name = `result1` ).
@@ -492,7 +493,7 @@ ENDCLASS.
You declare them using `METHODS` statements in a visibility
section. Note that you must create an instance of a class first before using instance methods.
-#### Method Parameter Interface
+#### Parameter Interface
In the simplest form, methods can have no parameter at all. Apart from that, methods can be defined with the following parameters:
@@ -501,7 +502,7 @@ In the simplest form, methods can have no parameter at all. Apart from that, met
|`IMPORTING`|Defines one or more input parameters to be imported by the method. |
|`EXPORTING`|Defines one or more output parameters to be exported by the method. |
|`CHANGING`|Defines one or more input or output parameters, i. e. that can be both imported and exported. |
-|`RETURNING`|For [functional methods](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenfunctional_method_glosry.htm "Glossary Entry"), i. e. such methods have only one `RETURNING` parameter that can be defined. As an output parameter like the `EXPORTING` parameter, `RETURNING` parameters pass back values (note that the formal parameters of returning parameters must be passed by value as covered below). In contrast to `EXPORTING` for which multiple parameters can be specified, only one `RETURNING` parameter can be specified in a method. If you only need one output parameter, you can benefit from using a `RETURNING` parameter by shortening the method call and enabling method chaining. Another big plus is that such functional methods can, for example, be used in expressions. In case of standalone method calls, the returned value can be accessed using the addition `RECEIVING`. |
+|`RETURNING`|For [functional methods](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenfunctional_method_glosry.htm "Glossary Entry"), i. e. such methods have only one `RETURNING` parameter that can be defined. As an output parameter like the `EXPORTING` parameter, `RETURNING` parameters pass back values (note that the formal parameters of returning parameters must be passed by value as covered below; the parameter must be [completely typed](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abencomplete_typing_glosry.htm)). In contrast to `EXPORTING` for which multiple parameters can be specified, only one `RETURNING` parameter can be specified in a method. If you only need one output parameter, you can benefit from using a `RETURNING` parameter by shortening the method call and enabling method chaining. Another big plus is that such functional methods can, for example, be used in expressions. In case of standalone method calls, the returned value can be accessed using the addition `RECEIVING`. |
|`RAISING` | Used to declare the [class-based exceptions](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenclass_based_exception_glosry.htm "Glossary Entry") that can be propagated from the method to the caller. |
@@ -573,14 +574,16 @@ In the simplest form, methods can have no parameter at all. Apart from that, met
instantiated and an instance is created.
- Can have `IMPORTING` parameters and raise exceptions.
-Example for method definitions: The following snippet shows
+**Example for method definitions**
+
+The following snippet shows
multiple method definitions in the public section of a local class. Most of the formal
parameters of the demo methods below are defined by just using the
parameter name. This means passing by reference (returning parameters
require to be passed by value).
``` abap
CLASS local_class DEFINITION.
- PUBLIC.
+ PUBLIC SECTION.
METHODS: inst_meth1, "instance methods
inst_meth2 IMPORTING a TYPE string,
@@ -963,6 +966,550 @@ ENDMETHOD.
⬆️ back to top
+### Example Class
+
+The commented example class below explores various aspects covered in the previous sections. You can create a demo class called `zcl_demo_test` and copy and paste the following code. Once activated, you can choose *F9* in ADT to run the class. The example is designed to display output in the console that shows the result of calling different methods.
+
+```abap
+CLASS zcl_demo_test DEFINITION
+ PUBLIC
+ FINAL
+ CREATE PUBLIC .
+
+ PUBLIC SECTION.
+ INTERFACES if_oo_adt_classrun.
+
+ "------------------------ Attributes ------------------------
+ "Instance attribute
+ DATA: inst_attr TYPE utclong,
+ inst_string TYPE string.
+
+ "Static attribute
+ CLASS-DATA stat_attr TYPE utclong.
+
+ "Attribute with the READ-ONLY addition. It is also possible for instance
+ "attributes. Such an attribute can only be read from outside the class,
+ "not changed. Inside the class, it can be changed. This also applies to
+ "subclasses (note that the example class does not allow inheritance).
+ CLASS-DATA read_only_attr TYPE string VALUE `read only` READ-ONLY.
+
+ "------------------------ Methods ------------------------
+ "The parameter interfaces (signatures) of the methods are intended to
+ "demonstrate various syntax options described in the cheat sheet.
+
+ "Instance methods
+ METHODS:
+ "No parameter specified
+ inst_meth1,
+
+ "Single importing parameter
+ inst_meth2 IMPORTING ip TYPE string,
+
+ "Importing and exporting parameters
+ inst_meth3 IMPORTING ip1 TYPE i
+ ip2 TYPE i
+ EXPORTING ep TYPE i,
+
+ "Returning parameters
+ inst_meth4 RETURNING VALUE(ret) TYPE string,
+
+ inst_meth5 IMPORTING ip1 TYPE string
+ ip2 TYPE string
+ EXPORTING ep TYPE string
+ RETURNING VALUE(ret) TYPE string,
+
+ "Changing parameter
+ inst_meth6 CHANGING chg TYPE string,
+
+ "Raising exceptions
+ inst_meth7 IMPORTING ip1 TYPE i
+ ip2 TYPE i
+ RETURNING VALUE(ret) TYPE i
+ RAISING cx_sy_arithmetic_overflow,
+
+ inst_meth8 IMPORTING ip1 TYPE i
+ RETURNING VALUE(ret) TYPE string
+ RAISING cx_uuid_error,
+
+ "Instance constructor
+ "Instance constructors can optionally have importing parameters
+ "and raise exceptions.
+ constructor.
+
+ "Static methods
+ CLASS-METHODS:
+ "Options of formal parameter definitions
+ stat_meth1 IMPORTING REFERENCE(ip1) TYPE string "pass by reference (specifying REFERENCE(...) is optional)
+ ip2 TYPE string "pass by reference
+ VALUE(ip3) TYPE string "pass by value
+ RETURNING VALUE(ret) TYPE string, "pass by value (mandatory for returning parameters)
+
+ "OPTIONAL/DEFAULT additions
+ "Both additions denote that passing values is optional. DEFAULT: If not supplied,
+ "the default value specified is used.
+ stat_meth2 IMPORTING ip1 TYPE string DEFAULT `ABAP`
+ ip2 TYPE string OPTIONAL
+ RETURNING VALUE(ret) TYPE string_table,
+
+ "Generic types are possible for field symbols and method parameters
+ "All of the previous formal parameters are typed with complete types (e.g. type i).
+ "The following method includes several formal parameters typed with generic
+ "types. Find more information in the 'Data Types and Objects' cheat sheet.
+ "Note: Returning parameters must be completely typed.
+ stat_meth3 IMPORTING ip_data TYPE data "Any data type
+ ip_clike TYPE clike "Character-like data type (such as c, n, string, etc.)
+ ip_numeric TYPE numeric "Numeric type (such as i, p, decfloat34 etc.)
+ ip_any_table TYPE ANY TABLE "Any table type (standard, sorted, hashed)
+ RETURNING VALUE(ret) TYPE string, "No generic type possible for returning parameters
+
+ "Static constructor
+ "No parameters possible
+ class_constructor.
+ PROTECTED SECTION.
+ PRIVATE SECTION.
+ENDCLASS.
+
+
+
+CLASS zcl_demo_test IMPLEMENTATION.
+ METHOD if_oo_adt_classrun~main.
+
+ "Note:
+ "This is a self-contained example. Usually, you must create an instance
+ "of a class first before using instance methods - when calling methods
+ "from outside, e.g. from another class. Within the class itself, you can
+ "indeed call the instance methods without a prior instance creation.
+ "To demonstrate 'calls from external', an instance of the class is
+ "nevertheless created in the example.
+
+ "--------------- Constructors ---------------
+
+ "Instance constructor: Automatically called when a class is instantiated
+ "and an instance is created.
+ "Creating an instance of a class and accessing an instance attribute
+ "using the object component selector ->.
+ DATA(oref) = NEW zcl_demo_test( ).
+ out->write( data = oref->inst_attr name = `oref->inst_attr` ).
+
+ "Creating more instances
+ "The example is implemented in a way that an instance attribute
+ "is assigned a time stamp when the instance constructor is called.
+ "As instance constructors are called once for each instance, the
+ "inst_attr values differ.
+ DATA(oref2) = NEW zcl_demo_test( ).
+ out->write( data = oref2->inst_attr name = `oref2->inst_attr` ).
+
+ DATA(oref3) = NEW zcl_demo_test( ).
+ out->write( data = oref3->inst_attr name = `oref3->inst_attr` ).
+
+ "Static constructor: Automatically and immediately called once for each class
+ "when calling a class for the first time in an internal session (e.g. an instance
+ "is created or a component is used).
+ "The example is implemented in a way that a static attribute is assigned a time
+ "stamp when the static constructor is called. The class was called with creating
+ "an instance above, and so the static constructor was called once. There is no new
+ "time stamp assigment, no new calls of the static constructor in this internal session.
+ "Therefore, the value of stat_attr is the same.
+ "The access is done using the class name, the class component selector =>, and
+ "the attribute name.
+ out->write( data = zcl_demo_test=>stat_attr name = `zcl_demo_test=>stat_attr` ).
+
+ "Static attributes are also accessible via the object reference variable
+ out->write( data = oref->stat_attr name = `oref->stat_attr` ).
+
+ "Checking that the values of the instance attribute that is modified when calling
+ "the instance constructor differ from instance to instance.
+ IF ( oref3->inst_attr > oref2->inst_attr )
+ AND ( oref2->inst_attr > oref->inst_attr ).
+ out->write( `Instance attribute check: All values differ.` ).
+ ELSE.
+ out->write( `Instance attribute check: At least one check is not successful.` ).
+ ENDIF.
+
+ "Checking that the value of the static attribute that is modified when calling
+ "the static constructor is identical from instance to instance (it is only changed
+ "when the class is called for the first time).
+ IF ( oref3->stat_attr = oref2->stat_attr )
+ AND ( oref2->stat_attr = oref->stat_attr )
+ AND ( oref->stat_attr = zcl_demo_test=>stat_attr ).
+ out->write( `Static attribute check: All values are identical.` ).
+ ELSE.
+ out->write( `Static attribute check: At least one check is not successful.` ).
+ ENDIF.
+
+ "Excursion: See the note above. In the self-contained example, in this class itself, the
+ "components can be called without reference variable or providing the class name. The
+ "assumption in the following snippets of the example is that the class is called
+ "from outside and instances are created outside of the class, so the variable/class
+ "name are provided.
+ "The following access is possible in the same class (not outside of this class):
+ DATA(a) = inst_attr.
+ DATA(b) = stat_attr.
+
+ "The following is also possible inside the class (it the only option outside of
+ "this class):
+ DATA(c) = oref->inst_attr.
+ DATA(d) = zcl_demo_test=>stat_attr.
+ DATA(e) = oref->stat_attr.
+
+ "--------------- Method calls ---------------
+
+ "Calling instance methods
+ "Instance methods are called using the object component selector ->
+ "via reference variables.
+
+ "--- Method without parameters ---
+ oref->inst_meth1( ).
+
+ "To show an effect of the method call in the example, the method implementation
+ "simply includes the change of an instance attribute value.
+ out->write( data = oref->inst_string name = `oref->inst_string` ).
+
+ "Notes:
+ "- See the method implementation of inst_meth1. It shows that
+ " instance methods can access both static and instance attributes.
+ "- As mentioned above regarding the attributes, in the same class and
+ " in this example, you can call the methods directly (without via
+ " a reference variable).
+ inst_meth1( ).
+
+ "--- Methods that specify importing parameters ---
+ "Similar to the inst_meth1 method, the implementation includes the
+ "change of an instance attribute.
+ "Notes:
+ "- In the method call, the caller exports values to the
+ " method having importing parameters defined. Therefore, the addition
+ " EXPORTING is relevant for the caller.
+ "- If a method only specifies importing parameters, specifying EXPORTING
+ " is optional.
+ "- If a method only specifies a single importing parameter, specifying
+ " EXPORTING and the formal parameter name is optional.
+
+ "Method with a single importing parameter (the following three method
+ "calls are basically the same)
+ "Method call that specifies EXPORTING and the formal parameter name
+ oref->inst_meth2( EXPORTING ip = `hello` ).
+
+ out->write( data = oref->inst_string name = `oref->inst_string` ).
+
+ "Method call that specifies the formal parameter, without EXPORTING
+ oref->inst_meth2( ip = `world` ).
+
+ out->write( data = oref->inst_string name = `oref->inst_string` ).
+
+ "Method call that only includes the actual parameter
+ oref->inst_meth2( `ABAP` ).
+
+ out->write( data = oref->inst_string name = `oref->inst_string` ).
+
+ "--- Methods that specify exporting parameters ---
+ "For the method call, specify EXPORTING for importing parameters,
+ "and IMPORTING for exporting parameters.
+ "The method implementation performs a calculation. The calculation
+ "result is assigned to the exporting parameter. You can assign the
+ "value to a suitable data object.
+ DATA calc_result1 TYPE i.
+ oref->inst_meth3( EXPORTING ip1 = 5
+ ip2 = 3
+ IMPORTING ep = calc_result1 ).
+
+ out->write( data = calc_result1 name = `calc_result1` ).
+
+ "Inline declaration is also possible.
+ oref->inst_meth3( EXPORTING ip1 = 2
+ ip2 = 4
+ IMPORTING ep = DATA(calc_result2) ).
+
+ out->write( data = calc_result2 name = `calc_result2` ).
+
+ "--- Methods that specify returning parameters ---
+ DATA(result1) = oref->inst_meth4( ).
+ out->write( data = result1 name = `result1` ).
+
+ "The RECEIVING addition is available in standalone method
+ "calls only if methods are defined with a returning parameter.
+ "Inline declaration is also possible here.
+ oref->inst_meth4( RECEIVING ret = DATA(result2) ).
+ out->write( data = result2 name = `result2` ).
+
+ "The following example method specifies multiple parameters,
+ "among them 2 output parameters (exporting and reporting).
+
+ "Functional method call
+ "In a functional method call, inline declaration is not possible
+ "for 'ep'.
+ DATA str1 TYPE string.
+ DATA(str2) = oref->inst_meth5( EXPORTING ip1 = `AB`
+ ip2 = `AP`
+ IMPORTING ep = str1 ).
+
+ out->write( data = str1 name = `str1` ).
+ out->write( data = str2 name = `str2` ).
+
+ "Standalone method call (including inline declarations)
+ oref->inst_meth5( EXPORTING ip1 = `AB`
+ ip2 = `AP`
+ IMPORTING ep = DATA(str3)
+ RECEIVING ret = DATA(str4) ).
+
+ out->write( data = str3 name = `str3` ).
+ out->write( data = str4 name = `str4` ).
+
+ "Returning parameters enable ...
+ "... the use of method calls in other statements, for example,
+ "in logical expressions, instead of storing the method call
+ "result in an extra variable.
+ IF oref->inst_meth4( ) IS INITIAL.
+ out->write( `Initial` ).
+ ELSE.
+ out->write( `Not initial` ).
+ ENDIF.
+
+ "... method chaining to write more concise code and avoid
+ "declaring helper variables.
+ "The following example uses a class that creates random integers.
+ "The 'create' method has a returning parameter. It returns an
+ "instance of the class (an object reference) based on which
+ "more methods can be called. Using method chaining, you can
+ "do the following in one go.
+ DATA(inst) = cl_abap_random_int=>create( seed = cl_abap_random=>seed( )
+ min = 1
+ max = 10 ).
+ DATA(random_integer1) = inst->get_next( ).
+
+ DATA(random_integer2) = cl_abap_random_int=>create( seed = cl_abap_random=>seed( )
+ min = 1
+ max = 10 )->get_next( ).
+
+ out->write( data = random_integer1 name = `random_integer1` ).
+ out->write( data = random_integer2 name = `random_integer2` ).
+
+ "--- Method that specifies a changing parameter ---
+ "Changing parameters should be reserved for changing an existing
+ "local variable and value.
+ "The method implementation includes the demonstration of the
+ "self-reference 'me'. For this purpose, a data object is created
+ "in the method implementation that has the same name as a data
+ "object declared in the class's declaration part.
+
+ "Changing the value of the instance attribute with the same name
+ "as the local data object in the method implementation.
+ oref->inst_string = `TEST`.
+
+ DATA local_var TYPE string VALUE `hello`.
+ oref->inst_meth6( CHANGING chg = local_var ).
+
+ out->write( data = local_var name = `local_var` ).
+
+ "--- Methods that specify RAISING ---
+ "The following example method declares an exception of the category
+ "CX_DYNAMIC_CHECK. That is, the check is not performed until runtime.
+ "There is no syntax warning shown at compile time.
+ "The ipow function is included in the method implementation. The
+ "second example raises the exception.
+
+ "No TRY control structure, no syntax warning at compile. However,
+ "the calculation works.
+ DATA(power_res1) = oref->inst_meth7( ip1 = 5 ip2 = 2 ).
+ out->write( data = power_res1 name = `power_res1` ).
+
+ "The example raises the exception because the resulting number is too high.
+ "Not catching the exception results in a runtime error.
+ TRY.
+ DATA(power_res2) = oref->inst_meth7( ip1 = 10 ip2 = 10 ).
+ out->write( data = power_res2 name = `power_res2` ).
+ CATCH cx_sy_arithmetic_overflow.
+ out->write( `cx_sy_arithmetic_overflow was raised` ).
+ ENDTRY.
+
+ "The following example method declares an exception of the category
+ "CX_STATIC_CHECK. That is, it is statically checked. Without the
+ "TRY control structure and catching the exception, a syntax warning
+ "is displayed. And in the case of the example implementation,
+ "the exception is indeed raised. Not cathcing the exception results
+ "in a runtime error.
+ TRY.
+ DATA(test) = oref->inst_meth8( ip1 = 1 ).
+ out->write( data = test name = `test` ).
+ CATCH cx_uuid_error.
+ out->write( `cx_uuid_error was raised` ).
+ ENDTRY.
+
+ "A syntax warning is displayed for the following method call.
+ "DATA(test2) = oref->inst_meth8( ip1 = 1 ).
+
+ "Calling static methods
+ "The method definitions/implementations cover further aspects.
+
+ "--- Pass by reference/value ---
+ "The following example method emphasizes pass by reference and
+ "by value.
+ "Notes:
+ "- Returning parameters can only be declared with VALUE(...)
+ "- When passing by reference, the content of the data objects
+ " cannot be changed in the method implementation.
+ "- The method implementation includes that ...
+ " - attributes declared with READ-ONLY can be changed within
+ " the class they are declared.
+ " - static methods can only access static attributes.
+ DATA(res) = zcl_demo_test=>stat_meth1( ip1 = `a` "pass by reference (declaration with REFERENCE(...))
+ ip2 = `b` "pass by reference (without REFERENCE(...))
+ ip3 = `c` "pass by value (declaration with VALUE(...))
+ ).
+ out->write( data = res name = `res` ).
+
+ "--- OPTIONAL/DEFAULT additions ---
+ "The method implementation includes the predicate expression IS SUPPLIED
+ "that checks whether a formal parameter is populated.
+
+ DATA(res_tab1) = zcl_demo_test=>stat_meth2( ip1 = `aaa` ip2 = `bbb` ).
+ out->write( data = res_tab1 name = `res_tab1` ).
+
+ DATA(res_tab2) = zcl_demo_test=>stat_meth2( ip1 = `ccc` ).
+ out->write( data = res_tab2 name = `res_tab2` ).
+
+ DATA(res_tab3) = zcl_demo_test=>stat_meth2( ip2 = `ddd` ).
+ out->write( data = res_tab3 name = `res_tab3` ).
+
+ DATA(res_tab4) = zcl_demo_test=>stat_meth2( ).
+ out->write( data = res_tab4 name = `res_tab4` ).
+
+ "--- Generically typed formal parameters ---
+ "In the following method calls, various data objects are
+ "assigned to formal parameters. Note that returning parameters
+ "must be completely typed.
+ "In the example, the value passed for parameter ip_clike (which is
+ "convertible to type string) is returned.
+ DATA(res_gen1) = zcl_demo_test=>stat_meth3( ip_data = VALUE string_table( ( `hi` ) ) "any data type
+ ip_clike = abap_true "Character-like data type (such as c, n, string, etc.)
+ ip_numeric = 1 "Numeric type (such as i, p, decfloat34 etc.)
+ ip_any_table = VALUE string_table( ( `ABAP` ) ) "Any table type (standard, sorted, hashed)
+ ).
+
+ out->write( data = res_gen1 name = `res_gen1` ).
+
+ DATA(res_gen2) = zcl_demo_test=>stat_meth3( ip_data = 123
+ ip_clike = 'ABAP'
+ ip_numeric = CONV decfloat34( '1.23' )
+ ip_any_table = VALUE string_hashed_table( ( `hello` ) ( `world` ) )
+ ).
+
+ out->write( data = res_gen2 name = `res_gen2` ).
+
+ ENDMETHOD.
+
+ METHOD class_constructor.
+ "Assigning the current UTC timestamp to a static attribute
+ stat_attr = utclong_current( ).
+ ENDMETHOD.
+
+ METHOD constructor.
+ "Assigning the current UTC timestamp to an instance attribute
+ inst_attr = utclong_current( ).
+ ENDMETHOD.
+
+ METHOD inst_meth1.
+ inst_string = `Changed in inst_meth1`.
+
+ "Instance methods can access both static and instance attributes.
+ DATA(a) = inst_attr.
+ DATA(b) = stat_attr.
+ ENDMETHOD.
+
+ METHOD inst_meth2.
+ inst_string = |Changed in inst_meth2. Content of passed string: { ip }|.
+ ENDMETHOD.
+
+ METHOD inst_meth3.
+ ep = ip1 + ip2.
+ ENDMETHOD.
+
+ METHOD inst_meth4.
+ ret = |This string was assigned to the returning parameter at { utclong_current( ) }|.
+ ENDMETHOD.
+
+ METHOD inst_meth5.
+ ep = |Strings '{ ip1 }' and '{ ip2 }' were assigned to the exporting parameter at { utclong_current( ) }|.
+ ret = |Strings '{ ip1 }' and '{ ip2 }' were assigned to the returning parameter at { utclong_current( ) }|.
+ ENDMETHOD.
+
+ METHOD inst_meth6.
+ "Demonstrating the self-reference 'me'
+ "Its use is optional. The following data object intentionally
+ "has the same name as an instance attribute specified in the
+ "class's declaration part.
+ DATA inst_string TYPE string.
+ inst_string = `Local string`.
+
+ chg = |The local data object was changed: '{ to_upper( chg ) }'\nChecking the self-reference me:\ninst_string: '{ inst_string }'\nme->inst_string: '{ me->inst_string }'|.
+ ENDMETHOD.
+
+ METHOD inst_meth7.
+ ret = ipow( base = ip1 exp = ip2 ).
+ ENDMETHOD.
+
+ METHOD inst_meth8.
+ IF ip1 = 1.
+ RAISE EXCEPTION TYPE cx_uuid_error.
+ ELSE.
+ ret = `No exception was raised.`.
+ ENDIF.
+ ENDMETHOD.
+
+ METHOD stat_meth1.
+ "Static methods can only access static attributes.
+ "DATA(test1) = inst_attr.
+ DATA(test2) = stat_attr.
+
+ "Only read access possible when parameters are passed by value
+ DATA(a) = ip1.
+ DATA(b) = ip2.
+
+ "Write access is not possible (however, if you need to work with them
+ "and change the content, you can create copies as above)
+ "ip1 = `y`.
+ "ip2 = `z`.
+
+ "Pass by value, modification is possible
+ ip3 = to_upper( ip3 ) && `##`.
+
+ "Modifying a read only attribute is possible in the class
+ "in which it is declared.
+ read_only_attr = `Read-only attribute was modified`.
+
+ ret = |ip1 = '{ ip1 }', ip2 = '{ ip2 }', ip3 (modified) = '{ ip3 }' / read_only_attr = '{ read_only_attr }'|.
+ ENDMETHOD.
+
+ METHOD stat_meth2.
+ "Using IS SUPPLIED in an IF control structure
+ IF ip1 IS SUPPLIED.
+ APPEND |ip1 is supplied, value: '{ ip1 }'| TO ret.
+ ELSE.
+ APPEND |ip1 is not supplied, value: '{ ip1 }'| TO ret.
+ ENDIF.
+
+ "Using IS SUPPLIED with the COND operator
+ APPEND COND #( WHEN ip2 IS SUPPLIED
+ THEN |ip2 is supplied, value: '{ ip2 }'|
+ ELSE |ip2 is not supplied, value: '{ ip2 }'| ) TO ret.
+ ENDMETHOD.
+
+ METHOD stat_meth3.
+ "You may check the content in the debugger.
+ DATA(a) = REF #( ip_data ).
+ DATA(b) = REF #( ip_clike ).
+ DATA(c) = REF #( ip_numeric ).
+ DATA(d) = REF #( ip_any_table ).
+
+ ret = ip_clike.
+ ENDMETHOD.
+
+ENDCLASS.
+```
+
+⬆️ back to top
+
+
## Inheritance
- Concept: Deriving a new class (i. e.
diff --git a/05_Constructor_Expressions.md b/05_Constructor_Expressions.md
index cdb90fd..e441111 100644
--- a/05_Constructor_Expressions.md
+++ b/05_Constructor_Expressions.md
@@ -17,6 +17,7 @@
- [Iteration Expressions](#iteration-expressions)
- [Iteration Expressions Using FOR](#iteration-expressions-using-for)
- [REDUCE](#reduce)
+ - [Grouping Lines in Internal Tables with VALUE/REDUCE](#grouping-lines-in-internal-tables-with-valuereduce)
- [Executable Example](#executable-example)
## Introduction
@@ -424,7 +425,7 @@ topic](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file
| Addition | Details |
|---|---|
| `BASE` | Keeps original values. Unlike, for example, the operator `VALUE`, a pair of parentheses must be set around `BASE`. |
-| `MAPPING` | Enables the mapping of component names, i. e. a component of a source structure or source table can be assigned to a differently named component of a target structure or target table (e. g. `MAPPING c1 = c2`). The `DEFAULT` addition is possible when using the `MAPPING` addition. It allows the assignment of values for a target component based on an expression. |
+| `MAPPING` | Enables the mapping of component names, i. e. a component of a source structure or source table can be assigned to a differently named component of a target structure or target table (e. g. `MAPPING c1 = c2`). The `DEFAULT` addition is possible when using the `MAPPING` addition. It allows the assignment of values for a target component based on an expression. Do not use the component selector `-` to refer to data objects in nested components in the mappings. |
| `EXCEPT` | You can specify components that should not be assigned content in the target data object. They remain initial. In doing so, you exclude identically named components in the source and target object that are not compatible or convertible from the assignment to avoid syntax errors or runtime errors. |
| `DISCARDING DUPLICATES` | Relevant for tabular components. Handles duplicate lines and prevents exceptions when dealing with internal tables that have a unique primary or secondary table key. |
| `DEEP` | Relevant for deep tabular components. They are resolved at every hierarchy level and identically named components are assigned line by line. |
@@ -1885,8 +1886,25 @@ DATA(count) = REDUCE string( LET start = 10 IN
DATA(abap_str) = REDUCE string( INIT text = ``
FOR t = `ab` THEN t && `ap` UNTIL strlen( t ) > 15
NEXT text &&= |{ t } | ).
+```
-"---------- Excursion: Grouping lines in internal tables with VALUE/REDUCE ----------
+⬆️ back to top
+
+### Grouping Lines in Internal Tables with VALUE/REDUCE
+
+Find more information in the [Internal Tables: Grouping](11_Internal_Tables_Grouping.md) cheat sheet.
+
+```abap
+"Data objects and types to work with in the examples
+TYPES: BEGIN OF s,
+ col1 TYPE c LENGTH 5,
+ col2 TYPE i,
+ col3 TYPE i,
+ END OF s.
+TYPES itab_type TYPE TABLE OF s WITH EMPTY KEY.
+DATA(itab) = VALUE itab_type( ( col1 = 'a' col2 = 1 col3 = 30 )
+ ( col1 = 'bb' col2 = 2 col3 = 10 )
+ ( col1 = 'ccc' col2 = 3 col3 = 20 ) ).
"The following examples show equivalents of LOOP AT GROUP ... GROUP BY ... statements.
"Find more information and examples about grouping in the ABAP Keyword Documentation.
diff --git a/08_EML_ABAP_for_RAP.md b/08_EML_ABAP_for_RAP.md
index be07761..5d81a23 100644
--- a/08_EML_ABAP_for_RAP.md
+++ b/08_EML_ABAP_for_RAP.md
@@ -12,6 +12,8 @@
- [Components of BDEF Derived Types](#components-of-bdef-derived-types)
- [Secondary Table Keys of BDEF Derived Types](#secondary-table-keys-of-bdef-derived-types)
- [Type Mapping for RAP](#type-mapping-for-rap)
+ - [RAP-Specific Additions to the CORRESPONDING Operator](#rap-specific-additions-to-the-corresponding-operator)
+ - [ABAP SQL Statements with BDEF Derived Types](#abap-sql-statements-with-bdef-derived-types)
- [EML Syntax](#eml-syntax)
- [EML Syntax for Modifying Operations](#eml-syntax-for-modifying-operations)
- [EML Syntax for Reading Operations](#eml-syntax-for-reading-operations)
@@ -887,7 +889,7 @@ DATA(line_e) = itab_cr[ KEY entity %key = VALUE #( key_field = 1 ) ].
### Type Mapping for RAP
-**RAP-Specific Additions to the CORRESPONDING Operator**
+#### RAP-Specific Additions to the CORRESPONDING Operator
The [`CORRESPONDING`](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenconstructor_expr_corresponding.htm) operator offers RAP-specific additions for handling type mappings related to BDEF derived types and other types. For more information, see the [ABAP Keyword Documentation topic](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abapeml_type_mapping.htm).
@@ -961,7 +963,7 @@ derived_type = CORRESPONDING #( some_other_type CHANGING CONTROL ).
* 01 01 00 00 01
```
-**ABAP SQL Statements with BDEF Derived Types**
+#### ABAP SQL Statements with BDEF Derived Types
The ABAP SQL statements `INSERT`, `UPDATE`, `MODIFY`, and `DELETE` offer the [`MAPPING FROM ENTITY`](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abapmapping_from_entity.htmaddition) addition to handle BDEF derived types.
@@ -1487,7 +1489,7 @@ MODIFY ENTITIES OF root_ent
field1 = 'K' field2 = 'L' ) )
MAPPED DATA(mapped)
FAILED DATA(failed)
- REPORTED DATA(resp).
+ REPORTED DATA(rep).
COMMIT ENTITIES.
diff --git a/13_Program_Flow_Logic.md b/13_Program_Flow_Logic.md
index d621cca..a0dd85e 100644
--- a/13_Program_Flow_Logic.md
+++ b/13_Program_Flow_Logic.md
@@ -633,7 +633,7 @@ cl_abap_utclong=>diff( EXPORTING high = ts2
low = ts1
IMPORTING seconds = DATA(seconds) ).
-"The 'seconds' data object holding the delta of the time stamps
+"The value of the 'seconds' data object holding the delta of the time stamps
"should be greater than 4.
ASSERT seconds > 4.
```
diff --git a/22_Misc_ABAP_Classes.md b/22_Misc_ABAP_Classes.md
index a0fcc1a..afb0e70 100644
--- a/22_Misc_ABAP_Classes.md
+++ b/22_Misc_ABAP_Classes.md
@@ -1329,8 +1329,7 @@ CLASS zcl_demo_test IMPLEMENTATION.
source = it1
IMPORTING flag_identical = is_identical ).
IF is_identical = abap_true.
- out->write( `The two internal tables have identical content.` ).
- CLEAR is_identical.
+ out->write( `The two internal tables have identical content.` ).
ELSE.
out->write( comp_res1 ).
ENDIF.
@@ -1343,8 +1342,7 @@ CLASS zcl_demo_test IMPLEMENTATION.
source = it1
IMPORTING flag_identical = is_identical ).
IF is_identical = abap_true.
- out->write( `The two internal tables have identical content.` ).
- CLEAR is_identical.
+ out->write( `The two internal tables have identical content.` ).
ELSE.
out->write( comp_res2 ).
ENDIF.
@@ -1357,8 +1355,7 @@ CLASS zcl_demo_test IMPLEMENTATION.
source = it1
IMPORTING flag_identical = is_identical ).
IF is_identical = abap_true.
- out->write( `The two internal tables have identical content.` ).
- CLEAR is_identical.
+ out->write( `The two internal tables have identical content.` ).
ELSE.
out->write( comp_res3 ).
ENDIF.