Collaborative Extension: Part 4-Consuming Back-end APIs

In This Part

We are going to consume back-end API and create group template in SAP Jam.

Test Connection Chain of Shop OData Service

We’re going to test connection from SCP to Shop OData service on the back-end via (1) OData Provisioning, (2) SAP Cloud Connector, and (3) ABAP Backend.

Test Connection

  1. Open the link to Shop OData Service we bookmarked before. (e.g. https://gwaas-p1942320001trial.hanatrial.ondemand.com/odata/SAP/EPM_REF_APPS_SHOP_SRV;v=1) You should see available services in XML.
  2. Change the URL:
    From: /odata/SAP/EPM_REF_APPS_SHOP_SRV;v=1
    To: /odata/SAP/EPM_REF_APPS_SHOP_SRV/Products
    You should see the list of products in responsed XML.
  3. Paste the URL in a text editor for later use.

Prepare Annotation XML

  1. Download annotation.xml
  2. Open the file and replace {ODATA PROVISIONING URL} with your Shop OData Service URL. Save the file.
  3. Open SAP Jam cockpit.

Consuming Back-end API in SAP Jam

Create new external application

  1. Click the gear icon (Account Settings) in the upper right and select Admin.
  2. On the left navigation menu, select Integrations → External Applications.
  3. Click Add Application button and select SAP HANA Cloud Platform.
  4. Input the following:
    Name: EpmRefAppsShopSrv
    User name: (your SCP ID e.g. p1942320001)
    Password: (your SCP password)
  5. Click Save.

Add Products Record Type

  1. At the newly created External Application, click Edit and select Manage Record Types
  2. Click Add Record Type button.
  3. Input the following:
    Name: Products
    External Type: (Your Shop OData URL/$metadata#Products e.g. https://gwaas-p1942320001trial.hanatrial.ondemand.com/odata/SAP/EPM_REF_APPS_SHOP_SRV/$metadata#Products)
  4. Select Annotation URL and change it to Inline XML and paste the prepared annotation.xml into this field.
  5. Click Create.

Create Reviews Record Type

  1. Create another record type with the following information:
    Name: Reviews
    External Type: (Your Shop OData URL/$metadata#Reviews e.g. https://gwaas-p1942320001trial.hanatrial.ondemand.com/odata/SAP/EPM_REF_APPS_SHOP_SRV/$metadata#Reviews)
  2. Use the same annotation.xml

Display Business Record Data

  1. At the top navigation, click Business Records.
  2. Click EpmRefAppsShopSrv.
  3. Click Products.
  4. Click on any product to display its information.
  5. This proves your SAP Jam can connect to back-end API.

Create SAP Jam Entities based on Business Records

Create Jam Group based on a Product

  1. Go back to the previous page of list of products.
  2. Hover your mouse over a product and click Create Group button.
  3. Fill out the following information:
    Template: No Template
    Name: (Product name) Discussion
    Permission: Public
    Activatethis group now: selected
  4. Click Create.

Create Jam Group Template based on a Product

  1. On the upper right, click gear icon (Account Setttings) and select Admin.
  2. On the left navigation menu, select Product Setup → Group Templates.
  3. Click Create a template button.
  4. Fill in the following information:
    Name: Product Discussion
    Business Record: Products
  5. Click Create.

Design New Group Template

  1. Click Create An Overview Page button.
  2. Keep the selected layout and click Create.
  3. Close the Page Designer Tips.
  4. On Overview Page Designer, put Product Discussion in the Title.
  5. Click Add Widget button on the top area.
  6. Select suitcase icon (Business Record).
  7. Fill in the following information:
    Widget Title: Product
    Show: Item Detail
    Display Properties: (Keep all selected)
  8. Click OK.

Create Review Widget

  1. Click Add Widget button on the lower left area.
  2. Select suitcase icon (Business Record).
  3. Putting the following information:
    Name: Reviews
    Show: Related
    Types: Reviews
    Sort by: Rating (Descending)
    Layout: List
    Maximum number of items: 25
  4. Click OK.

Create Feed Widget

  1. Click Add Widget button on the lower left area.
  2. Select newspaper icon (Feed).
  3. Keep all defaults and click OK.

Click Publish and the new template design is displayed.

Activate Group Template

  1. On the upper right, click gear icon (Account Settings) and select Admin.
  2. On the left navigation menu, select Product Setup → Group Template.
  3. Search for Product Discussion and turn it on.

Create a New Group based on Template

  1. On the top navigation, select Business Record.
  2. Click EpmRefAppsShopSrvProducts.
  3. Hover your mouse on a different product and click Create Group button.
  4. Input the following information:
    Template: Product Discussion
    Name: (Product name) Discussion
    Permissions: Public
    Activate this group now: selected
  5. Click Create.

Go to Overview page and you should see the new layout you’ve just designed.

Continue Reading

Read More