-%param-col2 }"|
67 | crea_date_time = cl_abap_tstmp=>utclong2tstmp( utclong_current( ) )
68 | ) TO evt_log.
69 | CATCH cx_uuid_error INTO DATA(err).
70 | ASSERT err IS INITIAL.
71 | ENDTRY.
72 | MODIFY zdemo_abap_draft FROM TABLE @evt_log.
73 | ENDLOOP.
74 | ENDMETHOD.
75 | ENDCLASS.
76 |
--------------------------------------------------------------------------------
/src/zcl_demo_abap_rap_evt_handler.clas.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | ZCL_DEMO_ABAP_RAP_EVT_HANDLER
7 | E
8 | RAP event handler class
9 | 07
10 | 1
11 | X
12 | X
13 | X
14 | ZDEMO_ABAP_RAP_RO_M_AS
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/src/zcl_demo_abap_rap_ext_num_m.clas.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | ZCL_DEMO_ABAP_RAP_EXT_NUM_M
7 | E
8 | ABAP cheat sheet: ABAP EML in a RAP scenario (managed BO)
9 | 1
10 | X
11 | X
12 | X
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/src/zcl_demo_abap_rap_ext_num_u.clas.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | ZCL_DEMO_ABAP_RAP_EXT_NUM_U
7 | E
8 | ABAP cheat sheet: ABAP EML in a RAP scenario (unmanaged BO)
9 | 1
10 | X
11 | X
12 | X
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/src/zcl_demo_abap_rap_m_as.clas.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | ZCL_DEMO_ABAP_RAP_M_AS
7 | E
8 | ABAP cheat sheet: Local consumption of RAP Business Events
9 | 1
10 | X
11 | X
12 | X
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/src/zcl_demo_abap_regex.clas.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | ZCL_DEMO_ABAP_REGEX
7 | E
8 | ABAP cheat sheet: Regular Expressions in ABAP
9 | 1
10 | X
11 | X
12 | X
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/src/zcl_demo_abap_sql.clas.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | ZCL_DEMO_ABAP_SQL
7 | E
8 | ABAP cheat sheet: ABAP SQL
9 | 1
10 | X
11 | X
12 | X
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/src/zcl_demo_abap_sql_group_by.clas.abap:
--------------------------------------------------------------------------------
1 | "! Grouping internal tables
ABAP cheat sheet example class
2 | "!
3 | "! The example class demonstrates syntax options when grouping internal tables.
4 | "! Choose F9 in ADT to run the class.
5 | "!
6 | "! Note
7 | "! Find information on getting started with the example class and the
8 | "! disclaimer in the ABAP Doc comment of class {@link zcl_demo_abap_aux}.
9 | CLASS zcl_demo_abap_sql_group_by DEFINITION
10 | PUBLIC
11 | FINAL
12 | CREATE PUBLIC .
13 |
14 | PUBLIC SECTION.
15 | INTERFACES: if_oo_adt_classrun.
16 |
17 | CLASS-METHODS: class_constructor.
18 |
19 | protected section.
20 | PRIVATE SECTION.
21 | CLASS-DATA:
22 | wa TYPE zdemo_abap_flsch,
23 | member TYPE zdemo_abap_flsch,
24 | members TYPE STANDARD TABLE OF zdemo_abap_flsch WITH EMPTY KEY.
25 |
26 | ENDCLASS.
27 |
28 |
29 |
30 | CLASS ZCL_DEMO_ABAP_SQL_GROUP_BY IMPLEMENTATION.
31 |
32 |
33 | METHOD class_constructor.
34 | "Fill demo database tables.
35 | zcl_demo_abap_aux=>fill_dbtabs( ).
36 | ENDMETHOD.
37 |
38 |
39 | METHOD if_oo_adt_classrun~main.
40 |
41 | out->write( |ABAP Cheat Sheet Example: Grouping Internal Tables\n\n| ).
42 |
43 | SELECT *
44 | FROM zdemo_abap_flsch
45 | INTO TABLE @DATA(fli_tab).
46 |
47 | out->write( |1) Representative Binding\n| ).
48 | out->write( |1a) Grouping by one column\n| ).
49 |
50 | LOOP AT fli_tab INTO wa
51 | GROUP BY wa-carrid.
52 | out->write( wa-carrid ).
53 | ENDLOOP.
54 |
55 | out->write( zcl_demo_abap_aux=>heading( `1b) Members of one column groups` ) ).
56 |
57 | LOOP AT fli_tab INTO wa
58 | GROUP BY wa-carrid.
59 | CLEAR members.
60 | LOOP AT GROUP wa INTO member.
61 | members = VALUE #( BASE members ( member ) ).
62 | ENDLOOP.
63 |
64 | out->write( members ).
65 | out->write( |\n| ).
66 | ENDLOOP.
67 |
68 | out->write( zcl_demo_abap_aux=>heading( `1c) Grouping by two columns` ) ).
69 |
70 | LOOP AT fli_tab INTO wa
71 | GROUP BY ( key1 = wa-carrid key2 = wa-airpfrom ).
72 |
73 | out->write( |{ wa-carrid } { wa-airpfrom }| ).
74 | out->write( |\n| ).
75 | ENDLOOP.
76 |
77 | out->write( zcl_demo_abap_aux=>heading( `1d) Members of two column groups` ) ).
78 |
79 | LOOP AT fli_tab INTO wa
80 | GROUP BY ( key1 = wa-carrid key2 = wa-airpfrom ).
81 | CLEAR members.
82 | LOOP AT GROUP wa INTO member.
83 | members = VALUE #( BASE members ( member ) ).
84 | ENDLOOP.
85 |
86 | out->write( members ).
87 | out->write( |\n| ).
88 | ENDLOOP.
89 |
90 | out->write( zcl_demo_abap_aux=>heading( `2) Group Key Binding` ) ).
91 | out->write( |2a) Grouping by one column\n| ).
92 |
93 | LOOP AT fli_tab INTO wa
94 | GROUP BY wa-carrid
95 | INTO DATA(key).
96 |
97 | out->write( key ).
98 | out->write( |\n| ).
99 | ENDLOOP.
100 |
101 | out->write( zcl_demo_abap_aux=>heading( `2b) Members of one column groups` ) ).
102 |
103 | LOOP AT fli_tab INTO wa
104 | GROUP BY wa-carrid
105 | INTO key.
106 | CLEAR members.
107 | LOOP AT GROUP key INTO member.
108 | members = VALUE #( BASE members ( member ) ).
109 | ENDLOOP.
110 |
111 | out->write( members ).
112 | out->write( |\n| ).
113 | ENDLOOP.
114 |
115 | out->write( zcl_demo_abap_aux=>heading( `2c) Grouping by two columns` ) ).
116 |
117 | LOOP AT fli_tab INTO wa
118 | GROUP BY ( key1 = wa-carrid key2 = wa-airpfrom )
119 | INTO DATA(keys).
120 |
121 | out->write( keys ).
122 | out->write( |\n| ).
123 | ENDLOOP.
124 |
125 | out->write( zcl_demo_abap_aux=>heading( `2d) Members of two column groups` ) ).
126 |
127 | LOOP AT fli_tab INTO wa
128 | GROUP BY ( key1 = wa-carrid key2 = wa-airpfrom )
129 | INTO keys.
130 | CLEAR members.
131 | LOOP AT GROUP keys INTO member.
132 | members = VALUE #( BASE members ( member ) ).
133 | ENDLOOP.
134 |
135 | out->write( members ).
136 | out->write( |\n| ).
137 | ENDLOOP.
138 |
139 | out->write( zcl_demo_abap_aux=>heading( `2e) Two column groups without members` ) ).
140 |
141 | LOOP AT fli_tab INTO wa
142 | GROUP BY ( key1 = wa-carrid key2 = wa-airpfrom
143 | index = GROUP INDEX size = GROUP SIZE )
144 | WITHOUT MEMBERS
145 | INTO DATA(keysplus).
146 |
147 | out->write( keysplus ).
148 | out->write( |\n| ).
149 | ENDLOOP.
150 |
151 | ENDMETHOD.
152 | ENDCLASS.
153 |
--------------------------------------------------------------------------------
/src/zcl_demo_abap_sql_group_by.clas.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | ZCL_DEMO_ABAP_SQL_GROUP_BY
7 | E
8 | ABAP cheat sheet: ABAP SQL - Grouping internal tables
9 | 1
10 | X
11 | X
12 | X
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/src/zcl_demo_abap_string_proc.clas.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | ZCL_DEMO_ABAP_STRING_PROC
7 | E
8 | ABAP cheat sheet: String processing
9 | 1
10 | X
11 | X
12 | X
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/src/zcl_demo_abap_structures.clas.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | ZCL_DEMO_ABAP_STRUCTURES
7 | E
8 | ABAP cheat sheet: Structures
9 | 1
10 | X
11 | X
12 | X
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/src/zcl_demo_abap_unit_dataprov.clas.abap:
--------------------------------------------------------------------------------
1 | "! Class Supporting ABAP Unit Test Example
ABAP cheat sheet example class
2 | "!
3 | "! The example class represents a dependent-on-component (DOC) and supports an ABAP Unit test example.
4 | "! Methods of this class are called in another class: {@link zcl_demo_abap_unit_tdf}. The DOCs are replaced
5 | "! by test doubles when running ABAP Unit tests.
6 | "! Choose F9 in ADT to run the class.
7 | "!
8 | "! Information
9 | "! Find information on getting started with the example class and the disclaimer in
10 | "! the ABAP Doc comment of class {@link zcl_demo_abap_aux}.
11 | CLASS zcl_demo_abap_unit_dataprov DEFINITION
12 | PUBLIC
13 | CREATE PUBLIC .
14 |
15 | PUBLIC SECTION.
16 | METHODS get_discount RETURNING VALUE(discount) TYPE decfloat34.
17 | METHODS get_discount_value IMPORTING day_value TYPE i
18 | time_value TYPE i
19 | RETURNING VALUE(discount_value) TYPE decfloat34.
20 | PROTECTED SECTION.
21 | PRIVATE SECTION.
22 | ENDCLASS.
23 |
24 |
25 |
26 | CLASS zcl_demo_abap_unit_dataprov IMPLEMENTATION.
27 | METHOD get_discount.
28 | "Getting the weekday
29 | "1) Monday, 2) Tuesday, 3) Wednesday, 4) Thursday, 5) Friday, 6) Saturday, 7) Sunday
30 | DATA(weekday) = ( 5 + CONV d( xco_cp=>sy->date( xco_cp_time=>time_zone->utc
31 | )->as( xco_cp_time=>format->iso_8601_basic )->value ) MOD 7 ) MOD 7 + 1.
32 |
33 | "- Standard discount is granted at the weekend (Saturday, Sunday)
34 | "- On other weekdays, discount is granted depending on the daytime
35 | IF weekday = 6 OR weekday = 7.
36 | discount = '20'.
37 | ELSE.
38 | "Retrieving the current time in UTC
39 | DATA(utc_time) = CONV t( xco_cp=>sy->time( xco_cp_time=>time_zone->utc
40 | )->as( xco_cp_time=>format->iso_8601_basic )->value ).
41 |
42 | discount = COND #( WHEN utc_time BETWEEN '000000' AND '045959' THEN '15' "Night discount
43 | WHEN utc_time BETWEEN '220000' AND '235959' THEN '15' "Night discount
44 | WHEN utc_time BETWEEN '050000' AND '115959' THEN '10' "Morning discount
45 | WHEN utc_time BETWEEN '180000' AND '215959' THEN '5' "Evening discount
46 | ELSE 0 "No discount
47 | ).
48 | ENDIF.
49 | ENDMETHOD.
50 |
51 | METHOD get_discount_value.
52 | CASE day_value.
53 | "Standard discount is granted at the weekend (Saturday, Sunday)
54 | WHEN 6 OR 7.
55 | discount_value = '20'.
56 | "On other weekdays, discount is granted depending on the daytime
57 | WHEN OTHERS.
58 | discount_value = SWITCH #( time_value
59 | WHEN 1 THEN '15' "Night discount
60 | WHEN 2 THEN '10' "Morning discount
61 | WHEN 3 THEN '5' "Evening discount
62 | ELSE '0' "No discount
63 | ).
64 | ENDCASE.
65 | ENDMETHOD.
66 |
67 | ENDCLASS.
68 |
--------------------------------------------------------------------------------
/src/zcl_demo_abap_unit_dataprov.clas.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | ZCL_DEMO_ABAP_UNIT_DATAPROV
7 | E
8 | ABAP cheat sheet: Built-in Functions
9 | 1
10 | X
11 | X
12 | X
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/src/zcl_demo_abap_unit_tdf.clas.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | ZCL_DEMO_ABAP_UNIT_TDF
7 | E
8 | ABAP cheat sheet: Creating Test Doubles Using ABAP Framework
9 | 1
10 | X
11 | X
12 | X
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/src/zcl_demo_abap_unit_test.clas.locals_def.abap:
--------------------------------------------------------------------------------
1 | *"* use this source file for any type of declarations (class
2 | *"* definitions, interfaces or type declarations) you need for
3 | *"* components in the private section
4 | INTERFACE lif_get_data DEFERRED.
5 |
--------------------------------------------------------------------------------
/src/zcl_demo_abap_unit_test.clas.locals_imp.abap:
--------------------------------------------------------------------------------
1 | ******************************************************
2 | * Local interface
3 | ******************************************************
4 | INTERFACE lif_get_data.
5 |
6 | TYPES: carr_tab TYPE TABLE OF zdemo_abap_fli WITH EMPTY KEY,
7 | occ_rate TYPE p LENGTH 4 DECIMALS 2.
8 |
9 | METHODS:
10 | select_flight_data IMPORTING carrier TYPE zdemo_abap_fli-carrid
11 | RETURNING VALUE(flight_data) TYPE carr_tab,
12 |
13 | "This method is included to demonstrate the PARTIALLY IMPLEMENTED
14 | "addition in the test class when implementing the test double
15 | say_hello RETURNING VALUE(hi) TYPE string.
16 |
17 | ENDINTERFACE.
18 |
19 | ******************************************************
20 | * Local class
21 | * The class implements the local interface.
22 | ******************************************************
23 | CLASS lcl_data_prov_local_itf DEFINITION.
24 | PUBLIC SECTION.
25 | INTERFACES lif_get_data.
26 | ENDCLASS.
27 |
28 | CLASS lcl_data_prov_local_itf IMPLEMENTATION.
29 |
30 | METHOD lif_get_data~select_flight_data.
31 |
32 | SELECT seatsmax, seatsocc
33 | FROM zdemo_abap_fli
34 | WHERE carrid = @carrier
35 | INTO CORRESPONDING FIELDS OF TABLE @flight_data.
36 |
37 | ENDMETHOD.
38 |
39 | METHOD lif_get_data~say_hello.
40 | hi = `Hello, ` && sy-uname && `.`.
41 | ENDMETHOD.
42 |
43 | ENDCLASS.
44 |
45 | ******************************************************
46 | * Local class that implements a global interface
47 | * It serves the purpose of a data provider. It can be
48 | * imagined as a global class, and a method that is
49 | * implemented there and called by the class under test
50 | * is identified as DOC. A local class is used in the
51 | * example to keep the number of separate artifacts small.
52 | ******************************************************
53 | CLASS lcl_data_prov_glo_itf DEFINITION.
54 | PUBLIC SECTION.
55 | INTERFACES zdemo_abap_get_data_itf.
56 | ENDCLASS.
57 |
58 | CLASS lcl_data_prov_glo_itf IMPLEMENTATION.
59 |
60 | METHOD zdemo_abap_get_data_itf~select_flight_data.
61 |
62 | SELECT seatsmax, seatsocc
63 | FROM zdemo_abap_fli
64 | WHERE carrid = @carrier
65 | INTO CORRESPONDING FIELDS OF TABLE @flight_data.
66 |
67 | ENDMETHOD.
68 |
69 | METHOD zdemo_abap_get_data_itf~say_hello.
70 | hi = `Hello, ` && sy-uname && `.`.
71 | ENDMETHOD.
72 |
73 | ENDCLASS.
74 |
--------------------------------------------------------------------------------
/src/zcl_demo_abap_unit_test.clas.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | ZCL_DEMO_ABAP_UNIT_TEST
7 | E
8 | ABAP cheat sheet: Unit tests
9 | 1
10 | X
11 | X
12 | X
13 | X
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/src/zcl_demo_abap_xml_json.clas.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | ZCL_DEMO_ABAP_XML_JSON
7 | E
8 | ABAP cheat sheet: Working with XML and JSON in ABAP
9 | 1
10 | X
11 | X
12 | X
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/src/zcx_demo_abap_error_a.clas.abap:
--------------------------------------------------------------------------------
1 | CLASS zcx_demo_abap_error_a DEFINITION
2 | PUBLIC
3 | INHERITING FROM cx_dynamic_check
4 | FINAL
5 | CREATE PUBLIC .
6 |
7 | PUBLIC SECTION.
8 |
9 | INTERFACES if_t100_message.
10 |
11 | CONSTANTS message_class TYPE symsgid VALUE 'ZDEMO_ABAP_MESSAGES'.
12 |
13 | CONSTANTS:
14 | BEGIN OF zcx_demo_abap_error_a,
15 | msgid TYPE symsgid VALUE message_class,
16 | msgno TYPE symsgno VALUE '001',
17 | attr1 TYPE scx_attrname VALUE '',
18 | attr2 TYPE scx_attrname VALUE '',
19 | attr3 TYPE scx_attrname VALUE '',
20 | attr4 TYPE scx_attrname VALUE '',
21 | END OF zcx_demo_abap_error_a.
22 |
23 | CONSTANTS:
24 | BEGIN OF error_002,
25 | msgid TYPE symsgid VALUE message_class,
26 | msgno TYPE symsgno VALUE '002',
27 | attr1 TYPE scx_attrname VALUE '',
28 | attr2 TYPE scx_attrname VALUE '',
29 | attr3 TYPE scx_attrname VALUE '',
30 | attr4 TYPE scx_attrname VALUE '',
31 | END OF error_002.
32 |
33 | CONSTANTS:
34 | BEGIN OF error_003,
35 | msgid TYPE symsgid VALUE message_class,
36 | msgno TYPE symsgno VALUE '003',
37 | attr1 TYPE scx_attrname VALUE 'P_003_A',
38 | attr2 TYPE scx_attrname VALUE 'P_003_B',
39 | attr3 TYPE scx_attrname VALUE '',
40 | attr4 TYPE scx_attrname VALUE '',
41 | END OF error_003.
42 |
43 | CONSTANTS:
44 | BEGIN OF error_004,
45 | msgid TYPE symsgid VALUE message_class,
46 | msgno TYPE symsgno VALUE '004',
47 | attr1 TYPE scx_attrname VALUE 'P_004_A',
48 | attr2 TYPE scx_attrname VALUE 'P_004_B',
49 | attr3 TYPE scx_attrname VALUE 'P_004_C',
50 | attr4 TYPE scx_attrname VALUE 'P_004_D',
51 | END OF error_004.
52 |
53 | CONSTANTS:
54 | BEGIN OF error_005,
55 | msgid TYPE symsgid VALUE message_class,
56 | msgno TYPE symsgno VALUE '005',
57 | attr1 TYPE scx_attrname VALUE 'P_005_A',
58 | attr2 TYPE scx_attrname VALUE 'P_005_B',
59 | attr3 TYPE scx_attrname VALUE 'P_005_C',
60 | attr4 TYPE scx_attrname VALUE 'P_005_D',
61 | END OF error_005.
62 |
63 | DATA p_003_a TYPE string.
64 | DATA p_003_b TYPE string.
65 | DATA p_004_a TYPE string.
66 | DATA p_004_b TYPE string.
67 | DATA p_004_c TYPE string.
68 | DATA p_004_d TYPE string.
69 | DATA p_005_a TYPE string.
70 | DATA p_005_b TYPE string.
71 | DATA p_005_c TYPE string.
72 | DATA p_005_d TYPE string.
73 |
74 | METHODS constructor
75 | IMPORTING
76 | textid LIKE if_t100_message=>t100key OPTIONAL
77 | previous LIKE previous OPTIONAL
78 | p_003_a TYPE string OPTIONAL
79 | p_003_b TYPE string OPTIONAL
80 | p_004_a TYPE string OPTIONAL
81 | p_004_b TYPE string OPTIONAL
82 | p_004_c TYPE string OPTIONAL
83 | p_004_d TYPE string OPTIONAL
84 | p_005_a TYPE string OPTIONAL
85 | p_005_b TYPE string OPTIONAL
86 | p_005_c TYPE string OPTIONAL
87 | p_005_d TYPE string OPTIONAL
88 | .
89 | PROTECTED SECTION.
90 | PRIVATE SECTION.
91 | ENDCLASS.
92 |
93 |
94 |
95 | CLASS zcx_demo_abap_error_a IMPLEMENTATION.
96 |
97 |
98 | METHOD constructor ##ADT_SUPPRESS_GENERATION.
99 |
100 | super->constructor( previous = previous ).
101 |
102 | me->p_003_a = p_003_a.
103 | me->p_003_b = p_003_b.
104 | me->p_004_a = p_004_a.
105 | me->p_004_b = p_004_b.
106 | me->p_004_c = p_004_c.
107 | me->p_004_d = p_004_d.
108 | me->p_005_a = p_005_a.
109 | me->p_005_b = p_005_b.
110 | me->p_005_c = p_005_c.
111 | me->p_005_d = p_005_d.
112 |
113 | CLEAR me->textid.
114 | IF textid IS INITIAL.
115 | if_t100_message~t100key = if_t100_message=>default_textid.
116 | ELSE.
117 | if_t100_message~t100key = textid.
118 | ENDIF.
119 | ENDMETHOD.
120 | ENDCLASS.
121 |
--------------------------------------------------------------------------------
/src/zcx_demo_abap_error_a.clas.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | ZCX_DEMO_ABAP_ERROR_A
7 | E
8 | ABAP cheat sheet exception class
9 | 40
10 | 1
11 | X
12 | X
13 | X
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/src/zcx_demo_abap_error_b.clas.abap:
--------------------------------------------------------------------------------
1 | CLASS zcx_demo_abap_error_b DEFINITION
2 | PUBLIC
3 | INHERITING FROM cx_static_check
4 | FINAL
5 | CREATE PUBLIC .
6 |
7 | PUBLIC SECTION.
8 |
9 | INTERFACES if_t100_message.
10 | INTERFACES if_t100_dyn_msg.
11 |
12 | METHODS constructor
13 | IMPORTING
14 | textid LIKE if_t100_message=>t100key OPTIONAL
15 | previous LIKE previous OPTIONAL.
16 | PROTECTED SECTION.
17 | PRIVATE SECTION.
18 | ENDCLASS.
19 |
20 |
21 |
22 | CLASS zcx_demo_abap_error_b IMPLEMENTATION.
23 | METHOD constructor ##ADT_SUPPRESS_GENERATION.
24 | super->constructor( previous = previous ).
25 |
26 | CLEAR me->textid.
27 | IF textid IS INITIAL.
28 | if_t100_message~t100key = if_t100_message=>default_textid.
29 | ELSE.
30 | if_t100_message~t100key = textid.
31 | ENDIF.
32 | ENDMETHOD.
33 | ENDCLASS.
34 |
--------------------------------------------------------------------------------
/src/zcx_demo_abap_error_b.clas.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | ZCX_DEMO_ABAP_ERROR_B
7 | E
8 | ABAP cheat sheet exception class
9 | 40
10 | 1
11 | X
12 | X
13 | X
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/src/zdemo_abap_abstract_ent.ddls.asddls:
--------------------------------------------------------------------------------
1 | @EndUserText.label: 'Demo abstract entity'
2 | define abstract entity zdemo_abap_abstract_ent
3 | {
4 | col1: abap.char(25);
5 | col2: abap.char(25);
6 | }
7 |
--------------------------------------------------------------------------------
/src/zdemo_abap_abstract_ent.ddls.baseinfo:
--------------------------------------------------------------------------------
1 | {
2 | "BASEINFO":
3 | {
4 | "FROM":
5 | [],
6 | "ASSOCIATED":
7 | [],
8 | "BASE":
9 | [],
10 | "ANNO_REF":
11 | [],
12 | "SCALAR_FUNCTION":
13 | [],
14 | "VERSION":0,
15 | "ANNOREF_EVALUATION_ERROR":""
16 | }
17 | }
--------------------------------------------------------------------------------
/src/zdemo_abap_abstract_ent.ddls.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | ZDEMO_ABAP_ABSTRACT_ENT
7 | E
8 | Demo abstract entity
9 | A
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/src/zdemo_abap_carr.tabl.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | ZDEMO_ABAP_CARR
7 | E
8 | TRANSP
9 | X
10 | Demo table: Airline
11 | E
12 | A
13 | 1
14 |
15 |
16 | ZDEMO_ABAP_CARR
17 | A
18 | 0
19 | APPL0
20 | N
21 |
22 |
23 |
24 | MANDT
25 | X
26 | 0
27 | C
28 | 000006
29 | X
30 | CLNT
31 | 000003
32 | CLNT
33 |
34 |
35 | CARRID
36 | X
37 | 0
38 | C
39 | 000006
40 | X
41 | CHAR
42 | 000003
43 | CHAR
44 |
45 |
46 | CARRNAME
47 | 0
48 | C
49 | 000040
50 | X
51 | CHAR
52 | 000020
53 | CHAR
54 |
55 |
56 | CURRCODE
57 | 0
58 | C
59 | 000010
60 | X
61 | CUKY
62 | 000005
63 | CUKY
64 |
65 |
66 | URL
67 | 0
68 | C
69 | 000510
70 | X
71 | CHAR
72 | 000255
73 | CHAR
74 |
75 |
76 |
77 |
78 | ZDEMO_ABAP_CARR
79 | CUS_DEV_SUP_DA
80 |
81 |
82 |
83 |
84 |
85 |
--------------------------------------------------------------------------------
/src/zdemo_abap_carr_ve.ddls.asddls:
--------------------------------------------------------------------------------
1 | @AccessControl.authorizationCheck: #NOT_REQUIRED
2 | define view entity ZDEMO_ABAP_CARR_VE
3 | as select from zdemo_abap_carr
4 | {
5 | key carrid,
6 | carrname,
7 | currcode,
8 | url
9 | }
10 |
--------------------------------------------------------------------------------
/src/zdemo_abap_carr_ve.ddls.baseinfo:
--------------------------------------------------------------------------------
1 | {
2 | "BASEINFO":
3 | {
4 | "FROM":
5 | [
6 | "ZDEMO_ABAP_CARR"
7 | ],
8 | "ASSOCIATED":
9 | [],
10 | "BASE":
11 | [],
12 | "ANNO_REF":
13 | [],
14 | "SCALAR_FUNCTION":
15 | [],
16 | "VERSION":0,
17 | "ANNOREF_EVALUATION_ERROR":""
18 | }
19 | }
--------------------------------------------------------------------------------
/src/zdemo_abap_carr_ve.ddls.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | ZDEMO_ABAP_CARR_VE
7 | E
8 | Demo CDS view entity
9 | W
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/src/zdemo_abap_cds_ve_agg_exp.ddls.asddls:
--------------------------------------------------------------------------------
1 | // ABAP CDS cheat sheet example:
2 | // Aggregate expressions in the element list of CDS view entities
3 | //
4 | //////////////////////////------ NOTES ------//////////////////////////////////
5 | // - CDS view entity selects from a demo database table
6 | // - Demonstrates various aggregate expressions in the element list
7 | // - As a prerequisite, run the class zcl_demo_abap_cds_ve to populate the
8 | // database tables of the example. Otherwise, no data is displayed.
9 | //
10 | //////////////////////------ DATA PREVIEW ------///////////////////////////////
11 | // - Choose F8 in ADT to open the data preview and check out the data displayed
12 | // - For comparing and checking the output, you can also open the data preview
13 | // for the database table. In ADT, press and hold CTRL and click the database
14 | // table name. In the opened table artifact, choose F8 to open the data preview.
15 | //
16 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
17 |
18 | @AccessControl.authorizationCheck: #NOT_REQUIRED
19 | @EndUserText.label: 'CDS view entity: Aggregate expressions'
20 | define view entity zdemo_abap_cds_ve_agg_exp
21 | as select from zdemo_abap_fli
22 |
23 | {
24 |
25 | // The element list intentionally includes few fields only to focus on the effect of aggregate expressions.
26 | key carrid,
27 | currency,
28 |
29 | // -------- Aggregate expressions --------
30 | // - Aggregate expressions can be used as elements of an element list. Other positions are possible.
31 | // - An alias name must be specified.
32 | // - A GROUP BY clause is required. It must list all non-aggregated fields from the element list.
33 | // - Additions: If ALL is used, all rows in the result set are respected. This is the default setting.
34 | // If DISTINCT is used, only distinct values of an argument are respected.
35 | // - Note: There may or may not be spaces between the parentheses following avg, min, etc., and the
36 | // content specified within.
37 |
38 | // AVG (Returns the average value of an argument)
39 | avg( seatsocc as abap.dec(15,2)) as avg_seats_occ,
40 | avg( cast(paymentsum as abap.dec(15, 2)) as abap.dec(15,2)) as avg_paysum,
41 |
42 | // SUM (Returns the sum of an argument)
43 | // Since a currency field is used in the example, an annotatin is required.
44 | @Semantics.amount.currencyCode: 'currency'
45 | sum(paymentsum) as total_paysum,
46 |
47 | // MIN (Returns the least value of an argument)
48 | min( seatsocc ) as min_occ_seats,
49 |
50 | // MAX (Returns the greatest value of an argument)
51 | max( seatsocc ) as max_occ_seats,
52 | max( all seatsocc ) as max_occ_seats_all, //Same result as above, ALL is optional
53 |
54 | // COUNT (Returns counted lines)
55 | count(*) as cnt, // * means that all lines are respected
56 | count(distinct planetype) as cnt_planetype //DISTINCT means that the number of dinstinct values if an argument is counted;
57 | //e.g. if 3 is returned, it means there are 3 different plane types among the result set
58 |
59 | }
60 | //GROUP BY clause that lists all non-aggregated fields from the element list
61 | group by
62 | carrid,
63 | currency
64 |
--------------------------------------------------------------------------------
/src/zdemo_abap_cds_ve_agg_exp.ddls.baseinfo:
--------------------------------------------------------------------------------
1 | {
2 | "BASEINFO":
3 | {
4 | "FROM":
5 | [
6 | "ZDEMO_ABAP_FLI"
7 | ],
8 | "ASSOCIATED":
9 | [],
10 | "BASE":
11 | [],
12 | "ANNO_REF":
13 | [],
14 | "SCALAR_FUNCTION":
15 | [],
16 | "VERSION":0,
17 | "ANNOREF_EVALUATION_ERROR":""
18 | }
19 | }
--------------------------------------------------------------------------------
/src/zdemo_abap_cds_ve_agg_exp.ddls.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | ZDEMO_ABAP_CDS_VE_AGG_EXP
7 | E
8 | CDS view entity: Aggregate expressions
9 | W
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/src/zdemo_abap_cds_ve_assoc.ddls.baseinfo:
--------------------------------------------------------------------------------
1 | {
2 | "BASEINFO":
3 | {
4 | "FROM":
5 | [
6 | "ZDEMO_ABAP_CDS_VE_ASSOC_E",
7 | "ZDEMO_ABAP_CARR",
8 | "ZDEMO_ABAP_FLI"
9 | ],
10 | "ASSOCIATED":
11 | [
12 | "ZDEMO_ABAP_CARR"
13 | ],
14 | "BASE":
15 | [],
16 | "ANNO_REF":
17 | [],
18 | "SCALAR_FUNCTION":
19 | [],
20 | "VERSION":0,
21 | "ANNOREF_EVALUATION_ERROR":""
22 | }
23 | }
--------------------------------------------------------------------------------
/src/zdemo_abap_cds_ve_assoc.ddls.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | ZDEMO_ABAP_CDS_VE_ASSOC
7 | E
8 | CDS view entity: Associations
9 | W
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/src/zdemo_abap_cds_ve_assoc_e.ddls.asddls:
--------------------------------------------------------------------------------
1 | // ABAP CDS cheat sheet example: Associations
2 | //
3 | //////////////////////////------ NOTES ------//////////////////////////////////
4 | // - CDS view entity that selects from a demo database table.
5 | // - The purpose of this CDS view entity is to demonstrate associations. The view
6 | // is used as a data source in another CDS view entity.
7 | // - As a prerequisite, run the class zcl_demo_abap_cds_ve to populate the
8 | // database tables of the example. Otherwise, no data is displayed.
9 | //
10 | //////////////////////------ DATA PREVIEW ------///////////////////////////////
11 | // - Choose F8 in ADT to open the data preview and check out the data displayed
12 | //
13 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
14 |
15 | @AccessControl.authorizationCheck: #NOT_REQUIRED
16 | @EndUserText.label: 'CDS view entity: Associations'
17 | define view entity zdemo_abap_cds_ve_assoc_e
18 | as select from zdemo_abap_flsch as _flsch
19 | association [1..1] to zdemo_abap_carr as _carr_exp on _flsch.carrid = _carr_exp.carrid
20 | association [1..*] to zdemo_abap_fli as _fli on _flsch.carrid = _fli.carrid and _flsch.connid = _fli.connid
21 |
22 | {
23 | key _flsch.carrid as Carrid,
24 | key _flsch.connid as Connid,
25 | _flsch.countryfr as Countryfr,
26 | _flsch.cityfrom as Cityfrom,
27 | _flsch.airpfrom as Airpfrom,
28 | _flsch.countryto as Countryto,
29 | _flsch.cityto as Cityto,
30 | _flsch.airpto as Airpto,
31 | _flsch.fltime as Fltime,
32 | _flsch.deptime as Deptime,
33 | _flsch.arrtime as Arrtime,
34 | _flsch.distance as Distance,
35 | _flsch.distid as Distid,
36 | _flsch.fltype as Fltype,
37 | _flsch.period as Period,
38 | _carr_exp,
39 | _fli
40 | }
41 |
--------------------------------------------------------------------------------
/src/zdemo_abap_cds_ve_assoc_e.ddls.baseinfo:
--------------------------------------------------------------------------------
1 | {
2 | "BASEINFO":
3 | {
4 | "FROM":
5 | [
6 | "ZDEMO_ABAP_FLSCH"
7 | ],
8 | "ASSOCIATED":
9 | [
10 | "ZDEMO_ABAP_CARR",
11 | "ZDEMO_ABAP_FLI"
12 | ],
13 | "BASE":
14 | [],
15 | "ANNO_REF":
16 | [],
17 | "SCALAR_FUNCTION":
18 | [],
19 | "VERSION":0,
20 | "ANNOREF_EVALUATION_ERROR":""
21 | }
22 | }
--------------------------------------------------------------------------------
/src/zdemo_abap_cds_ve_assoc_e.ddls.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | ZDEMO_ABAP_CDS_VE_ASSOC_E
7 | E
8 | CDS view entity: Associations
9 | W
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/src/zdemo_abap_cds_ve_joins.ddls.asddls:
--------------------------------------------------------------------------------
1 | // ABAP CDS cheat sheet example: Joins
2 | //
3 | //////////////////////////------ NOTES ------//////////////////////////////////
4 | // - CDS view entity selects from a demo database table
5 | // - Demonstrates various joins
6 | // - As a prerequisite, run the class zcl_demo_abap_cds_ve to populate the
7 | // database tables of the example. Otherwise, no data is displayed.
8 | // It is particularly needed in this case because it contains entries to
9 | // visualize the effect of outer joins.
10 | // - HOW TO:
11 | // - To reduce the number of separate artifacts, this example CDS view entity
12 | // contains the code for multiple joins, which is commented out.
13 | // - To test out various joins, you can comment out and comment in the
14 | // respective code sections (select the lines and choose CTRL + 7).
15 | // - The example for inner joins is commented in by default. The relevant
16 | // code sections are marked with "COMMENT IN/OUT ... START" and
17 | // "COMMENT IN/OUT ... END" in both SELECT and element list
18 | // (inner joins -> 1a / 1b). To test the left outer joins, for example,
19 | // comment out the respective sections of the inner join and comment in
20 | // the sections for left outer joins (2a, 2b), and so on.
21 | // - Once done, activate the view and choose F8 to open the data preview.
22 | // You must activate the view and choose F8 again for every change here
23 | // because the alias names are different.
24 | //
25 | //////////////////////------ DATA PREVIEW ------///////////////////////////////
26 | // - Choose F8 in ADT to open the data preview and check out the data displayed
27 | // - Note the hints above regarding commenting in/out of code.
28 | //
29 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
30 |
31 | @AccessControl.authorizationCheck: #NOT_REQUIRED
32 | @EndUserText.label: 'CDS view entity: Joins'
33 | define view entity zdemo_abap_cds_ve_joins
34 | as select from zdemo_abap_carr as _carr
35 |
36 | // Notes on joins:
37 | // - Joins combine two data sources into one result set, consisting of columns of both data sources
38 | // - Rows of the result set are determined by the join type and by join conditions between columns of the data sources
39 | // - Joins can be nested
40 | // - Inner or outer join must contain a join condition after ON
41 | // - Each element of the SELECT list must have the name of its data source as prefix
42 | // - When joins are used, a WHERE condition affects the result set
43 | // - The cardinality can be specified for left outer joins. For more details, see the ABAP Keyword Documentation.
44 |
45 | /////////////////// ----- Example for INNER JOIN ----- /////////////////////////////////
46 | // Notes:
47 | // - Joins all entries of the data sources whose fields match the ON condition
48 | // - In the table zdemo_abap_carr, there are entries in carrid that are not present in zdemo_abap_flsch.
49 | // The same is true the other way round. The result only contains those entries that exist in both data sources
50 | // based on the ON condition.
51 |
52 | //// ----> COMMENT IN/OUT 1a START <-----
53 | inner join zdemo_abap_flsch as _flsch_in on _carr.carrid = _flsch_in.carrid
54 | //// ----> COMMENT IN/OUT 1a END <-----
55 |
56 | //Alternative syntax: Specifying 'inner' is optional
57 | // join zdemo_abap_flsch
58 | // as _flsch_in on _carr.carrid = _flsch_in.carrid
59 |
60 | /////////////////// ----- Example for LEFT OUTER JOIN ----- /////////////////////////////////
61 | // Notes:
62 | // - The join selects all entries on the left side. Entries that match the ON condition have the same content as in the inner join.
63 | // In entries that do not match the ON condition, the elements on the right side have the null value.
64 | // - To demonstrate the effect, the table zdemo_abap_carr contains entries for carrid that are not present in zdemo_abap_flsch.
65 | // - Example in the element list:
66 | // - The coalesce function can be used to prevent null values in the result set.
67 | // - In the example, the function is used for an element to prevent null values.
68 |
69 | //// ----> COMMENT IN/OUT 2A START <-----
70 | // left outer join zdemo_abap_flsch as _flsch_lo on _carr.carrid = _flsch_lo.carrid
71 | //// ----> COMMENT IN/OUT 2A END <-----
72 |
73 | /////////////////// ----- Example for RIGHT OUTER JOIN ----- /////////////////////////////////
74 | // Notes:
75 | // - The join selects all entries on the right side. Entries that match the ON condition have the same content as in the inner join.
76 | // In entries that do not match the ON condition, the elements on the left side have the null value.
77 | // - To demonstrate the effect, the table zdemo_abap_carr contains entries for carrid that are not present in zdemo_abap_flsch.
78 | // - Example in the element list:
79 | // - Instead of the coalesce function, you can also use a CASE expression using a logical expression with IS [NOT] NULL
80 | // to prevent null values in the result set.
81 | // - In the example, a CASE expression is used for an element to prevent null values.
82 |
83 | //// ----> COMMENT IN/OUT 3A START <-----
84 | // right outer join zdemo_abap_flsch as _flsch_ro on _carr.carrid = _flsch_ro.carrid
85 | //// ----> COMMENT IN/OUT 3A END <-----
86 |
87 | /////////////////// ----- Example for CROSS JOIN ----- /////////////////////////////////
88 | // Notes:
89 | // - All entries on the left side are combined with all entries on the right side.
90 | // - It is not possible to specify an ON condition.
91 | //- The number of lines of the result is the number of left lines multiplied by the number of lines of the right table.
92 |
93 | //// ----> COMMENT IN/OUT 4A START <-----
94 | // cross join zdemo_abap_flsch as _flsch_cr
95 | //// ----> COMMENT IN/OUT 4A END <-----
96 |
97 | {
98 | key _carr.carrid,
99 | _carr.carrname,
100 |
101 | /////////////////// ----- Example for INNER JOIN ----- /////////////////////////////////
102 |
103 | // ----> COMMENT IN/OUT 1b START <-----
104 | _flsch_in.cityfrom as cityfr_in,
105 | _flsch_in.cityto as cityto_in
106 | // ----> COMMENT IN/OUT 1b END <-----
107 |
108 | /////////////////// ----- Example for LEFT OUTER JOIN ----- /////////////////////////////////
109 |
110 | //// ----> COMMENT IN/OUT 2b START <-----
111 | // _flsch_lo.cityfrom as cityfr_lo,
112 | // coalesce(_flsch_lo.cityto, '???') as cityto_lo
113 | //// ----> COMMENT IN/OUT 2b END <-----
114 |
115 | /////////////////// ----- Example for RIGHT OUTER JOIN ----- /////////////////////////////////
116 |
117 | //// ----> COMMENT IN/OUT 3b START <-----
118 | // case when _carr.url is not null then _carr.url
119 | // else '!!!'
120 | // end as url_ro,
121 | // _flsch_ro.cityfrom as cityfr_ro,
122 | // _flsch_ro.cityto as cityto_ro
123 | //// ----> COMMENT IN/OUT 3b END <-----
124 |
125 | /////////////////// ----- Example for CROSS JOIN ----- /////////////////////////////////
126 |
127 | //// ----> COMMENT IN/OUT 4b START <-----
128 | // _flsch_cr.cityfrom as cityfr_cr,
129 | // _flsch_cr.cityto as cityto_cr
130 | //// ----> COMMENT IN/OUT 4b END <-----
131 |
132 | }
133 |
--------------------------------------------------------------------------------
/src/zdemo_abap_cds_ve_joins.ddls.baseinfo:
--------------------------------------------------------------------------------
1 | {
2 | "BASEINFO":
3 | {
4 | "FROM":
5 | [
6 | "ZDEMO_ABAP_CARR",
7 | "ZDEMO_ABAP_FLSCH"
8 | ],
9 | "ASSOCIATED":
10 | [],
11 | "BASE":
12 | [],
13 | "ANNO_REF":
14 | [],
15 | "SCALAR_FUNCTION":
16 | [],
17 | "VERSION":0,
18 | "ANNOREF_EVALUATION_ERROR":""
19 | }
20 | }
--------------------------------------------------------------------------------
/src/zdemo_abap_cds_ve_joins.ddls.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | ZDEMO_ABAP_CDS_VE_JOINS
7 | E
8 | CDS view entity: Joins
9 | W
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/src/zdemo_abap_cds_ve_sel.ddls.baseinfo:
--------------------------------------------------------------------------------
1 | {
2 | "BASEINFO":
3 | {
4 | "FROM":
5 | [
6 | "ZDEMO_ABAP_FLI"
7 | ],
8 | "ASSOCIATED":
9 | [],
10 | "BASE":
11 | [],
12 | "ANNO_REF":
13 | [],
14 | "SCALAR_FUNCTION":
15 | [],
16 | "VERSION":0,
17 | "ANNOREF_EVALUATION_ERROR":""
18 | }
19 | }
--------------------------------------------------------------------------------
/src/zdemo_abap_cds_ve_sel.ddls.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | ZDEMO_ABAP_CDS_VE_SEL
7 | E
8 | CDS view entity: Operands and expressions
9 | W
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/src/zdemo_abap_draft.tabl.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | ZDEMO_ABAP_DRAFT
7 | E
8 | TRANSP
9 | X
10 | X
11 | Draft table for RAP calculator
12 | E
13 | X
14 | A
15 | 1
16 |
17 |
18 | ZDEMO_ABAP_DRAFT
19 | A
20 | 0
21 | APPL0
22 | N
23 |
24 |
25 |
26 | CLIENT
27 | X
28 | 0
29 | C
30 | 000006
31 | X
32 | CLNT
33 | 000003
34 | CLNT
35 |
36 |
37 | ID
38 | X
39 | SYSUUID_X16
40 | 0
41 | X
42 | E
43 |
44 |
45 | DRAFTUUID
46 | X
47 | SYSUUID_X16
48 | 0
49 | X
50 | E
51 |
52 |
53 | NUM1
54 | 0
55 | X
56 | 000004
57 | INT4
58 | 000010
59 | INT4
60 |
61 |
62 | ARITHM_OP
63 | 0
64 | C
65 | 000002
66 | CHAR
67 | 000001
68 | CHAR
69 |
70 |
71 | NUM2
72 | 0
73 | X
74 | 000004
75 | INT4
76 | 000010
77 | INT4
78 |
79 |
80 | CALC_RESULT
81 | 0
82 | g
83 | 000008
84 | STRG
85 | STRG
86 |
87 |
88 | CREA_DATE_TIME
89 | TIMESTAMPL
90 | 0
91 | E
92 |
93 |
94 | LCHG_DATE_TIME
95 | TIMESTAMPL
96 | 0
97 | E
98 |
99 |
100 | .INCLUDE
101 | 0
102 | SYCH_BDL_DRAFT_ADMIN_INC
103 | S
104 | Standard Include for Draft Administration (BDL Syntax Check)
105 | S
106 | %ADMIN
107 |
108 |
109 |
110 |
111 | ZDEMO_ABAP_DRAFT
112 | CUS_DEV_SUP_DA
113 |
114 |
115 |
116 |
117 |
118 |
--------------------------------------------------------------------------------
/src/zdemo_abap_fli.tabl.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | ZDEMO_ABAP_FLI
7 | E
8 | TRANSP
9 | X
10 | Demo table: Flight
11 | E
12 | A
13 | 1
14 |
15 |
16 | ZDEMO_ABAP_FLI
17 | A
18 | 0
19 | APPL0
20 | N
21 |
22 |
23 |
24 | MANDT
25 | X
26 | 0
27 | C
28 | 000006
29 | X
30 | CLNT
31 | 000003
32 | CLNT
33 |
34 |
35 | CARRID
36 | X
37 | 0
38 | C
39 | 000006
40 | X
41 | CHAR
42 | 000003
43 | CHAR
44 |
45 |
46 | CONNID
47 | X
48 | 0
49 | N
50 | 000008
51 | X
52 | NUMC
53 | 000004
54 | NUMC
55 |
56 |
57 | FLDATE
58 | X
59 | 0
60 | D
61 | 000016
62 | X
63 | DATS
64 | 000008
65 | DATS
66 | T
67 |
68 |
69 | PRICE
70 | 0
71 | P
72 | 000008
73 | ZDEMO_ABAP_FLI
74 | CURRENCY
75 | CURR
76 | 000015
77 | 000002
78 | CURR
79 |
80 |
81 | CURRENCY
82 | 0
83 | C
84 | 000010
85 | X
86 | CUKY
87 | 000005
88 | CUKY
89 |
90 |
91 | PLANETYPE
92 | 0
93 | C
94 | 000020
95 | X
96 | CHAR
97 | 000010
98 | CHAR
99 |
100 |
101 | SEATSMAX
102 | 0
103 | X
104 | 000004
105 | X
106 | INT4
107 | 000010
108 | INT4
109 |
110 |
111 | SEATSOCC
112 | 0
113 | X
114 | 000004
115 | X
116 | INT4
117 | 000010
118 | INT4
119 |
120 |
121 | PAYMENTSUM
122 | 0
123 | P
124 | 000009
125 | ZDEMO_ABAP_FLI
126 | CURRENCY
127 | X
128 | CURR
129 | 000017
130 | 000002
131 | CURR
132 |
133 |
134 | SEATSMAX_B
135 | 0
136 | X
137 | 000004
138 | X
139 | INT4
140 | 000010
141 | INT4
142 |
143 |
144 | SEATSOCC_B
145 | 0
146 | X
147 | 000004
148 | X
149 | INT4
150 | 000010
151 | INT4
152 |
153 |
154 | SEATSMAX_F
155 | 0
156 | X
157 | 000004
158 | X
159 | INT4
160 | 000010
161 | INT4
162 |
163 |
164 | SEATSOCC_F
165 | 0
166 | X
167 | 000004
168 | X
169 | INT4
170 | 000010
171 | INT4
172 |
173 |
174 |
175 |
176 | ZDEMO_ABAP_FLI
177 | CUS_DEV_SUP_DA
178 |
179 |
180 |
181 |
182 |
183 |
--------------------------------------------------------------------------------
/src/zdemo_abap_fli_ve.ddls.asddls:
--------------------------------------------------------------------------------
1 | @AccessControl.authorizationCheck: #NOT_REQUIRED
2 | define view entity ZDEMO_ABAP_FLI_VE
3 | as select from zdemo_abap_fli
4 | {
5 | key carrid,
6 | key connid,
7 | key fldate,
8 | price,
9 | currency,
10 | planetype,
11 | seatsmax,
12 | seatsocc,
13 | paymentsum,
14 | seatsmax_b,
15 | seatsocc_b,
16 | seatsmax_f,
17 | seatsocc_f
18 | }
19 |
--------------------------------------------------------------------------------
/src/zdemo_abap_fli_ve.ddls.baseinfo:
--------------------------------------------------------------------------------
1 | {
2 | "BASEINFO":
3 | {
4 | "FROM":
5 | [
6 | "ZDEMO_ABAP_FLI"
7 | ],
8 | "ASSOCIATED":
9 | [],
10 | "BASE":
11 | [],
12 | "ANNO_REF":
13 | [],
14 | "SCALAR_FUNCTION":
15 | [],
16 | "VERSION":0,
17 | "ANNOREF_EVALUATION_ERROR":""
18 | }
19 | }
--------------------------------------------------------------------------------
/src/zdemo_abap_fli_ve.ddls.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | ZDEMO_ABAP_FLI_VE
7 | E
8 | Demo CDS view entity
9 | W
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/src/zdemo_abap_flsch.tabl.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | ZDEMO_ABAP_FLSCH
7 | E
8 | TRANSP
9 | X
10 | Demo table: Flight schedule
11 | E
12 | X
13 | A
14 | 1
15 |
16 |
17 | ZDEMO_ABAP_FLSCH
18 | A
19 | 0
20 | APPL0
21 | N
22 |
23 |
24 |
25 | MANDT
26 | X
27 | 0
28 | C
29 | 000006
30 | X
31 | CLNT
32 | 000003
33 | CLNT
34 |
35 |
36 | CARRID
37 | X
38 | 0
39 | C
40 | 000006
41 | X
42 | CHAR
43 | 000003
44 | CHAR
45 |
46 |
47 | CONNID
48 | X
49 | 0
50 | N
51 | 000008
52 | X
53 | NUMC
54 | 000004
55 | NUMC
56 |
57 |
58 | COUNTRYFR
59 | 0
60 | C
61 | 000006
62 | CHAR
63 | 000003
64 | CHAR
65 |
66 |
67 | CITYFROM
68 | 0
69 | C
70 | 000040
71 | X
72 | CHAR
73 | 000020
74 | CHAR
75 |
76 |
77 | AIRPFROM
78 | 0
79 | C
80 | 000006
81 | X
82 | CHAR
83 | 000003
84 | CHAR
85 |
86 |
87 | COUNTRYTO
88 | 0
89 | C
90 | 000006
91 | CHAR
92 | 000003
93 | CHAR
94 |
95 |
96 | CITYTO
97 | 0
98 | C
99 | 000040
100 | X
101 | CHAR
102 | 000020
103 | CHAR
104 |
105 |
106 | AIRPTO
107 | 0
108 | C
109 | 000006
110 | X
111 | CHAR
112 | 000003
113 | CHAR
114 |
115 |
116 | FLTIME
117 | 0
118 | X
119 | 000004
120 | X
121 | INT4
122 | 000010
123 | INT4
124 |
125 |
126 | DEPTIME
127 | 0
128 | T
129 | 000012
130 | X
131 | TIMS
132 | 000006
133 | TIMS
134 | T
135 |
136 |
137 | ARRTIME
138 | 0
139 | T
140 | 000012
141 | X
142 | TIMS
143 | 000006
144 | TIMS
145 | T
146 |
147 |
148 | DISTANCE
149 | 0
150 | P
151 | 000005
152 | ZDEMO_ABAP_FLSCH
153 | DISTID
154 | X
155 | QUAN
156 | 000009
157 | 000004
158 | QUAN
159 |
160 |
161 | DISTID
162 | 0
163 | C
164 | 000006
165 | X
166 | UNIT
167 | 000003
168 | UNIT
169 |
170 |
171 | FLTYPE
172 | 0
173 | C
174 | 000002
175 | X
176 | CHAR
177 | 000001
178 | CHAR
179 |
180 |
181 | PERIOD
182 | 0
183 | X
184 | 000001
185 | X
186 | INT1
187 | 000003
188 | INT1
189 |
190 |
191 |
192 |
193 | ZDEMO_ABAP_FLSCH
194 | CUS_DEV_SUP_DA
195 |
196 |
197 |
198 |
199 |
200 |
--------------------------------------------------------------------------------
/src/zdemo_abap_flsch_ve.ddls.asddls:
--------------------------------------------------------------------------------
1 | @AccessControl.authorizationCheck: #NOT_REQUIRED
2 | define view entity ZDEMO_ABAP_FLSCH_VE
3 | as select from zdemo_abap_flsch
4 | {
5 | key carrid,
6 | key connid,
7 | countryfr,
8 | cityfrom,
9 | airpfrom,
10 | countryto,
11 | cityto,
12 | airpto,
13 | fltime,
14 | deptime,
15 | arrtime,
16 | distance,
17 | distid,
18 | fltype,
19 | period
20 | }
21 |
--------------------------------------------------------------------------------
/src/zdemo_abap_flsch_ve.ddls.baseinfo:
--------------------------------------------------------------------------------
1 | {
2 | "BASEINFO":
3 | {
4 | "FROM":
5 | [
6 | "ZDEMO_ABAP_FLSCH"
7 | ],
8 | "ASSOCIATED":
9 | [],
10 | "BASE":
11 | [],
12 | "ANNO_REF":
13 | [],
14 | "SCALAR_FUNCTION":
15 | [],
16 | "VERSION":0,
17 | "ANNOREF_EVALUATION_ERROR":""
18 | }
19 | }
--------------------------------------------------------------------------------
/src/zdemo_abap_flsch_ve.ddls.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | ZDEMO_ABAP_FLSCH_VE
7 | E
8 | Demo CDS view entity
9 | W
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/src/zdemo_abap_get_data_itf.intf.abap:
--------------------------------------------------------------------------------
1 | "! Interface supporting the ABAP Unit Tests example class
2 | "!
ABAP cheat sheet example interface
3 | "!
4 | "! Note
5 | "! Find the disclaimer in the ABAP Doc comment of class {@link zcl_demo_abap_aux}.
6 | INTERFACE zdemo_abap_get_data_itf
7 | PUBLIC.
8 |
9 | TYPES: carr_tab TYPE TABLE OF zdemo_abap_fli WITH EMPTY KEY,
10 | occ_rate TYPE p LENGTH 4 DECIMALS 2.
11 |
12 | METHODS: select_flight_data IMPORTING carrier TYPE zdemo_abap_fli-carrid
13 | RETURNING VALUE(flight_data) TYPE carr_tab,
14 | say_hello RETURNING VALUE(hi) TYPE string.
15 |
16 | ENDINTERFACE.
17 |
--------------------------------------------------------------------------------
/src/zdemo_abap_get_data_itf.intf.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | ZDEMO_ABAP_GET_DATA_ITF
7 | E
8 | Interface for ABAP cheat sheet example
9 | 2
10 | 1
11 | X
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/src/zdemo_abap_messages.msag.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | ZDEMO_ABAP_MESSAGES
7 | E
8 | ABAP cheat sheet message class
9 |
10 |
11 |
12 | E
13 | ZDEMO_ABAP_MESSAGES
14 | 001
15 | An error occured (Nr. 001)
16 |
17 |
18 | E
19 | ZDEMO_ABAP_MESSAGES
20 | 002
21 | Exception raised (Nr. 002)
22 |
23 |
24 | E
25 | ZDEMO_ABAP_MESSAGES
26 | 003
27 | Test message (Nr. 003) &1 &2
28 |
29 |
30 | E
31 | ZDEMO_ABAP_MESSAGES
32 | 004
33 | Message (Nr. 004) p1: "&1" p2: "&2" p3: "&3" p4: "&4"
34 |
35 |
36 | E
37 | ZDEMO_ABAP_MESSAGES
38 | 005
39 | &1 &2 &3 &4
40 |
41 |
42 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/src/zdemo_abap_objects_interface.intf.abap:
--------------------------------------------------------------------------------
1 | "! Interface supporting the ABAP object orientation example class
2 | "!
ABAP cheat sheet example interface
3 | "!
4 | "! Note
5 | "! Find the disclaimer in the ABAP Doc comment of class {@link zcl_demo_abap_aux}.
6 | INTERFACE zdemo_abap_objects_interface
7 | PUBLIC.
8 |
9 | METHODS: double IMPORTING i_op TYPE i
10 | RETURNING VALUE(r_double) TYPE i,
11 |
12 | triple DEFAULT IGNORE IMPORTING i_op TYPE i
13 | RETURNING VALUE(r_triple) TYPE i .
14 |
15 | DATA in_str TYPE string.
16 |
17 | CLASS-METHODS: halve IMPORTING i_op TYPE i
18 | RETURNING VALUE(r_halve) TYPE i.
19 |
20 | CLASS-DATA: stat_str TYPE string.
21 |
22 | CONSTANTS const_intf TYPE i VALUE 987.
23 |
24 | TYPES c3 TYPE c LENGTH 3.
25 | DATA add_result TYPE i.
26 | CLASS-DATA: subtr_result TYPE i.
27 | METHODS addition IMPORTING num1 TYPE i
28 | num2 TYPE i.
29 | CLASS-METHODS subtraction IMPORTING num1 TYPE i
30 | num2 TYPE i.
31 |
32 | METHODS meth_ignore DEFAULT IGNORE RETURNING VALUE(int) TYPE i.
33 | METHODS meth_fail DEFAULT FAIL RETURNING VALUE(int) TYPE i.
34 |
35 | ENDINTERFACE.
36 |
--------------------------------------------------------------------------------
/src/zdemo_abap_objects_interface.intf.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | ZDEMO_ABAP_OBJECTS_INTERFACE
7 | E
8 | Interface for ABAP cheat sheet example
9 | 2
10 | 1
11 | X
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/src/zdemo_abap_rap_calc_sd.srvd.srvdsrv:
--------------------------------------------------------------------------------
1 | @EndUserText.label: 'Service definition for RAP Calculator'
2 | define service ZDEMO_ABAP_RAP_CALC_SD {
3 | expose ZDEMO_ABAP_RAP_DRAFT_M;
4 | }
--------------------------------------------------------------------------------
/src/zdemo_abap_rap_calc_sd.srvd.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | ZDEMO_ABAP_RAP_CALC_SD
7 | SRVD/SRV
8 | Service definition for RAP Calculator
9 | EN
10 | EN
11 | ./zdemo_abap_rap_calc_sd/source/main
12 | ABAP_SOURCE
13 | ABAP Development Tools
14 | S
15 | Definition
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/src/zdemo_abap_rap_ch_m.ddls.asddls:
--------------------------------------------------------------------------------
1 | @AccessControl.authorizationCheck: #NOT_REQUIRED
2 | define view entity ZDEMO_ABAP_RAP_CH_M
3 | as select from zdemo_abap_rapt2
4 | association to parent ZDEMO_ABAP_RAP_RO_M
5 | as _parent on $projection.key_field = _parent.key_field
6 | {
7 | _parent,
8 | key key_field,
9 | key key_ch,
10 | field_ch1,
11 | field_ch2
12 | }
13 |
--------------------------------------------------------------------------------
/src/zdemo_abap_rap_ch_m.ddls.baseinfo:
--------------------------------------------------------------------------------
1 | {
2 | "BASEINFO":
3 | {
4 | "FROM":
5 | [
6 | "ZDEMO_ABAP_RAPT2"
7 | ],
8 | "ASSOCIATED":
9 | [
10 | "ZDEMO_ABAP_RAP_RO_M"
11 | ],
12 | "BASE":
13 | [],
14 | "ANNO_REF":
15 | [],
16 | "SCALAR_FUNCTION":
17 | [],
18 | "VERSION":0,
19 | "ANNOREF_EVALUATION_ERROR":""
20 | }
21 | }
--------------------------------------------------------------------------------
/src/zdemo_abap_rap_ch_m.ddls.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | ZDEMO_ABAP_RAP_CH_M
7 | E
8 | CDS view entity (child)
9 | W
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/src/zdemo_abap_rap_ch_u.ddls.asddls:
--------------------------------------------------------------------------------
1 | @AccessControl.authorizationCheck: #NOT_REQUIRED
2 | define view entity ZDEMO_ABAP_RAP_CH_U
3 | as select from zdemo_abap_rapt2
4 | association to parent ZDEMO_ABAP_RAP_RO_U
5 | as _parent on $projection.key_field = _parent.key_field
6 | {
7 | _parent,
8 | key key_field,
9 | key key_ch,
10 | field_ch1,
11 | field_ch2
12 | }
13 |
--------------------------------------------------------------------------------
/src/zdemo_abap_rap_ch_u.ddls.baseinfo:
--------------------------------------------------------------------------------
1 | {
2 | "BASEINFO":
3 | {
4 | "FROM":
5 | [
6 | "ZDEMO_ABAP_RAPT2"
7 | ],
8 | "ASSOCIATED":
9 | [
10 | "ZDEMO_ABAP_RAP_RO_U"
11 | ],
12 | "BASE":
13 | [],
14 | "ANNO_REF":
15 | [],
16 | "SCALAR_FUNCTION":
17 | [],
18 | "VERSION":0,
19 | "ANNOREF_EVALUATION_ERROR":""
20 | }
21 | }
--------------------------------------------------------------------------------
/src/zdemo_abap_rap_ch_u.ddls.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | ZDEMO_ABAP_RAP_CH_U
7 | E
8 | CDS view entity (child)
9 | W
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/src/zdemo_abap_rap_draft_m.bdef.asbdef:
--------------------------------------------------------------------------------
1 | managed implementation in class zbp_demo_abap_rap_draft_m unique;
2 | strict(2);
3 | with draft;
4 |
5 | define behavior for ZDEMO_ABAP_RAP_DRAFT_M alias calc
6 | persistent table zdemo_abap_tabca
7 | draft table zdemo_abap_draft
8 | lock master
9 | total etag crea_date_time
10 | etag master lchg_date_time
11 | authorization master ( global )
12 | late numbering
13 | {
14 | create;
15 | update;
16 | delete;
17 | field ( readonly ) id, calc_result, crea_date_time, lchg_date_time;
18 | field ( mandatory ) num1, num2, arithm_op;
19 | static action delete_all;
20 | internal action calculation;
21 | side effects { field num1 affects field calc_result;
22 | field num2 affects field calc_result;
23 | field arithm_op affects field calc_result; }
24 | validation validate on save { create; field num1, arithm_op, num2; }
25 | determination det_modify on modify { field num1, num2, arithm_op; }
26 | draft action Resume;
27 | draft action Edit;
28 | draft action Activate optimized;
29 | draft action Discard;
30 | draft determine action Prepare
31 | {
32 | validation validate;
33 | }
34 | }
--------------------------------------------------------------------------------
/src/zdemo_abap_rap_draft_m.bdef.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | ZDEMO_ABAP_RAP_DRAFT_M
7 | BDEF/BDO
8 | BDEF, managed, draft, late numbering
9 | 60
10 | EN
11 |
12 | -
13 | ./zdemo_abap_rap_draft_m/source/main/versions
14 | http://www.sap.com/adt/relations/versions
15 | Historic versions
16 |
17 | -
18 | ./zdemo_abap_rap_draft_m/source/main
19 | http://www.sap.com/adt/relations/source
20 | text/plain
21 | Source Content
22 |
23 | -
24 | ./zdemo_abap_rap_draft_m/source/main
25 | http://www.sap.com/adt/relations/source
26 | text/html
27 | Source Content (HTML)
28 |
29 |
30 | EN
31 | 5
32 | ./zdemo_abap_rap_draft_m/source/main
33 | ABAP_SOURCE
34 | true
35 | true
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/src/zdemo_abap_rap_draft_m.ddls.asddls:
--------------------------------------------------------------------------------
1 | @AccessControl.authorizationCheck: #NOT_REQUIRED
2 |
3 | @ObjectModel.semanticKey: ['id']
4 | @UI: {
5 | headerInfo: {
6 | typeName: 'Calculation',
7 | typeNamePlural: 'Calculations',
8 | title: { type: #STANDARD, value: 'id' }
9 | }
10 | }
11 |
12 | define root view entity ZDEMO_ABAP_RAP_DRAFT_M
13 | as select from zdemo_abap_tabca
14 | {
15 |
16 | @UI.facet: [
17 | {
18 | id: 'calc',
19 | purpose: #STANDARD,
20 | type: #IDENTIFICATION_REFERENCE,
21 | label: 'Calculation',
22 | position: 10
23 | }]
24 |
25 | @EndUserText.label: 'Calculation ID'
26 | @UI: { lineItem: [ { importance: #HIGH, position: 10,
27 | label: 'Calculation ID' },
28 | { type: #FOR_ACTION, dataAction: 'delete_all',
29 | label: 'Delete All Persisted Calculations' } ],
30 | fieldGroup: [ { qualifier: 'Fieldgroup:HeaderItems',
31 | position: 10 } ] }
32 | key id,
33 | @UI: { lineItem: [ { importance: #HIGH, position: 20,
34 | label: '1st Operand' } ],
35 | identification: [ { position: 20,
36 | label: '1st Operand' } ],
37 | fieldGroup: [ { qualifier: 'CaluclationItems',
38 | position: 10 } ] }
39 | num1,
40 | @UI: { lineItem: [ { importance: #HIGH, position: 30,
41 | label: 'Operator' } ],
42 | identification: [ { position: 30, label: 'Operator' } ],
43 | fieldGroup: [ { qualifier: 'CaluclationItems',
44 | position: 20 } ] }
45 | arithm_op,
46 | @UI: { lineItem: [ { importance: #HIGH, position: 40,
47 | label: '2nd Operand' } ],
48 | identification: [ { position: 40,
49 | label: '2nd Operand' } ],
50 | fieldGroup: [ { qualifier: 'CaluclationItems',
51 | position: 30 } ] }
52 | num2,
53 | @UI: { lineItem: [ { importance: #HIGH, position: 50,
54 | label: 'Result' } ],
55 | identification: [ { position: 50, label: 'Result' } ],
56 | fieldGroup: [ { qualifier: 'CaluclationItems',
57 | position: 40 } ] }
58 | calc_result,
59 | @UI: { hidden: true }
60 | @Semantics.systemDateTime.lastChangedAt: true
61 | crea_date_time,
62 | @EndUserText.label: 'Last Changed At'
63 | @UI: { fieldGroup: [ { qualifier: 'Fieldgroup:HeaderItems',
64 | position: 20 } ] }
65 | @Semantics.systemDateTime.localInstanceLastChangedAt: true
66 | lchg_date_time
67 | }
68 |
--------------------------------------------------------------------------------
/src/zdemo_abap_rap_draft_m.ddls.baseinfo:
--------------------------------------------------------------------------------
1 | {
2 | "BASEINFO":
3 | {
4 | "FROM":
5 | [
6 | "ZDEMO_ABAP_TABCA"
7 | ],
8 | "ASSOCIATED":
9 | [],
10 | "BASE":
11 | [],
12 | "ANNO_REF":
13 | [],
14 | "SCALAR_FUNCTION":
15 | [],
16 | "VERSION":0,
17 | "ANNOREF_EVALUATION_ERROR":""
18 | }
19 | }
--------------------------------------------------------------------------------
/src/zdemo_abap_rap_draft_m.ddls.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | ZDEMO_ABAP_RAP_DRAFT_M
7 | E
8 | CDS root view entity
9 | W
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/src/zdemo_abap_rap_ro_m.bdef.asbdef:
--------------------------------------------------------------------------------
1 | managed implementation in class zbp_demo_abap_rap_ro_m unique;
2 | strict(2);
3 |
4 | define behavior for ZDEMO_ABAP_RAP_RO_M alias root
5 | persistent table zdemo_abap_rapt1
6 | lock master
7 | authorization master ( global )
8 |
9 | {
10 | create;
11 | update;
12 | delete;
13 | association _child { create; }
14 | action multiply_by_2;
15 | validation val on save { field field3; }
16 | determination det_add_text on save { create; }
17 | field ( readonly:update ) key_field;
18 | }
19 |
20 | define behavior for ZDEMO_ABAP_RAP_CH_M alias child
21 | persistent table zdemo_abap_rapt2
22 | lock dependent by _parent
23 | authorization dependent by _parent
24 | {
25 | update;
26 | delete;
27 | field ( readonly ) key_field;
28 | field ( readonly:update ) key_ch;
29 | association _parent;
30 | }
--------------------------------------------------------------------------------
/src/zdemo_abap_rap_ro_m.bdef.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | ZDEMO_ABAP_RAP_RO_M
7 | BDEF/BDO
8 | BDEF, managed, external numbering
9 | 60
10 | EN
11 |
12 | -
13 | ./zdemo_abap_rap_ro_m/source/main/versions
14 | http://www.sap.com/adt/relations/versions
15 | Historic versions
16 |
17 | -
18 | ./zdemo_abap_rap_ro_m/source/main
19 | http://www.sap.com/adt/relations/source
20 | text/plain
21 | Source Content
22 |
23 | -
24 | ./zdemo_abap_rap_ro_m/source/main
25 | http://www.sap.com/adt/relations/source
26 | text/html
27 | Source Content (HTML)
28 |
29 |
30 | EN
31 | 5
32 | ./zdemo_abap_rap_ro_m/source/main
33 | ABAP_SOURCE
34 | true
35 | true
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/src/zdemo_abap_rap_ro_m.ddls.asddls:
--------------------------------------------------------------------------------
1 | @AccessControl.authorizationCheck: #NOT_REQUIRED
2 | define root view entity ZDEMO_ABAP_RAP_RO_M
3 | as select from zdemo_abap_rapt1
4 | composition [0..*] of ZDEMO_ABAP_RAP_CH_M as _child
5 | {
6 | key key_field,
7 | field1,
8 | field2,
9 | field3,
10 | field4,
11 | _child
12 | }
13 |
--------------------------------------------------------------------------------
/src/zdemo_abap_rap_ro_m.ddls.baseinfo:
--------------------------------------------------------------------------------
1 | {
2 | "BASEINFO":
3 | {
4 | "FROM":
5 | [
6 | "ZDEMO_ABAP_RAPT1"
7 | ],
8 | "ASSOCIATED":
9 | [
10 | "ZDEMO_ABAP_RAP_CH_M"
11 | ],
12 | "BASE":
13 | [],
14 | "ANNO_REF":
15 | [],
16 | "SCALAR_FUNCTION":
17 | [],
18 | "VERSION":0,
19 | "ANNOREF_EVALUATION_ERROR":""
20 | }
21 | }
--------------------------------------------------------------------------------
/src/zdemo_abap_rap_ro_m.ddls.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | ZDEMO_ABAP_RAP_RO_M
7 | E
8 | CDS root view entity
9 | W
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/src/zdemo_abap_rap_ro_m_as.bdef.asbdef:
--------------------------------------------------------------------------------
1 | managed with additional save with full data
2 | implementation in class zbp_demo_abap_rap_ro_m_as unique;
3 | strict ( 2 );
4 |
5 | define behavior for ZDEMO_ABAP_RAP_RO_M_AS alias root
6 | persistent table zdemo_abap_tabca
7 | lock master
8 | authorization master ( global )
9 |
10 | {
11 | create;
12 | update;
13 | delete;
14 | internal action calc;
15 | event created;
16 | event updated parameter zdemo_abap_abstract_ent;
17 | event deleted parameter zdemo_abap_abstract_ent;
18 | field ( numbering : managed, readonly : update ) id;
19 | //determination det_save on save { field calc_result; }
20 | determination det_modify on modify { field num1, num2, arithm_op; }
21 | }
--------------------------------------------------------------------------------
/src/zdemo_abap_rap_ro_m_as.bdef.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | ZDEMO_ABAP_RAP_RO_M_AS
7 | BDEF/BDO
8 | BDEF: managed BO, unmanaged save, external numbering
9 | 60
10 | EN
11 |
12 | -
13 | ./zdemo_abap_rap_ro_m_as/source/main/versions
14 | http://www.sap.com/adt/relations/versions
15 | Historic versions
16 |
17 | -
18 | ./zdemo_abap_rap_ro_m_as/source/main
19 | http://www.sap.com/adt/relations/source
20 | text/plain
21 | Source Content
22 |
23 | -
24 | ./zdemo_abap_rap_ro_m_as/source/main
25 | http://www.sap.com/adt/relations/source
26 | text/html
27 | Source Content (HTML)
28 |
29 |
30 | EN
31 | 5
32 | ./zdemo_abap_rap_ro_m_as/source/main
33 | ABAP_SOURCE
34 | true
35 | true
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/src/zdemo_abap_rap_ro_m_as.ddls.asddls:
--------------------------------------------------------------------------------
1 | @AccessControl.authorizationCheck: #NOT_REQUIRED
2 | define root view entity ZDEMO_ABAP_RAP_RO_M_AS
3 | as select from zdemo_abap_tabca
4 | {
5 | key id,
6 | num1,
7 | arithm_op,
8 | num2,
9 | calc_result,
10 | @Semantics.systemDateTime.createdAt: true
11 | crea_date_time,
12 | @Semantics.systemDateTime.lastChangedAt: true
13 | lchg_date_time
14 | }
15 |
--------------------------------------------------------------------------------
/src/zdemo_abap_rap_ro_m_as.ddls.baseinfo:
--------------------------------------------------------------------------------
1 | {
2 | "BASEINFO":
3 | {
4 | "FROM":
5 | [
6 | "ZDEMO_ABAP_TABCA"
7 | ],
8 | "ASSOCIATED":
9 | [],
10 | "BASE":
11 | [],
12 | "ANNO_REF":
13 | [],
14 | "SCALAR_FUNCTION":
15 | [],
16 | "VERSION":0,
17 | "ANNOREF_EVALUATION_ERROR":""
18 | }
19 | }
--------------------------------------------------------------------------------
/src/zdemo_abap_rap_ro_m_as.ddls.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | ZDEMO_ABAP_RAP_RO_M_AS
7 | E
8 | CDS root view entity
9 | W
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/src/zdemo_abap_rap_ro_u.bdef.asbdef:
--------------------------------------------------------------------------------
1 | unmanaged implementation in class zbp_demo_abap_rap_ro_u unique;
2 | strict(2);
3 |
4 | define behavior for ZDEMO_ABAP_RAP_RO_U alias root
5 | lock master
6 | authorization master ( global, instance )
7 |
8 | {
9 | create;
10 | update;
11 | delete;
12 | association _child { create; }
13 | action multiply_by_2;
14 | action ( features : instance ) multiply_by_3;
15 | action ( features : global ) set_z;
16 | field ( readonly:update ) key_field;
17 | }
18 |
19 | define behavior for ZDEMO_ABAP_RAP_CH_U alias child
20 | lock dependent by _parent
21 | authorization dependent by _parent
22 | {
23 | field ( readonly ) key_field;
24 | field ( readonly : update ) key_ch;
25 | association _parent;
26 | }
--------------------------------------------------------------------------------
/src/zdemo_abap_rap_ro_u.bdef.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | ZDEMO_ABAP_RAP_RO_U
7 | BDEF/BDO
8 | BDEF, unmanaged, external numbering
9 | 60
10 | EN
11 |
12 | -
13 | ./zdemo_abap_rap_ro_u/source/main/versions
14 | http://www.sap.com/adt/relations/versions
15 | Historic versions
16 |
17 | -
18 | ./zdemo_abap_rap_ro_u/source/main
19 | http://www.sap.com/adt/relations/source
20 | text/plain
21 | Source Content
22 |
23 | -
24 | ./zdemo_abap_rap_ro_u/source/main
25 | http://www.sap.com/adt/relations/source
26 | text/html
27 | Source Content (HTML)
28 |
29 |
30 | EN
31 | 5
32 | ./zdemo_abap_rap_ro_u/source/main
33 | ABAP_SOURCE
34 | true
35 | true
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/src/zdemo_abap_rap_ro_u.ddls.asddls:
--------------------------------------------------------------------------------
1 | @AccessControl.authorizationCheck: #NOT_REQUIRED
2 | define root view entity ZDEMO_ABAP_RAP_RO_U
3 | as select from zdemo_abap_rapt1
4 | composition [0..*] of ZDEMO_ABAP_RAP_CH_U as _child
5 | {
6 | key key_field,
7 | field1,
8 | field2,
9 | field3,
10 | field4,
11 | _child
12 | }
13 |
--------------------------------------------------------------------------------
/src/zdemo_abap_rap_ro_u.ddls.baseinfo:
--------------------------------------------------------------------------------
1 | {
2 | "BASEINFO":
3 | {
4 | "FROM":
5 | [
6 | "ZDEMO_ABAP_RAPT1"
7 | ],
8 | "ASSOCIATED":
9 | [
10 | "ZDEMO_ABAP_RAP_CH_U"
11 | ],
12 | "BASE":
13 | [],
14 | "ANNO_REF":
15 | [],
16 | "SCALAR_FUNCTION":
17 | [],
18 | "VERSION":0,
19 | "ANNOREF_EVALUATION_ERROR":""
20 | }
21 | }
--------------------------------------------------------------------------------
/src/zdemo_abap_rap_ro_u.ddls.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | ZDEMO_ABAP_RAP_RO_U
7 | E
8 | CDS root view entity
9 | W
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/src/zdemo_abap_rapt1.tabl.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | ZDEMO_ABAP_RAPT1
7 | E
8 | TRANSP
9 | X
10 | Demo table for RAP
11 | E
12 | X
13 | A
14 | 1
15 |
16 |
17 | ZDEMO_ABAP_RAPT1
18 | A
19 | 0
20 | APPL0
21 | N
22 |
23 |
24 |
25 | CLIENT
26 | X
27 | 0
28 | C
29 | 000006
30 | X
31 | CLNT
32 | 000003
33 | CLNT
34 |
35 |
36 | KEY_FIELD
37 | X
38 | 0
39 | X
40 | 000004
41 | X
42 | INT4
43 | 000010
44 | INT4
45 |
46 |
47 | FIELD1
48 | 0
49 | C
50 | 000020
51 | CHAR
52 | 000010
53 | CHAR
54 |
55 |
56 | FIELD2
57 | 0
58 | C
59 | 000020
60 | CHAR
61 | 000010
62 | CHAR
63 |
64 |
65 | FIELD3
66 | 0
67 | X
68 | 000004
69 | INT4
70 | 000010
71 | INT4
72 |
73 |
74 | FIELD4
75 | 0
76 | X
77 | 000004
78 | INT4
79 | 000010
80 | INT4
81 |
82 |
83 |
84 |
85 | ZDEMO_ABAP_RAPT1
86 | CUS_DEV_SUP_DA
87 |
88 |
89 |
90 |
91 |
92 |
--------------------------------------------------------------------------------
/src/zdemo_abap_rapt2.tabl.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | ZDEMO_ABAP_RAPT2
7 | E
8 | TRANSP
9 | X
10 | Demo table for RAP
11 | E
12 | X
13 | A
14 | 1
15 |
16 |
17 | ZDEMO_ABAP_RAPT2
18 | A
19 | 0
20 | APPL0
21 | N
22 |
23 |
24 |
25 | CLIENT
26 | X
27 | 0
28 | C
29 | 000006
30 | X
31 | CLNT
32 | 000003
33 | CLNT
34 |
35 |
36 | KEY_FIELD
37 | X
38 | 0
39 | X
40 | 000004
41 | X
42 | INT4
43 | 000010
44 | INT4
45 |
46 |
47 | KEY_CH
48 | X
49 | 0
50 | X
51 | 000004
52 | X
53 | INT4
54 | 000010
55 | INT4
56 |
57 |
58 | FIELD_CH1
59 | 0
60 | C
61 | 000020
62 | CHAR
63 | 000010
64 | CHAR
65 |
66 |
67 | FIELD_CH2
68 | 0
69 | X
70 | 000004
71 | INT4
72 | 000010
73 | INT4
74 |
75 |
76 |
77 |
78 | ZDEMO_ABAP_RAPT2
79 | CUS_DEV_SUP_DA
80 |
81 |
82 |
83 |
84 |
85 |
--------------------------------------------------------------------------------
/src/zdemo_abap_st_carrhtml.xslt.source.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | Carrier Information
9 |
10 |
11 |
12 | ID
13 | |
14 |
15 | Name
16 | |
17 |
18 | Currency
19 | |
20 |
21 | Website
22 | |
23 |
24 |
25 |
26 |
27 |
28 | |
29 |
30 |
31 | |
32 |
33 |
34 | |
35 |
36 |
37 |
38 |
39 |
40 | |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/src/zdemo_abap_st_carrhtml.xslt.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | ZDEMO_ABAP_ST_CARRHTML
7 | E
8 | ST Demo
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/src/zdemo_abap_st_strhtml.xslt.source.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | String Table Content
8 |
9 |
10 |
11 |
12 |
13 | |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/src/zdemo_abap_st_strhtml.xslt.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | ZDEMO_ABAP_ST_STRHTML
7 | E
8 | ST Demo
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/src/zdemo_abap_tab1.tabl.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | ZDEMO_ABAP_TAB1
7 | E
8 | TRANSP
9 | X
10 | Demo table
11 | E
12 | X
13 | A
14 | 1
15 |
16 |
17 | ZDEMO_ABAP_TAB1
18 | A
19 | 0
20 | APPL0
21 | N
22 |
23 |
24 |
25 | CLIENT
26 | X
27 | 0
28 | C
29 | 000006
30 | X
31 | CLNT
32 | 000003
33 | CLNT
34 |
35 |
36 | KEY_FIELD
37 | X
38 | 0
39 | X
40 | 000004
41 | X
42 | INT4
43 | 000010
44 | INT4
45 |
46 |
47 | CHAR1
48 | 0
49 | C
50 | 000020
51 | CHAR
52 | 000010
53 | CHAR
54 |
55 |
56 | CHAR2
57 | 0
58 | C
59 | 000020
60 | CHAR
61 | 000010
62 | CHAR
63 |
64 |
65 | NUM1
66 | 0
67 | X
68 | 000004
69 | INT4
70 | 000010
71 | INT4
72 |
73 |
74 | NUM2
75 | 0
76 | X
77 | 000004
78 | INT4
79 | 000010
80 | INT4
81 |
82 |
83 |
84 |
85 | ZDEMO_ABAP_TAB1
86 | CUS_DEV_SUP_DA
87 |
88 |
89 |
90 |
91 |
92 |
--------------------------------------------------------------------------------
/src/zdemo_abap_tab2.tabl.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | ZDEMO_ABAP_TAB2
7 | E
8 | TRANSP
9 | X
10 | Demo table
11 | E
12 | X
13 | A
14 | 1
15 |
16 |
17 | ZDEMO_ABAP_TAB2
18 | A
19 | 0
20 | APPL0
21 | N
22 |
23 |
24 |
25 | CLIENT
26 | X
27 | 0
28 | C
29 | 000006
30 | X
31 | CLNT
32 | 000003
33 | CLNT
34 |
35 |
36 | KEY_FIELD
37 | X
38 | 0
39 | X
40 | 000004
41 | X
42 | INT4
43 | 000010
44 | INT4
45 |
46 |
47 | CHAR1
48 | 0
49 | C
50 | 000020
51 | CHAR
52 | 000010
53 | CHAR
54 |
55 |
56 | NUM1
57 | 0
58 | X
59 | 000004
60 | INT4
61 | 000010
62 | INT4
63 |
64 |
65 | NUMLONG
66 | 0
67 | 8
68 | 000008
69 | INT8
70 | 000019
71 | INT8
72 |
73 |
74 |
75 |
76 | ZDEMO_ABAP_TAB2
77 | CUS_DEV_SUP_DA
78 |
79 |
80 |
81 |
82 |
83 |
--------------------------------------------------------------------------------
/src/zdemo_abap_tabca.tabl.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | ZDEMO_ABAP_TABCA
7 | E
8 | TRANSP
9 | X
10 | Demo table for RAP calculator
11 | E
12 | X
13 | A
14 | 1
15 |
16 |
17 | ZDEMO_ABAP_TABCA
18 | A
19 | 0
20 | APPL0
21 | N
22 |
23 |
24 |
25 | CLIENT
26 | X
27 | 0
28 | C
29 | 000006
30 | X
31 | CLNT
32 | 000003
33 | CLNT
34 |
35 |
36 | ID
37 | X
38 | SYSUUID_X16
39 | 0
40 | X
41 | E
42 |
43 |
44 | NUM1
45 | 0
46 | X
47 | 000004
48 | INT4
49 | 000010
50 | INT4
51 |
52 |
53 | ARITHM_OP
54 | 0
55 | C
56 | 000002
57 | CHAR
58 | 000001
59 | CHAR
60 |
61 |
62 | NUM2
63 | 0
64 | X
65 | 000004
66 | INT4
67 | 000010
68 | INT4
69 |
70 |
71 | CALC_RESULT
72 | 0
73 | g
74 | 000008
75 | STRG
76 | STRG
77 |
78 |
79 | CREA_DATE_TIME
80 | TIMESTAMPL
81 | 0
82 | E
83 |
84 |
85 | LCHG_DATE_TIME
86 | TIMESTAMPL
87 | 0
88 | E
89 |
90 |
91 |
92 |
93 | ZDEMO_ABAP_TABCA
94 | CUS_DEV_SUP_DA
95 |
96 |
97 |
98 |
99 |
100 |
--------------------------------------------------------------------------------
/src/zdemo_abap_table_function.ddls.asddls:
--------------------------------------------------------------------------------
1 | @AccessControl.authorizationCheck: #NOT_REQUIRED
2 | @ClientHandling.type: #CLIENT_DEPENDENT
3 | @ClientHandling.algorithm: #SESSION_VARIABLE
4 | define table function ZDEMO_ABAP_TABLE_FUNCTION
5 | returns
6 | {
7 | client : abap.clnt;
8 | carrier_id : abap.char(3);
9 | carrier_name : abap.char(20);
10 | connections : abap.string;
11 | avg_flight_time : abap.decfloat34;
12 | avg_distance : abap.decfloat34;
13 | }
14 | implemented by method
15 | zcl_demo_abap_amdp=>flight_analysis;
16 |
--------------------------------------------------------------------------------
/src/zdemo_abap_table_function.ddls.baseinfo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-cheat-sheets/dadf4de59c64848cb40fa34f415103999ced7ad2/src/zdemo_abap_table_function.ddls.baseinfo
--------------------------------------------------------------------------------
/src/zdemo_abap_table_function.ddls.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | ZDEMO_ABAP_TABLE_FUNCTION
7 | E
8 | ABAP Demo: Table function
9 | F
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/src/zdemo_abap_xslt_fl.xslt.source.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/src/zdemo_abap_xslt_fl.xslt.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | ZDEMO_ABAP_XSLT_FL
7 | E
8 | XSLT Demo
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/src/ztcl_demo_abap_unit_tdf_testcl.clas.abap:
--------------------------------------------------------------------------------
1 | "! Test Class Supporting an ABAP Unit Test Example
ABAP cheat sheet example class
2 | "!
3 | "! The example class {@link zcl_demo_abap_unit_tdf} demonstrates managing dependencies (dependent-on-components, DOC)
4 | "! with ABAP Unit and explores the creation of test doubles using ABAP frameworks.
5 | "! This global class is empty, but the the Test Classes tab includes a test class. Using the syntax
6 | "! "! @testing ..., a test relation between this test class and another global class
7 | "! ({@link zcl_demo_abap_unit_tdf}) is defined. Therefore, when you run unit tests of class {@link zcl_demo_abap_unit_tdf},
8 | "! the tests contained in the class {@link ztcl_demo_abap_unit_tdf_testcl} are executed.
9 | "!
10 | "! Information
11 | "! Find information on getting started with the example class and the disclaimer in
12 | "! the ABAP Doc comment of class {@link zcl_demo_abap_aux}.
13 | CLASS ztcl_demo_abap_unit_tdf_testcl DEFINITION
14 | PUBLIC
15 | FINAL
16 | CREATE PUBLIC .
17 |
18 | PUBLIC SECTION.
19 | PROTECTED SECTION.
20 | PRIVATE SECTION.
21 | ENDCLASS.
22 |
23 | CLASS ztcl_demo_abap_unit_tdf_testcl IMPLEMENTATION.
24 |
25 | ENDCLASS.
26 |
--------------------------------------------------------------------------------
/src/ztcl_demo_abap_unit_tdf_testcl.clas.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | ZTCL_DEMO_ABAP_UNIT_TDF_TESTCL
7 | E
8 | ABAP cheat sheet: Creating Test Doubles Using ABAP Framework
9 | 1
10 | X
11 | X
12 | X
13 | X
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------