Quantcast
Channel: SCN : Blog List - All Communities
Viewing all articles
Browse latest Browse all 2548

Developing Custom Apps on Consumer Accounts of SAP Asset Intelligence Network

$
0
0

SAP announced the launch of a new cloud business network for assets at the Hannover Messe 2016 tech conference. SAP Asset Intelligence Network will help manufactures, service providers, operators and other business partners to collaborate using a shared platform which contains the single source of truth about shared assets.



Although the network is being constantly enhanced by SAP with functionality to address problems with enterprise asset performance and management, there will always be the need for unique usages of the asset data that is contained in the network.


This blog explains how customers, partners and preferred solution providers can create custom application using the networks public APIs.


Situations for creating custom apps

Building customized Fiori apps allows us to meet the "instant needs of the business". In the past, a custom Fiori app could be built in 2 -4 weeks. Today, the app deployment process with HCP enablement tools such as mobile services (HCPMS) and WEBIDE makes the app development significantly faster. In our recent experience, it took us just a couple of hours to build Fiori apps with HCP.

I envision customers will want to build custom Apps consuming the network data in the following 3 situations:


  • A custom application deployed on HCP or any other public cloud platform like Azure or AWS
    1. AIN extensions / Custom Apps that are used by each customers. These extensions would be deployed on the customers HCP account.


  • Deployed on a customer’s OnPrem Gateway or directly in the back-end: ß this might be the highest usage of AIN initially with existing EAM customers.
    1. Custom apps hosted OnPrem FLP with integrations to ECC. In this case, the custom App would show up as a tile on OnPrem FLP and will use public AIN APIs.
    2. Showing AIN content on an OnPrem application or transaction (contextual side panel)


  • Sold on SAP store or any other App store by partners, Service providers, and Content providers. When purchased, AIN will have additional features:
    1. Custom AIN extensions / Apps which will get downloaded onto each purchaser’s HCP account or any other public cloud platform. This is where we need a “AIN App store”
    2. In App purchasing in AIN, which will extend AIN functionality only for that user account. Like an SAP validated extension point.


Steps to build and deploy a custom application on HCP

The following 12 steps needs to be performed in sequence to successfully create a custom app that consumes the public APIs provided by the SAP Asset Intelligence Network.


Step 1

Open your consumer account cockpit and click on the “Services” Tab.

 

step1.png

 

Step 2

Select Web IDE from the list of services. Enable it if not already enabled

step2.png

 

Notes:

  • Instead of using SAP Web IDE, you can also use Eclipse or any other IDE to build your custom applications.
  • There are quite a few reference apps that you can use to get started on your first custom application. This article in SCN

 

Step 3

Click on the “Open SAP Web IDE” link. This should take you to the new Web IDE Screen for your account.


step3a.png


step3b.png

Step 4

Under the “Create a Project” Section, select “New Project From Template” -> UI5 Application.


step4.png


Step 5

Press Next and fill in all the required fields and click on the Finish Button to create a new project. The new project will be available in your workspace.


step5.png

Step 6

Build the UI5 application as required using the View-Controller given or add new ones, if required.

Step 7

For any service calls that needs to be made, it has to be done through a destination which can be created using the following steps:

  • In the consumer account Cockpit, click on the “Destinations” tab.
  • Click on “New Destination” button to create a new destination.

step7.png

  • Assign a Name and description, select the required type, proxy type and authentication and enter the host url relative to which service calls should be made.
  • Click on save to save the destination.
  • Click on the “Check Connection” button to verify if the connection succeeds.

 

Step 8

Once a destination has been created, it needs to be referred to the app created earlier. Open the neo-app.json in your application folder in the workspace and add the destination you just created as an object under the “routes” array.

 

Example of a destination:

{

      "path": "/ain/",

      "target": {

        "type": "destination",

        "name": "name of the destination",

        "entryPath": "/ain/"

      },

      "description": "Service end points for all the apps which will be used by the end user"

}

 

Step 9

Services can then be called relative to the path specified here.

  1. e.g.  $.ajax({

url: "/ain/services/api/v1/announcements",

                        success: function(data) {}

                        });

 

Step 10

  To test and run your application, you can select your application (or the html file within it) and run it from the “Run” menu or the Run icon on the icon bar.

step10.png

Step 11

Deploying the Application on HCP

  1. Select the Application you want to deploy and click on the Deploy to Hana Cloud Platform from the Deploy Menu. Or right-click -> Deploy -> Deploy to Hana Cloud Platform
  2. Enter your credentials for authentication.
  3. Once authenticated, a dialog pops up.
  4. Select the account you want to deploy the application on and enter the application name and click on Deploy.
  5. The application should get deployed.

 

Step 12

Create a Tile on Launchpad

  • Select the Application you want to create a tile for and click on “Register on SAP Fiori Launchpad” from the Deploy Menu. Or right-click -> Deploy -> Register on SAP Fiori Launchpad.
  • A dialog pops up.
  • Enter the relevant information for the tile configuration depending on how you want your tile to be display and click on Finish.
  • While configuring the tile, add the semantic Object, Action and parameters required for the application (if any)


step12.png

  • From UI we can retrieve the parameters through this code –  

       this._oComponent = sap.ui.component(sap.ui.core.Component.getOwnerIdFor(this.getView()));

     this._oComponent.getComponentData().startupParameters.Param

  • Your tile will be created on the Launchpad for use

 

Usage of APIs

SAP will continue to provide additional APIs and the more features are introduced.

As on Q2-2016, the following objects within the network can be accessed using APIs:

  • Templates
  • Models
  • Equipment
  • Instructions
  • Announcements
  • Documents
  • Spare Parts

 

Each of the objects can be accessed, edited or deleted using these APIs, provided that the pre-requisites are met.

The below tutorial will guide you in using the APIs :

https://cp.hana.ondemand.com/dps/d/preview/d2d73af931b14c7db6b4c216dca94c7c/1.0/en-US/SAP_AIN_API_Tutorial.pdf

 

References

 

Adding Custom Apps to Fiori Launchpad

 

Using SAP Web IDE:

 

HCP


Viewing all articles
Browse latest Browse all 2548

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>