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
- 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.
- 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. - Paste the URL in a text editor for later use.
Prepare Annotation XML
- Download annotation.xml
- Open the file and replace {ODATA PROVISIONING URL} with your Shop OData Service URL. Save the file.
- Open SAP Jam cockpit.
Consuming Back-end API in SAP Jam
Create new external application
- Click the gear icon (Account Settings) in the upper right and select Admin.
- On the left navigation menu, select Integrations → External Applications.
- Click Add Application button and select SAP HANA Cloud Platform.
- Input the following:
Name: EpmRefAppsShopSrv
User name: (your SCP ID e.g. p1942320001)
Password: (your SCP password) - Click Save.

Add Products Record Type
- At the newly created External Application, click Edit and select Manage Record Types
- Click Add Record Type button.
- 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) - Select Annotation URL and change it to Inline XML and paste the prepared annotation.xml into this field.
- Click Create.

Create Reviews Record Type
- 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) - Use the same annotation.xml

Display Business Record Data
- At the top navigation, click Business Records.
- Click EpmRefAppsShopSrv.
- Click Products.
- Click on any product to display its information.
- 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
- Go back to the previous page of list of products.
- Hover your mouse over a product and click Create Group button.
- Fill out the following information:
Template: No Template
Name: (Product name) Discussion
Permission: Public
Activatethis group now: selected - Click Create.

Create Jam Group Template based on a Product
- On the upper right, click gear icon (Account Setttings) and select Admin.
- On the left navigation menu, select Product Setup → Group Templates.
- Click Create a template button.
- Fill in the following information:
Name: Product Discussion
Business Record: Products - Click Create.

Design New Group Template
- Click Create An Overview Page button.
- Keep the selected layout and click Create.
- Close the Page Designer Tips.
- On Overview Page Designer, put Product Discussion in the Title.
- Click Add Widget button on the top area.
- Select suitcase icon (Business Record).
- Fill in the following information:
Widget Title: Product
Show: Item Detail
Display Properties: (Keep all selected) - Click OK.

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

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

Click Publish and the new template design is displayed.

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

Create a New Group based on Template
- On the top navigation, select Business Record.
- Click EpmRefAppsShopSrv → Products.
- Hover your mouse on a different product and click Create Group button.
- Input the following information:
Template: Product Discussion
Name: (Product name) Discussion
Permissions: Public
Activate this group now: selected - Click Create.

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