From 8257b3e74e65de5db8f4f6f99bde78c6257ff734 Mon Sep 17 00:00:00 2001 From: danrega <16720986+danrega@users.noreply.github.com> Date: Wed, 15 Jan 2025 16:29:35 +0100 Subject: [PATCH] Update --- 01_Internal_Tables.md | 10 ++++++++++ 04_ABAP_Object_Orientation.md | 20 +++++++++----------- README.md | 2 +- 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/01_Internal_Tables.md b/01_Internal_Tables.md index 8b05a02..9a89491 100644 --- a/01_Internal_Tables.md +++ b/01_Internal_Tables.md @@ -4294,6 +4294,16 @@ Notes and restrictions: - However, if a `SELECT` statement includes elements the ABAP SQL engine cannot handle in case of internal tables, the internal table data transfers to a temporary database table for query execution. - Yet, only the data of one internal table can be transferred to the database. Thus, if a query involves multiple internal tables, it can only be executed if the ABAP SQL engine can manage it. This means that if data from more than one internal table must be transferred to the database, the query will not function. Similarly, joins of database tables and internal tables can only specify one internal table whose data can be passed to the database. - If the compiler detects a statement the ABAP SQL engine cannot process, a syntax warning appears. To suppress this warning, use the pragma `##itab_db_select`. +- As mentioned, internal tables are treated like DDIC database tables. For example, if the internal table specifies a key that is not specified at the beginning of the line type, you cannot use `SELECT` to retrieve data from the table. + ```abap + TYPES: BEGIN OF s, + comp1 TYPE i, + comp2 TYPE i, + comp3 TYPE i, + END OF s. + DATA itab TYPE TABLE OF s WITH KEY comp3. + "SELECT SINGLE * FROM @itab AS tab INTO @DATA(line). + ``` - Find more information on ... - the restrictions [here](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abensql_engine_restr.htm). - the various ABAP SQL functionalities in the ABAP Keyword Documentation and in the [ABAP SQL cheat sheet](03_ABAP_SQL.md). The following code snippets cover a selection. diff --git a/04_ABAP_Object_Orientation.md b/04_ABAP_Object_Orientation.md index 6354539..9b4a0bc 100644 --- a/04_ABAP_Object_Orientation.md +++ b/04_ABAP_Object_Orientation.md @@ -32,7 +32,7 @@ - [Method Chaining and Chained Attribute Access](#method-chaining-and-chained-attribute-access) - [Excursion: Example Class](#excursion-example-class) - [Inheritance](#inheritance) - - [Additions Related to Inheritance and Instantion](#additions-related-to-inheritance-and-instantion) + - [Additions Related to Inheritance and Instantiation](#additions-related-to-inheritance-and-instantiation) - [Excursion: Inheritance Example](#excursion-inheritance-example) - [Polymorphism and Casting (Upcast/Downcast)](#polymorphism-and-casting-upcastdowncast) - [Demonstrating Upcasts and Downcasts Using the RTTS Inheritance Tree](#demonstrating-upcasts-and-downcasts-using-the-rtts-inheritance-tree) @@ -91,7 +91,7 @@ Classes ... However, the values of these components are different from instance to instance. For example, one instance is a red sedan of brand A having a certain acceleration; another instance is a black SUV of brand B and so on. You can create an object (or instance respectively) that stands - for an actual vehicle with which you can work with. You might create any number of objects that are based on such a class - if instantiation is allowed. + for an actual vehicle which you can work with. You might create any number of objects that are based on such a class - if instantiation is allowed. - contain [components](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abencomponent_glosry.htm "Glossary Entry"): - [Attributes](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenattribute_glosry.htm "Glossary Entry") @@ -190,7 +190,7 @@ ENDCLASS. #### Additions in the Class Declaration Part -This section covers a selection of additions to declare classes. They are also covered in other sections below, e.g. [Additions Related to Inheritance and Instantion](#inheritance--and-instantion-related-syntax). Find more information on the additions in the [ABAP Keyword Documentation](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abapclass_options.htm). +This section covers a selection of additions to declare classes. They are also covered in other sections below, e.g. [Additions Related to Inheritance and Instantiation](#additions-related-to-inheritance-and-instantiation). Find more information on the additions in the [ABAP Keyword Documentation](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abapclass_options.htm). @@ -1632,7 +1632,7 @@ methods are called using `->` via a reference variable. methods are called using `=>` via the class name. When used within the class in which it is declared, the static method can also be called without `class_name=>...`. -- Static methods can but should not be called via reference variable (oref->some_static_method( ).). +- Static methods can but should not be called via reference variable (oref->some_static_method( ).). - When methods are called, the (non-optional) parameters must be specified within parentheses. - You might also stumble on method calls with [`CALL METHOD`](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abapcall_method_static.htm) statements. These statements should no longer be used. Note that `CALL METHOD` statements are the only option in the context of [dynamic programming](06_Dynamic_Programming.md). Therefore, `CALL METHOD` statements should be reserved for dynamic method calls. @@ -2684,9 +2684,9 @@ ENDCLASS.

⬆️ back to top

-### Additions Related to Inheritance and Instantion +### Additions Related to Inheritance and Instantiation -The table below includes selected syntax related to inheritance in class and method declarations. +The table below includes selected syntax related to inheritance in class and method declarations. It includes additions related to instantiation. > **💡 Note**
> - Some of the syntax options have already been mentioned previously. This is to summarize. @@ -2910,7 +2910,7 @@ ENDCLASS. "Note the DEFINITION DEFERRED additions for lcl5. It is used to make the class known in the program "before its actual definition. Such statements are particularly necessary in local classes, and if a "reference to a local class is made before it is defined. -"A metehod of lcl5 includes the creation of an instance of lcl4, demonstrating that friends can +"A method of lcl5 includes the creation of an instance of lcl4, demonstrating that friends can "indeed create the instances. You can comment out FRIENDS lcl5 in the class declaration part of "lcl4. Consequently, a syntax error is displayed in lcl5 for the instance creation. CLASS lcl5 DEFINITION DEFERRED. @@ -3273,8 +3273,7 @@ CLASS lcl1 IMPLEMENTATION. METHOD meth2. ... - ENDMETHOD. - + ENDMETHOD. ENDCLASS. "Subclass inheriting from lcl1 @@ -3339,7 +3338,6 @@ CLASS lcl1 IMPLEMENTATION. * METHOD meth2. * ... * ENDMETHOD. - ENDCLASS. "Subclass inheriting from lcl1 @@ -4602,7 +4600,7 @@ Interfaces ... - are different from classes in the following ways: - They only consist of a part declaring the components without an implementation part. The implementation is done in classes that use the interface. - - There are no visibility sections. All components of an interface are visible. + - There are no visibility sections. All components of an interface are public. - No instances can be created from interfaces. - Declarations as mentioned for classes, e. g. `DATA`, `CLASS-DATA`, `METHODS`, diff --git a/README.md b/README.md index 01859c7..f28c0bb 100644 --- a/README.md +++ b/README.md @@ -236,7 +236,7 @@ Use the standalone version of the abapGit report to import the demo examples of - ... **classic ABAP**: Access the documentation in the SAP GUI via the transactions `ABAPDOCU` (opens the documentation directly) and `ABAPHELP` (opens an input field with which you can search the documentation content, for example, you can search for a keyword such as `SELECT`). Or, of course, choose `F1` on a keyword in your code. If you are in the SAP GUI (e.g. in `SE80`), the system-internal version opens. If you are in ADT, the documentation opens in the *ABAP Language Help* view. - ... **ABAP Cloud**: In ADT, the documentation is in the *ABAP Language Help* view, where you can also search. If you choose `F1` on a keyword in your code, the documentation opens there. - Links to the online version of the ABAP Keyword Documentation for: - - **Standard ABAP**: Unrestricted ABAP language scope for [classic ABAP](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenclassic_abap_glosry.htm) → [Online version of the documentation (latest version)](https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abenabap.htm). To access the online documentation for a specific ABAP version, e.g. 7.54, you can select the version from the drop-down list [here](https://help.sap.com/docs/ABAP?locale=en-US) (*latest* is preselected). The *ABAP* link under *Development* will take you to the documentation of choice. + - **Standard ABAP**: Unrestricted ABAP language scope for [classic ABAP](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenclassic_abap_glosry.htm) → [Online version of the documentation (latest version)](https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abenabap.htm). - **ABAP for Cloud Development**: Restricted ABAP language scope for developments, for example, in the SAP BTP ABAP environment → [Online version of the documentation](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm) - For demonstration examples of the ABAP Keyword Documentation in classic ABAP, see the `SABAPDEMOS` package. This package contains all the examples used in the ABAP Keyword Documentation. For the context, class/program name, etc., see the [example page](https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abenabap_examples.htm), which is also available in the system-internal SAP GUI version as a node in the topic tree and which summarizes the executable examples. Of course, you can also find the example topics in the context of the individual topic of the ABAP keyword documentation. The example topics are marked with a ⚙️ icon: