cancel
Showing results for 
Search instead for 
Did you mean: 

Gateway oData service -

Former Member
0 Kudos

Dear experts

I have a question on the metadata of an oData service. Here is the service I have


<edmx:Edmx Version="1.0" xmlns:edmx="http://schemas.microsoft.com/ado/2007/06/edmx" xmlns:sap="http://www.sap.com/Protocols/SAPData">

<edmx:DataServices xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/

metadata" m:DataServiceVersion="2.0">

<Schema xmlns="http://schemas.microsoft.com/ado/2008/09/edm" Namespace="MySalesOrders">

<EntityType Name="SalesOrder">

<Key> <PropertyRef Name="SalesOrderNumber" /> </Key>

<Property Name="SalesOrderNumber" Type="Edm.String" sap:label="Sales Order Number" Nullable="false" MaxLength="10" />

<Property Name="TotalAmount" Type="Edm.Decimal" sap:label="Total Amount" Precision="16" Scale="3" sap:unit="Currency" MaxLength="10" />

<Property Name="Currency" Type="Edm.String" sap:label="Currency" MaxLength="5" sap:semantics="currency-code" />

<Property Name="CustomerID" Type="Edm.String" sap:label="Customer ID" MaxLength="10" />

<Property Name="CustomerName" Type="Edm.String" sap:label="Customer Name" MaxLength="35" />

as you see, some of the properties have additional information like sap:label, sap:unit and so on. Are  these annotations???

Where can I use these information while building any UI5 app?

Thank you

Aakash

Accepted Solutions (1)

Accepted Solutions (1)

former_member184867
Active Contributor
0 Kudos

Hello Akash,

Here are some information for you

1. Yes, these are annotations. Anything that comes with 'sap:' are called SAP annotation.These are not  defined in Official OData specification, these are defined by SAP to make the data more meaningful. There are many other examples of annotation. In SEGW you can create annotation bases projects which will contain many more complex more annotations.    

2. They can be very useful in designing the UI.

   For example: If you are displaying a feed in form of a UI5 table,

          a.  sap:label becomes your column heading

          b.  If sap:updatatble is true, then you may make your field editable in the UI5 table

There are smart template UIs, which are heavily dependent on complex annotations, but that is a  different topic altogether.

Regards,

Atanu 

Former Member
0 Kudos

Hi Atanu, Ekansh

Thanks for your replies, now I understand it better.

Do you have any samples where UI has been created based on simple annotations similar to what I posted above?

Thank you

Aakash

nageshcaparthy
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Aakash,

You can refer to this link on UI5 Development with oData services. This gives the complete understanding.

You can also try out the Free WebIDE for quick UI5 apps development.

Regards,

Nagesh

nageshcaparthy
Product and Topic Expert
Product and Topic Expert
0 Kudos

Additionally, refer to the UI5 Development, this has the step by step development process, routing concepts, view, data binding and best practice. Go to Read me first and Building. 

OpenUI5 SDK - Demo Kit

Hope this answers your question.

Regards,

Nagesh

former_member184867
Active Contributor
0 Kudos

Answers (1)

Answers (1)

EkanshCapgemini
Active Contributor
0 Kudos

Hi Aakash,

Yes, these are annotations which are default supported by SAP Gateway framework for OData service v2.0 . You can get more details here:

Regards,

Ekansh