This commit is contained in:
danrega
2024-03-07 12:57:14 +01:00
parent 508e74a1e0
commit 5a5f0727fa
7 changed files with 1967 additions and 1912 deletions

View File

@@ -136,7 +136,7 @@ Views](https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm
You use ABAP SQL `SELECT` statements to read data from one or more database tables (or views). This can be done to create a multirow or single row result set by assigning the result set to a suitable data object, i. e. you can store the multirow read result in an internal table or the single row result in a structure. You use ABAP SQL `SELECT` statements to read data from one or more database tables (or views). This can be done to create a multirow or single row result set by assigning the result set to a suitable data object, i. e. you can store the multirow read result in an internal table or the single row result in a structure.
The `SELECT` statement includes several clauses that serve The `SELECT` statement includes several clauses that serve
different purposes. The following code snippet shows the basic syntax: different purposes. The following code snippet shows the basic syntax (see the note below for a different but interchangeable syntax):
``` abap ``` abap
SELECT FROM source "What database table or view to read from SELECT FROM source "What database table or view to read from
FIELDS field_list "What columns should be read FIELDS field_list "What columns should be read
@@ -155,8 +155,7 @@ SELECT FROM source "What database table or view to read from
> - specified in an [operand position](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenoperand_position_glosry.htm) of an ABAP SQL statement. > - specified in an [operand position](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenoperand_position_glosry.htm) of an ABAP SQL statement.
> See more information [here](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenhost_variable_glosry.htm). > See more information [here](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenhost_variable_glosry.htm).
>- The `SELECT` list, i. e. the fields that are specified, can also be specified following the `SELECT` >- The `SELECT` list, i. e. the fields that are specified, can also be specified following the `SELECT`
keyword before the `FROM` clause - without `FIELDS`. The keyword before the `FROM` clause - without `FIELDS`. The following two `SELECT` statements are basically the same but differently arranged. The code snippets in the cheat sheet randomly use one syntax or the other.
following two `SELECT` statements are basically the same but differently arranged:
> ``` abap > ``` abap
> SELECT FROM dbtab > SELECT FROM dbtab
> FIELDS comp1, comp2, comp3 > FIELDS comp1, comp2, comp3

View File

@@ -521,8 +521,8 @@ DATA it3 LIKE TABLE OF s1 WITH EMPTY KEY.
"Populating internal tables "Populating internal tables
it1 = VALUE #( ( a = 1 b = 'aaa' c = 'bbbbb' ) it1 = VALUE #( ( a = 1 b = 'aaa' c = 'bbbbb' )
( a = 2 b = 'ccc' c = 'ddddd' ) ). ( a = 2 b = 'ccc' c = 'ddddd' ) ).
it3 = VALUE #( ( a = 3 b = 'eee' c = 'fffff' ) ).
it2 = VALUE #( ( a = 7 b = 'eee' d = 'fffff' ) ). it2 = VALUE #( ( a = 7 b = 'eee' d = 'fffff' ) ).
it3 = VALUE #( ( a = 3 b = 'eee' c = 'fffff' ) ).
it2 = CORRESPONDING #( it1 ). it2 = CORRESPONDING #( it1 ).
@@ -789,13 +789,22 @@ tables using the `VALUE` operator. Using `VALUE` for
constructing [elementary data objects](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenelementary_data_object_glosry.htm "Glossary Entry") and providing values is not possible. You can only use it to create a data object with an initial value, for example `DATA(str) = VALUE string( ).`. The `CONV` operator closes this gap. constructing [elementary data objects](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenelementary_data_object_glosry.htm "Glossary Entry") and providing values is not possible. You can only use it to create a data object with an initial value, for example `DATA(str) = VALUE string( ).`. The `CONV` operator closes this gap.
``` abap ``` abap
DATA(c) = CONV decfloat34( '0.4' ). DATA(a) = CONV decfloat34( '0.4' ).
"Instead of "Instead of
DATA d TYPE decfloat34 VALUE '0.4'. DATA b TYPE decfloat34 VALUE '0.4'.
"or "or
DATA e TYPE decfloat34. DATA c TYPE decfloat34.
e = '0.4'. c = '0.4'.
"Using the VALUE operator to construct elementary data objects
"and provide values is not possible.
"It is only possible to create an elementary data object with
"an initial value.
DATA(d) = VALUE string( ).
"This way it basically corresponds to a declaration as follows,
"which does not specify a start value with the addition VALUE.
DATA e TYPE string.
"Redundant conversion "Redundant conversion
"The variable derives the type (string) automatically from the "The variable derives the type (string) automatically from the

