Skip to Content
Author's profile photo Gaurav Dey

Developing a sample C4C extension application using SAP HANA Cloud Platform (Part 1).

Companies need to provide exceptional support experience to customers once they have purchased their products/services. A good support experience goes a long way in improving the overall customer experience and customer satisfaction.


SAP Cloud for Customer provides an out-of-the-box support portal – “SAP Cloud for Service – Self-Service Support Portal”. It is an intuitive self-service support site for customers to raise and track service requests and collaborate with service agents to resolve issues quickly. The support portal can also be used for creating branded, customized service sites.


However, companies may need the flexibility to develop their own customized support sites with a custom look and feel (branding / layout). Companies can choose to expose additional information or services from the underlying C4C backend to the end users/customers to suit their support needs. A sample support site developed using the HANA Cloud Platform is shown in the image.


n.PNG


This series describes how the SAP HANA Cloud Platform can be used to build such a customized support site.

  • Part1:(This blog)
    • Leverage the SAP Cloud for Customer (C4C) OData services that expose service request functionality from the C4C backend.
    • Use the rapid application development capabilities (project templates with OData services) of the SAP Web IDE to develop an SAP UI5 application.
  • Part 2: Integrate the SAP UI5 application into a Fiori Launchpad site.

Prerequisites

  • You have signed up for a developer account for SAP HANA Cloud Platform and have your SAP ID or SCN credentials. If not, register for a developer account here.
  • You have access to a C4C test tenant which exposes the underlying C4C service request functionality via OData services. The OData services relevant for the service request scenario are accessible at <Your_C4C_tenant_host_name>/sap/byd/odata/v1/servicerequest/

I. Configure connectivity to the Cloud for Customer backend

Launch your SAP HANA Cloud Platform Account Cockpit

From your browser, access the SAP HANA Cloud Platform cockpit for your developer account. Go to https://account.hanatrial.ondemand.com/cockpit. Log on with your SAP ID or SCN credentials.

Configure connectivity destinations to the Cloud for Customer backend

SAP HANA Cloud Platform account enables secured connections from your cloud account to C4C backend systems by configuring destinations.

Input Output
  • Download the attached zip file – C4CODataServices.txt.zip that contains the destination.
  • Click on the Destinations tab in your HANA Cloud Platform cockpit.
  • From the empty Destinations table, click Import from File
/wp-content/uploads/2015/10/1_806942.jpg
  • In the file selection dialog, select the downloaded destination file.  The destination configuration properties from the file would be displayed as shown in the image.

       Change the URL to point to your C4C tenant system.

      <Your_C4C_tenant_hostname>sap/byd/odata/v1/servicerequest/

/wp-content/uploads/2015/10/1_806942.jpg
  • Click on Save: A new entry is added to your Destinations table.
/wp-content/uploads/2015/10/1_806942.jpg

II. Develop the SAPUI5 application for displaying open tickets

Input Output

Launch the SAP Web IDE

  • Click on the Subscriptions tab of your HANA Cloud Platform cockpit.
  • From the subscribed HTML5 Applications list, click the webide link in the Application column.
/wp-content/uploads/2015/10/1_806942.jpg
  • Click the Application URL or copy it into your browser to launch the Web IDE in a new tab. The SAP Web IDE opens (this may take a few seconds).
  • Click on the icon </> to open the Development perspective.
/wp-content/uploads/2015/10/1_806942.jpg

Use the Project Templates in SAP Web IDE

Since we have enabled connectivity from our HCP account to the C4C OData services, we can use the SAP Web IDE templates to generate applications that consume data coming from the OData services.


Input Output
  • From the Project Explorer select the Local root folder.
  • Right click and select New > Project from Template. The new project from template wizard is opened.
1.PNG
  • From the drop down select the All Categories tab as this will list all the types of application you can build.
11.PNG
  • In the Template Selection screen select the SAP Fiori Master Detail Application template as shown in adjacent figure.
