Using a Third-party Library with SAPUI5 Application – SAP Cloud Development Scenario – Part 3

Previous post https://blogs.sap.com/2017/10/26/using-a-third-party-library-with-sapui5-application-sap-hana-cloud-development-scenario-part-2/

Testing Odata Service :

In this part we have to validate our Odata service befor building the Front End application.

For this i will use Advanced Rest Client ( chrome Extension ). Create a new Request put the url to call Event Entity and added the “$top” parameter to the url to select just the first two events from the whole list.

If you are not familiar with Odata you can see this blog https://blogs.sap.com/2016/02/08/odata-everything-that-you-need-to-know-part-1/

This is the final set up we need to use GET operation and i added X-Csrf-Token = Fetch to use the result in the next operation

https://mdcpXXXXXXtrial.hanatrial.ondemand.com/Calendar/services/BookingEBC.xsodata/Events?$top=2 Events https://mdcpXXXXXXtrial.hanatrial.ondemand.com:443/Calendar/services/BookingEBC.xsodata/Events https://mdcpXXXXXXtrial.hanatrial.ondemand.com:443/Calendar/services/BookingEBC.xsodata/Events(‘00065ec7-9051-4798-a321-7dfc4eec09c9’) 00065ec7-9051-4798-a321-7dfc4eec09c9 Empty Task TEST 2017-05-11T09:00 2017-05-11T10:30 #77DD77 F 6f9137f3-092a-408b-9385-549ed7116ffb 2017 5 11 ONGABI https://mdcpXXXXXXtrial.hanatrial.ondemand.com:443/Calendar/services/BookingEBC.xsodata/Events(‘001e0529-8218-4a40-ad20-d7374516c38a’) 001e0529-8218-4a40-ad20-d7374516c38a Empty Task 2017-08-17T11:00 2017-08-17T12:30 #77DD77 F 6f9137f3-092a-408b-9385-549ed7116ffb 2017 8 17

If the call is executed correctly we should see a result similar to my XML. Pick one ID to check the GetDetail_Entity method by changing the URL.

https://mdcpXXXXXXtrial.hanatrial.ondemand.com/Calendar/services/BookingEBC.xsodata/Events(‘001e0529-8218-4a40-ad20-d7374516c38a’)?$format=json { “d”: { “__metadata”: { “type”: “Calendar.services.BookingEBC.EventsType”, “uri”: “https://mdcp601643trial.hanatrial.ondemand.com:443/Calendar/services/BookingEBC.xsodata/Events(‘001e0529-8218-4a40-ad20-d7374516c38a’)” }, “ID”: “001e0529-8218-4a40-ad20-d7374516c38a”, “TITLE”: “Empty Task”, “START_DATE”: “2017-08-17T11:00”, “END_DATE”: “2017-08-17T12:30”, “COLOR”: “#77DD77”, “STATUS”: “F”, “DESCRIPTION”: “6f9137f3-092a-408b-9385-549ed7116ffb”, “YEAR”: 2017, “MONTH”: 8, “DAY”: 17, “OWNERID”: “ ”, “CUST_COSTCENTER”: “ ”, “SREP_COSTCENTER”: “ ” } }

Back to Advanced Rest Client, copy the X-CSRF-TOKEN value and use it to send a PUT operation to modify the Event Content

Change the X-Csrf-Token value and the Request type and URL

https://mdcpXXXXXXtrial.hanatrial.ondemand.com/Calendar/services/BookingEBC.xsodata/Events(‘001e0529-8218-4a40-ad20-d7374516c38a’)

Change the body by putting the same JSON result from the GET operation request and modify some value and Execute the request.

