cancel
Showing results for 
Search instead for 
Did you mean: 

xsodata service for a HANA View - Severe limitations?

Former Member
0 Kudos

Hi,

I am just starting out creating xsodata services on top of HANA views. The intention is for a generic client to consume one or more oData services exposed on HANA. However, I find the generated service to contain very limited information.

For example, I create a view using this syntax:

service {

          "<some_path>/myview.analyticview" as "MyView" keys generate local "GENERATED_ID" aggregates always;

}

The generated service metadata only contains the IDs associated with the columns in the analytic view. I don't have access to the labels of the columns, I have no indication of the description fields either. No generic client can work well with only access to the IDs and no additional metadata.

<Schema xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns="http://schemas.microsoft.com/ado/2008/09/edm" Namespace="something">

  <EntityType Name="analyticViewType">

  <Key>

  <PropertyRef Name="GENERATED_ID"/>

  </Key>

  <Property Name="GENERATED_ID" Type="Edm.String" Nullable="false" MaxLength="2147483647"/>

  <Property Name="KMLAND_1" Type="Edm.String" MaxLength="3"/>

  <Property Name="GJAHR" Type="Edm.String" MaxLength="4"/>

  <Property Name="PERDE" Type="Edm.String" MaxLength="3"/>

  <Property Name="FRWAE" Type="Edm.String" MaxLength="5"/>

  <Property Name="REC_WAERS" Type="Edm.String" MaxLength="5"/>

  <Property Name="WWDFM" Type="Edm.String" MaxLength="18"/>

  <Property Name="VVCAP_ME" Type="Edm.String" MaxLength="3"/>

  <Property Name="ABSMG_ME" Type="Edm.String" MaxLength="3"/>

  <Property Name="VVMIR" Type="Edm.Decimal" Precision="34"/>

  <Property Name="VVMPA" Type="Edm.Decimal" Precision="34"/>

  <Property Name="VVPMT" Type="Edm.Decimal" Precision="34"/>

  <Property Name="VVPPT" Type="Edm.Decimal" Precision="34"/>

  <Property Name="VVSFT" Type="Edm.Decimal" Precision="34"/>

  <Property Name="VVSPA" Type="Edm.Decimal" Precision="34"/>

  <Property Name="VVVIR" Type="Edm.Decimal" Precision="34"/>

  </EntityType>

  <EntityContainer Name="" m:IsDefaultEntityContainer="true">

  <EntitySet Name="MyView" EntityType="something"/>

  </EntityContainer>

</Schema>

Is there an alternate xsodata definition format which allows me to expose additional information like field labels and description columns?

thanks,

Nitin Goel

Accepted Solutions (1)

Accepted Solutions (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

If you want the column labels as well add the OData4SAP Annotation to the XSODATA service definition.

Here is an example:

service namespace "sap.hana.democontent.epmNext.services" {

  "sap.hana.democontent.epmNext.models::BUYER"

  as "BusinessPartners"

  keys("PARTNERID");

}

annotations {

   enable OData4SAP;

}

Former Member
0 Kudos

Thank you Thomas. Is there a resource where I can get more details of the options available to me when creating an xsodata service?

thomas_jung
Developer Advocate
Developer Advocate

Answers (0)