Quantcast
Channel: SCN: Message List - SAP HANA Developer Center
Viewing all articles
Browse latest Browse all 9165

Re: Facing errors while creating a odata service consuming a calculation view.

$
0
0

An OData service must have a key specification as a unique URL for each record must be generated. For table sources XSODATA uses the key specification of the table itself as the source of the OData key.  Calculation views, on the other hand, have no key structure. You must either specify the key columns within the XSODATA document itself

service  {

  "sap.hana.democontent.epmNext.data::MD.BuyerView"

  as "Buyer"

  keys("Id"); 

 

 

}

 

Or use the KEYS GENERATE LOCAL option to have the framework generate a key for you (useful when you have aggregation):

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

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

    as "SalesByCountry" with ("COUNTRY", "TOTAL_SALES", "SALES", "SHARE_SALES")  

  keys generate local "ID"

    aggregates always; 

}


Viewing all articles
Browse latest Browse all 9165

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>