Professional Documents
Culture Documents
How-To Guide
Applicable Releases:
SAP River Rapid Development Environment 1.0
Version 1.0 - May 2014
Extend a SAP FIORI app (HCM_TS_APV) from remote using the extensibility pane
Document History
Document Version
Authored By
Description
1.0
Customer Experience
Group
Extend a SAP FIORI app (HCM_TS_APV) from remote using the extensibility pane
TABLE OF CONTENTS
1.
2.
3.
Prerequisites ........................................................................................................................................ 4
4.
Extend a SAP FIORI app (HCM_TS_APV) from remote using the extensibility pane
1.
BUSINESS SCENARIO
SAP River Rapid Development Environment (or SAP River RDE) is a next-generation cloud-based
meeting space where multiple project stakeholders can work together from a common web interface -connecting to the same shared repository with virtually no setup required. It includes multiple interactive
features that allow you to collaborate with your colleagues and accelerate the development of your
HTML5/UI5 applications.
2.
BACKGROUND INFORMATION
In this How-To Guide we will start off by extending an existing SAP FIORI app (HCM_TS_APV) directly
from the gateway server. We will extend an existing view; we will add a new button to it and some logic to
the new button. Finally we will see how to hide an existing control in the extended app. For some of these
extensions we will use the Extensibility Pane feature.
3.
PREREQUISITES
To connect to your SAP River RDE system, open the browser and enter the URL of your system.
Extend a SAP FIORI app (HCM_TS_APV) from remote using the extensibility pane
4.
STEP-BY-STEP PROCEDURE
4.1
In this exercise we will create an extension project for the FIORI application HCM_TS_APV
...
Extend a SAP FIORI app (HCM_TS_APV) from remote using the extensibility pane
4. Click on Remote
Extend a SAP FIORI app (HCM_TS_APV) from remote using the extensibility pane
7. Wait until you get the list of the available OData services
Extend a SAP FIORI app (HCM_TS_APV) from remote using the extensibility pane
9. The Application location and the Extension Project name will be compiled automatically. Click on
the down arrow at the bottom of the page to go to the next screen
12. To check if the Fiori extension app is running correctly, select the index.html file and click on the
button Run
Extend a SAP FIORI app (HCM_TS_APV) from remote using the extensibility pane
You have successfully created and tested your new extension project
Extend a SAP FIORI app (HCM_TS_APV) from remote using the extensibility pane
4.2
...
As our first extension exercise we are going to see how to replace an existing view in the extended
application.
Choos e th e men u op tio n File -> New -> P r ojec t
3. A new overlapping window will open. From this window, select first the S2 view, then choose
Replace with copy of the parent view and click on the Extend button
10
Extend a SAP FIORI app (HCM_TS_APV) from remote using the extensibility pane
4. Click on OK
5. Double click on the S2Custom.view.xml file and it will open on the right side
11
Extend a SAP FIORI app (HCM_TS_APV) from remote using the extensibility pane
4.3
...
We are going to see how to add a very simple button the extended view. This button, after the extension of
its controller, will be used to display an alert message.
Choos e th e men u op tio n File -> New -> P r ojec t
3. In the source code window, just after the first <content> tag add the following line
<Button icon="sap-icon://display" tap="display"/>
and paste it just below this one
12
Extend a SAP FIORI app (HCM_TS_APV) from remote using the extensibility pane
6. Select the index.html file in the extension project and click on Run
7. Enter again the credentials you have been given by the instructor and click on Log In
8. You should be able to see a new button on the sidebar. If you click, it does nothing at moment. We
will add some code to it in the next part
13
Extend a SAP FIORI app (HCM_TS_APV) from remote using the extensibility pane
4.4
Extending a controller
...
Here we can add some logic to the button we added in the previous chapter, by extending the view
controller.
Choos e th e men u op tio n File -> New -> P r ojec t
14
Extend a SAP FIORI app (HCM_TS_APV) from remote using the extensibility pane
6. Click on Finish
15
Extend a SAP FIORI app (HCM_TS_APV) from remote using the extensibility pane
8. Add the following code just after the first row of the source JavaScript code, then click on Save:
display:function(){
alert("Hi, you clicked on Display!");
}
10. Click on the new Display button and you should get the message you have put in the code
16
Extend a SAP FIORI app (HCM_TS_APV) from remote using the extensibility pane
4.5
Hiding a UI control
...
As a final exercise we are going to see how to hide an existing control in a view. In particular we will see how
to ide the Notes button in the content part of the app
17
Extend a SAP FIORI app (HCM_TS_APV) from remote using the extensibility pane
3. A new overlapping window will open. From this window, select first the button you want to hide. On
the left pane you will get the name of the control that needs to be hidden. In this case its
TSA_LIST_DAYENTRY_NotesCell, then choose Hide Control from the list and click on the OK
button
4. Looking at the extensibility pane you can see that the control already disappeared
18
Extend a SAP FIORI app (HCM_TS_APV) from remote using the extensibility pane
6. If you open the Component.js file you see that some new code has been added in the
viewModifications function in order to hide the selected control
19
www.sap.com