diff --git a/01_Internal_Tables.md b/01_Internal_Tables.md
index 6d0f84a..8b05a02 100644
--- a/01_Internal_Tables.md
+++ b/01_Internal_Tables.md
@@ -3145,7 +3145,8 @@ DATA(line_ref) = REF #( itab[ 3 ] ).
- You can specify default values for lines that are not found to avoid an exception.
- The first example shows catching the execption with a `TRY` control structure.
-- The `OPTIONAL` and `DEFAULT` additions can be used in the context of statements using table expressions and constructor expressions (`VALUE` and `REF` are possible).
+- The `OPTIONAL` and `DEFAULT` additions can be used in the context of statements using table expressions and constructor expressions (`VALUE` and `REF` are possible).
+- When using `OPTIONAL`, the type-specific initial value is set. After the `DEFAULT` addition, a value is expected that is convertible to the target type. You may also specify another table expression for an alternative table line to be searched.
diff --git a/02_Structures.md b/02_Structures.md
index c8fd9ed..9f19cf3 100644
--- a/02_Structures.md
+++ b/02_Structures.md
@@ -10,6 +10,8 @@
- [Creating Structures](#creating-structures)
- [Creating Structures Using Existing Structured Types](#creating-structures-using-existing-structured-types)
- [Creating Structures by Inline Declaration](#creating-structures-by-inline-declaration)
+ - [Creating Constant and Immutable Structures](#creating-constant-and-immutable-structures)
+ - [Creating Enumerated Structures](#creating-enumerated-structures)
- [Creating Anonymous Structures](#creating-anonymous-structures)
- [Variants of Structures](#variants-of-structures)
- [Accessing (Components of) Structures](#accessing-components-of-structures)
@@ -251,6 +253,67 @@ LOOP AT itab INTO DATA(wa_2).
ENDLOOP.
```
+
|
- - - `... ABSTRACT ...`: - Defines abstract classes - Abstract classes cannot be instantiated. @@ -2814,6 +3087,57 @@ CLASS zcl_demo DEFINITION - Abstract classes may contain both abstract and concrete instance methods. However, abstract methods are not implemented within abstract classes. - By adding the `FINAL` addition, abstract classes can be made final. In these cases, only static components are usable. While instance components may be declared, they are not usable. + + +The following code example demonstrates local classes: + +```abap +CLASS lcl1 DEFINITION ABSTRACT CREATE PUBLIC. + PUBLIC SECTION. + METHODS meth1. + DATA inst_attr TYPE i. +ENDCLASS. + +CLASS lcl1 IMPLEMENTATION. + METHOD meth1. + "Creating an instance of lcl1 within the class itself + "is not possible. Generally, abstract classes cannot be + "instantiated. + "DATA(oref1) = NEW lcl1( ). + ENDMETHOD. +ENDCLASS. + +"Creating instances is not possible outside the class +CLASS lcl2 DEFINITION CREATE PUBLIC. +PUBLIC SECTION. + METHODS meth2. +ENDCLASS. + +CLASS lcl2 IMPLEMENTATION. + METHOD meth2. + "Creating an instance is not possible + "DATA(oref2) = NEW lcl1( ). + ENDMETHOD. +ENDCLASS. + +"Using instance components of abstract classes only via subclasses +CLASS lcl3 DEFINITION INHERITING FROM lcl1. +PUBLIC SECTION. + METHODS meth1 REDEFINITION. +ENDCLASS. + +CLASS lcl3 IMPLEMENTATION. + METHOD meth1. + ... + DATA(oref3) = NEW lcl3( ). + oref3->inst_attr = 1. + + "Creating instances of abstract classes not possible + "DATA(oref4) = NEW lcl1( ). + ENDMETHOD. +ENDCLASS. +``` + |
@@ -2829,8 +3153,6 @@ CLASS zcl_sub DEFINITION
- - - `... INHERITING FROM ...`: - Can be specified in subclasses inheriting from visible superclasses - If not specified, the class implicitly inherits from the predefined, empty, abstract class `OBJECT` (the root object). @@ -2843,6 +3165,65 @@ CLASS zcl_sub DEFINITION - The properties of inherited components are immutable. However, subclasses can declare additional components (with unique names) and redefine inherited methods without altering the interface. - Upon instantiation of a subclass, all superclasses are also instantiated, ensuring the initialization of superclass attributes through calling superclass constructors. + + +The following code example demonstrates local classes: + +```abap +CLASS lcl1 DEFINITION CREATE PUBLIC. + PUBLIC SECTION. + METHODS meth1. + DATA num1 TYPE i. + CLASS-DATA str TYPE string. + PROTECTED SECTION. + DATA num2 TYPE i. + PRIVATE SECTION. + DATA num3 TYPE i. +ENDCLASS. + +CLASS lcl1 IMPLEMENTATION. + METHOD meth1. + ... + ENDMETHOD. +ENDCLASS. + +"Subclasses inheriting from lcl1 +CLASS lcl2 DEFINITION INHERITING FROM lcl1. + PUBLIC SECTION. + METHODS meth1 REDEFINITION. + "Data object with the same name as specified in the superclass + "is not possible in subclasses + "DATA num1 TYPE i. +ENDCLASS. + +CLASS lcl2 IMPLEMENTATION. + METHOD meth1. + ... + "Only public and protected components can be accessed in subclasses. + DATA(oref) = NEW lcl2( ). + oref->num1 = 1. + oref->num2 = 2. + "Private components are not accessible + "oref->num3 = 3. + + "Static attribute accessible with the name directly without class=> (which is also possible) + str = `hello`. + lcl1=>str = `hi`. + ENDMETHOD. +ENDCLASS. + +CLASS lcl3 DEFINITION INHERITING FROM lcl1. + PUBLIC SECTION. + METHODS meth1 REDEFINITION. +ENDCLASS. + +CLASS lcl3 IMPLEMENTATION. + METHOD meth1. + ... + ENDMETHOD. +ENDCLASS. +``` + |
@@ -2874,6 +3255,43 @@ METHODS some_meth FINAL ...
- These methods cannot be overridden in subclasses.
- Note: In final classes, all methods are inherently final. Therefore, the `FINAL` addition cannot be specified. Instance constructors are always final, but the use of the `FINAL` addition is optional.
+