on 01-08-2015 10:55 PM
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
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;
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
They are documented in the online help:
User | Count |
---|---|
89 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.