第 426 页 / 共 465 页
A Developing Applications on the SAP Cloud Platform
(cid:2) Data access
To read data from custom sources, a set of libraries and language bindings are pro-
vided which makes use of CDS models and query languages.
(cid:2) Service integration
Gives provision to leverage SAP S/4HANA services, other applications or services,
and SAP S/4HANA Cloud SDK.
(cid:2) Data replication
By means of CDS models available from SAP S/4HANA, the SAP Cloud Platform
applications can replicate model and annotations and consume them.
Note
For more details about the features provided by the SAP Cloud Platform application
programming model, visit http://bit.ly/2O3pVrQ.
A.3 Developing an App on SAP Cloud Platform Using SAP Web IDE
Full-Stack
With the introduction of the SAP Web IDE full-stack, we no longer need to switch
back-and-forth between the Eclipse IDE and the old SAP Web IDE to develop apps. The
SAP Web IDE full-stack now gives us all the necessary tools to generate CDS views, ser-
vices, data models, and UI developments. This makes it a lot easier to develop, build,
deploy, test, and extend apps on SAP Cloud Platform.
Note
To know more about SAP Web IDE full-stack, visit http://bit.ly/2NBGwn8.
A.3.1 Setting Up SAP Web IDE Full-Stack in SAP Cloud Platform
To set up SAP Web IDE full-stack, you must register for a free trial in the SAP Cloud
Platform and enable the SAP Web IDE full-stack service from the Neo Trial within the
cloud platform. You also need to set up the Cloud Foundry within the SAP Cloud Plat-
form for our example. To register for a trial account in SAP Cloud Platform, visit
https://account.hanatrial.ondemand.com. After you’ve setup an account, click on the
Neo Trial account, as shown in the Figure A.2.
426
| Note For more details about the features provided by the SAP Cloud Platform application |
| programming model, visit http://bit.ly/2O3pVrQ. |
| Note |
| To know more about SAP Web IDE full-stack, visit http://bit.ly/2NBGwn8. |
第 427 页 / 共 465 页
A.3 Developing an App on SAP Cloud Platform Using SAP Web IDE Full-Stack
Figure A.2 Set Up Neo Trial Account
Then go to Services on the left side tab, click on the SAP Web IDE Full-Stack tile (see
Figure A.3), and enable it if it’s not enabled yet. Then click on the Go to Service link on
the next page, and you’ll be redirected to the SAP Web IDE full-stack home page.
Bookmark this link because we’ll come back to the SAP Web IDE later.
Figure A.3 Enabling the SAP Web IDE Full-Stack Service in SAP Cloud Platform
427
第 428 页 / 共 465 页
A Developing Applications on the SAP Cloud Platform
Now we need to enable the Cloud Foundry trial in the SAP Cloud Platform. Navigate
to the SAP Cloud Platform Cockpit home page, click on Cloud Foundry Trial 1 as
shown in Figure A.4, and then select the region 2 closest to you.
Figure A.4 Enabling the Cloud Foundry Trial
After the Cloud Foundry is set up, open the SAP Web IDE Full-Stack (as shown in Figure
A.5), navigate to Tools (cid:2) Preferences 1, and select Cloud Foundry from the left side of
the tab 2. Select the API endpoint, which you’ll get from the Cloud Foundry home
page. After it’s selected, the Organization tab 3 and the space will be automatically
picked up from your endpoint (assuming that you haven’t created additional subac-
counts or spaces in the Cloud Foundry account). After the Cloud Foundry settings are
listed, click on the Install Builder 4 button below it. This will install a builder applica-
tion for your SAP Web IDE into the Cloud Foundry. Then click on the Save 5 button.
Note
A space in Cloud Foundry is like a development area or package that you reserve for
your application developments; you can register OData services, deploy applications,
and so on in this space. The memory allocated to the space is limited in a trial
account, so you won’t be able to deploy too many apps into this space. To learn more
about the relation between spaces, orgs, and subaccounts in Cloud Foundry, go to
http://bit.ly/2xOU4Rc.
428
| Note A space in Cloud Foundry is like a development area or package that you reserve for your application developments; you can register OData services, deploy applications, and so on in this space. The memory allocated to the space is limited in a trial account, so you won’t be able to deploy too many apps into this space. To learn more about the relation between spaces, orgs, and subaccounts in Cloud Foundry, go to |
| http://bit.ly/2xOU4Rc. |
第 429 页 / 共 465 页
A.3 Developing an App on SAP Cloud Platform Using SAP Web IDE Full-Stack
Figure A.5 Link the Cloud Foundry Space with SAP Web IDE
A.3.2 Creating a Full-Stack Business Application in SAP Web IDE
Now let’s create a SAP full-stack business application. Navigate to File (cid:2) New (cid:2) Project
from Template (or press (Ctrl)+(Alt)+(Shift)+(O)). From the list of templates, select
SAP Cloud Platform Business Application template (as shown in Figure A.6), and click
Next.
Figure A.6 Selecting the SAP Cloud Platform Business Application Template
429
第 430 页 / 共 465 页
A Developing Applications on the SAP Cloud Platform
Give a project name (for our example, it’s “PurchaseDocumentSCP” as shown in Fig-
ure A.7), and click Next.
Figure A.7 SAP Cloud Platform Business Application Basic Information
Now enter the Template Customization details for the app (you can use the values in
Table A.1). Check the Use HTML5 Application Repository checkbox as shown in Figure
A.8 because we’ll need this feature later in the app to add a UI. Click the Finish button
to generate the template app.
Figure A.8 Template Customization for an SAP Cloud Platform Business Application
430
第 431 页 / 共 465 页
A.3 Developing an App on SAP Cloud Platform Using SAP Web IDE Full-Stack
Field Parameter
Application ID “PurchaseDocumentSCP”
Application Version 0.0.1 (Default value)”
Description “Purchase Document SCP Application”
Package “com.company.purchasedocumentscp”
Table A.1 Values for SAP Cloud Platform Business Application Template Customization
A.3.3 Creating a New Data Model for the Application
Our plan is to make a simplified version of our Purchase Document list report page
(LRP) app, which we created in Chapter 4. Before we start to add the SAP Fiori ele-
ments app into our project, we need to create the relevant CDS views and data models
and deploy them into Cloud Foundry using the SAP Web IDE full-stack.
But first, we need to get familiarized with some of the components in this template
project. Figure A.9 shows the folder structure of the template project that we just cre-
ated.
Database module
Java module
Multi-target application
config file
Referenced by SAP Web
IDE builder tool
Figure A.9 Template App Structure Overview
431
| Field | Parameter |
|---|---|
| Application ID | “PurchaseDocumentSCP” |
| Application Version | 0.0.1 (Default value)” |
| Description | “Purchase Document SCP Application” |
| Package | “com.company.purchasedocumentscp” |
第 432 页 / 共 465 页
A Developing Applications on the SAP Cloud Platform
In this structure, the following files are mainly needed for the application we’re going
to create in this chapter:
(cid:2) data-model.cds
This file is under the folder named db (this folder is the database module of our
app) and is used to create a data model for the application. The framework will
compile this data model into the relevant database view in SAP HANA by convert-
ing the contents of this file into a compatible type ending with .hdbcds (which we’ll
see later in this chapter). Then, it will create the schemas/views in the Cloud
Foundry database via the SAP HANA Deployment Infrastructure (HDI).
(cid:2) my-service.cds
The content of this file helps us with generating the required OData service for our
application (this file is inside the Java module of the project as shown in Figure
A.9). It generates a service definition from our previously created data-model.cds
file and generates two additional files under the folder path srv (cid:2) main (cid:2) resources (cid:2)
edmx, as shown in Figure A.10. The csn.json (Core Schema Notation) file in the
folder is a JavaScript Object Notation (JSON) file, which contains the structure of
the CDS models. The .xml file is the Entity Data Model XML (EDMX) file used for the
OData service.
Figure A.10 Java Module for Generating and Extending OData Services
432
第 433 页 / 共 465 页
A.3 Developing an App on SAP Cloud Platform Using SAP Web IDE Full-Stack
The srv folder itself is a Java module containing a Java application that can be used
to implement custom logic on the generated OData services (this custom logic acts
like the extension classes in the OData project).
(cid:2) mta.yaml
The Multi-Target Application (MTA) file is used to specify the prerequisites and
dependencies with the Cloud Foundry. When the application is deployed into the
Cloud Foundry by the SAP Web IDE, it refers the mta.yaml file and deploys all the
modules and services specified in it.
(cid:2) package.json
The SAP Web IDE builder tool executes the npm commands defined in this file (see
Figure A.11) for compiling the .cds files for the application deployment.
Figure A.11 Package.json File Used by the SAP Web IDE Builder Tool
Now, we need to set up a data model that will form the structure of our CDS views.
The template project has already created a dummy data model. We need to edit this
data model to adjust it for our requirements. Navigate to the db folder, and replace
the contents of the data-model.cds. We’ll split the codes that will go into the data-
model.cds into three parts for easy understanding (source code of all the applications
explained in this chapter will be available for download):
(cid:2) PurchaseDocument
In Figure A.12, you can see the entity PurchaseDocument is defined similar to the
original CDS view for the Purchase Document LRP app in Chapter 4. The Purchase-
DocPriority has an association to a custom entity type Priorities (which acts as
the value help for the Priority field). Similarly, the PurchaseDocumentItem is defined
433
第 434 页 / 共 465 页
A Developing Applications on the SAP Cloud Platform
as an association of (0…*) cardinality to the PurchaseDocmentItems entity. This will
generate the necessary navigation properties between the entities when the ser-
vice is generated and when it’s deployed to the Cloud Foundry.
Figure A.12 Defining the PurchaseDocument Entity Type in the Data Model
(cid:2) PurchaseDocumentItems
The PurchaseDocumentItems entity (Figure A.13) has a Price and Currency field that
requires value helps from custom entity types such as Currency and QuantityUnit.
In addition, the PurchaseDocument field needs an association back to the PurchaseD-
ocument entity.
Figure A.13 Defining the PurchaseDocument Items Entity Type in the Data Model
(cid:2) CustomEntityTypes
Because we need a value help for Priority, we must declare a custom type named
PRIORITIES as shown in Figure A.14. In addition, the Currency and QuantityUnit are
required for Price and Quantity fields, so they are also declared as custom types.
434
第 435 页 / 共 465 页
A.3 Developing an App on SAP Cloud Platform Using SAP Web IDE Full-Stack
Figure A.14 Defining Custom Entity Types in the Data Model
A.3.4 Defining an OData Service for the Application
Now we need to define/register our CDS views as an OData service. Navigate to the
folder srv, and rename the my-service.cds file to purch-service.cds, and add the follow-
ing codes as shown in Figure A.15. When deployed into the Cloud Foundry, this file
will register our CDS view as an OData service. The entities defined in this file will be
exposed by the OData service, and we’ll use it later for our HTML5-based UI app.
Figure A.15 Defining the OData Service
A.3.5 Defining User Interface Annotations for Core Data Services Views
Now, we have our basic CDS views and our OData service defined, but we need to create
a UI to consume our OData service later using SAP Fiori elements app. To generate the
SAP Fiori elements UI, we need to add UI annotations to our CDS view. Because it’s a
list report application, we need to annotate our PurchaseDocument and PurchaseDocu-
mentItems CDS views. To do this, we need to create a new file named purch-annotations
435
第 436 页 / 共 465 页
A Developing Applications on the SAP Cloud Platform
under the PurchaseDocumentSAP Cloud Platform (cid:2) srv folder. We’ll split the entity
annotations into three parts for easy understanding (all three parts go into the same
purch-annotations file):
(cid:2) PurchaseDocument
In the LRP, we want to display all the fields by default in the table. So, you can see
in Figure A.16, we’ve added the UI{LineItem:[ ]} syntax to specify the required
fields. If you remember the CDS view UI annotations we created in the previous
chapters, this is the same thing but on a slightly different syntax. Similarly, we
added the SelectionFields property for the default filter fields to come up in the
filter bar. Then we added the HeaderInfo, HeaderFacets, and FieldGroups for the pur-
chase document object page. Now to link our PurchaseDocumentItem CDS view’s UI
annotations for LineItem to come up in the object page area of our PurchaseDocu-
ment, we added the UI.Facets:[{$Type:’UI.ReferenceFacet’}] annotation.
Figure A.16 UI Annotations for the PurchaseDocument CDS View
(cid:2) PurchaseDocumentItems
Similarly, we must specify which fields should be the default columns for the Pur-
chaseDocumentItems entity, so we use the LineItem annotation as shown in Figure
A.17. Here we don’t want any fields in the filter bar, so we won’t annotate the Selec-
tionFields. For the object page of this CDS view, we annotate the fields for Header-
Info, HeaderFacets, and FieldGroup
436
第 437 页 / 共 465 页
A.3 Developing an App on SAP Cloud Platform Using SAP Web IDE Full-Stack
Figure A.17 UI Annotations for the PurchaseDocumentItems CDS View
(cid:2) ValueHelp
Now, the ValueHelp entities also needs to be annotated to prevent unwanted fields
like the code and name coming up in the filter bar settings. So, we annotate those
fields with @UI.HiddenFilter property, as shown in Figure A.18.
Figure A.18 UI Annotations for the ValueHelp CDS Views
A.3.6 Adding a Database for the Application
Now, we have our CDS views with the required UI annotations, data model for the
database, and our OData service definition. But if we generate our OData service now
and test it, it won’t return any data because we haven’t added any records into our
database. So, we’ll add the records via a set of .csv files to import records to our data-
base tables. Navigate to PurchaseDocumentSCP (cid:2) db (cid:2) src, and create a new folder
named csv.
437
第 438 页 / 共 465 页
A Developing Applications on the SAP Cloud Platform
Now we’ll create our CSV files. Right-click on the csv folder, and navigate to New (cid:2) File.
Create one .csv each for all the entities we’ve defined in the data-model.csv file, as
shown in Figure A.19. You must create records in the .csv files that are separated by
“,”. In addition to these files, create another file in the same folder named Data.hdbt-
abledata.
Figure A.19 Creating a csv File for All the Entities Defined in the Data Model
Figure A.20 shows the sample syntax for the Data.hdbtabledata file to make it read
from the .csv files and import them into our tables defined in the data model.
Figure A.20 Syntax for Reading from csv Files into the OData Model Tables
438
第 439 页 / 共 465 页
A.3 Developing an App on SAP Cloud Platform Using SAP Web IDE Full-Stack
Note
Alternatively, you can import data files from existing OData APIs by right-clicking on
the srv folder and navigating to New (cid:2) Data Model from External Service. Then you
must select SAP API Business Hub and then select the required OData service from
the list of available APIs. But for our example, we’re relying on a custom table, so we
must create our own records.
A.3.7 Deploying the Application on Cloud Foundry
Now, let’s generate our OData service defined in the purch-services.cds file by deploy-
ing the Java application in the srv folder to the Cloud Foundry. Right-click on the srv
folder, and go to Run (cid:2) Run as Java Application, as shown in Figure A.21.
Figure A.21 Registering the OData Service by Deploying the Java Application
After the deployment is successful, you’ll get the OData endpoint link highlighted in
blue on top of the console window, as shown in Figure A.22.
439
| Note Alternatively, you can import data files from existing OData APIs by right-clicking on the srv folder and navigating to New (cid:2) Data Model from External Service. Then you must select SAP API Business Hub and then select the required OData service from the list of available APIs. But for our example, we’re relying on a custom table, so we |
| must create our own records. |
第 440 页 / 共 465 页
A Developing Applications on the SAP Cloud Platform
Figure A.22 OData Endpoint Generated Successfully
A.3.8 Consuming the OData Service
Now we have our OData service. Let’s check whether all of our entities are returning
the correct data that we uploaded from those .csv files into our database. Run the
OData endpoint URL in the browser, and you should see the response of our OData
service listing all the entities defined in our purch-service.cds file in the srv folder (see
Figure A.23).
Figure A.23 Testing the OData Service
440
第 441 页 / 共 465 页
A.3 Developing an App on SAP Cloud Platform Using SAP Web IDE Full-Stack
Now let’s test our PurchaseDocument entity set. Execute the URL ending with /Pur-
chaseService/PurchaseDocument, and you should get a result as shown in Figure A.24.
Figure A.24 Testing the PurchaseDocument Entity Set
Now let’s test whether our PurchaseDocument to PurchaseDocumentItem association is
working properly. To do so, we need to test the URL with one of our purchase docu-
ment numbers in it, so let’s test for purchase document 110 and check whether the
association to PurchaseDocumentItem is returning all the relevant items for the pur-
chase document. Test the URL ending with /PurchaseService(110)/PurchaseDocument-
Item, and you should get a result as shown in Figure A.25. The query result is showing
the correct result, which means our association is working.
Figure A.25 Testing Associations between PurchaseDocument and Item
441
第 442 页 / 共 465 页
A Developing Applications on the SAP Cloud Platform
Now, we need our application to update its EDMX files because this will be used when
we add a UI to the app (the wizard will use the .xml file to identify the entities and
associations for generating the template app). Right-click on the root folder, and nav-
igate to Build (cid:2) Build CDS (see Figure A.26). This will compile the OData service and
generate the EDMX files.
Figure A.26 Compiling the OData Services to Generate EDMX Metadata Files
A.3.9 Building a User Interface to Display the Data
We’re done with building our base application for setting up the CDS views and
OData service for consumption. Now, we need a UI to display the data we tested ear-
lier in the browser via the OData endpoints. To add a UI, right-click on the root folder,
and navigate to New (cid:2) HTML5 Module, as shown in Figure A.27.
Figure A.27 Adding an HTML5-Based UI to the App
442
第 443 页 / 共 465 页
A.3 Developing an App on SAP Cloud Platform Using SAP Web IDE Full-Stack
Select the List Report Application from the Template Selection wizard (see Figure
A.28).
Figure A.28 HTML5 Template Selection
Fill in the Basic Information for our app. Give the Module Name as “FioriEle-
mentsApp” and the remaining information as shown in Figure A.29, and click on the
Next button. This is like the steps we followed in Chapter 4 to create a list report appli-
cation.
Figure A.29 Purchase Document LRP Basic Information
443
第 444 页 / 共 465 页
A Developing Applications on the SAP Cloud Platform
In the Data Connection window, select Sources as Current Project, and the framework
will detect the services from the EDMX files we generated earlier. Our PurchaseService
should be in the list (see Figure A.30). Click on the Next button.
Figure A.30 PurchaseDocument LRP: Selecting the Data Connection
In the next window, select the PurchaseDocument as the main OData Collection, and
the PurchaseDocumentItem should be automatically selected by the framework and
will be added to the OData Navigation field, as shown in Figure A.31. Click on Finish to
generate the list report template app.
Now let’s run our application. Right-click on the HTML5 module we just added, and go
to Run (cid:2) Run flpSandBox.html, as shown in Figure A.32.
444
第 445 页 / 共 465 页
A.3 Developing an App on SAP Cloud Platform Using SAP Web IDE Full-Stack
Figure A.31 PurchaseDocument LRP Template Customization
Figure A.32 Run Configurations for the PurchaseDocument LRP App
We can see the app displaying the data from our OData service and all the UI annota-
tions, which we specified in our purch-annotations.cds file, are also reflected accord-
ingly in the UI, as shown in Figure A.33. Now, let’s check the object page and the
navigation. Click on one of the table rows to go to the object page.
445
第 446 页 / 共 465 页
A Developing Applications on the SAP Cloud Platform
Figure A.33 Purchase Document LRP Object Page Output
In the object page of the app, we can see all the UI annotations are working (see Figure
A.34). But notice in the table level fields heading, the PurchaseDocumentItem and
Description seem to be missing i18n translation. We can either update this in our
purch-annotations.cds file or directly in the data-model.cds file. We can also do this
using the annotation modeler tool of the SAP Fiori elements app.
Figure A.34 Purchase Document Object Page Output
446
第 447 页 / 共 465 页
A.3 Developing an App on SAP Cloud Platform Using SAP Web IDE Full-Stack
A.3.10 Modifying the User Interface Using the Annotation Modeler
To modify the UI of our SAP Fiori elements LRP app, we need to first generate the anno-
tation file. Navigate to FioriElementsApp (cid:2) webapp (cid:2) localService folder, right-click on
the localService, and navigate to New (cid:2) Annotation File, as shown in Figure A.35.
Figure A.35 Adding a New Annotation File to the Project
In the popup window, give the name for the annotation files, and click Next, as shown
in Figure A.36.
Figure A.36 New Annotation File Details
Open the annotations file, and you can see that the annotation modeler tool has
already detected all the existing UI annotations within the entity sets of the CDS
view. We need to override the purchaseDocumentItem and description columns in the
447
第 448 页 / 共 465 页
A Developing Applications on the SAP Cloud Platform
LineItem to add a label for the fields. So, select the relevant LineItem, and click on the
Clone for overriding icon 1 on the rightmost side of the table, as shown in Figure A.37.
This will make a copy of that row so that we can add or modify its properties.
Figure A.37 Annotation Modeler Displaying the UI Annotations from Service
Add the Label properties for both the columns and link the labels to the i18n files
named as Purchase Document Item and Purchase Document Item Name, as shown in Figure
A.38.
Figure A.38 Adding Custom UI Annotations to the PurchaseDocumentItems Entity
448
第 449 页 / 共 465 页
A.3 Developing an App on SAP Cloud Platform Using SAP Web IDE Full-Stack
A.3.11 Adding Custom Logic to the OData Service
Now we have a SAP Fiori elements LRP app that consumes the OData service we gen-
erated via the Java application. But the Java application in the srv folder doesn’t just
help us generate services based on our data model. It also gives us the flexibility of
registering custom handlers to different hook operations for the service. These hooks
will give us the option to add custom logic before and after, as well as to override the
generic CRUD operations. For this example, we’ll add a custom hook to add an addi-
tional property to the PurchaseDocument entity result set.
Adding hooks to our existing Java app in the srv folder is relatively easy. Right-click
on the srv folder and navigate to New (cid:2) Entity Operation Hooks (see Figure A.39).
Figure A.39 Creating a New Entity Operation Hook
In the next popup window, the framework has already listed out the entity sets that
it detected from the service, as shown in Figure A.40. Select the PurchaseDocument
entity, click Next, and click on Confirm to generate the Java handler class for imple-
menting the hook operations.
In Figure A.41, you can see that the Java handler class is created in the app under Pur-
chaseDocumentSCP (cid:2) srv (cid:2) main (cid:2) java (cid:2) com (cid:2) company (cid:2) purchasedocumentscp (cid:2) han-
dlers (cid:2) purchaseservice as PurchaseDocumentEntityHandler.java.
449
第 450 页 / 共 465 页
A Developing Applications on the SAP Cloud Platform
Figure A.40 Selecting the Entity for the Hooks
Figure A.41 Java Class Handler Created for PurchaseDocument Entity Hook Operations
The framework already has inserted sample code (commented out by default) for all
the supported hook methods for after, before, and CRUD events. You can go through
all these and uncomment the methods that are relevant. For our scenario, we only
need two hook events.
(cid:2) @AfterRead
This is triggered immediately after the read operation on an entity in a service is
carried out, so we uncomment the codes for that. In Figure A.42, you can see that
450
第 451 页 / 共 465 页
A.4 Summary
we’ve opted to add an additional property named comments with a value “Cloud
Foundry Says Hello” to the PurchaseDocument entity set.
(cid:2) @AfterQuery
This is triggered after a query operation on an entity in a service is complete. Here
also we add our Comments property along with its value.
After this, you need to redeploy your Java application to the Cloud Foundry by right-
clicking on the srv folder and going to Run (cid:2) Run as Java Application. Now your OData
result for the PurchaseDocument entity set will have this additional custom property.
By using these operation hooks, you can implement various logics such as valida-
tions for requests coming from the app, custom authorization checks, modifications
of the incoming results, and so on.
Figure A.42 Added Custom Logic for AfterRead and AfterQuery Hook Operations
Note
To learn more about adding custom logic to your service, visit http://bit.ly/2xwB1Mk.
A.4 Summary
In this appendix, you learned about SAP Cloud Platform and the application program-
ming model used for developing apps for SAP Cloud Platform. We created a simple
451
| Note |
| To learn more about adding custom logic to your service, visit http://bit.ly/2xwB1Mk. |
第 452 页 / 共 465 页
A Developing Applications on the SAP Cloud Platform
Java-based application and deployed it in the SAP Cloud Platform. We discussed how
to create data models, CDS annotations, and databases, as well as register OData ser-
vices using the SAP Web IDE full-stack tool. Then we added a UI using SAP Fiori ele-
ments as an HTML5 module into this app and consumed the OData service we created
earlier. We also covered modifying the UI using the annotation modeler tool in SAP
Web IDE and added custom logic via hook operations to the OData service we regis-
tered.
452
第 453 页 / 共 465 页
Appendix B
The Authors
Stefan Haasis a senior developer at SAP working on enterprise
asset management applications for SAP S/4HANA within the
digital supply chain and manufacturing lines of business. He is
an experienced full stack developer on all layers of SAP S/
4HANA ranging from SAP HANA, core data services (CDS), and
ABAP over OData and SAP Gateway to SAP Fiori, SAPUI5, and
JavaScript. Additionally, he was a fellow at the Machine Learn-
ing Engine team of SAP's Predictive Maintenance and Service
cloud solution. He holds a master’s degree in computer science,
with a minor in business, from Ludwig Maximilian University of Munich and is a cer-
tified Cloud Foundry developer.
Bince Mathewis a senior developer at SAP with more than
nine years of experience in providing solutions on various
SAP mobility platforms. He is an expert in areas such as SAP
Fiori, SAP S/4HANA, SAP Syclo, SAP Mobile Platform (formerly
Sybase Unwired Platform), SAP Afaria, and the Internet of
Things. He has worked with industry verticals such as Manu-
facturing and Retail. He is an SAP Certified Technology Associ-
ate for SAP Fiori and a published author with afocus on SAP
Fiori developments. He was also given the best speaker award
for SAP Fiori at the SAP Inside Track event held by SAP. He is active in the SAP Com-
munity Network (SCN) on topics related to SAP mobility.
453
第 454 页 / 共 465 页
第 455 页 / 共 465 页
Index
A Annotation (Cont.)
@ObjectModel.dataCategory:
ABAP #VALUE_HELP .............................................. 198
development tools in Eclipse ........................122 @ObjectModel.deleteEnabled ...................... 151
dictionary ...............................................................96 @ObjectModel.foreignKey.association .... 197
ABAP code exit .......................................................366 @ObjectModel.modelCategory:
ABAP core data services .................................23, 26 #BUSINESS_OBJECT .................................... 151
ABAP data model ..................................................125 @ObjectModel.representativeKey ............. 132
ABAP development tools ............................43, 365 @ObjectModel.semanticKey ........................ 132
ABAP Development Workbench ....................122 @ObjectModel.text.element:
ABAP Dictionary ...................................................128 [’Description’] ................................................ 132
ABAP in Eclipse .........................................................43 @ObjectModel.transactionalProcessing-
ABAP programming model ..........................39, 95 Enabled:true .................................................. 151
ABAP test cockpit ..................................................415 @ObjectModel.updateEnabled ................... 151
@ObjectModel.writeActivePersistence ..... 152
ABAP unit ....................................................... 121, 364
@ObjectModel.writeActivePersistence:
ABAP unit runner ....................................... 364, 418
’ZPURCHDOCUMENT’ ................................ 151
ABAP unit test ........................................................365
@OData.publish:true .............................161, 249
Access control ........................................................147
@selectionVariant ........................................... 233
adaptation description language
@Semantics.amount.currencyCode .......... 129
data model definition .....................................110
@Semantics.imageUrl:true .......................... 167
service implementation ..................................111
@Semantics.quantity.unitOfMeasure ...... 129
Analytical card .......................................................215
@UI.chart .........................................200, 238, 245
add .........................................................................215
@UI.datapoint.criticalityCalculation ....... 203
annotations ........................................................200
@UI.dataPoint.visualization:
Analytical engine .....................................................40
#NUMBER ...................................................... 200
Analytical list page .............................. 40, 227, 247
@UI.facet.parentId .......................................... 174
annotation selection .......................................250
@UI.facet.type:#COLLECTION ..................... 174
data connection ................................................249
@UI.headerInfo ................................................. 167
template ...............................................................248
@UI.hidden ......................................................... 267
Analytics ......................................................................40
@UI.identification: .......................................... 201
Annotation
@UI.lineItem ................166–168, 171, 175, 266
@AbapCatalog.enhancementCategory:
@UI.presentationVariant .............................. 244
#EXTENSIBLE_ANY .....................................128
@UI.selectionField ........................................... 169
@AccessControl.authorizationCheck:
@UI.selectionVariant ..................................... 244
#CHECK ...........................................................132
@VDM.viewType:#BASIC .............................. 132
@Analytics.query:true ....................................227
#ALLOWED ......................................................... 128
@Consumption. valueHelpDefinition ......197
semanticObjectAction: ................................... 201
@DefaultAggregation:#NONE ....................134
writeActivePersistence .................................... 114
@EndUserText.label ........................................128 Z_C_PurchaseDocumentLRP ....................... 165
@ObjectModel ......................................... 150, 153 App launcher
@ObjectModel.compositionRoot:true ......151 dynamic ............................................................... 309
@ObjectModel.createEnabled .....................151 static ...................................................................... 309
455
第 456 页 / 共 465 页
Index
Application development ................................. 270 Cloud Foundry .................................................46, 439
Application tiles ...........................................309, 320 Commit .....................................................................341
Apply stash .............................................................. 343 Composite interface view ..................................136
Artificial intelligence .......................................... 423 Concourse CI ...........................................................398
Authorization field Constructor injection ..........................................371
ACTVT ................................................................... 147 Consumption view ........................................35, 191
ZPURCHORGA ................................................... 147 Z_C_PurchaseDocumentOVP .......................191
Automated testing ............................................... 361 Contact quick view ...............................................168
Axure .....................................................................49, 78 Content area ............................................................239
Continuous delivery ............................................395
B Continuous deployment ..........................393, 396
pipeline .................................................................401
Bamboo .................................................................... 398 Continuous integration ............................393–394
Bar list card ............................................................. 220 ABAP server .........................................................414
Behavior-driven development ........................ 289 SAPUI5 ...................................................................397
Blue Ocean .............................................................. 398 Core data services ...................................................95
Branches ................................................................... 355 basic interface ....................................................130
Breakout ................................................................... 181 test double framework ..........................121, 376
Build task ................................................................. 404 virtual elements .................................................160
Business intelligence consumer services ......40 Core data services view .......................................365
Business logic ............................................................39 create .....................................................................190
action .......................................................................39 simple ....................................................................190
determinations .....................................................39 Core data services views ...........................121, 189
validations .............................................................39 Cross-application navigation ...........................329
Business object Cube views ...............................................................229
Z_I_PurchaseDocumentTP ........................... 156
Business Object Nodes ....................................... 155 D
Business object processing framework .........27,
37, 95, 113, 414 Data control file .....................................................199
business object generation ........................... 150 Data control language .........................................199
draft-enabled application ............................. 115 Data control language files ...............................146
new application with draft ................. 114–115 Data definition language ..............................26, 96
quick action ........................................................ 156 analytical annotations .....................................96
read-only application ..................................... 113 search annotations ............................................96
transactional processing ............................... 150 transactional annotations ..............................96
UI annotations .....................................................96
C Data dictionary ........................................................96
Data provider class ...............................................106
Calculated fields .................................................... 136 Default chart ...........................................................239
Catalog ...................................................................... 305 Dependency inversion principle ....................372
business .......................................................305, 307 Deploy stage ............................................................411
link to user .......................................................... 322 Deployment ............................................................297
technical .....................................................305, 307 Design-led development ......................................62
Change and transport system ............................95 design ......................................................................64
classic online transaction processing .............40 develop ....................................................................64
Clean task ................................................................. 404 discover ...................................................................63
456
第 457 页 / 共 465 页
Index
Dimension views ..................................................229 Integrated development environment ....... 122
Docker .......................................................................398 Integration tests .................................................... 363
Interface annotations ......................................... 164
E Internet of Things .........................................46, 423
Eclipse ........................................................................122 J
Eclipse Oxygen .......................................................122
Embedded analytics ...............................................40 Java ................................................................................46
End-to-end tests ....................................................363 Jenkins
Enterprise search .....................................................26 automation server ........................................... 398
Entity relationship model .................................125 jenkinsfile ............................................................ 400
Extreme programming ......................................394 multibranch pipeline ....................................... 402
Journey ..................................................................... 384
F JSON ..............................................................................27
Feature packs .............................................................45 K
Fetch ...........................................................................342
Filter area .................................................................236 Key performance indicators ............................ 251
Filter bar ...................................................................283 Kubernetes .................................................................46
consumption view ............................................196
Freestyle app ...........................................................316 L
Freestyle application ...........................................261
development .......................................................270 Layer
#CORE ................................................................... 165
G #CUSTOMER ...................................................... 165
Lint task .................................................................... 404
Git ................................................................................335 List card
automatic trigger .............................................407 annotation .......................................................... 202
basics .....................................................................335 bar list card annotations ............................... 203
push .......................................................................407 consumption view .................................. 193–194
GitHub .......................................................................337 interface view ..................................................... 192
Group standard list card annotations .................... 202
link to user ...........................................................322 List report .............................................166, 187, 283
Groups ............................................................. 306, 320 create .................................................................... 177
Grunt ............................................................... 398, 403 criticality .............................................................. 168
header info .......................................................... 167
H image .................................................................... 167
line item ............................................................... 166
HTML5 ...................................................................28, 46 quick actions ...................................................... 171
searchable ........................................................... 170
I selection field ..................................................... 169
template ............................................................... 177
Indirect input .........................................................375 value helps .......................................................... 171
Indirect output ......................................................375 Local repository ........................................... 339–340
Info access service ...................................................40
457