Final JSON { “__metadata”: { “type”: “Calendar.services.BookingEBC.EventsType”, “uri”: “https://mdcpXXXXXXtrial.hanatrial.ondemand.com:443/Calendar/services/BookingEBC.xsodata/Events(‘001e0529-8218-4a40-ad20-d7374516c38a’)” }, “ID”: “001e0529-8218-4a40-ad20-d7374516c38a”, “TITLE”: “Empty Task Test”, “START_DATE”: “2017-08-17T11:00”, “END_DATE”: “2017-08-17T12:30”, “COLOR”: “#77DD77”, “STATUS”: “F”, “DESCRIPTION”: “6f9137f3-092a-408b-9385-549ed7116ffb”, “YEAR”: 2017, “MONTH”: 8, “DAY”: 17, “OWNERID”: “ONGABI”, “CUST_COSTCENTER”: “ ”, “SREP_COSTCENTER”: “ ” }

Change the operation from PUT to GET on the Advanced Rest and check the result

https://mdcpXXXXXXtrial.hanatrial.ondemand.com/Calendar/services/BookingEBC.xsodata/Events(‘001e0529-8218-4a40-ad20-d7374516c38a’)

The response should be like this.

Conslusion :

The Odata service is now ready and we can start the UI part in the next article. http://bit.ly/2AFofhl #SAP #SAPCloud #AI

Smarter Analytics: Hybrid Analytics for Cloud and On-Premise #ASUG Webcast Recap Part 1

This was an ASUG webcast from earlier this year.  Part 2 and 3 are coming soon.

Be sure to register for tomorrow’s related webcast Cross-Solution Analytics with SAP Analytics Cloud and upcoming webcasts.  Tell us what you would like most to hear in this survey.

Source: SAP

BI-modal IT is shown above

Business & IT collaboration needs to be better

Increasingly, with business moving faster with “digital transformation”, selling data, change leads to differentiation

IT is trying to keep the lights on, with increasing pressures of security, high availablility, network threats

Two groups in separate direction

Data remains same; underneath applications

Holistic data foundation

Source: SAP

“More advanced customers have up to 50% of their employees using Analytics.” (source: SAP)

Adoption is a challenge; less than 20% of employees have access to analytics

How get more analytics to more people

Make sure analytics is embedded where the users are

Analytics is spread everywhere in different portals, SharePoint, different sites, email, personal devices

New employees have to find this information

This can be a high barrier to usage

If you’re one of the 20% who has access, reach 3rd barrier – can I trust data?  When was it refreshed?  Is it from a high quality system?

Source: SAP

It is not just about delivering analytics; it is about self-service

Moving from 20% to 70% – no way to get there using stylized reports

End users to deploy their own reports

Needs to fit inside holistic analytics strategy

Source: SAP

Creating an analytic strategy

Know objectives, business needs – centralized competency center

Hybrid analytics is a key component

Competency center – building programs, evangelizing, training programs, mapping value that group is providing

Building strategy – SAP has a workshop for free, ask account rep for analytics strategy

Source: SAP

That was the framework

Hybrid analytics – customers not using this phrase

Definition is there to use

“seamless user experience” so user not think of where data is residing

Source: SAP

* Article of how competency centers are changing
* It is not just IT, analytic skills and business skills – center – work being done
* Link to blog

* Business Skills:

* Understanding of line-of-business (LOB) needs
* Ability to help business managers set and balance priorities by analyzing consequences of choices and creating business cases
* An understanding of the organization’s strategic business objectives and the role action-oriented information plays in achieving the corporate objectives
* Stewardship skills to drive standardization of official hierarchies, business vocabularies and other relevant business terminology, and to participate in semantic reconciliation and ongoing data-quality efforts

* IT Skills:

* Ability to understand the business intelligence infrastructure implications of business and analytic requirements
* Deep understanding of how to access and manage data required to support business and analysis requirements
* Deep understanding of diverse business intelligence and performance management tools and technologies
* Understanding of the differences in design and access characteristics of diverse data sources
* Data governance, architecture and management skills
* Data administration and metadata management skills

* Analytical Skills

* Fluency with key analytic applications
* Researching business problems and creating models that help analyze these business problems
* Working with the IT department to develop insight into how to identify data for a specific analysis or application
* Skills to train the users in how to transform data into action-oriented information, and how to use that information (source: SAP)

Source: SAP

It is about more than technology – have programs around it, training, where publish assets, who can access

Source: SAP

Data foundation needs to be rock solid

More live stream data, more cloud data sources, blending and merge

How find right sources together

Policies for right amount of governance

Part of information governance program

Information Governance and BI need to be “best friends”

1.Refine the data schema and database architecture underpinning the BI system so business users could easily locate data.

2.Add metadata where possible, including definitions, aliases, and owners. Tip: Start a business glossary, like SAP Information Steward’s Metapedia.

3.Perform routine cleansing and de-duplication.

4.Promote your best, widely-used sources to enterprise sources. Create universes or views of these sources, and gate access with user controls. Tip: Review universes and create smaller, more focused ones for specific audiences to make them easier to use.

5.Decide which existing queries, transformations, and views you can reuse from enterprise systems. How will you control performance implications? (Source: SAP)

Source: SAP

“SAP helps give insight to make better decisions”

Decision making is a process and to succeed in the digital economy just having access to more data isn’t enough. Organizations need to turn data into meaningful insights, improve decision making, and take immediate action.

SAP can help you lead your organization’s digital journey and address the challenges of data proliferation from enterprise data, Big Data, IoT, and beyond.  And we help you to transform your all of data, the foundation of a digital enterprise, into insight to drive innovation and create business value.

Source: SAP

BI, planning and predictive in one solution

Above shows what the market

SAP has put this in one application in SAP Analytics Cloud

Analytics solutions on the market today are fragmented at best and only provide one part of the complete picture. BI technology typically looks at historical data, “what has happened” but isn’t connected with future plans and outcomes. Plans aren’t connected with simulations and modelling based on automated machine learning algorithms to uncover hidden insights. And all of these elements aren’t connected with the ability to take immediate action within a business process whether it’s a decision being made by the board or from the front line. (Source: SAP)

Source: SAP

Should have planning integrated

Data prep across multiple stories

* SAP is creating a highly differentiated solution
* “Interactive Analytics” is the intersection of BI, Predictive and Planning
* Putting these together forces competitors to play a different game (Source: SAP)

Source: SAP

What to do next

*

Explore Relevant Data
*

Simulate & Predict What Will Happen
*

Plan a Course of Action
*

ACT! – Implement Decisions (Source: SAP)

Source: SAP

Leading the cloud – digital boardroom, to help disrupt business

Innovate core – what you have on-premise has a roadmap in front of it

Customers will have a mix; that is hybrid analytics

Two grey arrows – hybrid analytics

* SAP Analytics Cloud off to great start – Continue innovation quickly and lead the Cloud
* Protect Investment in On-Premise: Hybrid, “Build Bridges” (Source: SAP)

Source: SAP

Cloud – SAP Analytics Cloud, Digital Boardroom

SAP BusinessObjects provides all the analytical capabilities that SAP BW/4HANA users need including reporting, analysis, dashboards and applications, advanced analytics and planning and consolidation
– for both on-premise and cloud deployments of BW/4HANA.

SAP BEx analytical tools are no longer supported with BW/4HANA

Source: SAP

Planning/predictive rolled together in cloud

Sits on top of SAP Cloud Platform

SAP’s vision for SAP Analytics Cloud (SAC) is to connect to both on premise and Cloud data sources and applications.  Analtyics Cloud is a SaaS platform and is separated into 4 areas:

Core Capabilities – The first layer are core capabilities that are included in all Analytic capabilities and applications such as Data connectivity and Modeling, Administration and Auditing, Story Experience, and Collaboration.

Analytic Capabilities – The second layer are our 3 analytical capabilities:  BI, Planning, and Predictive.  No other competitors have all these Analytic capabilities.

Embedding Capabilities – SAP is building APIs to integrate and embed SAP Analytics  Cloud into SAP, 3rd Party, and customer applications.

Applications – The third and top layer are the Analytical applications.   SAP Digital Boardroom is an example of an SAP Analytics Cloud application.  SAP and our partners continue to look at building additional analytical applications and content that can be consumed on the App Marketplace. (Source: SAP)

Source: SAP

SAP Analytics provides both Private and Public Cloud options:

Private Cloud (IaaS) – BusinessObjects Enterprise can be deployed on premise or hosted on HEC, Amazon Web Services, Microsoft Azure, GCP, as well as 3rd party hosting providers.  Customers can leverage their existing BOE licenses in a hosted model (aka Bring Your Own License).  With HEC, we can provide BOE licenses in a subscription model.  The benefit of the private BOE cloud model is for customers who don’t want to manage their infrastructure internally and offload those costs to a hosting provider.  Customers would still need to administer and upgrade their BOE system in this hosted model, however, HEC does provide a managed service offering to help customers with the administration and upgrades of BOE.

Public Cloud (SaaS) – Our solution for public cloud is Analytics Cloud which can only be sold on a subscription model.  The benefit of Analytics Cloud is that it allows customers to try out all of our analytics capabilities (BI, Planning, and Predictive) on one platform with one user experience.

Note:  SAP Analytics Cloud is a new SaaS application and doesn’t support BOE content types like Lumira, Crystal Reports, Webi, Design Studio.  BusinessObjects Cloud should be positioned to complement an existing BOE platform by focusing on new use cases (ie Digital Transformation, extending SAP Cloud applications and SCP applications).  We will cover these examples throughout the presentation. (Source: SAP)

Customer story:

To be continued http://bit.ly/2AFo3i7 #SAP #SAPCloud #AI

Fiori Mobile: Practical Tips

Setup

Cloud Connector

If you are using Gateway (rather than OData Provisioning) you may need to set the trust flag for the SAP Cloud Platform (SAP CP) dispatcher (in the Principle Propagation section).  The Fiori Mobile project might be the first time you have used app-to-app SSO. We had a 401 error when our offline app began to sync and it was resolved by checking this one checkbox.

Develop

Managing multiple environments

You’re going to need to build three variants of your app (assuming that you have dev/test/prod environments).  Each version will reference a different environment.  So, from the start, make it easy to distinguish between them.  You may be running dev, test and prod versions of your app simultaneously on your phone.  You might want to call the 3 versions D_MyApp, T_MyApp and MyApp, so you know which one is which.

To move our app changes through the environments (dev to prod), taking account of the small differences in project setup (e.g. different sub-account guids), we used GIT branches.  We had one branch for each environment.

When our latest build in dev was ready we would open the Web IDE in the test sub-account and switch to the test branch. We would then merge-in the development branch.  Next we would build the app and then testing could commence.

When testing was complete we would open the Web IDE in production, merge in from the test branch and do a build.  The master branch can be used for prod.

Feature branches can be created from the development branch.

I must say that prior to this I had never opened the Web IDE in any environment other than dev!  I don’t really like doing so but this was the best approach we could come up with.  Note that because of the way GIT works, we don’t have to repeat the entry of the sub-account GUIDs in the project settings, for example.  Once we have done this once, we can apply the new features from dev without overwriting those settings.  For this you must become proficient at conflict resolution.

You might like to choose a different Web IDE theme in each environment.  That way you will never make a change to the code in prod mistakenly thinking you are in dev, because the colours are clearly distinguishable.

Mobile Secure

Most of your app setup can be done in Mobile Secure.  You can launch this via the Fiori Mobile service in the Cloud Platform cockpit.

Mobile Secure betrays it’s heritage as a separate product (I assume) and doesn’t work quite the same as other SCP screens.  I haven’t found a way to log on to multiple sub-accounts simultaneously (e.g. to compare dev to test) as I do all the time with the Web IDE or the Mobile Service for Development and Operations for example.  If you save the URL as a bookmark always check the sub-account GUID in the account name before you log in, otherwise you might end up going back to the last environment you logged into.  Indeed it’s best to log out before trying to access a different environment.

Sometimes Mobile Secure seems to load with a blank grey screen, but an F5 refresh soon fixes it.  This happens with the Mobile Service for Development and Operations UI too.

Gateway Services for Offline

I’ll mention a couple of things that we discovered, without trying to write a comprehensive guide to offline.

Delta tokens (using a change log, similar to the agentry approach) only seem to work if the tokens are in ‘GUID_Timestamp‘ format.  We tried just using a timestamp but we got some errors.

Key fields (OData properties) must have a max. length defined in the metadata (i.e. in Gateway Builder, SEGW).

Blank screen issue

If you get a blank screen when you run your app try setting a different UI5 version on the portal site.  We currently have ours on UI5 1.46.11.

Offline

If you upload an application configuration file in Mobile Secure (to optimise the offline settings for your app) you must use the connection name not the ID.  This is covered by KB article 2525195.  The beginning of your file will look like this: [endpoint] name=Fiori Cloud Edition

You may find that if your file includes multiple defining requests only the very last defining request is uploaded successfully.  There is currently a work-around in place to use postman to upload the configuration file and this ensures that everything is uploaded correctly.

If you are using delta queries for your offline app you must use XML format for your OData responses rather than JSON.  This caused us some issues in the UI5.  For example dates and booleans were showing as strings in the JavaScript.  I’m not sure if this is a known binding issue or something specific to UI5 version 1.46.  To handle all scenarios you can write you statements like this: if (myProp && myProp !== “false”) { }

Online/offline mix

In our app we wanted to use some OData services in an offline mode and some (pre-existing services) in an online mode.  This proved to be a little tricky and I would avoid doing a mix if you can.  You can’t declare the online services in the manifest and when you do declare them you have to read the absolute path from one of the offline stores.  A mix also makes the authentication trickier because back-end calls are required more frequently.

Cloud Build

Debug-enabling

Be aware that selecting Build debug-enabled binaries can have unexpected consequences.  We had an issue with file upload (when running the app) that only occurred if the debug option was selected.  In addition, at the time of writing, iOS apps aren’t 64 bit (and therefore iOS11 compatible) if the debug option is selected.

App Download

CDN for faster downloads

Make sure you have the Content Delivery Network (CDN) option enabled.  This won’t speed up the very first download (from Mobile Place) but it should speed up subsequent downloads.  In our experience however it still seems quite slow.

Global

Account->Settings->Mobile Place

No need to authenticate

To allow users to download the app from Mobile Place without needing to authenticate you need to change settings both at the global and the app level.

Global

Account->Settings->Mobile Place

App

Applications->Manage Apps

Detail tab

Download on PC or mac

If you open Mobile Place on your PC or mac it won’t give you a download option because you aren’t on a mobile device.  You can fool it though by turning on device mode in the Chrome debugger.  This means you can download the file to your PC before attaching your mobile device to install it.  Even better, you can download the file from the build-complete dialog in Web IDE.

Debugging

It’s surprisingly easy to debug your app, if you did select Build debug-enabled binaries when you built it.  To debug an Android device connect it to a PC and enter the following URL into Chrome:

chrome://inspect/#devices

To debug an iOS device connect it to a mac and find the device via the developer menu in Safari.

With Fiori web apps I frequently turn debugging on so that I can debug the SAP-standard UI5 libraries.  I don’t believe there is a way to do this with Fiori Mobile.

Logs and Traces

For logs and traces you need to log on to the Mobile Service for Development and Operations.  A network trace captures all of the requests that go through mobile services (a.k.a. CPms).  There are often 2 matching requests, because there is a proxy component which makes the ultimate call to the OData backend.

You can download the trace as an HTTP archive (.har) file.  There are online viewers, but I found a Chrome extension viewer easier to use, especially with larger files.

To trace requests between the mobile client and SAP Cloud Platform mobile services (CPms) you can use Fiddler.  You install fiddler on your PC then configure the wi-fi settings on your phone so that your PC is used as a proxy.  Fiddler logs all of the network requests from your phone. I found this worked best when I did it at home, where there are only a handful of devices on the wi-fi network.

Support

You can raise incidents under MOB-FM (general Fiori Mobile) or MOB-FM-SEC (Mobile Secure, Mobile Place).

Back to Fiori Mobile Overview http://bit.ly/2iF4yiD #SAP #SAPCloud #AI