Skip to Content

SAP HCP predictive services, Access your predictive demo data set using an OData services from a REST client


SAP HCP predictive services, Access your predictive demo data set using an OData services from a REST client

By Abdel Dadouche

Using a REST client, you will interact with an OData services and get access to your predictive demo data set

You will learn

  • How to test an OData Service deployed on HCP using a REST Client


In order to ease the readability of this tutorial, we have used tokens to replace long URLs.
Therefore you can replace any occurrence of the token by the value listed above.
Make sure you update the URL with your HCP Account identifier.

Token Value
<HANA URL> http://trial<HCP Identifier>

  1. Open Postman.

    Fill in the following information:

    Field Name Value
    Request Type GET
    URL <HANA URL>/public/timeseries/odata/timeseries.xsodata
    Postman URL

    Select the Authorization tab

    Field Name Value
    Type Basic Auth
    Username HCPPSTRIAL (your HANA User Account login)
    Password Welcome16 (your HANA User Account password)
    Postman URL

    Click on Send

  2. It will now display the list of OData services registered in the timeseries.xsodata

    <?xml version="1.0" encoding="utf-8" standalone="yes"?>
      <service xmlns:atom="http:/"
        xml:base="<HANA URL>/">
          <collection href="TimeSeriesData">
  3. Now append $metadata to the URL which should look like this:
    Field Name Value
    URL <HANA URL>/public/timeseries/odata/timeseries.xsodata/$metadata

    This will return the EDMX (***Entity Data Model*** XML) document that contains a complete description of the configured feeds.

    Click Send

    <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
    <edmx:Edmx Version="1.0" xmlns:edmx="http:/">
      <edmx:DataServices xmlns:m="http:/" m:DataServiceVersion="2.0">
        <Schema Namespace="public.timeseries.odata.timeseries"
          <EntityType Name="TimeSeriesDataType">
              <PropertyRef Name="Date" />
            <Property Name="Date" Type="Edm.DateTime" Nullable="false" />
            <Property Name="WorkingDaysIndices" Type="Edm.Int16" />
            <Property Name="ReverseWorkingDaysIndices" Type="Edm.Int16" />
            <Property Name="MondayMonthInd" Type="Edm.Int16" />
            <Property Name="TuesdayMonthInd" Type="Edm.Int16" />
            <Property Name="WednesdayMonthInd" Type="Edm.Int16" />
            <Property Name="ThursdayMonthInd" Type="Edm.Int16" />
            <Property Name="FridayMonthInd" Type="Edm.Int16" />
            <Property Name="BeforeLastMonday" Type="Edm.Int16" />
            <Property Name="LastMonday" Type="Edm.Int16" />
            <Property Name="BeforeLastTuesday" Type="Edm.Int16" />
            <Property Name="LastTuesday" Type="Edm.Int16" />
            <Property Name="BeforeLastWednesday" Type="Edm.Int16" />
            <Property Name="LastWednesday" Type="Edm.Int16" />
            <Property Name="BeforeLastThursday" Type="Edm.Int16" />
            <Property Name="LastThursday" Type="Edm.Int16" />
            <Property Name="BeforeLastFriday" Type="Edm.Int16" />
            <Property Name="LastFriday" Type="Edm.Int16" />
            <Property Name="Last5WDaysInd" Type="Edm.Int16" />
            <Property Name="Last5WDays" Type="Edm.Int16" />
            <Property Name="Last4WDaysInd" Type="Edm.Int16" />
            <Property Name="Last4WDays" Type="Edm.Int16" />
            <Property Name="LastWMonth" Type="Edm.Int16" />
            <Property Name="BeforeLastWMonth" Type="Edm.Int16" />
            <Property Name="Cash" Type="Edm.Decimal" Precision="17" Scale="6" />
          <EntityContainer Name="timeseries" m:IsDefaultEntityContainer="true">
            <EntitySet Name="TimeSeriesData" EntityType="public.timeseries.odata.timeseries.TimeSeriesDataType" />
  4. Let’s have a look at the TimeSeriesData feed. Update the URL and replace $metadata by TimeSeriesData which should look like this:

    Field Name Value
    URL <HANA URL>/public/timeseries/odata/timeseries.xsodata/TimeSeriesData

    Click Send

    This will return the all table content in an Entity Data XML format which contains around 250 items.

  5. In order to filter the data and only includes entities where the Cash property is not null, you can update the URL like this:

    Field Name Value
    URL <HANA URL>/public/timeseries/odata/timeseries.xsodata/TimeSeriesData/?$filter=(Cash eq null)

    Click Send

    This will return only 21 items.


Next Steps

Updated 12/08/2016

Time to Complete

5 minutes




Back to top