View File

@@ -370,7 +370,6 @@ ASSIGN s-xl1 TO <simple>.
"ASSIGN s-tab_ha TO <simple>. "ASSIGN s-tab_ha TO <simple>.
ASSIGN s-oref TO <object>. ASSIGN s-oref TO <object>.
s-oref = NEW zcl_demo_abap_objects( ).
``` ```
<p align="right"><a href="#top">⬆️ back to top</a></p> <p align="right"><a href="#top">⬆️ back to top</a></p>
@@ -1028,9 +1027,12 @@ st = VALUE #( col1 = 1 col2 = `aaa` col3 = `Z` ).
APPEND st TO it. APPEND st TO it.
DATA(dref) = NEW st_type( col1 = 2 col2 = `b` col3 = `Y` ). DATA(dref) = NEW st_type( col1 = 2 col2 = `b` col3 = `Y` ).
"You can achieve the access using ASSIGN statements as shown above, or "You can achieve the access using ASSIGN statements as shown above
"by statically specifying the structure and the (object) component selector "(using field symbols), ...
"followed by a character-like data object in parentheses. ASSIGN st-('COL1') TO FIELD-SYMBOL(<col1>).
"... or by statically specifying the structure and the (object) component
"selector followed by a character-like data object in parentheses.
"Write position "Write position
st-('COL1') = 123. st-('COL1') = 123.
it[ 1 ]-('COL1') = 456. it[ 1 ]-('COL1') = 456.
@@ -1038,15 +1040,24 @@ dref->('COL1') = 789.
"Read position "Read position
"The example shows how you can retrieve the textual content of any component "The example shows how you can retrieve the textual content of any component
"of any structure. "of any structure. As a prerequisite, the components must be convertible
DATA(content_col2) = CONV string( st-('COL1') ). "to type string in the example.
DATA(content_col3) = |{ st-('COL3') }|. DATA content_col1 TYPE string.
DATA content_col1 LIKE st-col1.
content_col1 = st-('COL1'). content_col1 = st-('COL1').
DATA(content_col2) = CONV string( st-('COL2') ).
DATA(content_col3) = |{ st-('COL3') }|.
"The following example creates an anonymous data object. The dereferenced
"data reference variable is assigned the component value. Using the LIKE
"addition, the appropriate type is specified (and not the string type as
"above for the structure component col1 that is of type i).
DATA dref_comp TYPE REF TO data. DATA dref_comp TYPE REF TO data.
CREATE DATA dref_comp LIKE st-('COL3'). CREATE DATA dref_comp LIKE st-('COL1').
dref_comp->* = st-('COL3'). dref_comp->* = st-('COL1').
"As shown further down, using RTTI to get the absolute type name of the
"dereferenced data reference variable.
DATA(type_used) = cl_abap_typedescr=>describe_by_data(
dref_comp->* )->absolute_name. "\TYPE=I
"If the component is not found, a catchable exception is raised. "If the component is not found, a catchable exception is raised.
TRY. TRY.
@@ -1766,7 +1777,7 @@ tdo_by_name_elem_helper = cl_abap_typedescr=>describe_by_name( 'ELEMTYPE' ).
"... using the cl_abap_typedescr=>describe_by_data method. "... using the cl_abap_typedescr=>describe_by_data method.
"In this case, the data objects are provided. "In this case, the data objects are provided.
"The examples cover an elementary data object, a structure and and "The examples cover an elementary data object, a structure and an
"internal table. "internal table.
DATA elemdobj TYPE elemtype. DATA elemdobj TYPE elemtype.
DATA strucdobj TYPE structype. DATA strucdobj TYPE structype.

View File