/wp-content/uploads/2015/10/22_846113.png
  • Click Next. The Basic Information screen opens.
  • Enter the Project Name as “OpenTickets”
  • Click Next.


  • The Data Connection screen opens. This screen allows you to select data sources for your application as defined by the various destination files you configured in your HANA Cloud Platform Cockpit.
  • From the list of Sources, select Service URL
  • From the Service Information drop down list select the connection source: C4CODataServices: This connection source reflects the connectivity defined by the destination you created in the previous section.
  • Enter the relative path to the C4C OData service end point: sap/byd/odata/v1/servicerequest/
/wp-content/uploads/2015/10/1_806942.jpg
  • Click on the /wp-content/uploads/2015/10/1_806942.jpg button. A list of available OData entity collections is displayed on the right side of the screen


ff.PNG
  • Click Next. Choose the OData entity collection you want to work with (ServiceRequestCollection), and bind its properties to the applications Master-Detail UI controls.
  • In the Master Section and Detail section, enter the following details as shown in the image.
  • Click Next. The confirmation screen is opened
  • Click Finish – A new project is created in your SAP Web IDE.

/wp-content/uploads/2015/10/1_806942.jpg


Preview the application

Input Output
  • Click on the OpenTickets folder to expand it.
  • Select the index.html file.

/wp-content/uploads/2015/10/2_806952.jpg

  • Click the /wp-content/uploads/2015/10/1_806942.jpgbutton to preview the application. The application preview opens displaying data coming from the configured Cloud for Customers backend (this may take several seconds).

/wp-content/uploads/2015/10/1_806942.jpg

Deploy the application to SAP HANA Cloud Platform


In this part, we will deploy our application to the SAP HANA Cloud Platform and activate the application.


Input Output
  • Right click on the OpenTickets project folder and select Deploy > Deploy to SAP HANA Cloud Platform.
  • If this is the first time you’re deploying an application to HANA Cloud Platform – A User Information dialog box is opened.
  • Verify your SCN user Email Address for the Settings of the Git repositories (the OpenTickets application will be stored in the Git repository).
  • Click OK. The SAP HANA Cloud Platform Login dialog opens.
  • Enter your SCN credentials.
  • Click Login.


  • The Deploy Application to SAP HANA Cloud Platform dialog box is displayed with values for the application version.
  • Click Deploy.
/wp-content/uploads/2015/10/2_806952.jpg
  • The deployment allocates a dedicated Git repository for hosting the application source code on HCP,creates a version from the current code and activates the application – publishing the current activated version.
  • A Successfully Deployed dialog box is opened.



Note: To test the running application, click on Open the active version of the application. This will take you to the running instance of the application

/wp-content/uploads/2015/10/1_806942.jpg




