├── .abapgit.xml
├── CONTRIBUTING.md
├── LICENSE
├── LICENSES
└── Apache-2.0.txt
├── README.md
├── REUSE.toml
├── exercises
├── ex0
│ ├── README.md
│ ├── assets
│ │ └── sample_image.png
│ └── images
│ │ ├── Console_result.png
│ │ ├── add_to_favorite_packages.png
│ │ ├── packages_0030.png
│ │ └── run_via_f9_0020.png
├── ex1
│ ├── README.md
│ └── images
│ │ ├── 001-find-interface.png
│ │ ├── 002-start-generator.png
│ │ ├── 003-odata-ui-service.png
│ │ ├── 004-select-package.png
│ │ ├── 005-configure-generator.png
│ │ ├── 006-configure-generator.png
│ │ ├── 007-configure-generator.png
│ │ ├── 008-configure-generator.png
│ │ ├── 009-configure-generator.png
│ │ ├── 00_010_RAP630.png
│ │ ├── 010-abap-artifacts-list.png
│ │ ├── 011-select-transport.png
│ │ ├── 012-result-service-binding.png
│ │ ├── 013-result-project-explorer.png
│ │ ├── 014-start-fiori-elements-preview.png
│ │ ├── 015-create-new-bank.png
│ │ ├── 016-create-new-bank.png
│ │ ├── 017-create-new-bank.png
│ │ ├── 01_010_rap630.png
│ │ ├── 01_020_rap630.png
│ │ ├── 020-missing-authorizations.png
│ │ ├── 021-check-own-context.png
│ │ ├── 022-check-own-context.png
│ │ ├── 06_020_RAP630.png
│ │ ├── 06_030_RAP630.png
│ │ ├── 06_040_RAP640.png
│ │ ├── 200_iam_app.png
│ │ ├── ABAP Artifacts List.png
│ │ ├── F_BNKA_INT.png
│ │ ├── F_BNKA_MAO.png
│ │ ├── README.md
│ │ ├── Scenario_New_App_on_stack.png
│ │ ├── adt_class.png
│ │ ├── copy_content.png
│ │ ├── copyrawcontents.png
│ │ ├── error.png
│ │ └── success.png
├── ex2
│ ├── README.md
│ ├── README_235.md
│ └── images
│ │ ├── Extensibility_Extend_the_behavior.png
│ │ ├── Extensibility_RAP_Business_Object_Enabled_For_Extensibility.png
│ │ ├── README.md
│ │ ├── Scenario_Extend_SAP_App.png
│ │ ├── ex2_01_010_RAP630.png
│ │ ├── ex2_01_020_RAP630.png
│ │ ├── ex2_01_030_RAP630.png
│ │ ├── ex2_01_040_RAP630.png
│ │ ├── ex2_01_050_RAP630.png
│ │ ├── ex2_01_060_RAP630.png
│ │ ├── ex2_01_070_RAP630.png
│ │ ├── ex2_01_090_RAP630.png
│ │ ├── ex2_01_overview_RAP630.png
│ │ ├── ex2_02_010_RAP630.png
│ │ ├── ex2_02_020_RAP630.png
│ │ ├── ex2_02_030_RAP630.png
│ │ └── ex2_02_040_RAP630.png
├── ex3
│ ├── README.md
│ ├── README_2023.md
│ ├── README_ABAP_ENVIRONMENT.md
│ └── images
│ │ ├── Extensibility_Extend_the_data_model.png
│ │ ├── README.md
│ │ ├── ex3_01_overview_RAP630.png
│ │ ├── ex3_02_010_RAP630.png
│ │ ├── ex3_02_020_RAP630.png
│ │ ├── ex3_02_030_RAP630.png
│ │ ├── ex3_02_040_show_objects_to_be_extended.png
│ │ ├── ex3_03_010_RAP630.png
│ │ ├── ex3_03_020_RAP630.png
│ │ ├── ex3_03_030_RAP630.png
│ │ ├── ex3_03_030_RAP640.png
│ │ ├── ex3_03_040_overview_of_obj_to_be_extended.png
│ │ ├── ex3_03_330_RAP630.png
│ │ ├── ex3_04_010_RAP640.png
│ │ ├── ex3_04_020_RAP640.png
│ │ ├── ex3_04_030_RAP640.png
│ │ ├── ex3_05_010_RAP630.png
│ │ ├── ex3_05_RAP630.png
│ │ ├── ex3_06_010_RAP630.png
│ │ ├── ex3_06_020_RAP630.png
│ │ ├── ex3_06_030_RAP630.png
│ │ ├── ex3_Extend_view_entity_025.jpg
│ │ ├── ex3_Extensions_overview_055.jpg
│ │ ├── ex3_extension_for_ext_include_005.png
│ │ ├── ex3_extension_for_ext_include_010.png
│ │ ├── ex3_extension_for_ext_include_030.png
│ │ ├── ex3_new_field_feedback_010.png
│ │ ├── ex3_new_field_feedback_020.png
│ │ ├── ex3_with_wizard_010.png
│ │ ├── ex3_with_wizard_020.png
│ │ ├── ex3_with_wizard_025.png
│ │ ├── ex3_with_wizard_030.png
│ │ ├── ex3_with_wizard_100.png
│ │ ├── ex3_with_wizard_110.png
│ │ ├── ex3_with_wizard_120.png
│ │ ├── ex3_with_wizard_130.png
│ │ ├── ex3_with_wizard_140.png
│ │ ├── ex3_with_wizard_150.png
│ │ ├── ex3_with_wizard_160.png
│ │ ├── ex3_with_wizard_170.png
│ │ ├── ex3_with_wizard_180.png
│ │ └── ex3_with_wizard_190.png
├── ex4
│ ├── README.md
│ └── images
│ │ ├── README.md
│ │ ├── ex4_abstract_entity_feedback_010.png
│ │ ├── ex4_abstract_entity_feedback_020.png
│ │ ├── ex4_add_p_bdef_extension_020.png
│ │ ├── ex4_add_p_bdef_extension_030.png
│ │ ├── ex4_implement_action_010.png
│ │ ├── ex4_implement_action_020.png
│ │ ├── ex4_implement_action_030.png
│ │ └── ex4_select_ddls_template_010.png
└── images
│ ├── README.md
│ └── Scenario_Overview.png
├── images
├── README.md
├── Scenario_Overview.png
├── adt_activate.png
├── adt_bdef.png
├── adt_class.png
├── adt_ddls.png
├── adt_ddlx.png
├── adt_package.png
├── adt_save.png
├── adt_srvd.png
├── adt_tabl.png
├── copy.png
├── copy2.png
├── copy3.png
└── copyrawcontents.png
├── slides
├── RAP630_RAP_Extensibility_2405.pdf
└── README.md
└── src
├── e3d0bb064039a255b892a7fc7b2d18ht.sush.xml
├── zrap630_ashopsol.tabl.xml
├── zrap630_cl_vh_product_sol.clas.abap
├── zrap630_cl_vh_product_sol.clas.xml
├── zrap630_cx_demo_exception.clas.abap
├── zrap630_cx_demo_exception.clas.xml
├── zrap630bp_r_shoptp_sol.clas.abap
├── zrap630bp_r_shoptp_sol.clas.locals_imp.abap
├── zrap630bp_r_shoptp_sol.clas.xml
├── zrap630c_shoptp_sol bdef.apis.xml
├── zrap630c_shoptp_sol ddls.apis.xml
├── zrap630c_shoptp_sol.bdef.asbdef
├── zrap630c_shoptp_sol.bdef.xml
├── zrap630c_shoptp_sol.ddls.asddls
├── zrap630c_shoptp_sol.ddls.baseinfo
├── zrap630c_shoptp_sol.ddls.xml
├── zrap630c_shoptp_sol.ddlx.asddlxs
├── zrap630c_shoptp_sol.ddlx.xml
├── zrap630e_shop_sol ddls.apis.xml
├── zrap630e_shop_sol.ddls.asddls
├── zrap630e_shop_sol.ddls.baseinfo
├── zrap630e_shop_sol.ddls.xml
├── zrap630i_shoptp_sol bdef.apis.xml
├── zrap630i_shoptp_sol ddls.apis.xml
├── zrap630i_shoptp_sol.bdef.asbdef
├── zrap630i_shoptp_sol.bdef.xml
├── zrap630i_shoptp_sol.ddls.asddls
├── zrap630i_shoptp_sol.ddls.baseinfo
├── zrap630i_shoptp_sol.ddls.xml
├── zrap630i_vh_product_sol.ddls.asddls
├── zrap630i_vh_product_sol.ddls.baseinfo
├── zrap630i_vh_product_sol.ddls.xml
├── zrap630r_shop_d_sol ddls.apis.xml
├── zrap630r_shop_d_sol.ddls.asddls
├── zrap630r_shop_d_sol.ddls.baseinfo
├── zrap630r_shop_d_sol.ddls.xml
├── zrap630r_shoptp_sol bdef.apis.xml
├── zrap630r_shoptp_sol ddls.apis.xml
├── zrap630r_shoptp_sol.bdef.asbdef
├── zrap630r_shoptp_sol.bdef.xml
├── zrap630r_shoptp_sol.ddls.asddls
├── zrap630r_shoptp_sol.ddls.baseinfo
├── zrap630r_shoptp_sol.ddls.xml
├── zrap630sh00d_sol.tabl.xml
├── zrap630sshop_sol tabl.apis.xml
├── zrap630sshop_sol.tabl.xml
├── zrap630ui_shop_o4_sol.srvb.xml
├── zrap630ui_shop_sol.srvd.srvdsrv
└── zrap630ui_shop_sol.srvd.xml
/.abapgit.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | E
6 | /src/
7 | PREFIX
8 |
9 | /.gitignore
10 | /LICENSE
11 | /README.md
12 | /package.json
13 | /.travis.yml
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing
2 |
3 | ## Code of Conduct
4 |
5 | All members of the project community must abide by the [SAP Open Source Code of Conduct](https://github.com/SAP/.github/blob/main/CODE_OF_CONDUCT.md).
6 | Only by respecting each other we can develop a productive, collaborative community.
7 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting [a project maintainer](.reuse/dep5).
8 |
9 | ## Engaging in Our Project
10 |
11 | We use GitHub to manage reviews of pull requests.
12 |
13 | * If you are a new contributor, see: [Steps to Contribute](#steps-to-contribute)
14 |
15 | * Before implementing your change, create an issue that describes the problem you would like to solve or the code that should be enhanced. Please note that you are willing to work on that issue.
16 |
17 | * The team will review the issue and decide whether it should be implemented as a pull request. In that case, they will assign the issue to you. If the team decides against picking up the issue, the team will post a comment with an explanation.
18 |
19 | ## Steps to Contribute
20 |
21 | Should you wish to work on an issue, please claim it first by commenting on the GitHub issue that you want to work on. This is to prevent duplicated efforts from other contributors on the same issue.
22 |
23 | If you have questions about one of the issues, please comment on them, and one of the maintainers will clarify.
24 |
25 | ## Contributing Code or Documentation
26 |
27 | You are welcome to contribute code in order to fix a bug or to implement a new feature that is logged as an issue.
28 |
29 | The following rule governs code contributions:
30 |
31 | * Contributions must be licensed under the [Apache 2.0 License](./LICENSE)
32 | * Due to legal reasons, contributors will be asked to accept a Developer Certificate of Origin (DCO) when they create the first pull request to this project. This happens in an automated fashion during the submission process. SAP uses [the standard DCO text of the Linux Foundation](https://developercertificate.org/).
33 |
34 | ## Issues and Planning
35 |
36 | * We use GitHub issues to track bugs and enhancement requests.
37 |
38 | * Please provide as much context as possible when you open an issue. The information you provide must be comprehensive enough to reproduce that issue for the assignee.
39 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "[]"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright [yyyy] [name of copyright owner]
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------
/LICENSES/Apache-2.0.txt:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "[]"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright [yyyy] [name of copyright owner]
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | [](https://api.reuse.software/info/github.com/SAP-samples/abap-platform-rap630)
2 |
3 | # RAP630 - Cloud ERP Extensibility
4 | https://github.com/SAP-samples/abap-platform-rap630/tree/main
5 |
6 | ## Description
7 |
8 | This repository contains the material for the RAP hands-on workshop called _RAP630 - Use ABAP Cloud for developer extensibility_ where _Developer Extensibility_ is used.
9 |
10 | Developer extensibility as defined by SAP basically encompasses two activities
11 |
12 | 1. Develop custom code to implement your own business logic.
13 |
14 | Here you can make use of existing API's from SAP that have been released for that purpose.
15 |
16 | 3. Extend an existing RAP Business Object so that additional business functionality is added.
17 |
18 | Such an extensible RAP business object will usually reside in another software components or it is an existing extensible RAP BO that has been delivered by SAP or a SAP partner.
19 | By extending the funcitionality of an existing RAP Business object its functionality can be adapted to your specific business requirements.
20 |
21 | 
22 |
23 | ## Overview
24 |
25 | This session introduces attendees to the ABAP RESTful application programming model (RAP) and how this can be leveraged how
26 | - to build extensions (own code) in SAP S/4HANA BTP ABAP Environment and
27 | - to extend an existing RAP Business Object.
28 |
29 | ## 📋Requirements for attending this workshop
30 | [^Top of page](#)
31 |
32 | > You need the latest version of the ABAP Development Tools for Eclipse (ADT) on your laptop or PC as well as the access to an appropriate ABAP system* to carry out the practical exercises of this workshop.
33 | > (*) The supported ABAP systems are SAP BTP ABAP Environment, SAP S/4HANA Cloud, Public Edition.
34 | > In order to run the workshop on an on prem system use the [on-prem]([https://github.com/SAP-samples/abap-platform-rap630/tree/on-prem) branch.
35 | > The [openSource RAP Generator](https://github.com/SAP-samples/cloud-abap-rap) must be imported into the relevant system.
36 | >
37 | > **In the SAP ABAP Environment Trial systems the RAP Generator has already been imported for your convenience.**
38 |
39 |
40 | Click to expand!
41 |
42 | The requirements to follow the exercises in this repository are:
43 | 1. [Install the latest Eclipse platform and the latest ABAP Development Tools (ADT) plugin](https://developers.sap.com/tutorials/abap-install-adt.html)
44 | 2. [Create an user on the SAP BTP, ABAP environment Trial](https://developers.sap.com/tutorials/abap-environment-trial-onboarding.html) (_Read exception below_)
45 | 3. [Create an ABAP Cloud Project](https://developers.sap.com/tutorials/abap-environment-create-abap-cloud-project.html)
46 |
47 | >> ⚠ **Exception regarding SAP-led events such as "ABAP Developer Day" and "SAP CodeJam"**:
48 | >> → A dedicated ABAP system with pre-generated packages for the hands-on workshop participants will be provided.
49 | >> → Access to the system details for this on-site workshop will be provided by the instructors during the session.
50 |
51 |
52 |
53 | ## Slides
54 | [Presentation](https://github.com/SAP-samples/abap-platform-rap630/blob/main/slides/RAP630_RAP_Extensibility_2405.pdf)
55 |
56 | ## 🛠 Exercises
57 | [^Top of page](#)
58 |
59 | ## Exercises
60 |
61 | In the _Getting Started_ section you will learn what needs to be prepared in order to work through this script.
62 |
63 | The first aspect of developer extensibility is how to use RAP business objects that have been C1-released by SAP or SAP partners for the use in ABAP Cloud development.
64 |
65 | In _Exercise 1_ you will learn how you can leverage the released RAP business object `I_BankTP`. You will learn how you can use a new wizard in ADT that lets you generate a custom UI on top of a released RAP business object without having to write a single line of code. An additional (optional) task is to call the same released RAP business object from within a class which shows how released RAP business objects can also be used in application jobs.
66 |
67 | The second aspect of developer extensibility is the option to extend an extensible RAP business object that has been delivered by SAP or a SAP partner.
68 |
69 | In _Exercise 2_ you will _extend the behavior_ of the base RAP business object that has been generated in the _Getting Started_ section. You will learn how extend the behavior of the base RAP BEO by validations, determinations and side effects.
70 |
71 | In _Exercise 3_ you will then continue to _extend the data model_ with additional fields.
72 |
73 | > Since with the latest release 2408 an **_Extension Field Wizard_** has been delivered we have to different scripts for ABAP Environement systems and on premise systems (SAP S/4HANA 2023).
74 |
75 | In _Exercise 4_ you will continue to _extend the behavior_ of the base RAP business object by adding an action. Since actions can only added via an extension to fields that have been added itself via an extension, adding an action via an extension must be performed after Exercise 3.
76 |
77 | So let us start and have a look at the _Getting Started_ section.
78 |
79 | - [Getting Started - Mandatory, please check](exercises/ex0/)
80 |
81 | You can the continue and build custom code that leverages released API's
82 |
83 | - [Exercise 1 - New App on stack (Developer Extensibility)](exercises/ex1/)
84 |
85 | Finally you will learn how to extend a RAP Business object
86 |
87 | - [Exercise 2, 3 and 4 - Extend a RAP business object (behavior and data model)](exercises/ex2/README_235.md)
88 |
89 | ## Online Help
90 |
91 | https://help.sap.com/docs/abap-cloud/abap-rap/develop-rap-extensions
92 | https://help.sap.com/docs/SAP_S4HANA_CLOUD/6aa39f1ac05441e5a23f484f31e477e7/1b345c53060846b091f55ea901e21ae7.html
93 |
94 | ## Download and Installation
95 |
96 | The packages **ZRAP630_SOL** and **ZRAP630_SOL_EXT** that contain the solutions of this workshop can be downloaded via abapGIT into an *SAP BTP, ABAP Environment* system or into the *SAP S/4HANA Cloud, ABAP environment* system.
97 |
98 | > Please note that these packages have already been installed in the SAP BTP, ABAP Environment Trial systems !
99 | > So there is no need to install them on an ABAP Environment trial system.
100 |
101 |
102 | Click to expand download and installation steps.
103 |
104 | The steps to download and install the package of the base RAP business object can be found here:
105 |
106 | 1. Create a package **'ZRAP630_SOL'** with **'ZLOCAL'** as the superpackage.
107 | 2. Link this package with the URL of the RAP630 GitHub repository `https://github.com/SAP-samples/abap-platform-rap630`.
108 | 3. Use the branch `main`.
109 | 4. Pull changes.
110 | 5. Use mass activation to activate the objects that have been imported in step 3.
111 | 6. Publish the service binding `ZRAP630UI_SHOP_O4_SOL`.
112 |
113 | After you have performed the aforementioned steps you can continue to download the solution package of the extension project **ZRAP630_SOL_EXT**.
114 |
115 | Since these are stored for technical reasons in another Github repository **abap-platform-rap630-ext** you have to
116 | to download the source from that repository 'https://github.com/SAP-samples/abap-platform-rap630-ext'.
117 |
118 |
119 |
120 |
121 | ## Known Issues
122 |
123 |
124 | ## How to obtain support
125 | [Create an issue](https://github.com/SAP-samples//issues) in this repository if you find a bug or have questions about the content.
126 |
127 | For additional support, [ask a question in SAP Community](https://answers.sap.com/questions/ask.html).
128 |
129 | ## Contributing
130 | If you wish to contribute code, offer fixes or improvements, please send a pull request. Due to legal reasons, contributors will be asked to accept a DCO when they create the first pull request to this project. This happens in an automated fashion during the submission process. SAP uses [the standard DCO text of the Linux Foundation](https://developercertificate.org/).
131 |
132 | ## Code of Conduct
133 | Please read the [SAP Open Source Code of Conduct](https://github.com/SAP-samples/.github/blob/main/CODE_OF_CONDUCT.md).
134 |
135 | ## License
136 | Copyright (c) 2023 SAP SE or an SAP affiliate company. All rights reserved. This project is licensed under the Apache Software License, version 2.0 except as noted otherwise in the [LICENSE](LICENSE) file.
137 |
--------------------------------------------------------------------------------
/REUSE.toml:
--------------------------------------------------------------------------------
1 | version = 1
2 | SPDX-PackageName = "abap-platform-rap630"
3 | SPDX-PackageSupplier = "ospo@sap.com"
4 | SPDX-PackageDownloadLocation = "https://github.com/sap-samples/abap-platform-rap630"
5 | SPDX-PackageComment = "The code in this project may include calls to APIs (\"API Calls\") of\n SAP or third-party products or services developed outside of this project\n (\"External Products\").\n \"APIs\" means application programming interfaces, as well as their respective\n specifications and implementing code that allows software to communicate with\n other software.\n API Calls to External Products are not licensed under the open source license\n that governs this project. The use of such API Calls and related External\n Products are subject to applicable additional agreements with the relevant\n provider of the External Products. In no event shall the open source license\n that governs this project grant any rights in or to any External Products,or\n alter, expand or supersede any terms of the applicable additional agreements.\n If you have a valid license agreement with SAP for the use of a particular SAP\n External Product, then you may make use of any API Calls included in this\n project's code for that SAP External Product, subject to the terms of such\n license agreement. If you do not have a valid license agreement for the use of\n a particular SAP External Product, then you may only make use of any API Calls\n in this project for that SAP External Product for your internal, non-productive\n and non-commercial test and evaluation of such API Calls. Nothing herein grants\n you any rights to use or access any SAP External Product, or provide any third\n parties the right to use of access any SAP External Product, through API Calls."
6 |
7 | [[annotations]]
8 | path = "**"
9 | precedence = "aggregate"
10 | SPDX-FileCopyrightText = "2023 SAP SE or an SAP affiliate company and abap-platform-rap630 contributors"
11 | SPDX-License-Identifier = "Apache-2.0"
12 |
--------------------------------------------------------------------------------
/exercises/ex0/README.md:
--------------------------------------------------------------------------------
1 | [Home - Cloud ERP Extensibility](../../README.md#-exercises)
2 |
3 | # Getting started
4 |
5 | There are three options
6 |
7 | - **Option 1**: You conduct these exercises at an SAP event where we provide you with a dedicated system and a dedicated demo user.
8 | - **Option 2**: You conduct these exercises on your own in one of the shared ABAP trial systems.
9 | - **Option 3**: You condcut these exercises on your own in your own SAP BTP ABAP Environment system.
10 |
11 | ## Option 1 - SAP-led hands-on workshop (e.g. at SAP TechEd, SAP user group events, SAP CodeJams, ...)
12 |
13 |
14 | click to expand the exercise description
15 |
16 | In case of an SAP led hands-on session we have prepared the following for your convenience:
17 |
18 | - two exercise packages `ZRAP630_###` and `ZRAP630_###_EXT` and
19 | - an extensible managed Business Object (BO) with one entity _Shop_ with generic transactional behavior - i.e. CRUD: Create, Read, Update, and Delete.
20 |
21 | 1. **⚠Check the suffix `###` of your demo user (e.g. developer-###@abapcloud.sap).**
22 |
23 | 2. In the "Project Explorer" right click on **Favorite Packages** and click on **Add Package...**.
24 | Enter `ZRAP630_###` and and select **both** packages and click OK.
25 |
26 |
27 |
28 | ## Option 2 - Self-study in SAP BTP Trial
29 |
30 |
31 | click to expand the exercise description
32 |
33 | If you run the exercises in SAP BTP ABAP Trial, you have to start a helper class that will generate the necessary artefacts needed for the remaining exercises.
34 |
35 | You will generate
36 | - two exercise packages and
37 | - an extensible managed Business Object (BO) with one entity _Shop_ with generic transactional behavior - i.e. CRUD: Create, Read, Update, and Delete.
38 |
39 | You will use class `ZDMO_GEN_RAP630_SINGLE` to generate two packages.
40 |
41 | > ⚠️ Please note that if you don't find this class you have to import the openSource RAP Generator first as described in the
42 | > section [Getting started](../../README.md#requirements-for-attending-this-workshop)
43 |
44 | The first package `ZRAP630_###` will contain an extensible RAP business object which you will extend in exercise 2.
45 |
46 | You will use the second package `ZRAP630_###_EXT` to store the objects that you are going to create in Excerise 1 and Exercise 2.
47 |
48 | 1. Right-click **Favorite Objects** and click **Add Object**.
49 |
50 | 2. Search for **`ZDMO_GEN_RAP630_SINGLE`**, select it and click **OK**.
51 |
52 | 3. Right-click **`ZDMO_GEN_RAP630_SINGLE`**, select **Run As** > **ABAP Application (Console) F9**.
53 |
54 | 
55 |
56 | 4. Now your packages `ZRAP630_###` and `ZRAP630_###_EXT` will now be created
57 | (where the suffix `###` denotes your group number and will contain everythin g you need).
58 |
59 | > ⚠ **The generation process will take a few minutes.**
60 | > ⚠ So, stay tuned and check the ABAP console.
61 |
62 | 
63 |
64 | 5. **⚠Note down the suffix `###` for later use.**
65 |
66 | 6. In the "Project Explorer" right click on **Favorite Packages** and click on **Add Package...**.
67 | Enter `ZRAP630_###` and and select **both** packages and click OK.
68 |
69 |
70 | 
71 |
72 |
73 |
74 | ## Option 3 - Self-study in your own SAP BTP ABAP Envrionment
75 |
76 |
77 | click to expand the exercise description
78 |
79 |
80 |
81 |
82 | ## Summary
83 |
84 | Now that you have generated your own extensible RAP business object you can continue to - [Exercise 1](../ex1/README.md)
85 |
--------------------------------------------------------------------------------
/exercises/ex0/assets/sample_image.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex0/assets/sample_image.png
--------------------------------------------------------------------------------
/exercises/ex0/images/Console_result.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex0/images/Console_result.png
--------------------------------------------------------------------------------
/exercises/ex0/images/add_to_favorite_packages.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex0/images/add_to_favorite_packages.png
--------------------------------------------------------------------------------
/exercises/ex0/images/packages_0030.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex0/images/packages_0030.png
--------------------------------------------------------------------------------
/exercises/ex0/images/run_via_f9_0020.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex0/images/run_via_f9_0020.png
--------------------------------------------------------------------------------
/exercises/ex1/README.md:
--------------------------------------------------------------------------------
1 | [Home - Cloud ERP Extensibility](../../../../#exercises)
2 |
3 |
4 |
5 | # Exercise 1: New App on stack (Developer Extensibility)
6 |
7 | ⚠️ Be sure to have completed the steps described in the **[Getting started section](../ex0/#readme)**. Here you learn how to get access to the packages and repository objects needed for this hands-on session.
8 |
9 | ## Introduction
10 |
11 | In Exercise 1.1 you will build a custom UI on top of the released API **I_BankTP**. This application will allow you to create a bank.
12 |
13 | As an additional (optional) Exercise 1.2 you can try out to consume this released API in a class via EML.
14 |
15 | 
16 |
17 | We will start by showing you how you can search for a released RAP business object. For this we will use the *Released Objects* part of the *Project Explorer* in ADT.
18 |
19 |
20 | > **Reminder:**
21 | > Don't forget to replace all occurences of the placeholder **`###`** with your group ID in the exercise steps below.
22 | > You can use the ADT function **Replace All** (**Ctrl+F**) for the purpose.
23 | >
24 | > 
25 |
26 |
27 |
28 | ## Exercise 1.1: Generate a UI on top of a released Business Object Interface
29 |
30 | In Exercise 1.1 you will build a custom UI on top of the released API **I_BankTP**.
31 |
32 |
33 |
34 | Click to expand!
35 |
36 | 1. In the Project Explorer select the **Released Objects** tree and then the node **USE_IN_CLOUD_DEVELOPMENT**. Here you have to open the folder **Core Data Services** and then the folder **Behavior Definitions** where you find the C1-released Business Object Interface **`I_BankTP`**.
37 |
38 | 
39 |
40 | 2. Right-click on the interface `I_BankTP` and select **Generate ABAP Repository Objects**
41 |
42 | 
43 |
44 | 3. Select **OData UI Service** and then **Next**
45 |
46 | 
47 |
48 | 4. Select the package `ZRAP630_###_EXT` where `###` is the unique ID chosen by the generator class by pressing the **Browse** button and press **Next**.
49 |
50 | 
51 |
52 | 5. The generator finishes with the *Configure Generator* screen.
53 |
54 | 
55 |
56 | Enter your group number **###** in the field **Artifacts Suffix**.
57 |
58 | > This will add the suffix to the names of the repository objects that will be generated. You can check the names that will be chosen by the generator by selecting the entries **Service Projection Entities**, **Service Projection Behavior**, **Service Definition** and **Service Binding**.
59 | > Since the generator will suggest unique names we will leave the suggested values unchanged.
60 |
61 | Press **Next** to continue.
62 |
63 | 7. The wizard shows an overview of the repository objects that are going to be generated. Press **Next**.
64 |
65 | 
66 |
67 | 8. Select an existing or create a new transport and press **Finish** to start the generation of the repository objects.
68 |
69 | 
70 |
71 |
72 | ### Publish service and test the application
73 |
74 | 1. When the generation process is finished a new tab with the generated Service Binding will be opened in ADT. Click **Publish** to publish the service binding locally. In the project explorer you can see all objects that have been generated.
75 |
76 | 
77 |
78 | 
79 |
80 | 2. Select the entity set `Bank` and click **Preview** or double-click on the entity set `Bank`. This will start the SAP Fiori Elements preview.
81 |
82 | 
83 |
84 | 3. In the preview of your app press the button **Create** to create a new bank.
85 |
86 | 
87 |
88 |
89 | 4. Enter values in the fields **Bank Country / Region** e.g. `CZ` and **Bank Key** e.g. `1234` and press **Continue**.
90 |
91 | 
92 |
93 | 5. The object page opens and you have to provide data for the remaining mandatory fields such as the **Bank Name**.
94 |
95 | 
96 |
97 |
98 | ### Troubleshooting
99 |
100 |
101 | Click to expand!
102 |
103 | 1. When your development user does not have the authorization to create new banks you will receive the following error message: **You are not authorized to create bank data for country/region CZ.**
104 |
105 | 
106 |
107 | 2. In order to identify the missing authorizations you can check the **Knowledge Transfer Document** of `I_BANKTP`. Either open it using the shortcut **Ctrl+Shift+A** or navigate to it in the Project Explorer as shown as shown below.
108 |
109 | 
110 |
111 | 3. As you can see the business object `I_BankTP` checks for the authorization objects `F_BNKA_MAO` and `F_BNKA_INT`.
112 |
113 | 
114 |
115 |
116 | 
117 |
118 | 
119 |
120 | > ⚠️
121 | > The issue can only be resolved by creating an appropriate IAM app, assigning the same to a business catalog which in the end has to be assigned to a new or existing role that has to be assigned to your user.
122 | > In the next (optional) exercise where the BO is called as an API we show a workaround how the API can be called in a so called priveliged mode.
123 |
124 |
125 |
126 |
127 | ## Exercise 1.2: Use a released RAP BO in a custom application (optional)
128 | [^Top of page](#)
129 |
130 | A second typical use case where released API's in an SAP S/4HANA system are used for, is using such an API in your own code that might for example be consumed as part of an application job.
131 |
132 | Here the user under which the job runs might not have appropriate application authorizations.
133 |
134 | ### Test EML call
135 |
136 |
137 | Click to expand!
138 |
139 | Create a class  in the extension package `ZRAP630_###_EXT` to circumvent authorization problems with EML calls.
140 |
141 | 1. Right-click on your ABAP package **`ZRAP630_###_EXT`** and select **New** > **ABAP Class** from the context menu.
142 |
143 | .
144 |
145 | 2. Maintain the required information (`###` is your group ID).
146 | - Name: **`zcl_test_abap_cloud_###`**
147 | - Description: _**`Test ABAP Cloud Governance`**_
148 |
149 | Click on **Add** and select the interface `if_oo_adt_classrun` and press OK.
150 |
151 | and click **Next >**
152 |
153 | .
154 |
155 | 3. Select or create a transport request, and click **Finish** to create the class.
156 |
157 | 4. Replace the code in the method `if_oo_adt_classrun~main( )` with the following code snippet.
158 |
159 | > Hint
160 | > You have to replace the value for **'####'** with a string that only contains numbers.
161 |
162 | > Coding explained:
163 | > The coding leverages the `response` parameter of EML statements that is used to specify response parameters for ABAP EML statements
164 | > to get information on the following:
165 | > - Failures, i. e. operations that could not get processed (FAILED failed_resp)
166 | > - Key mapping information (MAPPED mapped_resp)
167 | > - Returned error messages (REPORTED reported_resp)
168 |
169 |
170 |
171 | METHOD if_oo_adt_classrun~main.
172 | DATA create_bank TYPE STRUCTURE FOR CREATE i_banktp.
173 | DATA bank_id_number TYPE i_banktp-BankInternalID VALUE '8035'.
174 |
175 | SELECT SINGLE *
176 | FROM I_Bank_2
177 | * WITH
178 | * PRIVILEGED ACCESS
179 | WHERE BankInternalID = @bank_id_number
180 | INTO @DATA(my_bank).
181 |
182 | IF sy-subrc = 0.
183 | out->write( |my new bank { my_bank-BankName } { my_bank-BankInternalID } already exists.| ).
184 | EXIT.
185 | ENDIF.
186 |
187 | create_bank = VALUE #( BankCountry = 'ZW'
188 | BankInternalID = bank_id_number
189 | LongBankName = 'Bank name'
190 | LongBankBranch = 'Bank branch'
191 | BankNumber = bank_id_number
192 | BankCategory = ''
193 | BankNetworkGrouping = ''
194 | SWIFTCode = 'SABMGB2LACP'
195 | IsMarkedForDeletion = '' ).
196 |
197 | MODIFY ENTITIES OF i_banktp
198 | * PRIVILEGED
199 | ENTITY bank
200 | CREATE FIELDS ( bankcountry
201 | bankinternalid
202 | longbankname
203 | longbankbranch
204 | banknumber
205 | bankcategory
206 | banknetworkgrouping
207 | swiftcode
208 | IsMarkedForDeletion )
209 | WITH VALUE #( ( %cid = 'cid1'
210 | BankCountry = create_bank-BankCountry
211 | BankInternalID = create_bank-BankInternalID
212 | LongBankName = create_bank-LongBankName
213 | LongBankBranch = create_bank-LongBankBranch
214 | BankNumber = create_bank-BankNumber
215 | BankCategory = create_bank-BankCategory
216 | BankNetworkGrouping = create_bank-BankNetworkGrouping
217 | SWIFTCode = create_bank-SWIFTCode
218 | IsMarkedForDeletion = create_bank-IsMarkedForDeletion ) )
219 |
220 | MAPPED DATA(mapped)
221 | REPORTED DATA(reported)
222 | " TODO: variable is assigned but never used (ABAP cleaner)
223 | FAILED DATA(failed).
224 |
225 | LOOP AT mapped-bank INTO DATA(mapped_success).
226 | out->write( |mapped key { mapped_success-%key-BankInternalID }| ).
227 | ENDLOOP.
228 |
229 | LOOP AT reported-bank INTO DATA(reported_error_1).
230 | DATA(exc_create_bank) = cl_message_helper=>get_longtext_for_message( text = reported_error_1-%msg ).
231 | out->write( |error EML { exc_create_bank } | ).
232 | ENDLOOP.
233 |
234 | IF reported-bank IS NOT INITIAL.
235 | EXIT.
236 | ENDIF.
237 |
238 | COMMIT ENTITIES
239 | RESPONSE OF i_banktp
240 | " TODO: variable is assigned but never used (ABAP cleaner)
241 | FAILED DATA(failed_commit)
242 | REPORTED DATA(reported_commit).
243 |
244 | LOOP AT reported_commit-bank INTO DATA(reported_error_2).
245 | DATA(exc_create_bank2) = cl_message_helper=>get_longtext_for_message( text = reported_error_2-%msg ).
246 | out->write( |error commit entities { exc_create_bank2 } | ).
247 | ENDLOOP.
248 |
249 | IF reported_commit-bank IS NOT INITIAL.
250 | EXIT.
251 | ENDIF.
252 |
253 | COMMIT WORK.
254 |
255 | SELECT SINGLE *
256 | FROM I_Bank_2
257 | * WITH
258 | * PRIVILEGED ACCESS
259 | WHERE BankInternalID = @bank_id_number
260 | INTO @my_bank.
261 |
262 | IF sy-subrc = 0.
263 | out->write( |my new bank { my_bank-BankName } { my_bank-BankInternalID }| ).
264 | ELSE.
265 | out->write( |my new bank { my_bank-BankName } does not exist| ).
266 | ENDIF.
267 | ENDMETHOD.
268 |
269 |
270 | 5. Activate your changes by pressing **Ctrl+F3**
271 |
272 | 6. Run the test class by pressing **F9**.
273 |
274 | You should receive an error message such as:
275 | `error You are not authorized to create bank data for country/region ZW.`
276 |
277 | This is because your user only has the authorization to create banks with the following country/region codes:
278 |
279 | 
280 |
281 |
282 |
283 | ### Test the use of **PRIVILEGED** calls
284 |
285 |
286 | Click to expand!
287 |
288 | 1. Adding **PRIVILEGED** to the EML call
289 |
290 | When we add the key word `PRIVILEGED` to our EML call the authorization checks for the authorization objects
291 | `F_BNKA_MAO` and `F_BNKA_INT` will basically be skipped. Just uncomment the `PRIVILEGED` statement in the source code.
292 |
293 |
303 |
304 | When you now run the class again using F9 you will find that the creation of a new bank seem to have worked.
305 |
306 | However the select statement is not able to retrieve the newly created data.
307 |
308 |
309 | Click to learn more about the PRIVILEGED EML access
310 |
311 |
312 | We will now check the behavior definition of the Bank RAP business object. To do so use Ctrl+Shift+A to open the behavior definition `R_BankTP`.
313 |
314 | In the source code (see below) we see that the BDEF `R_BankTP` defines two so called authorization contexts:
315 |
316 | _Own authorization context_ : Lists all authorization objects used by the RAP BO implementation.
317 | _NoCheckWhenPrivileged_ : Lists authorization objects that can be skipped by a RAP BO consumer with privileged access.
318 |
319 | ```abap
320 | managed with unmanaged save implementation in class bp_r_banktp unique;
321 | strict ( 2 );
322 | with draft;
323 | extensible
324 | {
325 | with additional save;
326 | with determinations on modify;
327 | with determinations on save;
328 | with validations on save;
329 | }
330 |
331 | with privileged mode disabling NoCheckWhenPrivileged;
332 |
333 | //NoCheckWhenPrivileged
334 | define authorization context NoCheckWhenPrivileged
335 | {
336 | 'F_BNKA_MAO';
337 | 'F_BNKA_INT';
338 | }
339 |
340 | ```
341 |
342 |
343 |
344 |
345 | 2. Run your class again via F9.
346 |
347 | You should receive a response if you such as:
348 |
349 | ```
350 | mapped key ####
351 | my new bank does not exist
352 | ```
353 |
354 | This means you are now able to create a new bank, but you can't retrieve the data via SQL.
355 |
356 | 3. Adding **WITH PRIVILEGED ACCESS** to the ABAP SQL statement
357 |
358 | Similar to enforce skipping the authorization checks when creating a new bank it is also possible to enforce skipping of the authorization check that is imposed by the underlying DCL which performs a check on the authorization object `F_BNKA_MAO` and the field `BBANKS` for displaying data.
359 |
360 | Open the DCL and check its source code.
361 |
362 | To do so press **Ctrl+Shift+A** and enter **I_Bank_2** to search for the DCL objects.
363 |
364 | 
365 |
366 | 
367 |
368 | When we now change both ABAP SQL statements in class **`zcl_test_abap_cloud_###`** such that we add the key words **`WITH PRIVILEGED ACCESS`** to them:
369 |
370 |
371 |
372 | METHOD if_oo_adt_classrun~main.
373 |
374 | "...
375 |
376 | SELECT SINGLE *
377 | FROM I_Bank_2
378 | WITH
379 | PRIVILEGED ACCESS
380 | WHERE BankInternalID = @bank_id_number
381 | INTO @DATA(my_bank).
382 |
383 | "...
384 |
385 | SELECT SINGLE *
386 | FROM I_Bank_2
387 | WITH
388 | PRIVILEGED ACCESS
389 | WHERE BankInternalID = @bank_id_number
390 | INTO @my_bank.
391 |
392 | "...
393 |
394 | ENDMETHOD.
395 |
396 |
397 | We see that the data is now successfully been created and can also be read.
398 |
399 |
400 | 
401 |
402 |
403 |
404 | ### Other potential problems
405 |
406 | The I_BankTP RAP BO checks whether the provided switft code fits to the ISO code of the region.
407 |
408 | - error ISO code GB in the SWIFT code SABMGB2LACP is not correct for country/region US. Diagnosis Positions 5 and 6 of the SWIFT code do not correspond to the ISO code of country/region US. Procedure Check your entries. If necessary, check whether the ISO code of country/region US has been defined correctly.
409 |
410 | When a bank with the ID that is provided already exists you will receive an error message as well.
411 |
412 | - error Bank CZ 8888 already exists.
413 |
414 |
415 |
416 |
508 |
509 |
510 |
511 |
512 |
513 |
514 | ## Summary
515 | [^Top of page](#)
516 |
517 | Now that you've have learned about how to leverage the released API **I_BankTP** in *ABAP Cloud* you can continue with the next exercise where you will learn how to extend an extensible RAP business object- **[Exercise 2](../ex2/#readme)**.
518 |
519 | ## Further Reading
520 | [^Top of page](#)
521 |
522 |
523 | Click to expand!
524 |
525 | ### No Information in your system ? --> Find information about Released API's in GitHub
526 |
527 | While developing an ABAP Application for _S/4HANA on premise_ or _S/4HANA private cloud edition_ , you do get the following error message: "Use of
553 |
554 |
555 |
--------------------------------------------------------------------------------
/exercises/ex1/images/001-find-interface.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex1/images/001-find-interface.png
--------------------------------------------------------------------------------
/exercises/ex1/images/002-start-generator.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex1/images/002-start-generator.png
--------------------------------------------------------------------------------
/exercises/ex1/images/003-odata-ui-service.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex1/images/003-odata-ui-service.png
--------------------------------------------------------------------------------
/exercises/ex1/images/004-select-package.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex1/images/004-select-package.png
--------------------------------------------------------------------------------
/exercises/ex1/images/005-configure-generator.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex1/images/005-configure-generator.png
--------------------------------------------------------------------------------
/exercises/ex1/images/006-configure-generator.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex1/images/006-configure-generator.png
--------------------------------------------------------------------------------
/exercises/ex1/images/007-configure-generator.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex1/images/007-configure-generator.png
--------------------------------------------------------------------------------
/exercises/ex1/images/008-configure-generator.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex1/images/008-configure-generator.png
--------------------------------------------------------------------------------
/exercises/ex1/images/009-configure-generator.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex1/images/009-configure-generator.png
--------------------------------------------------------------------------------
/exercises/ex1/images/00_010_RAP630.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex1/images/00_010_RAP630.png
--------------------------------------------------------------------------------
/exercises/ex1/images/010-abap-artifacts-list.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex1/images/010-abap-artifacts-list.png
--------------------------------------------------------------------------------
/exercises/ex1/images/011-select-transport.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex1/images/011-select-transport.png
--------------------------------------------------------------------------------
/exercises/ex1/images/012-result-service-binding.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex1/images/012-result-service-binding.png
--------------------------------------------------------------------------------
/exercises/ex1/images/013-result-project-explorer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex1/images/013-result-project-explorer.png
--------------------------------------------------------------------------------
/exercises/ex1/images/014-start-fiori-elements-preview.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex1/images/014-start-fiori-elements-preview.png
--------------------------------------------------------------------------------
/exercises/ex1/images/015-create-new-bank.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex1/images/015-create-new-bank.png
--------------------------------------------------------------------------------
/exercises/ex1/images/016-create-new-bank.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex1/images/016-create-new-bank.png
--------------------------------------------------------------------------------
/exercises/ex1/images/017-create-new-bank.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex1/images/017-create-new-bank.png
--------------------------------------------------------------------------------
/exercises/ex1/images/01_010_rap630.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex1/images/01_010_rap630.png
--------------------------------------------------------------------------------
/exercises/ex1/images/01_020_rap630.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex1/images/01_020_rap630.png
--------------------------------------------------------------------------------
/exercises/ex1/images/020-missing-authorizations.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex1/images/020-missing-authorizations.png
--------------------------------------------------------------------------------
/exercises/ex1/images/021-check-own-context.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex1/images/021-check-own-context.png
--------------------------------------------------------------------------------
/exercises/ex1/images/022-check-own-context.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex1/images/022-check-own-context.png
--------------------------------------------------------------------------------
/exercises/ex1/images/06_020_RAP630.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex1/images/06_020_RAP630.png
--------------------------------------------------------------------------------
/exercises/ex1/images/06_030_RAP630.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex1/images/06_030_RAP630.png
--------------------------------------------------------------------------------
/exercises/ex1/images/06_040_RAP640.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex1/images/06_040_RAP640.png
--------------------------------------------------------------------------------
/exercises/ex1/images/200_iam_app.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex1/images/200_iam_app.png
--------------------------------------------------------------------------------
/exercises/ex1/images/ABAP Artifacts List.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex1/images/ABAP Artifacts List.png
--------------------------------------------------------------------------------
/exercises/ex1/images/F_BNKA_INT.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex1/images/F_BNKA_INT.png
--------------------------------------------------------------------------------
/exercises/ex1/images/F_BNKA_MAO.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex1/images/F_BNKA_MAO.png
--------------------------------------------------------------------------------
/exercises/ex1/images/README.md:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/exercises/ex1/images/Scenario_New_App_on_stack.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex1/images/Scenario_New_App_on_stack.png
--------------------------------------------------------------------------------
/exercises/ex1/images/adt_class.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex1/images/adt_class.png
--------------------------------------------------------------------------------
/exercises/ex1/images/copy_content.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex1/images/copy_content.png
--------------------------------------------------------------------------------
/exercises/ex1/images/copyrawcontents.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex1/images/copyrawcontents.png
--------------------------------------------------------------------------------
/exercises/ex1/images/error.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex1/images/error.png
--------------------------------------------------------------------------------
/exercises/ex1/images/success.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex1/images/success.png
--------------------------------------------------------------------------------
/exercises/ex2/README.md:
--------------------------------------------------------------------------------
1 | [Home - Cloud ERP Extensibility](../../../../#exercises)
2 |
3 | # Exercise 2 - Behavior extension
4 |
5 | In this exercise, we will extend the behavior of an extensible RAP BO. That means we will add a validation, a determination and side-effects to the behavior of the RAP BO by using an extenstion.
6 |
7 | 
8 |
9 | ## Exercise 2.1 Extend the behavior definition with a validation
10 |
11 | > After completing these steps you will have created a validation to check the delivery date.
12 |
13 |
14 | 🔵 Click to expand!
15 |
16 | 1. Right-click on the behavior definition `ZRAP630R_ShopTP_###` and select **New Behavior Extension** from the context menue.
17 |
18 | 
19 |
20 | 2. In the Create Behavior Extension dialogue enter the following values
21 |
22 | > **⚠⚠⚠ Caution**
23 | > Be sure to change the name of the package from `ZRAP630_###` to `ZRAP630_###_EXT`.
24 | > By default the dialogue will propose the package name of the base RAP BO.
25 | > In case of a package delivered by SAP an error message would be thrown since you are not allowed to create objects in the SAP namespace.
26 | > But here we want to build the extension in a different package in the customer namespace `Z`.
27 |
28 | **Package**: ⚠`ZRAP630_###_EXT`⚠
29 | **Name**: `ZRAP630R_EXT_SHOPTP_###`
30 | **Description**: `Extension for ZRAP630R_ShopTP_###`
31 | **Behavior Definition**: `ZRAP630R_SHOPTP_###`
32 | **BO Interface**: `ZRAP630I_SHOPTP_###`
33 |
34 | 
35 |
36 | 3. Select a transport request and press **Finish** <
37 |
38 | 4. Add a validation `zz_validateDeliverydate` to your behavior defintion that reacts on `create;` and the field `DeliveryDate;`
39 | This validation must also be added to the `draft determine action Prepare`. Do not forget to activate your changes.
40 |
41 |
42 | extension using interface zrap630i_shoptp_###
43 | implementation in class zbp_rap630r_ext_shoptp_### unique;
44 |
45 | extend behavior for Shop
46 | {
47 | validation zz_validateDeliverydate on save { create; field DeliveryDate; }
48 |
49 | extend draft determine action Prepare
50 | {
51 | validation zz_validateDeliveryDate;
52 | }
53 | }
54 |
55 |
56 |
57 | 5. Click on the proposed name of the behavior implementation class **(1)** of your behavior extension and press **Ctrl+1** to start the content assist and click on the proposed action **(2)** and press Next **(3)**.
58 |
59 | 
60 |
61 | 6. Select a transport request and press **Finish**.
62 |
63 | 7. This will open the editor for your behavior implementation class. Here you have to have to navigate to the **Local Types** tab since the implementation of behaviors takes place in local classes.
64 |
65 | 
66 |
67 | 8. Add the following code to the local class `lhc_shop` which implements the validation.
68 |
69 |
70 | CLASS lhc_shop DEFINITION INHERITING FROM cl_abap_behavior_handler.
71 |
72 | PUBLIC SECTION.
73 | CONSTANTS state_area_check_delivery_date TYPE string VALUE 'CHECK_DELIVERYDATE' ##NO_TEXT.
74 | PRIVATE SECTION.
75 | METHODS zz_validateDeliverydate FOR VALIDATE ON SAVE
76 | IMPORTING keys FOR Shop~zz_validateDeliverydate.
77 |
78 | ENDCLASS.
79 |
80 | CLASS lhc_shop IMPLEMENTATION.
81 |
82 | METHOD zz_validateDeliverydate.
83 | READ ENTITIES OF ZRAP630i_ShopTP_### IN LOCAL MODE
84 | ENTITY Shop
85 | FIELDS ( DeliveryDate OverallStatus )
86 | WITH CORRESPONDING #( keys )
87 | RESULT DATA(onlineorders).
88 |
89 | LOOP AT onlineorders INTO DATA(onlineorder).
90 | APPEND VALUE #( %tky = onlineorder-%tky
91 | %state_area = state_area_check_delivery_date )
92 | TO reported-shop.
93 | DATA(deliverydate) = onlineorder-DeliveryDate - cl_abap_context_info=>get_system_date( ).
94 | IF onlineorder-deliverydate IS INITIAL .
95 | APPEND VALUE #( %tky = onlineorder-%tky ) TO failed-shop.
96 | APPEND VALUE #( %tky = onlineorder-%tky
97 | %state_area = state_area_check_delivery_date
98 | %msg = new_message_with_text(
99 | severity = if_abap_behv_message=>severity-error
100 | text = 'delivery period cannot be initial'
101 | ) )
102 | TO reported-shop.
103 | ENDIF.
104 | ENDLOOP.
105 | ENDMETHOD.
106 | ENDCLASS.
107 |
108 |
109 | 9. Open the service binding `ZRAP630UI_SHOP_O4_###` of your RAP base BO.
110 |
111 | 10. Double-click on the entity **Shop** . This will start the ADT preview of the Shop RAP BO.
112 |
113 | 
114 |
115 | 10. Press the **Create** button on the list page.
116 | 11. The **New : Shop** object page opens where you have to enter the data for a new order.
117 | 12. Select a product for the field **OrderedItem** but do **NOT** select a **Delivery Date**
118 | 13. Press **Create**.
119 | 14. This shall raise the follwoing error message:
120 |
121 | 
122 |
123 |
124 |
125 | ## Exercise 2.2 Extend the behavior definition with an determination
126 |
127 | In a second step we will now add a determination `ZZ_setOverallStatus` to the behavior defintion extension. This shall be executed in case the content of the field `OrderedItem` is changed by the user.
128 |
129 |
130 | 🔵 Click to expand!
131 |
132 | 1. Add the following statement to your behavior defintion extension `ZRAP630R_EXT_SHOPTP_###`.
133 |
134 |
135 | determination ZZ_setOverallStatus on modify { field OrderedItem; }
136 |
137 |
138 | so that the code of your BDEF should now read as follows:
139 |
140 | extension using interface zrap630i_shoptp_###
141 | implementation in class zbp_rap630r_ext_shoptp_### unique;
142 |
143 | extend behavior for Shop
144 | {
145 | validation zz_validateDeliverydate on save { create; field DeliveryDate; }
146 |
147 | extend draft determine action Prepare
148 | {
149 | validation zz_validateDeliveryDate;
150 | }
151 | determination ZZ_setOverallStatus on modify { field OrderedItem; }
152 | }
153 |
154 |
155 | 2. Press **Ctrl+1** to start the content assist and double-click on the proposal to add the appropriate code in the behavior implementation class `zbp_rap630r_ext_shoptp_###`.
156 |
157 | 3. Add the following code into the implementation of the method `ZZ_setOverallStatus`. Do not forget to replace all occurences of `###` with your group number.
158 |
159 | > The code first performs a read request using EML using the key fields of our RAP BO that are provided by the framework an reads the data of all affected
160 | > orders. In the following loop statement it is checked whether the price exceeds a certain threshould (1000 EUR) and depending on the price the order is
161 | > either autmatically approved or is awaiting an approval.
162 | > The price for a product is read from an CDS view and the instance of the RAP BO is modified accordingly.
163 |
164 |
165 | METHOD ZZ_setOverallStatus.
166 |
167 | DATA update_bo TYPE TABLE FOR UPDATE ZRAP630i_ShopTP_###\\Shop.
168 | DATA update_bo_line TYPE STRUCTURE FOR UPDATE ZRAP630i_ShopTP_###\\Shop .
169 |
170 | READ ENTITIES OF ZRAP630I_ShopTP_### IN LOCAL MODE
171 | ENTITY Shop
172 | ALL FIELDS " ( OrderItemPrice OrderID )
173 | WITH CORRESPONDING #( keys )
174 | RESULT DATA(OnlineOrders)
175 | FAILED DATA(onlineorders_failed)
176 | REPORTED DATA(onlineorders_reported).
177 |
178 | DATA(product_value_help) = NEW zrap630_cl_vh_product_###( ).
179 | data(products) = product_value_help->get_products( ).
180 |
181 | LOOP AT onlineorders INTO DATA(onlineorder).
182 |
183 | update_bo_line-%tky = onlineorder-%tky.
184 |
185 | SELECT SINGLE * FROM @products as hugo
186 | WHERE Product = @onlineorder-OrderedItem INTO @data(product).
187 |
188 | update_bo_line-OrderItemPrice = product-Price.
189 | update_bo_line-CurrencyCode = product-Currency.
190 |
191 | IF product-Price > 1000.
192 | update_bo_line-OverallStatus = 'Awaiting approval'.
193 | ELSE.
194 | update_bo_line-OverallStatus = 'Automatically approved'.
195 | ENDIF.
196 |
197 | APPEND update_bo_line TO update_bo.
198 | ENDLOOP.
199 |
200 |
201 | MODIFY ENTITIES OF zrap630i_shoptp_### IN LOCAL MODE
202 | ENTITY Shop
203 | UPDATE FIELDS (
204 | OverallStatus
205 | CurrencyCode
206 | OrderItemPrice
207 | )
208 | WITH update_bo
209 | REPORTED DATA(update_reported).
210 |
211 | reported = CORRESPONDING #( DEEP update_reported ).
212 |
213 | ENDMETHOD.
214 |
215 |
216 |
217 | 3. > When you get the error message:
218 | > The entity "SHOP" does not have a determination "ZZ_SETOVERALLSTATUS".
219 | > This might be, because you have not activated yor BDEF yet.
220 |
221 | 4. Create a new entity and select an item or change the item an existing entity,
222 | **but don't save your changes** so that only the draft is affected.
223 |
224 | > You will notice that the draft data for the item name is updated, but the price is NOT updated in the draft.
225 | > Also the approval status does not change in the draft if the product price becomes larger than 1000 Euro.
226 | > The data will only be updated in the UI once you save your data.
227 | > This we will change in the following step of our excerise by using side effects.
228 |
229 |
230 |
231 |
232 |
233 | ## Exercise 2.3 Extend the behavior definition with side effects
234 |
235 | Now you can continue and add side effects via your behavior defintion extension.
236 |
237 | > Please note:
238 | > An extension via side effects is only possible if the extensible RAP business objects provide the `use side effects` statement in its behavior projection or in its interface projection.
239 | > Since the statement `use side effects` can not be added via an extension itself this has thus to be foreseen by the developer.
240 |
241 |
242 | 🔵 Click to expand!
243 |
244 | 1. Open the behavior extension `ZRAP630R_Ext_ShopTP_###` by pressing **Ctrl+Shift+A**.
245 | 2. Add the following code snippet
246 |
247 |
side effects { field OrderedItem affects field OrderItemPrice , field CurrencyCode , field OverallStatus ; }
248 |
249 | to your behavior extension right after the determination.
250 |
251 | Your BDEF extension code should now read as follows:
252 |
253 |
254 | extension using interface zrap630i_shoptp_###
255 | implementation in class zbp_rap630r_ext_shoptp_### unique;
256 |
257 | extend behavior for Shop
258 | {
259 | validation zz_validateDeliverydate on save { create; field DeliveryDate; }
260 | extend draft determine action Prepare
261 | {
262 | validation zz_validateDeliveryDate;
263 | }
264 | determination ZZ_setOverallStatus on modify { field OrderedItem; }
265 | side effects { field OrderedItem affects field OrderItemPrice , field CurrencyCode , field OverallStatus ; }
266 | }
267 |
268 |
269 | 3. Create a new order, specify a delivery data or open an existing order and switch to the edit mode and then select a (new) product.
270 |
271 | You will notice that the data for the product that you have selected in the SAP Fiori UI is being updated automatically.
272 | Also the approval status changes if the price changes from below 1000 Euro to a value that is larger than 1000 Euro and vice versa.
273 |
274 | 
275 |
276 |
277 |
278 |
279 |
280 |
281 | ## Summary
282 |
283 | You've now extended the behavior of the base RAP business object. For this you only had to create an extension of the BDEF of the base BO on the R-layer.
284 |
285 | Continue to - [Exercise 3 - Extend the data model ](../ex3/README.md)
286 |
287 |
288 |
--------------------------------------------------------------------------------
/exercises/ex2/README_235.md:
--------------------------------------------------------------------------------
1 | [Home - Cloud ERP Extensibility](../../../../#exercises)
2 |
3 | # Excercise 2, 3 and 4 - Extend a RAP business object
4 |
5 | In the following three exercises 2,3 and 4 you will extend a RAP business object.
6 |
7 | 
8 |
9 | Since extending a RAP business object in parallel by several developers can cause severe problems, every participant will work with his or her own base RAP business object. For your convenience an extensible RAP BO has thus been generated using the class `zdmo_gen_rap630_single` that you have run in the [Getting started](../ex0/README.md) section.
10 |
11 | In addition to the repository objects that are required for a normal RAP business object a RAP business object that has been enabled for extensibility requires three additional repository objects for each entity.
12 |
13 | - Extension include
14 | - Extension include view
15 | - Draft query view
16 |
17 | 
18 |
19 | - [Exercise 2 - Extend the behavior of a RAP business object (determinations, validations, side-effects)](../../exercises/ex2/)
20 | - [Exercise 3 - Extend the data model of a RAP business object (add additional fields)](../../exercises/ex3/)
21 | - [Exercise 4 - Extend the behavior of a RAP business object (add an action)](../../exercises/ex4/)
22 |
23 |
24 | You can continue with the next exercise - **[Exercise 2](../ex2/#readme)**.
25 |
26 |
27 |
--------------------------------------------------------------------------------
/exercises/ex2/images/Extensibility_Extend_the_behavior.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex2/images/Extensibility_Extend_the_behavior.png
--------------------------------------------------------------------------------
/exercises/ex2/images/Extensibility_RAP_Business_Object_Enabled_For_Extensibility.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex2/images/Extensibility_RAP_Business_Object_Enabled_For_Extensibility.png
--------------------------------------------------------------------------------
/exercises/ex2/images/README.md:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/exercises/ex2/images/Scenario_Extend_SAP_App.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex2/images/Scenario_Extend_SAP_App.png
--------------------------------------------------------------------------------
/exercises/ex2/images/ex2_01_010_RAP630.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex2/images/ex2_01_010_RAP630.png
--------------------------------------------------------------------------------
/exercises/ex2/images/ex2_01_020_RAP630.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex2/images/ex2_01_020_RAP630.png
--------------------------------------------------------------------------------
/exercises/ex2/images/ex2_01_030_RAP630.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex2/images/ex2_01_030_RAP630.png
--------------------------------------------------------------------------------
/exercises/ex2/images/ex2_01_040_RAP630.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex2/images/ex2_01_040_RAP630.png
--------------------------------------------------------------------------------
/exercises/ex2/images/ex2_01_050_RAP630.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex2/images/ex2_01_050_RAP630.png
--------------------------------------------------------------------------------
/exercises/ex2/images/ex2_01_060_RAP630.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex2/images/ex2_01_060_RAP630.png
--------------------------------------------------------------------------------
/exercises/ex2/images/ex2_01_070_RAP630.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex2/images/ex2_01_070_RAP630.png
--------------------------------------------------------------------------------
/exercises/ex2/images/ex2_01_090_RAP630.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex2/images/ex2_01_090_RAP630.png
--------------------------------------------------------------------------------
/exercises/ex2/images/ex2_01_overview_RAP630.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex2/images/ex2_01_overview_RAP630.png
--------------------------------------------------------------------------------
/exercises/ex2/images/ex2_02_010_RAP630.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex2/images/ex2_02_010_RAP630.png
--------------------------------------------------------------------------------
/exercises/ex2/images/ex2_02_020_RAP630.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex2/images/ex2_02_020_RAP630.png
--------------------------------------------------------------------------------
/exercises/ex2/images/ex2_02_030_RAP630.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex2/images/ex2_02_030_RAP630.png
--------------------------------------------------------------------------------
/exercises/ex2/images/ex2_02_040_RAP630.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex2/images/ex2_02_040_RAP630.png
--------------------------------------------------------------------------------
/exercises/ex3/README.md:
--------------------------------------------------------------------------------
1 | [Home - Cloud ERP Extensibility](../../../../#exercises)
2 |
3 | # Exercise 3 - Extend the CDS data model of the extensible RAP base business object
4 |
5 | ## Introduction
6 |
7 | In the preceeding exercise we have extended the _behavior_ of the based RAP BO by adding a determination, a validation and a side effect.
8 |
9 | We will now adapt the _CDS data model_, that means we will add new fields to the _Shop_ entity.
10 |
11 | Compared to the activities for adding additional behavior this is a larger amount of work since the complete stack of CDS views has be extended rather than only extensing the behavior definition (BDEF).
12 |
13 | 
14 |
15 | > In order to extend the data model of a RAP BO the base RAP BO must be enabled to support extensibility as described in the Online Help.
16 | > [RAP Extensibility-Enablement](https://help.sap.com/docs/abap-cloud/abap-rap/rap-extensibility-enablement)
17 | > For your convenience the generated RAP BO `ZRAP630R_ShopTP_###` that has been prepared for your convenience supports the extensibility of the data model.
18 |
19 | As shown in the schematic view above we have to extend the following objects of our extensible base BO.
20 |
21 | Order of extension | Repository object name | Name | Comment
22 | -------- | ---------------------- | ------------------------ | -----------------------------------------------------
23 | 1 | `ZRAP630SSHOP_###` | Extension include | extends active and draft table with additional fields
24 | 2 | `ZRAP630E_Shop_###` | Extension include view | selects from (extended) active table
25 | 3 | `ZRAP630R_ShopTP_###` | Restricted base view | selects from (2)
26 | 4 | `ZRAP630C_ShopTP_###` | CDS projection view | selects from (3)
27 | 5 | `ZRAP630I_ShopTP_###` | Interface view | selects from (3)
28 | 6 | `ZRAP630R_Shop_D_###` | Draft query view | selects from (extended) draft table
29 |
30 |
31 | ## Step-by-Step guide
32 |
33 | While for **SAP BTP ABAP Environment** and for **SAP S/4HANA Cloud ABAP Environment** there is an [extension field wizard](https://help.sap.com/docs/abap-cloud/abap-development-tools-user-guide/generating-extension-fields) available in **SAP S/4HANA 2023** you have to create the extension objects for the objects mentioned above **manually**.
34 |
35 | Therefore we have two different how-to-guides depending on the type of ABAP system you are working on.
36 |
37 | Continue here when working in **SAP BTP ABAP Environment** or **SAP S/4HANA ABAP Environment**:
38 |
39 | [Exercise 3 - Add a field with the field extensibility wizard ](../ex3/README_ABAP_ENVIRONMENT.md)
40 |
41 | Continue here when working in an on premise or private cloud **SAP S/4HANA 2023** system :
42 |
43 | [Exercise 3 - Add a field manually ](../ex3/README_2023.md)
44 |
45 |
46 | ## Summary
47 |
48 | You have now added a single editable field to your extensible RAP business object.
49 | In the next execise we will show how to add an action.
50 |
51 | Continue to - [Exercise 4 - Add an action ](../ex4/README.md)
52 |
53 |
54 |
55 |
--------------------------------------------------------------------------------
/exercises/ex3/README_2023.md:
--------------------------------------------------------------------------------
1 | [Home - Cloud ERP Extensibility](../../../../#exercises)
2 |
3 | # Exercise 3 - Extend the CDS data model of the extensible RAP base business object
4 |
5 | As shown in the schematic view above we have to extend the following objects of our extensible base BO.
6 |
7 | Order of extension | Repository object name | Name | Comment
8 | -------- | ---------------------- | ------------------------ | -----------------------------------------------------
9 | 1 | `ZRAP630SSHOP_###` | Extension include | extends active and draft table with additional fields
10 | 2 | `ZRAP630E_Shop_###` | Extension include view | selects from (extended) active table
11 | 3 | `ZRAP630R_ShopTP_###` | Restricted base view | selects from (2)
12 | 4 | `ZRAP630C_ShopTP_###` | CDS projection view | selects from (3)
13 | 5 | `ZRAP630I_ShopTP_###` | Interface view | selects from (3)
14 | 6 | `ZRAP630R_Shop_D_###` | Draft query view | selects from (extended) draft table
15 |
16 |
17 | 
18 |
19 |
20 | ## Exercise 3.1 - Extend the extension include with an append structure - Add a field
21 |
22 | We start the extension of the base RAP BO by adding field to the _extension include structure_ by creating an _append structure_ .
23 |
24 |
25 | 🔵 Click to expand!
26 |
27 | 1. Right click on the _extension include structure_ `ZRAP630SSSHOP_###` and choose **New Append Structure** from the context menue.
28 |
29 | 
30 |
31 | 2. In the **New Append Structure** dialogue enter the following values.
32 |
33 | Be sure to change the package name to `ZRAP630_###_EXT` since the wizard in ADT by default propopses the package of the include structure of your base RAP BO.
34 |
35 | Package: `ZRAP630_###_EXT` ⚠️
36 | Name: `ZAPD_ZRAP630SSHOP_###`
37 | Description: Extend Extension Include Structure
38 |
39 | and press **Next**.
40 |
41 | 3. Select the transport request that has been created for your extension package and press **Finish**.
42 |
43 | 3. In the code editor enter the following code snippet
44 |
45 | ```abap
46 | zzfeedbackzaa : text100;
47 | ```
48 |
49 | So that your code should read as follows:
50 |
51 |
58 |
59 |
60 | 4. Activate your changes
61 |
62 |
63 |
64 | ## Excercise 3.2 - Extend the extension include view
65 |
66 | In the following we will explain how to extend the remaining 5 CDS view entities. Since the process (the wizard) is the same for each CDS view entity we will only show screen shots for doing this for the first CDS view that has to be extended, which is the extension of the _Extension Include View_ `ZRAP630E_Shop_###`.
67 |
68 | For the remaining CDS views we will only provide the code snippets.
69 |
70 |
71 | 🔵 Click to expand!
72 |
73 | First we have to extend our extension include view `ZRAP630E_Shop_###` since the R-view reads from this view .
74 |
75 | 1. Right click on the CDS view of the base RAP business object that has to be extended. In this case right click on ´ZRAP630E_Shop_###´.
76 |
77 | 
78 |
79 | 2. Select **New Data Definition** from the context menu.
80 |
81 | 
82 |
83 | 3. In the **New Data Defintion** screen enter the following values:
84 |
85 | Package: `ZRAP630_###_EXT` --> !!! Be sure to have changed the package name since ADT will propose the name of the package where your base RAP BO resides in
86 |
87 | Name: `ZX_ZRAP630E_SHOP_###`
88 | Description: `Extension for Extension Include View`
89 |
90 | and press **Next** .
91 |
92 | 4. Select a transport request and press **Next**.
93 |
94 | > **Caution:**
95 | > Do **NOT** press finish, because on the following screen you have to select the template that shall be used.
96 |
97 | 5. Select the template **Extend View Entity** and press **Finish**
98 |
99 | 
100 |
101 | 6. The editor window opens. Here you have to enter the following code.
102 |
103 |
104 | extend view entity ZRAP630E_Shop_### with {
105 | Shop.zz_feedback_zaa as zz_feedback_zaa
106 | }
107 |
108 |
109 | 
110 |
111 |
112 |
113 | ## Excercise 3.3 - Extend the remaining CDS views
114 |
115 | You have now to extend the remaining 4 CDS views in the following order with the following code snippets as we have done this for the extension include view in Exercise 3.5.
116 |
117 |
118 | 🔵 Click to expand!
119 |
120 | ### Extension for R-CDS view
121 |
122 | Name: `ZX_ZRAP630R_SHOPTP_###`
123 | Package: `ZRAP630_###_EXT`
124 | Description: Extension for R-CDS view
125 |
126 | > **Please note:**
127 | > The code extension of the R-CDS view reads from the `_Extension` association as the data source.
128 | > All other extensions read from the alias `Shop` as the data source.
129 |
130 | ```abap
131 | extend view entity ZRAP630R_SHOPTP_### with
132 | {
133 | @EndUserText.label: 'Feedback'
134 | _EXTENSION.ZZFEEDBACKZAA as ZZFEEDBACKZAA
135 | }
136 | ```
137 |
138 | ### Extension for C-CDS view
139 |
140 | Name: `ZX_ZRAP630C_SHOPTP_###`
141 | Package: `ZRAP630_###_EXT`
142 | Description: Extension for P-CDS view
143 |
144 | ```abap
145 | extend view entity ZRAP630C_SHOPTP_### with
146 | {
147 | @EndUserText.label: 'Feedback'
148 | @UI.dataFieldDefault: [{hidden: false}]
149 | @UI.identification: [{hidden: false}]
150 | @UI.lineItem: [{hidden: false}]
151 | SHOP.ZZFEEDBACKZAA as ZZFEEDBACKZAA
152 |
153 | }
154 | ```
155 |
156 | ### Extension for I-CDS view
157 |
158 | Name: `ZX_ZRAP630I_SHOPTP_###`
159 | Package: `ZRAP630_###_EXT`
160 | Description: Extension for interface view
161 |
162 | ```abap
163 | extend view entity ZRAP630I_SHOPTP_### with
164 | {
165 | @EndUserText.label: 'Feedback'
166 | SHOP.ZZFEEDBACKZAA as ZZFEEDBACKZAA
167 |
168 | }
169 | ```
170 |
171 |
172 | ### Extension for draft query view
173 |
174 | Name: `ZX_ZRAP630R_SHOP_D_###`
175 | Package: `ZRAP630_###_EXT`
176 | Description: Extension for draft query view
177 |
178 | ```ABAP
179 | extend view entity ZRAP630R_SHOP_D_### with
180 | {
181 | SHOP.ZZFEEDBACKZAA as ZZFEEDBACKZAA
182 |
183 | }
184 | ```
185 |
186 |
187 |
188 |
189 | #### Result
190 |
191 | The extension project should now look like as follows:
192 |
193 | 
194 |
195 | No. | Extension repository object | Extended repository object | Comment
196 | -------- | ------------------------- | ------------------------ | -----------------------------------------------------
197 | 1 | `ZAPD_ZRAP630SSHOP_###` | `ZRAP630SSHOP_###` | extends extension include structure
198 | 2 | `ZX_ZRAP630E_SHOP_###` | `ZRAP630E_Shop_###` | extends extension include view
199 | 3 | `ZX_ZRAP630R_SHOPTP_###` | `ZRAP630R_ShopTP_###` | extends restricted transcational base view
200 | 4 | `ZX_ZRAP630C_SHOPTP_###` | `ZRAP630C_ShopTP_###` | extends transactional projection view
201 | 5 | `ZX_ZRAP630I_SHOPTP_###` | `ZRAP630I_ShopTP_###` | extends transactional interface view
202 | 6 | `ZX_ZRAP630R_SHOP_D_###` | `ZRAP630R_Shop_D_###` | extends draft query view
203 |
204 |
205 |
206 |
207 | ### Exercise 3.3 - Test the field extensibility
208 |
209 | After having extended all the objects in the hiearchy of your base RAP business object you can now leverage the additional field in the UI.
210 |
211 |
212 | 🔵 Click to expand!
213 |
214 | 1. Open the Service Binding of the extensible RAP business object and double-click on the entity**Shop**.
215 |
216 | 2. Press the **Go** button.
217 |
218 | You should see a new column called "Feedback".
219 |
220 | 
221 |
222 | 3. Select one entry and use the **Edit** button
223 |
224 | 
225 |
226 |
227 | > When no field is visible you should check the extension of your projection view `ZRAP630C_EXT_SHOPTP_###` and check the UI annotations.
228 |
229 |
230 |
231 | ## Summary
232 |
233 | You have now added a single editable field to your extensible RAP business object.
234 | In the next execise we will show how to add an action.
235 |
236 | Continue to - [Exercise 4 - Add an action ](../ex4/README.md)
237 |
238 |
239 |
240 |
--------------------------------------------------------------------------------
/exercises/ex3/README_ABAP_ENVIRONMENT.md:
--------------------------------------------------------------------------------
1 | [Home - Cloud ERP Extensibility](../../../../#exercises)
2 |
3 | # Exercise 3 - Extend the CDS data model using the field extension wizard
4 |
5 | The **extension field wizard** can be started from the consumption (c-view) or interface projection view (i-view) or from the underlying restricted base view (r-view). Depending on which view is used as the starting point certain options are pre-set in the wizard.
6 |
7 | 
8 |
9 | When for example using the C-view as the entry point the wizard will suggest to extend the C-view by default.
10 |
11 | ## Excercise 3.1 - Extend the data structure with the extension field wizard
12 |
13 | 1. Right click on the consumption projection view `ZRAP630C_ShopTP_###` (the one with the statement `provider contract TRANSACTIONAL_QUERY` ) and choose **Generate ABAP Repository Objects ..**.
14 |
15 | 
16 |
17 | 3. In the **Select Generator** screen choose **ABAP Cloud: Extensibility** and then **Extension Fields**. Press **Next**.
18 |
19 | 
20 |
21 | 4. In the **Enter Package** screen enter the name of the package `ZRAP630_###_EXT` and press **Next**.
22 |
23 | 
24 |
25 | 5. In the **Configure Generator** screen press **Add** (1). Then, in the **Add Field** dialogue enter the following values (2) to add a field to enter feedback:
26 |
27 | - Name `ZZFEEDBACKZAA`
28 | - Label: `Feedback`
29 | - Data Elemeent: `TEXT100`
30 | - Activate the check box **Generate UI annotations** (3)
31 |
32 | and press **Add** (4)
33 |
34 | 
35 |
36 | 6. Expand the section **Business Service Layer Extensions** and verify that the option **Extend Object ?** is checked and press **Next**.
37 |
38 | 
39 |
40 | 7. The wizard now shows the list of ABAP Artifacts that are going to be created / modified.
41 |
42 | 
43 |
44 | You can check out the code for also for the other artifacts that are going to be generated
45 |
46 |
47 | 🔵 Click to show other artifacts
48 |
49 | ### Extension include structure
50 |
51 | 
52 |
53 | ### Extension include view
54 |
55 | 
56 |
57 |
58 | ### Extension for draft query view
59 |
60 | 
61 |
62 | ### Extension for base restricted view
63 |
64 | 
65 |
66 | ### Extension for tranactional interface view
67 |
68 | 
69 |
70 | ### Extension for tranactional consumption view
71 |
72 | 
73 |
74 |
146 |
147 | 8. Press **Next** to continue
148 |
149 | 9. Select a transport request
150 |
151 |
152 |
153 |
154 |
155 | ## Excercise 3.2 - Check the data structure extension
156 |
157 | The wizard has generated the following repository objects:
158 |
159 |
160 | No. | Extension repository object | Extended repository object | Comment
161 | -------- | ------------------------- | ------------------------ | -----------------------------------------------------
162 | 1 | `ZAPD_ZRAP630SSHOP_###` | `ZRAP630SSHOP_###` | extends extension include structure
163 | 2 | `ZX_ZRAP630E_SHOP_###` | `ZRAP630E_Shop_###` | extends extension inlcude view
164 | 3 | `ZX_ZRAP630R_SHOPTP_###` | `ZRAP630R_ShopTP_###` | extends restricted transcational base view
165 | 4 | `ZX_ZRAP630C_SHOPTP_###` | `ZRAP630C_ShopTP_###` | extends transactional projection view
166 | 5 | `ZX_ZRAP630I_SHOPTP_###` | `ZRAP630I_ShopTP_###` | extends transactional interface view
167 | 6 | `ZX_ZRAP630R_SHOP_D_###` | `ZRAP630R_Shop_D_###` | extends draft query view
168 |
169 | The extension project should now look like as follows:
170 |
171 | 
172 |
173 | ### Exercise 3.3 - Test the field extensibility
174 |
175 | After having extended all the objects in the hiearchy of your base RAP business object you can now leverage the additional field in the UI.
176 |
177 |
178 | 🔵 Click to expand!
179 |
180 | 1. Open the Service Binding of the extensible RAP business object and double-click on the entity**Shop**.
181 |
182 | 2. Press the **Go** button.
183 |
184 | You should see a new column called "Feedback".
185 |
186 | 
187 |
188 | 3. Select one entry and use the **Edit** button
189 |
190 | 
191 |
192 |
193 | > Hint:
194 | > ⚠️ When no field is visible you should check the extension of your projection view `ZX_ZRAP630C_SHOPTP_###` and check the UI annotations.
195 |
196 |
197 |
198 | ## Summary
199 |
200 | You have now added a single editable field to your extensible RAP business object.
201 | In the next execise we will show how to add an action.
202 |
203 | Continue to - [Exercise 4 - Add an action ](../ex4/README.md)
204 |
205 |
206 |
--------------------------------------------------------------------------------
/exercises/ex3/images/Extensibility_Extend_the_data_model.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex3/images/Extensibility_Extend_the_data_model.png
--------------------------------------------------------------------------------
/exercises/ex3/images/README.md:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/exercises/ex3/images/ex3_01_overview_RAP630.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex3/images/ex3_01_overview_RAP630.png
--------------------------------------------------------------------------------
/exercises/ex3/images/ex3_02_010_RAP630.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex3/images/ex3_02_010_RAP630.png
--------------------------------------------------------------------------------
/exercises/ex3/images/ex3_02_020_RAP630.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex3/images/ex3_02_020_RAP630.png
--------------------------------------------------------------------------------
/exercises/ex3/images/ex3_02_030_RAP630.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex3/images/ex3_02_030_RAP630.png
--------------------------------------------------------------------------------
/exercises/ex3/images/ex3_02_040_show_objects_to_be_extended.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex3/images/ex3_02_040_show_objects_to_be_extended.png
--------------------------------------------------------------------------------
/exercises/ex3/images/ex3_03_010_RAP630.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex3/images/ex3_03_010_RAP630.png
--------------------------------------------------------------------------------
/exercises/ex3/images/ex3_03_020_RAP630.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex3/images/ex3_03_020_RAP630.png
--------------------------------------------------------------------------------
/exercises/ex3/images/ex3_03_030_RAP630.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex3/images/ex3_03_030_RAP630.png
--------------------------------------------------------------------------------
/exercises/ex3/images/ex3_03_030_RAP640.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex3/images/ex3_03_030_RAP640.png
--------------------------------------------------------------------------------
/exercises/ex3/images/ex3_03_040_overview_of_obj_to_be_extended.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex3/images/ex3_03_040_overview_of_obj_to_be_extended.png
--------------------------------------------------------------------------------
/exercises/ex3/images/ex3_03_330_RAP630.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex3/images/ex3_03_330_RAP630.png
--------------------------------------------------------------------------------
/exercises/ex3/images/ex3_04_010_RAP640.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex3/images/ex3_04_010_RAP640.png
--------------------------------------------------------------------------------
/exercises/ex3/images/ex3_04_020_RAP640.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex3/images/ex3_04_020_RAP640.png
--------------------------------------------------------------------------------
/exercises/ex3/images/ex3_04_030_RAP640.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex3/images/ex3_04_030_RAP640.png
--------------------------------------------------------------------------------
/exercises/ex3/images/ex3_05_010_RAP630.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex3/images/ex3_05_010_RAP630.png
--------------------------------------------------------------------------------
/exercises/ex3/images/ex3_05_RAP630.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex3/images/ex3_05_RAP630.png
--------------------------------------------------------------------------------
/exercises/ex3/images/ex3_06_010_RAP630.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex3/images/ex3_06_010_RAP630.png
--------------------------------------------------------------------------------
/exercises/ex3/images/ex3_06_020_RAP630.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex3/images/ex3_06_020_RAP630.png
--------------------------------------------------------------------------------
/exercises/ex3/images/ex3_06_030_RAP630.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex3/images/ex3_06_030_RAP630.png
--------------------------------------------------------------------------------
/exercises/ex3/images/ex3_Extend_view_entity_025.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex3/images/ex3_Extend_view_entity_025.jpg
--------------------------------------------------------------------------------
/exercises/ex3/images/ex3_Extensions_overview_055.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex3/images/ex3_Extensions_overview_055.jpg
--------------------------------------------------------------------------------
/exercises/ex3/images/ex3_extension_for_ext_include_005.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex3/images/ex3_extension_for_ext_include_005.png
--------------------------------------------------------------------------------
/exercises/ex3/images/ex3_extension_for_ext_include_010.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex3/images/ex3_extension_for_ext_include_010.png
--------------------------------------------------------------------------------
/exercises/ex3/images/ex3_extension_for_ext_include_030.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex3/images/ex3_extension_for_ext_include_030.png
--------------------------------------------------------------------------------
/exercises/ex3/images/ex3_new_field_feedback_010.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex3/images/ex3_new_field_feedback_010.png
--------------------------------------------------------------------------------
/exercises/ex3/images/ex3_new_field_feedback_020.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex3/images/ex3_new_field_feedback_020.png
--------------------------------------------------------------------------------
/exercises/ex3/images/ex3_with_wizard_010.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex3/images/ex3_with_wizard_010.png
--------------------------------------------------------------------------------
/exercises/ex3/images/ex3_with_wizard_020.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex3/images/ex3_with_wizard_020.png
--------------------------------------------------------------------------------
/exercises/ex3/images/ex3_with_wizard_025.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex3/images/ex3_with_wizard_025.png
--------------------------------------------------------------------------------
/exercises/ex3/images/ex3_with_wizard_030.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex3/images/ex3_with_wizard_030.png
--------------------------------------------------------------------------------
/exercises/ex3/images/ex3_with_wizard_100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex3/images/ex3_with_wizard_100.png
--------------------------------------------------------------------------------
/exercises/ex3/images/ex3_with_wizard_110.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex3/images/ex3_with_wizard_110.png
--------------------------------------------------------------------------------
/exercises/ex3/images/ex3_with_wizard_120.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex3/images/ex3_with_wizard_120.png
--------------------------------------------------------------------------------
/exercises/ex3/images/ex3_with_wizard_130.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex3/images/ex3_with_wizard_130.png
--------------------------------------------------------------------------------
/exercises/ex3/images/ex3_with_wizard_140.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex3/images/ex3_with_wizard_140.png
--------------------------------------------------------------------------------
/exercises/ex3/images/ex3_with_wizard_150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex3/images/ex3_with_wizard_150.png
--------------------------------------------------------------------------------
/exercises/ex3/images/ex3_with_wizard_160.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex3/images/ex3_with_wizard_160.png
--------------------------------------------------------------------------------
/exercises/ex3/images/ex3_with_wizard_170.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex3/images/ex3_with_wizard_170.png
--------------------------------------------------------------------------------
/exercises/ex3/images/ex3_with_wizard_180.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex3/images/ex3_with_wizard_180.png
--------------------------------------------------------------------------------
/exercises/ex3/images/ex3_with_wizard_190.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SAP-samples/abap-platform-rap630/7bc7fd9ec26f47b6c620f11b5cbbc42e4c6b6394/exercises/ex3/images/ex3_with_wizard_190.png
--------------------------------------------------------------------------------
/exercises/ex4/README.md:
--------------------------------------------------------------------------------
1 | [Home - Cloud ERP Extensibility](../../../../#exercises)
2 |
3 | # Exercise 4 - Extend the business object with an action
4 |
5 | After having added a field we will add an action to the base RAP BO.
6 |
7 | > ⚠ Please note:
8 | > Actions can only be added using extensibility to fields that have been added via extensibility themselves.
9 | > This is why we have added this exercise as the fourth exercise after a field for adding feedback has been added to our Shop RAP business object.
10 |
11 | This action will be used to create/ update comments.
12 | We will thus make the new field that has been added to enter a comment read-only
13 | and add the required extensions to the
14 |
15 | - BDEF (add the action)
16 | - Projection BDEF (add a use statement)
17 | - Projection view (add UI annotations to make the button of the action visible)
18 |
19 | ### Exercise 4.1 Create an abstract entity
20 |
21 | We want to provide the feedback for an order as a parameter of an action that will be added as an extenstion.
22 | Parameters are passed to the action using abstract entites.
23 |
24 | 1. Right click on the folder **Data Definition** in your package `ZRAP630_###_EXT`
25 | 2. Choose **New data defintion** from the context menu
26 | - Package: `ZRAP630_###_EXT`
27 | - Name: `ZRAP630_A_Feedback_###`
28 | - Description: `Pass feedback as a parameter`
29 | and press **Next**
30 | 3. Select a transport
31 | 4. Expand the folder **Abstract Entity(creation)**
32 | 5. Select the template **Define abstract entity with parameters** and press **Finish**
33 |
34 | 
35 |
36 | 6. Enter the following coding
37 |
38 |
45 |
46 | 7. Activate your changes
47 |
48 | ### Exercise 4.2 Extend the behavior definition
49 |
50 | Now we can define the action with the parameter that has just been created.
51 |
52 | 1. Open the behavior extension `ZRAP630R_EXT_SHOPTP_###`
53 | 2. Add the following code snippet in your behavior extension `ZRAP630R_EXT_SHOPTP_###`
54 |
55 |
63 | extension using interface zrap630i_shoptp_###
64 | implementation in class zbp_rap630r_ext_shoptp_### unique;
65 |
66 | extend behavior for Shop
67 | {
68 |
69 | validation zz_validateDeliverydate on save { create; field DeliveryDate; }
70 |
71 | extend draft determine action Prepare
72 | {
73 | validation zz_validateDeliveryDate;
74 | }
75 | determination ZZ_setOverallStatus on modify { field OrderedItem; }
76 |
77 | side effects { field OrderedItem affects field OrderItemPrice , field CurrencyCode ; }
78 |
79 | field(readonly) zzfeedbackzaa;
80 | action(authorization : global, features : instance ) ZZ_ProvideFeedback parameter ZRAP630_A_Feedback_### result[1] $self;
81 | }
82 |
83 |
84 | 3. Activate your changes.
85 |
86 | 3. Use the code assist (Press Ctrl+1) on the **Shop** entity and let the framework generate the missing artefacts.
87 |
88 | 
89 |
90 | ### Exercise 4.3 - Implement the method for the action in the behvior implementation class
91 |
92 | 1. Open the local class of the behavior implementation class.
93 |
94 | 
95 |
96 | 2. Implement the method zz_providefeedback and activate your changes
97 |
98 |
99 | METHOD ZZ_ProvideFeedback.
100 | MODIFY ENTITIES OF ZRAP630I_ShopTP_### IN LOCAL MODE
101 | ENTITY Shop
102 |
103 | UPDATE FIELDS ( zzfeedbackzaa )
104 | WITH VALUE #( FOR key IN keys ( %tky = key-%tky
105 | zzfeedbackzaa = key-%param-feedback ) ).
106 |
107 | "Read the changed data for action result
108 | READ ENTITIES OF ZRAP630I_ShopTP_### IN LOCAL MODE
109 | ENTITY Shop
110 | ALL FIELDS WITH
111 | CORRESPONDING #( keys )
112 | RESULT DATA(result_read).
113 | "return result entities
114 | result = VALUE #( FOR order_2 IN result_read ( %tky = order_2-%tky
115 | %param = order_2 ) ).
116 |
117 | ENDMETHOD.
118 |
119 |
120 | ### Exercise 4.4 - Extend the projection BDEF
121 |
122 | In order to make the action visible an appropriate `use action` statement has to added to the projection level of the BDEF of the extensible root BO.
123 |
124 | 1. Right click on the projection behavior definition `ZRAP630C_ShopTP_###` within the package `ZRAP630_###` and select **New Behavior Extension**
125 |
126 | 
127 |
128 | 2. Fill in the data for the projection behavior extension
129 |
130 | - Package: `ZRAP630_###_EXT`
131 | - Name: `ZRAP630C_Ext_SHOPTP_###`
132 | - Description: Behavior extension for projection bdef
133 |
134 | 
135 |
136 | 3. Select a transport and press **Finish**
137 |
138 | 4. Enter a use statement for your action so that the code looks like
139 |
140 |
141 | extension for projection;
142 |
143 | extend behavior for Shop
144 | {
145 | use action ZZ_ProvideFeedback;
146 | }
147 |
148 |
149 | ### Exercise 4.5 - Add UI annotation
150 |
151 | UI annotations have to be added to make the action button visible. This is done in the C-View Extension `ZRAP630C_EXT_SHOPTP_###`.
152 |
153 | For this you have to add the following code snippet to the `UI.identification` and `UI.lineitem` annotations.
154 |
155 |