@@ -42,7 +42,7 @@
- [Escaping Special Characters](#escaping-special-characters) - [Escaping Special Characters](#escaping-special-characters)
- [Excursions](#excursions) - [Excursions](#excursions)
- [Comparison Operators for Character-Like Data Types in a Nutshell](#comparison-operators-for-character-like-data-types-in-a-nutshell) - [Comparison Operators for Character-Like Data Types in a Nutshell](#comparison-operators-for-character-like-data-types-in-a-nutshell)
- [String Processing Using the XCO Library](#string-processing-using-the-xco-library) - [Miscellaneous Classes for String Processing](#miscellaneous-classes-for-string-processing)
- [Executable Example](#executable-example) - [Executable Example](#executable-example)
@@ -2008,147 +2008,179 @@ IF s8 NP `*c#D*`. ... "false; sy-fdpos: 2
<p align="right"><a href="#top">⬆️ back to top</a></p> <p align="right"><a href="#top">⬆️ back to top</a></p>
### String Processing Using the XCO Library ### Miscellaneous Classes for String Processing
The Extension Components Library (XCO) library provides [released APIs](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenreleased_api_glosry.htm) and offers various development utilities. Find more information [here](https://help.sap.com/docs/btp/sap-business-technology-platform/overview-of-xco-modules). The following code snippet demonstrates several methods of the `XCO_CP` class that deal with string processing. The following list shows a selected set of classes that support string processing.
```abap - `CL_ABAP_CHAR_UTILITIES`: As previously mentioned, this class provides utilities for string processing, such as attributes that represent new lines and horizontal tabs.
"--------- Extracting a substring from a string ---------
DATA(some_string) = `abcdefghijklmnopqrstuvwxyz`.
"Creating an encapsulation of a string using XCO ``` abap
DATA(str) = xco_cp=>string( some_string ). DATA(tabbed) = `#` && cl_abap_char_utilities=>horizontal_tab && `#`.
"Using the FROM and TO methods, you can determine "The following attributes can be replaced by a representation of
"the character position. Note that the value includes the "the control characters in a string template.
"character at the position specified. ASSERT cl_abap_char_utilities=>newline = |\n|.
"The character index pattern for the example string above ASSERT cl_abap_char_utilities=>horizontal_tab = |\t|.
"is (the string has 26 characters in total): ASSERT cl_abap_char_utilities=>cr_lf = |\r\n|.
"a = 1, b = 2, c = 3 ... z = 26 ```
"a = -26, b = -25, c = -24 ... z = -1
"Providing a value that is out of bounds means that
"the first (or the last) character of the string is used
"by default.
"Note: When combining FROM and TO, e.g. with method
"chaining ...->from( ...)->to( ... ), note that another
"instance is created with the first 'from', and another
"character index pattern is created based on the new
"and adjusted string value.
"bcdefghijklmnopqrstuvwxyz - `CL_ABAP_STRING_UTILITIES`: For processing text strings, such as handling trailing blanks in character strings (i.e. data objects of type <code>string</code>).
DATA(sub1) = str->from( 2 )->value.
"defghijklmnopqrstuvwxyz ``` abap
DATA(sub2) = str->from( -23 )->value. DATA(string) = `ABAP `.
"Removing trailing blanks
cl_abap_string_utilities=>del_trailing_blanks( CHANGING str = string ).
"`ABAP`
"vwxyz "Preserving trailing blanks when assigning text fields to data objects of
DATA(sub3) = str->from( -5 )->value. "type string
DATA(chars) = 'ABAP '.
cl_abap_string_utilities=>c2str_preserving_blanks( EXPORTING source = chars
IMPORTING dest = DATA(str_w_blanks) ).
"`ABAP `
DATA(str_no_blanks) = CONV string( chars ).
"`ABAP`
```
"abcde - `XCO_CP`: The Extension Components Library (XCO) library provides [released APIs](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenreleased_api_glosry.htm) and offers various development utilities. Find more information [here](https://help.sap.com/docs/btp/sap-business-technology-platform/overview-of-xco-modules). The following code snippet demonstrates several methods of the class that deal with string processing.
DATA(sub4) = str->to( 5 )->value.
"ab ```abap
DATA(sub5) = str->to( -25 )->value. "--------- Extracting a substring from a string ---------
DATA(some_string) = `abcdefghijklmnopqrstuvwxyz`.
"Result of 1st 'from' method call: bcdefghijklmnopqrstuvwxyz "Creating an encapsulation of a string using XCO
"Based on this result, the 'to' method call is DATA(str) = xco_cp=>string( some_string ).
"applied.
"bcdefg
DATA(sub6) = str->from( 2 )->to( 6 )->value.
"Result of 1st 'to' method call: abcdefghijklmnopq "Using the FROM and TO methods, you can determine
"Based on this result, the 'from' method call is "the character position. Note that the value includes the
"applied. "character at the position specified.
"defghijklmnopq "The character index pattern for the example string above
DATA(sub7) = str->to( -10 )->from( 4 )->value. "is (the string has 26 characters in total):
"a = 1, b = 2, c = 3 ... z = 26
"a = -26, b = -25, c = -24 ... z = -1
"Providing a value that is out of bounds means that
"the first (or the last) character of the string is used
"by default.
"Note: When combining FROM and TO, e.g. with method
"chaining ...->from( ...)->to( ... ), note that another
"instance is created with the first 'from', and another
"character index pattern is created based on the new
"and adjusted string value.
"Values that are out of bounds. "bcdefghijklmnopqrstuvwxyz
"In the example, the first and last character of the DATA(sub1) = str->from( 2 )->value.
"string are used.
"abcdefghijklmnopqrstuvwxyz
DATA(sub8) = str->from( 0 )->to( 100 )->value.
"--------- Splitting and joining --------- "defghijklmnopqrstuvwxyz
DATA(sub2) = str->from( -23 )->value.
"Splitting a string into a string table "vwxyz
DATA(str_table) = xco_cp=>string( `Hello.World.ABAP` )->split( `.` )->value. DATA(sub3) = str->from( -5 )->value.
"Hello
"World
"ABAP
"Concatenating a string table into a string; specifying a delimiter "abcde
str_table = VALUE #( ( `a` ) ( `b` ) ( `c` ) ). DATA(sub4) = str->to( 5 )->value.
"a, b, c
DATA(conc_str1) = xco_cp=>strings( str_table )->join( `, ` )->value.
"Concatenating a string table into a string; specifying a delimiter and "ab
"reversing the table order DATA(sub5) = str->to( -25 )->value.
"c / b / a
DATA(conc_str2) = xco_cp=>strings( str_table )->reverse( )->join( ` / ` )->value.
"--------- Prepending and appending strings --------- "Result of 1st 'from' method call: bcdefghijklmnopqrstuvwxyz
DATA(name) = xco_cp=>string( `Max Mustermann` ). "Based on this result, the 'to' method call is
"applied.
"bcdefg
DATA(sub6) = str->from( 2 )->to( 6 )->value.
"Max Mustermann, Some Street 1, 12345 Someplace "Result of 1st 'to' method call: abcdefghijklmnopq
DATA(address) = name->append( `, Some Street 1, 12345 Someplace` )->value. "Based on this result, the 'from' method call is
"applied.
"defghijklmnopq
DATA(sub7) = str->to( -10 )->from( 4 )->value.
"Mr. Max Mustermann "Values that are out of bounds.
DATA(title) = name->prepend( `Mr. ` )->value. "In the example, the first and last character of the
"string are used.
"abcdefghijklmnopqrstuvwxyz
DATA(sub8) = str->from( 0 )->to( 100 )->value.
"--------- Transforming to lowercase and uppercase --------- "--------- Splitting and joining ---------
"ABAP
DATA(to_upper) = xco_cp=>string( `abap` )->to_upper_case( )->value.
"hallo world "Splitting a string into a string table
DATA(to_lower) = xco_cp=>string( `HALLO WORLD` )->to_lower_case( )->value. DATA(str_table) = xco_cp=>string( `Hello.World.ABAP` )->split( `.` )->value.
"Hello
"World
"ABAP
"--------- Checking if a string starts/ends with a specific string --------- "Concatenating a string table into a string; specifying a delimiter
DATA check TYPE string. str_table = VALUE #( ( `a` ) ( `b` ) ( `c` ) ).
DATA(str_check) = xco_cp=>string( `Max Mustermann` ). "a, b, c
DATA(conc_str1) = xco_cp=>strings( str_table )->join( `, ` )->value.
"yes "Concatenating a string table into a string; specifying a delimiter and
IF str_check->ends_with( `mann` ). "reversing the table order
"c / b / a
DATA(conc_str2) = xco_cp=>strings( str_table )->reverse( )->join( ` / ` )->value.
"--------- Prepending and appending strings ---------
DATA(name) = xco_cp=>string( `Max Mustermann` ).
"Max Mustermann, Some Street 1, 12345 Someplace
DATA(address) = name->append( `, Some Street 1, 12345 Someplace` )->value.
"Mr. Max Mustermann
DATA(title) = name->prepend( `Mr. ` )->value.
"--------- Transforming to lowercase and uppercase ---------
"ABAP
DATA(to_upper) = xco_cp=>string( `abap` )->to_upper_case( )->value.
"hallo world
DATA(to_lower) = xco_cp=>string( `HALLO WORLD` )->to_lower_case( )->value.
"--------- Checking if a string starts/ends with a specific string ---------
DATA check TYPE string.
DATA(str_check) = xco_cp=>string( `Max Mustermann` ).
"yes
IF str_check->ends_with( `mann` ).
check = `yes`. check = `yes`.
ELSE. ELSE.
check = `no`. check = `no`.
ENDIF. ENDIF.
"no "no
IF str_check->starts_with( `John` ). IF str_check->starts_with( `John` ).
check = `yes`. check = `yes`.
ELSE. ELSE.
check = `no`. check = `no`.
ENDIF. ENDIF.
"--------- Converting strings to xstrings using a codepage --------- "--------- Converting strings to xstrings using a codepage ---------
"536F6D6520737472696E67 "536F6D6520737472696E67
DATA(xstr) = xco_cp=>string( `Some string` )->as_xstring( xco_cp_character=>code_page->utf_8 )->value. DATA(xstr) = xco_cp=>string( `Some string` )->as_xstring( xco_cp_character=>code_page->utf_8 )->value.
"--------- Camel case compositions and decompositions with split and join operations --------- "--------- Camel case compositions and decompositions with split and join operations ---------
"Pascal case is also possible "Pascal case is also possible
"someValue "someValue
DATA(comp) = xco_cp=>string( `some_value` )->split( `_` )->compose( xco_cp_string=>composition->camel_case )->value. DATA(comp) = xco_cp=>string( `some_value` )->split( `_` )->compose( xco_cp_string=>composition->camel_case )->value.
"Camel case decomposition "Camel case decomposition
"some_value "some_value
DATA(decomp) = xco_cp=>string( `someValue` )->decompose( xco_cp_string=>decomposition->camel_case )->join( `_` )->value. DATA(decomp) = xco_cp=>string( `someValue` )->decompose( xco_cp_string=>decomposition->camel_case )->join( `_` )->value.
"--------- Matching string against regular expression --------- "--------- Matching string against regular expression ---------
DATA match TYPE string. DATA match TYPE string.
"yes "yes
IF xco_cp=>string( ` 1` )->matches( `\s\d` ). IF xco_cp=>string( ` 1` )->matches( `\s\d` ).
match = 'yes'. match = 'yes'.
ELSE. ELSE.
match = 'no'. match = 'no'.
ENDIF. ENDIF.
"no "no
IF xco_cp=>string( ` X` )->matches( `\s\d` ). IF xco_cp=>string( ` X` )->matches( `\s\d` ).
match = 'yes'. match = 'yes'.
ELSE. ELSE.
match = 'no'. match = 'no'.
ENDIF. ENDIF.
``` ```
<p align="right"><a href="#top">⬆️ back to top</a></p> <p align="right"><a href="#top">⬆️ back to top</a></p>

View File

@@ -823,8 +823,8 @@ Bullet points on selected `%` components:
draft scenario. In doing so, you can avoid lots of adaptations draft scenario. In doing so, you can avoid lots of adaptations
in your code by manually adding the indicator. in your code by manually adding the indicator.
- [`%control`](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abapderived_types_control.htm) - [`%control`](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abapderived_types_control.htm)
- Component group that contains the names of all key - Structured component that is a component of many BDEF derived types. It contains the names of all key
and data fields of a RAP BO instance which indicate flags. and data fields of a RAP BO instance, which indicate flags.
- For example, it is used to get information on which fields are provided or set a - For example, it is used to get information on which fields are provided or set a
flag for which fields are requested by RAP BO providers or RAP flag for which fields are requested by RAP BO providers or RAP
BO consumers respectively during the current EML request. BO consumers respectively during the current EML request.
@@ -1072,10 +1072,7 @@ created for the root entity. Then, in the same request, instances are
created for the child entity based on the root instance. In the example created for the child entity based on the root instance. In the example
below, the assumption is that a composition is specified in the root below, the assumption is that a composition is specified in the root
view entity like `composition [1..*] of root_ent as _child` and `key_field` and view entity like `composition [1..*] of root_ent as _child` and `key_field` and
`key_field_child` are the keys of the child view entity. The `key_field_child` are the keys of the child view entity. The structured component [`%target`](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abapderived_types_target.htm) enters the picture here which contains the target's primary key and data fields.
[`%target`](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abapderived_types_target.htm)
component group enters the picture here which contains the target's
primary key and data fields.
``` abap ``` abap
MODIFY ENTITIES OF root_ent MODIFY ENTITIES OF root_ent
ENTITY root_ent ENTITY root_ent
@@ -1291,7 +1288,10 @@ MODIFY ENTITIES OF root_ent
ENTITY root_ent ENTITY root_ent
CREATE FIELDS ( key_field field1 field2 ) WITH CREATE FIELDS ( key_field field1 field2 ) WITH
VALUE #( ( %cid = 'cid' key_field = 7 VALUE #( ( %cid = 'cid' key_field = 7
field1 = 'K' field2 = 'L' ) ). field1 = 'K' field2 = 'L' ) )
MAPPED DATA(mapped)
FAILED DATA(failed)
REPORTED DATA(resp).
COMMIT ENTITIES. COMMIT ENTITIES.
@@ -1578,10 +1578,10 @@ contains all relevant components for the chosen scenario.
> in which the final key values are assigned; the preliminary keys can > in which the final key values are assigned; the preliminary keys can
> be included in `%key` or `%pid` or both of them. > be included in `%key` or `%pid` or both of them.
>- `%pid` and the preliminary key values in `%key` are >- `%pid` and the preliminary key values in `%key` are
> automatically assigned to the following component groups when > automatically assigned to the following components when
> reaching the `adjust_numbers` method: > reaching the `adjust_numbers` method:
> - [`%tmp`](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abapderived_types_tmp.htm): > - [`%tmp`](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abapderived_types_tmp.htm):
> A component group that is assigned the preliminary key values > A component that is assigned the preliminary key values
> contained in `%key`. In doing so, `%tmp` takes > contained in `%key`. In doing so, `%tmp` takes
> over the role that `%key` has had in the RAP interaction > over the role that `%key` has had in the RAP interaction
> phase to hold the preliminary key values. > phase to hold the preliminary key values.

View File

@@ -40,8 +40,12 @@ Data types
- Can occur in [ABAP programs](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenabap_program_glosry.htm) as [bound data types](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenbound_data_type_glosry.htm), that is, the type is a property of a data object, or as a [standalone data type](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenstand-alone_data_type_glosry.htm), that is, the data type is defined independently. - Can occur in [ABAP programs](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenabap_program_glosry.htm) as [bound data types](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenbound_data_type_glosry.htm), that is, the type is a property of a data object, or as a [standalone data type](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenstand-alone_data_type_glosry.htm), that is, the data type is defined independently.
- Can be defined locally in an ABAP program or globally in classes, interfaces and in the [ABAP Dictionary (DDIC)](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenabap_dictionary_glosry.htm). - Can be defined locally in an ABAP program or globally in classes, interfaces and in the [ABAP Dictionary (DDIC)](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenabap_dictionary_glosry.htm).
> **💡 Note**<br> > **💡 Note**<br>
> - Note: Data types in the ABAP Dictionary are either created directly as [repository objects](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenrepository_object_glosry.htm) ([DDIC data elements](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abendata_element_glosry.htm)) or in a type pool (only in [Standard ABAP](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenstandard_abap_glosry.htm)). [Database tables](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abendatabase_table_glosry.htm), [CDS entities](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abencds_entity_glosry.htm) and their components can also be used as data types in ABAP programs. > Global data types are created as [repository objects](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenrepository_object_glosry.htm) in the ABAP Dictionary:
> - Their existence and visibility depends on the declaration context. > - DDIC types such as [DDIC data elements](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abendata_element_glosry.htm) (elementary data types or reference types), [DDIC structures](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenddic_structure_glosry.htm), [DDIC table types](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenddic_table_type_glosry.htm).
> - Furthermore, [database tables](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abendatabase_table_glosry.htm) and [CDS entities](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abencds_entity_glosry.htm) and their components can also be used as data types in ABAP programs.
>
> Data types declared in interfaces and in the public visibility section of global classes are also globally visibile. Global classes and interfaces as such are global types to refer to. In [classic ABAP](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenclassic_abap_glosry.htm), global data types can also be created in [type pools](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abentype_pool_glosry.htm). Find more information [here](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenddic_data_types.htm).
Data objects: Data objects:
- Are objects (or [instances](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abeninstance_glosry.htm)) of a data type (similar to objects/instances of classes in [ABAP Objects](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenabap_objects_glosry.htm)). - Are objects (or [instances](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abeninstance_glosry.htm)) of a data type (similar to objects/instances of classes in [ABAP Objects](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenabap_objects_glosry.htm)).

View File

@@ -3,16 +3,16 @@
# ABAP for Cloud Development # ABAP for Cloud Development
- [ABAP for Cloud Development](#abap-for-cloud-development) - [ABAP for Cloud Development](#abap-for-cloud-development)
- [Terms](#terms) - [Terms](#terms)
- [Excursions](#excursions) - [Excursions](#excursions)
- [More Information](#more-information) - [More Information](#more-information)
- [Executable Example](#executable-example) - [Executable Example](#executable-example)
This ABAP cheat sheet briefly outlines the terms ABAP Cloud and classic ABAP to get an idea about [ABAP for Cloud Development](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenabap_for_cloud_dev_glosry.htm). This ABAP cheat sheet briefly outlines the terms ABAP Cloud and classic ABAP to get an idea about [ABAP for Cloud Development](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm?file=abenabap_for_cloud_dev_glosry.htm).
It provides references to more detailed information on the topic. It provides references to more detailed information on the topic.
# Terms ## Terms
- ABAP Cloud - ABAP Cloud
- Progamming paradigm for state-of-the-art, cloud-ready and upgrade-stable solutions - Progamming paradigm for state-of-the-art, cloud-ready and upgrade-stable solutions
@@ -41,7 +41,7 @@ It provides references to more detailed information on the topic.
<p align="right"><a href="#top">⬆️ back to top</a></p> <p align="right"><a href="#top">⬆️ back to top</a></p>
# Excursions ## Excursions
1) If available to you, you have accessed an SAP BTP ABAP environment using ADT. 1) If available to you, you have accessed an SAP BTP ABAP environment using ADT.
@@ -155,7 +155,7 @@ It provides references to more detailed information on the topic.
<p align="right"><a href="#top">⬆️ back to top</a></p> <p align="right"><a href="#top">⬆️ back to top</a></p>
# More Information ## More Information
- Devtoberfest sessions - Devtoberfest sessions
- [Overview of ABAP Cloud](https://www.youtube.com/watch?v=ApZSn_t_WSo) - [Overview of ABAP Cloud](https://www.youtube.com/watch?v=ApZSn_t_WSo)
@@ -174,7 +174,7 @@ It provides references to more detailed information on the topic.
<p align="right"><a href="#top">⬆️ back to top</a></p> <p align="right"><a href="#top">⬆️ back to top</a></p>
# Executable Example ## Executable Example
[zcl_demo_abap_cloud_excursion](./src/zcl_demo_abap_cloud_excursion.clas.abap) [zcl_demo_abap_cloud_excursion](./src/zcl_demo_abap_cloud_excursion.clas.abap)
> **💡 Note**<br> > **💡 Note**<br>