Update content
This commit is contained in:
@@ -159,7 +159,7 @@ CLASS zcl_demo_abap_amdp IMPLEMENTATION.
|
||||
|
||||
DATA(output) = NEW zcl_demo_abap_display( out ).
|
||||
|
||||
output->display( `Demo: ABAP AMDP` ).
|
||||
output->display( `ABAP Cheat Sheet Example: ABAP AMDP` ).
|
||||
|
||||
output->display( `1. AMDP procedure` ).
|
||||
|
||||
|
||||
@@ -98,7 +98,7 @@ CLASS zcl_demo_abap_cds_ve IMPLEMENTATION.
|
||||
|
||||
DATA(output) = NEW zcl_demo_abap_display( out ).
|
||||
|
||||
output->display( `ABAP cheat sheet: CDS view entities` ).
|
||||
output->display( `ABAP Cheat Sheet Example: CDS view entities` ).
|
||||
|
||||
output->display( `1) Operands, expressions and built-in functions ` &&
|
||||
`in a CDS view entity` ).
|
||||
|
||||
@@ -111,7 +111,7 @@ CLASS zcl_demo_abap_constructor_expr IMPLEMENTATION.
|
||||
|
||||
DATA(output) = NEW zcl_demo_abap_display( out ).
|
||||
|
||||
output->display( `ABAP cheat sheet: Constructor expressions` ).
|
||||
output->display( `ABAP Cheat Sheet Example: Constructor expressions` ).
|
||||
|
||||
output->next_section( `VALUE` ).
|
||||
output->display( `1) Structures: Populating a flat structure` ).
|
||||
@@ -341,9 +341,9 @@ CLASS zcl_demo_abap_constructor_expr IMPLEMENTATION.
|
||||
END OF substruc,
|
||||
END OF deep_struc_ty.
|
||||
|
||||
DATA(deep_struc) = VALUE deep_struc_ty( num = 1 char1 = 'aaa'
|
||||
|
||||
substruc = VALUE #( int = 123 str = `hallo` ) ).
|
||||
DATA(deep_struc) = VALUE deep_struc_ty( num = 1
|
||||
char1 = 'aaa'
|
||||
substruc = VALUE #( int = 123 str = `hallo` ) ).
|
||||
|
||||
output->display( input = deep_struc name = `deep_struc` ).
|
||||
|
||||
@@ -1335,6 +1335,8 @@ CLASS zcl_demo_abap_constructor_expr IMPLEMENTATION.
|
||||
|
||||
output->display( input = str_tab name = `str_tab` ).
|
||||
|
||||
**********************************************************************
|
||||
|
||||
output->next_section( `42) LET Expressions (2)` ).
|
||||
|
||||
"2) LET within a constructor expression with COND: 12 o'clock is
|
||||
@@ -1354,6 +1356,8 @@ CLASS zcl_demo_abap_constructor_expr IMPLEMENTATION.
|
||||
|
||||
output->display( input = time name = `time` ).
|
||||
|
||||
**********************************************************************
|
||||
|
||||
output->next_section( `43) LET Expressions (3)` ).
|
||||
|
||||
"3) An internal table that includes three components is created and
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
* code.
|
||||
*
|
||||
***********************************************************************
|
||||
"! <p class="shorttext synchronized">ABAP cheat sheets: Data types and data objects</p>
|
||||
"! <p class="shorttext synchronized">ABAP cheat sheet: Data types and data objects</p>
|
||||
"! Example to demonstrate data types and data objects in ABAP.<br>Choose F9 in ADT to run the class.
|
||||
CLASS zcl_demo_abap_dtype_dobj DEFINITION
|
||||
PUBLIC
|
||||
@@ -91,8 +91,7 @@ CLASS zcl_demo_abap_dtype_dobj IMPLEMENTATION.
|
||||
" CDS entity, which is not covered in this demo example.
|
||||
"- In ADT and because of the many type declarations, you may want to press
|
||||
" F2 on the types to get more information.
|
||||
"- The examples show a selection. For more information, chheck out the
|
||||
" ABAP Keyword Documentation.
|
||||
"- The examples show a selection.
|
||||
"- Only non-generic types can be used.
|
||||
|
||||
output->display( `1) Declaring data types based on elementary types` ).
|
||||
@@ -760,7 +759,6 @@ CLASS zcl_demo_abap_dtype_dobj IMPLEMENTATION.
|
||||
"- Must always be performed explicitly using the casting operator ?= and the casting
|
||||
" operator CAST.
|
||||
|
||||
|
||||
"The following example would result in a syntax error due to type incompatibility.
|
||||
"dref_1_i = dref_3_data.
|
||||
|
||||
@@ -775,7 +773,7 @@ CLASS zcl_demo_abap_dtype_dobj IMPLEMENTATION.
|
||||
dref_1_i = CAST #( dref_3_data ).
|
||||
|
||||
"If not caught, the following would result in a runtime error.
|
||||
"dref_3_data points to a reference of type i, the static type is dref_2_str is string.
|
||||
"dref_3_data points to a reference of type i, the static type of dref_2_str is string.
|
||||
"So, the downcast does not work.
|
||||
TRY.
|
||||
dref_2_str = CAST #( dref_3_data ).
|
||||
@@ -973,7 +971,7 @@ CLASS zcl_demo_abap_dtype_dobj IMPLEMENTATION.
|
||||
|
||||
**********************************************************************
|
||||
|
||||
output->display( `1) Character strings and text field strings` ).
|
||||
output->display( `12) Character strings and text field strings` ).
|
||||
|
||||
"The following example shows the difference between text field strings
|
||||
"of type c and character strings of type string when it comes to trailing
|
||||
@@ -990,7 +988,7 @@ CLASS zcl_demo_abap_dtype_dobj IMPLEMENTATION.
|
||||
|
||||
**********************************************************************
|
||||
|
||||
output->display( `12) Floating point numbers` ).
|
||||
output->display( `13) Floating point numbers` ).
|
||||
|
||||
"The following example shows the difference between binary and decimal
|
||||
"floating point numbers.
|
||||
@@ -1005,9 +1003,9 @@ CLASS zcl_demo_abap_dtype_dobj IMPLEMENTATION.
|
||||
|
||||
**********************************************************************
|
||||
|
||||
output->display( `13) Byte-like types` ).
|
||||
output->display( `14) Byte-like types` ).
|
||||
|
||||
"The following example shows byte-like types x and xstring..
|
||||
"The following example shows byte-like types x and xstring.
|
||||
|
||||
"A byte string is filled with binary data created from a string
|
||||
"using the convert_out method of the cl_abap_codepage class.
|
||||
@@ -1058,7 +1056,7 @@ CLASS zcl_demo_abap_dtype_dobj IMPLEMENTATION.
|
||||
|
||||
**********************************************************************
|
||||
|
||||
output->display( `14) Date and time` ).
|
||||
output->display( `15) Date and time` ).
|
||||
|
||||
"In the example, date and time fields are assigned the current values
|
||||
"using the cl_abap_context_info class. Calculations follow. The date of next
|
||||
@@ -1093,7 +1091,7 @@ CLASS zcl_demo_abap_dtype_dobj IMPLEMENTATION.
|
||||
|
||||
**********************************************************************
|
||||
|
||||
output->display( `15) Type conversion rules` ).
|
||||
output->display( `16) Type conversion rules` ).
|
||||
|
||||
"The purpose of this example is to emphasize the conversion rules
|
||||
"that should be noted when performing conversions.
|
||||
@@ -1248,7 +1246,7 @@ CLASS zcl_demo_abap_dtype_dobj IMPLEMENTATION.
|
||||
|
||||
**********************************************************************
|
||||
|
||||
output->display( `16) Excursion: RTTI` ).
|
||||
output->display( `17) Excursion: RTTI` ).
|
||||
|
||||
"Using RTTI to check type compatibility
|
||||
"In the following example the applies_to_data method of the RTTI class
|
||||
@@ -1316,7 +1314,7 @@ CLASS zcl_demo_abap_dtype_dobj IMPLEMENTATION.
|
||||
|
||||
**********************************************************************
|
||||
|
||||
output->display( `17) Constants and immutable variables` ).
|
||||
output->display( `18) Constants and immutable variables` ).
|
||||
|
||||
"As mentioned above, constants cannot be changed at runtime.
|
||||
CONSTANTS con_str TYPE string VALUE `hallo`.
|
||||
@@ -1356,7 +1354,7 @@ CLASS zcl_demo_abap_dtype_dobj IMPLEMENTATION.
|
||||
|
||||
**********************************************************************
|
||||
|
||||
output->display( `18) Various ABAP glossary terms on data types and objects in a nutshell` ).
|
||||
output->display( `19) Various ABAP glossary terms on data types and objects in a nutshell` ).
|
||||
|
||||
"Standalone and bound data types
|
||||
"Standalone: Data type that is defined using the statement TYPES in an ABAP program, as
|
||||
@@ -1570,7 +1568,7 @@ CLASS zcl_demo_abap_dtype_dobj IMPLEMENTATION.
|
||||
|
||||
**********************************************************************
|
||||
|
||||
output->display( `19) Generic ABAP types for formal parameters of methods` ).
|
||||
output->display( `20) Generic ABAP types for formal parameters of methods` ).
|
||||
|
||||
"Generic data types have already been covered above.
|
||||
"A generic data type is an incomplete type specification that covers multiple
|
||||
@@ -1615,7 +1613,7 @@ CLASS zcl_demo_abap_dtype_dobj IMPLEMENTATION.
|
||||
|
||||
**********************************************************************
|
||||
|
||||
output->display( `20) Built-in data objects` ).
|
||||
output->display( `21) Built-in data objects` ).
|
||||
|
||||
"This example demonstrates the availability of built-in data objects in ABAP..
|
||||
|
||||
@@ -1697,7 +1695,7 @@ CLASS zcl_demo_abap_dtype_dobj IMPLEMENTATION.
|
||||
|
||||
**********************************************************************
|
||||
|
||||
output->display( `21) Declaration context` ).
|
||||
output->display( `22) Declaration context` ).
|
||||
|
||||
"The declaration context of data objects can be problematic.
|
||||
"The example deals with local declarations and control structures.
|
||||
|
||||
@@ -77,7 +77,7 @@ CLASS zcl_demo_abap_dynamic_prog IMPLEMENTATION.
|
||||
|
||||
DATA(output) = NEW zcl_demo_abap_display( out ).
|
||||
|
||||
output->display( `ABAP Cheat Sheet: Dynamic Programming` ).
|
||||
output->display( `ABAP Cheat Sheet Example: Dynamic Programming` ).
|
||||
|
||||
**********************************************************************
|
||||
|
||||
@@ -953,7 +953,7 @@ CLASS zcl_demo_abap_dynamic_prog IMPLEMENTATION.
|
||||
* "If the value is 0, the memory area of the entire structure is assigned to the field symbol.
|
||||
* ASSIGN wa-(0) TO FIELD-SYMBOL(<fs_m10>).
|
||||
|
||||
"The above statements replace the following syntax syntax
|
||||
"The above statements replace the following syntax
|
||||
ASSIGN COMPONENT 'CARRID' OF STRUCTURE wa TO FIELD-SYMBOL(<fs_m11>).
|
||||
|
||||
ASSIGN COMPONENT 5 OF STRUCTURE wa TO FIELD-SYMBOL(<fs_m12>).
|
||||
|
||||
@@ -181,7 +181,7 @@ CLASS ZCL_DEMO_ABAP_INTERNAL_TABLES IMPLEMENTATION.
|
||||
|
||||
DATA(output) = NEW zcl_demo_abap_display( out ).
|
||||
|
||||
output->display( `Demo: Working with Internal Tables` ).
|
||||
output->display( `ABAP Cheat Sheet Example: Working with Internal Tables` ).
|
||||
output->display( `Filling and Copying Internal Table Content` ).
|
||||
output->display( `1) Adding single lines using APPEND/INSERT` ).
|
||||
|
||||
|
||||
@@ -97,7 +97,7 @@ CLASS zcl_demo_abap_objects IMPLEMENTATION.
|
||||
|
||||
DATA(output) = NEW zcl_demo_abap_display( out ).
|
||||
|
||||
output->display( `Demo: ABAP Object Orientation` ).
|
||||
output->display( `ABAP Cheat Sheet Example: ABAP Object Orientation` ).
|
||||
output->display( `Working with objects and components` ).
|
||||
output->display( `1) Declaring reference variables` ).
|
||||
|
||||
|
||||
@@ -104,7 +104,7 @@ CLASS zcl_demo_abap_prog_flow_logic IMPLEMENTATION.
|
||||
|
||||
DATA(output) = NEW zcl_demo_abap_display( out ).
|
||||
|
||||
output->display( `ABAP Cheat Sheet Demonstration Example: Program Flow Logic` ).
|
||||
output->display( `ABAP Cheat Sheet Example: Program Flow Logic` ).
|
||||
|
||||
**********************************************************************
|
||||
|
||||
|
||||
@@ -145,7 +145,7 @@ CLASS ZCL_DEMO_ABAP_RAP_DRAFT_LN_M IMPLEMENTATION.
|
||||
|
||||
DATA(output) = NEW zcl_demo_abap_display( out ).
|
||||
|
||||
output->display( `RAP Demo: RAP Calculator Using Managed, ` &&
|
||||
output->display( `ABAP Cheat Sheet Example: RAP Calculator Using Managed, ` &&
|
||||
`Draft-Enabled RAP BO (Late Numbering)` ).
|
||||
output->display( `1) Creating Instances and ` &&
|
||||
`Saving to the database` ).
|
||||
|
||||
@@ -184,7 +184,7 @@ CLASS ZCL_DEMO_ABAP_RAP_EXT_NUM_M IMPLEMENTATION.
|
||||
|
||||
DATA(output) = NEW zcl_demo_abap_display( out ).
|
||||
|
||||
output->display( `RAP Demo: RAP BO Operations Using a Managed ` &&
|
||||
output->display( `ABAP Cheat Sheet Example: RAP BO Operations Using a Managed ` &&
|
||||
`RAP BO` ).
|
||||
|
||||
**********************************************************************
|
||||
|
||||
@@ -193,7 +193,7 @@ CLASS zcl_demo_abap_rap_ext_num_u IMPLEMENTATION.
|
||||
|
||||
DATA(output) = NEW zcl_demo_abap_display( out ).
|
||||
|
||||
output->display( `RAP Demo: RAP BO Operations Using an ` &&
|
||||
output->display( `ABAP Cheat Sheet Example: RAP BO Operations Using an ` &&
|
||||
`Unmanaged RAP BO (External Numbering)` ).
|
||||
|
||||
**********************************************************************
|
||||
|
||||
@@ -72,7 +72,7 @@ CLASS zcl_demo_abap_sql IMPLEMENTATION.
|
||||
|
||||
DATA(output) = NEW zcl_demo_abap_display( out ).
|
||||
|
||||
output->display( `ABAP Cheat Sheet: ABAP SQL in Use` ).
|
||||
output->display( `ABAP Cheat Sheet Example: ABAP SQL in Use` ).
|
||||
output->display( `Using SELECT for multiple purposes` ).
|
||||
output->display( `1) Reading a single row from database table ` &&
|
||||
`into a structure` ).
|
||||
|
||||
@@ -69,7 +69,7 @@ CLASS zcl_demo_abap_sql_group_by IMPLEMENTATION.
|
||||
|
||||
DATA(output) = NEW zcl_demo_abap_display( out ).
|
||||
|
||||
output->display( `Demo: Grouping Internal Tables` ).
|
||||
output->display( `ABAP Cheat Sheet Example: Grouping Internal Tables` ).
|
||||
|
||||
SELECT *
|
||||
FROM zdemo_abap_flsch
|
||||
|
||||
@@ -57,7 +57,7 @@ CLASS zcl_demo_abap_string_proc IMPLEMENTATION.
|
||||
|
||||
DATA(output) = NEW zcl_demo_abap_display( out ).
|
||||
|
||||
output->display( `ABAP Cheat Sheet Demo Example: String Processing` ).
|
||||
output->display( `ABAP Cheat Sheet Example: String Processing` ).
|
||||
output->display( `1) Creating Strings and Assigning Values` ).
|
||||
|
||||
"Data object declarations providing default values
|
||||
|
||||
@@ -114,7 +114,7 @@ CLASS zcl_demo_abap_structures IMPLEMENTATION.
|
||||
|
||||
DATA(output) = NEW zcl_demo_abap_display( out ).
|
||||
|
||||
output->display( `ABAP Cheat Sheet Demonstration Example: Working with Structures` ).
|
||||
output->display( `ABAP Cheat Sheet Example: Working with Structures` ).
|
||||
|
||||
**********************************************************************
|
||||
|
||||
|
||||
@@ -178,7 +178,7 @@ METHOD if_oo_adt_classrun~main.
|
||||
|
||||
DATA(output) = NEW zcl_demo_abap_display( out ).
|
||||
|
||||
output->display( `ABAP Cheat Sheet Demonstration Example: ABAP Unit Tests` ).
|
||||
output->display( `ABAP Cheat Sheet Example: ABAP Unit Tests` ).
|
||||
output->display( `1) get_sum Method` ).
|
||||
"This method demonstrates the use of the setup and teardown methods in the test class.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user