Skip to content

Commit d08bb26

Browse files
VolkerDreesGitHub Enterprise
authored and
GitHub Enterprise
committedMar 14, 2019
Merge pull request #1 from ABAP-for-HANA-Programming-Model/staging
Staging
2 parents 31f23e8 + 586669d commit d08bb26

File tree

68 files changed

+2362
-64
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+2362
-64
lines changed
 

‎README.md

+40-21
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,52 @@
22
The ABAP RESTful programming model defines the architecture for efficient end-to-end development of intrinsically SAP HANA-optimized Fiori apps in SAP Cloud Platform ABAP Environment. It supports the development of all types of Fiori applications as well as A2X services. It is based on technologies and frameworks such as Core Data Services (CDS) for defining semantically rich data models and a service model infrastructure for creating OData services with bindings to an OData protocol and ABAP-based application services for custom logic and SAPUI5-based user interfaces.
33

44
## Prerequisites
5-
Please make sure to fulfill the following requirements:
6-
* You have access to an SAP Cloud Platform ABAP Environment instance (see [here](https://blogs.sap.com/2018/09/04/sap-cloud-platform-abap-environment) for additional information)
7-
* You have downloaded and installed [ABAP Development Tools for SAP NetWeaver](https://tools.hana.ondemand.com/#abap) (ADT)
8-
* You have created an ABAP Cloud Project in ADT that allows you to access your SAP Cloud Platform ABAP Environment instance
9-
* You have installed the [abapGit](https://github.com/abapGit/eclipse.abapgit.org) plug-in for Eclipse via the updatesite `http://eclipse.abapgit.org/updatesite/`
10-
11-
## Download and Installation
12-
Use the abapGit plug-in to install the Flight Reference Scenario by executing the following steps:
13-
* In ADT create the package `/DMO/FLIGHT` as a subpackage under `/DMO/SAP` (keep the defaulted values)
14-
* In ADT click on `Window` > `Show View` > `Other...` and choose the entry `abapGit Repositories` to open the abapGit view
15-
* Make sure to have the right ABAP Cloud Project marked (See the little headline in the abapGit view for the current project)
16-
* Click on the `+` icon to clone a abapGit repository
17-
* Provide the URL of this repository: `https://github.com/SAP/abap-platform-refscen-flight.git`
18-
* On the next page choose the master branch and provide the package `/DMO/FLIGHT`
19-
* Provide a valid transport request and choose `Finish`. This starts the cloning of the repository - which might take a few minutes
20-
* Once the cloning has finished, refresh your project tree
5+
Make sure to fulfill the following requirements:
6+
* You have access to an SAP Cloud Platform ABAP Environment instance (see [here](https://blogs.sap.com/2018/09/04/sap-cloud-platform-abap-environment) for additional information).
7+
* You have downloaded and installed ABAP Development Tools (ADT). Make sure to use the most recent version as indicated on the [installation page](https://tools.hana.ondemand.com/#abap).
8+
* You have created an ABAP Cloud Project in ADT that allows you to access your SAP Cloud Platform ABAP Environment instance (see [here](https://help.sap.com/viewer/5371047f1273405bb46725a417f95433/Cloud/en-US/99cc54393e4c4e77a5b7f05567d4d14c.html) for additional information).
9+
* You have installed the [abapGit](https://github.com/abapGit/eclipse.abapgit.org) plug-in for ADT from the update site `http://eclipse.abapgit.org/updatesite/`.
10+
11+
## Download
12+
Use the abapGit plug-in to install the <em>Flight Reference Scenario</em> by executing the following steps:
13+
1. In your ABAP cloud project, create the ABAP package `/DMO/FLIGHT` (using the superpackage `/DMO/SAP`) as the target package for the demo content to be downloaded (leave the suggested values unchanged when following the steps in the package creation wizard).
14+
2. To add the <em>abapGit Repositories</em> view to the <em>ABAP</em> perspective, click `Window` > `Show View` > `Other...` from the menu bar and choose `abapGit Repositories`.
15+
3. In the <em>abapGit Repositories</em> view, click the `+` icon to clone an abapGit repository.
16+
4. Enter the following URL of this repository: `https://github.com/SAP/abap-platform-refscen-flight.git` and choose <em>Next</em>.
17+
5. Select the <em>master</em> branch and enter the newly created package `/DMO/FLIGHT` as the target package.
18+
6. Create a new transport request that you only use for this demo content installation (recommendation) and choose <em>Finish</em> to start the cloning of the repository contents. Note that this procedure may take a few minutes.
19+
7. Once the cloning has finished, refresh your project tree.
20+
21+
As a result of the installation procedure above, the ABAP system creates an inactive version of all artifacts from the demo content and adds the following sub packages to the target package:
22+
* `/DMO/FLIGHT_LEGACY`
23+
* `/DMO/FLIGHT_REUSE`
24+
* `/DMO/FLIGHT_READONLY` - represents a read-only list reporting app (see also: corresponding [end-to-end guide](https://help.sap.com/viewer/c0d02c4330c34b3abca88bdd57eaccfc/Cloud/en-US/a1243bff462b4ee3a03e2bb6fc30e015.html)).
25+
* `/DMO/FLIGHT_UNMANAGED` - represents the transactional app with implementation type <em>unmanaged</em> (see also: corresponding [end-to-end guide](https://help.sap.com/viewer/c0d02c4330c34b3abca88bdd57eaccfc/Cloud/en-US/971e03cd952a47458e57f87fc566a8f3.html)).
26+
27+
NOTE: The demo packages do not include <em>service bindings</em>. They must be created in your own namespace to complete the service.
28+
Then you can run, for exmaple, the UI services with the <em>Fiori Elements</em> preview in the <em>service binding</em>.
2129

2230
## Configuration
23-
The cloned content contains "legacy" logic only. This includes e.g. DDIC artifacts and Function Modules. The legacy content can be used together with the end-2end development guides (see [here](https://help.sap.com/viewer/c0d02c4330c34b3abca88bdd57eaccfc/Cloud/en-US/3b77569ca8ee4226bdab4fcebd6f6ea6.html) > Develop) to build e.g. a Fiori List Reporting and a Fiori Transactional Application.
31+
To activate all development objects from the `/DMO/FLIGHT` package:
32+
1. Click the mass-activation icon (<em>Activate Inactive ABAP Development Objects</em>) in the toolbar.
33+
2. In the dialog that appears, select all development objects in the transport request (that you created for the demo content installation) and choose `Activate`.
2434

25-
Once cloned, run ABAP class `/DMO/CL_FLIGHT_DATA_GENERATOR` in ADT via `F9` (Run as Console Application) to generate some sample data.
35+
To create a <em>service binding</em> for the read-only list reporting app (package `/DMO/FLIGHT_READONLY`):
36+
1. Right-click the service definition `/DMO/FLIGHT_R` and choose `New Service Binding` (see [here](https://help.sap.com/viewer/c0d02c4330c34b3abca88bdd57eaccfc/Cloud/en-US/6709cab6cb5b4c01b28463d760429a9a.html) for additional information).
37+
2. Specify your own package and your own namespace when following the steps in the creation wizard.
2638

27-
## Known Issues
28-
After cloning a abapGit repository some objects might not be active. Use the mass activation feature in ADT to activate those artifacts.
39+
NOTE: The namespace /DMO/ is reserved for the demo content. Apart from the downloaded demo content, do not use the namespace /DMO/ and do not create any development objects in the downloaded packages. You can access the development objects in /DMO/ from your own namespace.
40+
41+
To create a <em>service binding</em> for the transactional app with implementation type unmanaged (package `/DMO/FLIGHT_UNMANAGED`):
42+
1. Right-click the service definition `/DMO/TRAVEL_U` and choose `New Service Binding` (see [here](https://help.sap.com/viewer/c0d02c4330c34b3abca88bdd57eaccfc/Cloud/en-US/9cda72a7bd9e476b8696f625da404605.html) for additional information).
43+
2. Create the service binding in your own package and your own namespace.
44+
45+
To fill the demo database tables with sample business data:
46+
1. Expand the package structure in the Project Explorer `/DMO/FLIGHT_LEGACY` > `Source Code Library` > `Classes`.
47+
2. Select the data generator class `/DMO/CL_FLIGHT_DATA_GENERATOR` and press `F9` (Run as Console Application).
2948

3049
## Limitations
31-
The abapGit plug-in currently only supports a one-time download of the content. You can neither download any delta nor upload any changes.
50+
The abapGit plug-in currently only supports to download content. It's not possible to upload any changes.
3251

3352
## How to obtain support
3453
This project is provided "as-is": there is no guarantee that raised issues will be answered or addressed in future releases.
+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
CLASS /dmo/cl_flight_amdp DEFINITION
2+
PUBLIC
3+
FINAL
4+
CREATE PUBLIC .
5+
6+
PUBLIC SECTION.
7+
INTERFACES if_amdp_marker_hdb.
8+
9+
CLASS-METHODS convert_currency IMPORTING VALUE(iv_amount) TYPE /dmo/total_price
10+
VALUE(iv_currency_code_source) TYPE /dmo/currency_code
11+
VALUE(iv_currency_code_target) TYPE /dmo/currency_code
12+
VALUE(iv_exchange_rate_date) TYPE d
13+
EXPORTING VALUE(ev_amount) TYPE /dmo/total_price.
14+
ENDCLASS.
15+
16+
17+
18+
CLASS /dmo/cl_flight_amdp IMPLEMENTATION.
19+
20+
METHOD convert_currency BY DATABASE PROCEDURE FOR HDB LANGUAGE SQLSCRIPT OPTIONS READ-ONLY .
21+
tab = SELECT CONVERT_CURRENCY( amount => :iv_amount,
22+
source_unit => :iv_currency_code_source,
23+
target_unit => :iv_currency_code_target,
24+
reference_date => :iv_exchange_rate_date,
25+
schema => CURRENT_SCHEMA,
26+
error_handling => 'set to null',
27+
steps => 'shift,convert,shift_back',
28+
client => SESSION_CONTEXT( 'CLIENT' )
29+
) AS target_value
30+
FROM dummy ;
31+
ev_amount = :tab.target_value[1];
32+
ENDMETHOD.
33+
34+
ENDCLASS.

0 commit comments

Comments
 (0)
Failed to load comments.