Assigned Tags

      27 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Pushkar Ranjan
      Pushkar Ranjan

      Excellent stuff Gaurav. Keep them coming. Thank you.

      Author's profile photo Gaurav Dey
      Gaurav Dey
      Blog Post Author

      Thanks Pushkar.

      Author's profile photo Michael Janello
      Michael Janello

      thanks for sharing Gaurav!

      Author's profile photo Gaurav Dey
      Gaurav Dey
      Blog Post Author

      Thanks Michael.

      Author's profile photo Former Member
      Former Member

      Hi Gaurav,

      How are we going to perform actions/activities on the Data from the ODATA Service?

      For example updating ticket status, updating ticket information and then returning the updates to the C4C Tenant / Cloud System.

      Author's profile photo Gaurav Dey
      Gaurav Dey
      Blog Post Author

      Hi Dominic,

      You can use POST/PUT methods to perform CRUD operations.

      Refer to:

      C4C OData API reference: SAP Cloud for Customer – OData Services

      C4C OData API Developer's guide at GitHub:    https://github.com/SAP/C4CODATAAPIDEVGUIDE

      You can also have a look at Sample payload: C4CODATAAPIDEVGUIDE/serviceticket.md at master · SAP/C4CODATAAPIDEVGUIDE · GitHub

      Hope this helps. Cheers!!

      Author's profile photo Pushkar Ranjan
      Pushkar Ranjan

      Thank you for the pointers Gaurav Dey

      Author's profile photo Former Member
      Former Member

      Is this possible using a Trial Account in SAP HANA Cloud Platform?

      Author's profile photo Gaurav Dey
      Gaurav Dey
      Blog Post Author

      Yes Dominic it is, but the C4C tenant you need to have your own.

      Author's profile photo Syambabu Allu
      Syambabu Allu

      Good Blog.

      Is there any trail C4C tenant available for accessing C4C Odata services.

      Thanks,

      Syam

      Author's profile photo Gaurav Dey
      Gaurav Dey
      Blog Post Author

      Hi Syam,

      You need to have your own C4C tenant.

      Author's profile photo Former Member
      Former Member

      hi Syam,

      Yes its available.
      https://my<trailAccount>.crm.ondemand.com/sap/byd/odata/v1/c4codata/

      Br..
      Prasad Sistla.

      Author's profile photo Former Member
      Former Member

      Thank you Gaurav for sharing such a nice blog. I am facing the following error while following the steps provided in your blog. But the connection is successful when I click on check connection from my trail account destinations after setting ups the destination. Please suggest

      /wp-content/uploads/2016/04/2016_04_09_1507_926454.png

      Author's profile photo Gaurav Dey
      Gaurav Dey
      Blog Post Author

      Hi Ayyappa,

      It works fine for me. Check your destination file once again.

      Thanks.

      Author's profile photo Rajeev Singh
      Rajeev Singh

      Hi Gaurav,

      Thanks for sharing nice information. At the same step, I am getting "Internal Server Error".

      I have used the same information (Destination, URL etc) shared in this blog.

      Can you please help me?

      Thanks,

      Rajeev Singh

      Author's profile photo Gaurav Dey
      Gaurav Dey
      Blog Post Author

      Hi Rajeev,


      Thanks for following the blog.

      It works fine for me. Kindly check your destination file, I suspect some issue is there from your C4C tenant.

      Author's profile photo Dennis Klein
      Dennis Klein

      Hi Gaurav,

      how do i get the out-of-the box portal "Self-Service-Portal"?

      The cusomter has already purchased licenses for the Hana Cloud Plattform.

      Thanks in advance.

      Best regards,

      Dennis

      Author's profile photo Gaurav Dey
      Gaurav Dey
      Blog Post Author

      Hi Dennis,

      Thanks for following the blog.


      This has to be bought separately. For more info contact your Account Executive.

      Author's profile photo Raghav Rathor
      Raghav Rathor

      Hello Gaurav,

      Thanks for sharing the blog with step by step guides.

      It would be great if you could provide the details of getting the access to C4C test tenant.

      Please share the link where we can register for C4C test tenant system.

      Regards,

      Raghav Rathor

      Author's profile photo Gaurav Dey
      Gaurav Dey
      Blog Post Author

      Hi Raghav,

      Thanks for following the blog. You can check the details with your SAP account Manager.

      Author's profile photo Vishal Menon
      Vishal Menon

      Hi Gaurav ,

      I tried doing the above steps .

      I successfully created a project template in Web IDE but when I was trying to run the project it gave a 404 error .

      Kindly help .

      Regards,

      Vishal Menon

      Author's profile photo Gaurav Dey
      Gaurav Dey
      Blog Post Author

      Hi Vishal,

      Thanks for trying this out.

      The destination that you are using are they proper. ?

      Author's profile photo Vishal Menon
      Vishal Menon

      Hi gaurav ,

      Yes those are correct .. Tried the connection test which were successful .

      same format as you mentioned in this post :-

      https://<MyC4Ctenant_name>.crm.ondemand.com/sap/byd/odata/v1/servicerequest/

      Kindly suggest if this pattern has some correction?

      Thank you .

      Regards,

      Vishal Menon

      Author's profile photo Gaurav Dey
      Gaurav Dey
      Blog Post Author

      Hi Vishal,

      The url pattern that you are using is proper. Can you share the screenshot if you are still facing the error.

      Regards,
      Gaurav Dey

      Author's profile photo Former Member
      Former Member

      Hi Gaurav,
      Are you able to create a ticket using Crud?

      Author's profile photo Jan Adelmann
      Jan Adelmann

      Hi Gaurav,

      Thanks for sharing the blog. Very nice!

      Do you know about a list of all odata services?

      Thanks,

      Jan

      Author's profile photo Gaurav Dey
      Gaurav Dey
      Blog Post Author

      Hi Jan,

      Thanks for trying out the blog. Couple of them that I know about are

      Regards,
      Gaurav Dey