<Schema Namespace="ODataDemoService" xmlns="http://schemas.microsoft.com/ado/2007/05/edm"
xmlns:sap="http://www.sap.com/Protocols/SAPData">
<EntityType Name="Product">
<Key>
<PropertyRef Name="ID"/>
</Key>
<Property Name="ID" Type="Edm.Int32" Nullable="false" sap:label="ID"/>
<Property Name="CategoryID" Type="Edm.Int32" Nullable="false" sap:label="Category"/>
<Property Name="SupplierID" Type="Edm.Int32" Nullable="false" sap:label="Supplier"/>
<Property Name="Name" Type="Edm.String" Nullable="true" sap:label="Name"/>
<NavigationProperty Name="Supplier" Relationship="ODataDemo.Product_Supplier_Supplier_Products" FromRole="Product_Supplier"
ToRole="Supplier_Products"/>
</EntityType>
<EntityContainer Name="DemoService" m:IsDefaultEntityContainer="true">
<EntitySet Name="Products" EntityType="ODataDemoService.Product" />
</EntitySet>
</EntityContainer>
</Schema>
<smartFilterBar:SmartFilterBar id="smartFilterBar" entitySet="Products"
useToolbar="false" showFilterConfiguration="false">
</smartFilterBar:SmartFilterBar>
<smartTable:SmartTable id="ProductsSmartTable" entitySet="Products"
smartFilterId="smartFilterBar" header="Products" showRowCount="true"
useExportToExcel="false" useVariantManagement="false"
useTablePersonalisation="false">
</smartTable:SmartTable>
<Annotations Target="ODataDemoService.Product">
<Annotation Term="com.sap.vocabularies.UI.v1.LineItem">
<Collection>
<Record Type="com.sap.vocabularies.UI.v1.DataField">
<PropertyValue Property="Value" Path="Name"/>
</Record>
<Record Type="com.sap.vocabularies.UI.v1.DataField">
<PropertyValue Property="Value" Path="CategoryID"/>
</Record>
<Record Type="com.sap.vocabularies.UI.v1.DataField">
<PropertyValue Property="Label" String="Supplier Name"/>
<PropertyValue Property="Value" Path="Supplier/Name"/>
</Record>
</Collection>
</Annotation>
</Annotations>
<EntityType Name="Product">
<Key>
<PropertyRef Name="ID"/>
</Key>
<Property Name="ID" Type="Edm.Int32" Nullable="false" sap:label="ID"/>
<Property Name="CategoryID" Type="Edm.Int32" Nullable="false"
sap:label="Category"/>
</EntityType>
<EntityType Name="Category">
<Key>
<PropertyRef Name="ID"/>
</Key>
<Property Name="ID" Type="Edm.Int32" Nullable="false" sap:label="ID"/>
<Property Name="Name" Type="Edm.String" Nullable="true"
sap:label="Name"/>
</EntityType>
<EntityContainer Name="DemoService" m:IsDefaultEntityContainer="true">
<EntitySet Name="Products" EntityType="ODataDemoService.Product" />
<EntitySet Name="Categories" EntityType="ODataDemoService.Category" />
</EntityContainer>
<smartFilterBar:SmartFilterBar id="smartFilterBar" entitySet="Products"
useToolbar="false" showFilterConfiguration="false">
<smartFilterBar:controlConfiguration>
<smartFilterBar:ControlConfiguration key="CategoryID"
visibleInAdvancedArea="true"
preventInitialDataFetchInValueHelpDialog="false">
</smartFilterBar:ControlConfiguration>
</smartFilterBar:controlConfiguration>
</smartFilterBar:SmartFilterBar>
<smartTable:SmartTable id="ProductsSmartTable" entitySet="Products"
smartFilterId="smartFilterBar" header="Products" showRowCount="true"
useExportToExcel="false" useVariantManagement="false"
useTablePersonalisation="false" tableType="ResponsiveTable">
</smartTable:SmartTable>
<Annotations Target="ODataDemoService.Product/CategoryID">
<Annotation Term="com.sap.vocabularies.Common.v1.ValueList">
<Record Type="com.sap.vocabularies.Common.v1.ValueListType">
<PropertyValue Property="CollectionPath" String="Categories"/>
<PropertyValue Property="Parameters">
<Collection>
<Record Type="com.sap.vocabularies.Common.v1.ValueListParameterOut">
<PropertyValue Property="LocalDataProperty" PropertyPath="CategoryID"/>
<PropertyValue Property="ValueListProperty" String="ID"/>
</Record>
<Record Type="com.sap.vocabularies.Common.v1.ValueListParameterDisplayOnly">
<PropertyValue Property="ValueListProperty" String="Name"/>
</Record>
</Collection>
</PropertyValue>
</Record>
</Annotation>
</Annotations>
<EntityType Name="Product">
<Key>
<PropertyRef Name="ID"/>
</Key>
<Property Name="ID" Type="Edm.Int32" Nullable="false" sap:label="ID"/>
<Property Name="CategoryID" Type="Edm.Int32" Nullable="false" sap:label="Category"
sap:value-list="fixed-values"/>
</EntityType>
<EntityType Name="Category">
<Key>
<PropertyRef Name="ID"/>
</Key>
<Property Name="ID" Type="Edm.Int32" Nullable="false" sap:text="Name" sap:label="ID"/>
<Property Name="Name" Type="Edm.String" Nullable="true" sap:label="Name"/>
</EntityType>
<Schema Namespace="ODataDemoService" xmlns="http://schemas.microsoft.com/ado/2007/05/edm"
xmlns:sap="http://www.sap.com/Protocols/SAPData">
<EntityType Name="Product">
<Key>
<PropertyRef Name="ID"/>
</Key>
<Property Name="ID" Type="Edm.Int32" Nullable="false" sap:label="ID" sap:text="Name"/>
<Property Name="CategoryID" Type="Edm.Int32" Nullable="false" sap:label="Category" sap:value-list="fixed-values"/>
<Property Name="SupplierID" Type="Edm.Int32" Nullable="false" sap:label="Supplier" sap:value-list="standard"/>
<Property Name="Name" Type="Edm.String" Nullable="true" sap:label="Name"/>
</EntityType>
</Schema>
<edmx:Edmx xmlns:edmx="http://schemas.microsoft.com/ado/2007/06/edmx"
xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"
xmlns:sap="http://www.sap.com/Protocols/SAPData" Version="1.0">
<edmx:DataServices m:DataServiceVersion="2.0">
<Schema xmlns="http://schemas.microsoft.com/ado/2008/09/edm"
Namespace="ODataDemoService" xml:lang="en" sap:schema-version="1">
<Annotations Target="ODataDemoService.Product"
xmlns="http://docs.oasis-open.org/odata/ns/edm">
<Annotation Term="com.sap.vocabularies.UI.v1.LineItem">
<Collection>
<Record Type="com.sap.vocabularies.UI.v1.DataField">
<PropertyValue Property="Value" Path="Name"/>
</Record>
</Collection>
</Annotation>
</Annotations>
</Schema>
</edmx:DataServices>
</edmx:Edmx>
"sap.app": {
"dataSources": {
"mainService": {
"uri": "/here/goes/your/serviceurl/",
"type": "OData",
"settings": {
"localUri": "localService/metadata.xml",
"annotations": [
"annotation0"
]
}
},
"annotation0": {
"type": "ODataAnnotation",
"uri": "annotation0.xml",
"settings": {
"localUri": "annotation0.xml"
}
}
}
}
DATA:
lo_annotation TYPE REF TO /iwbep/if_mgw_odata_annotation,
lo_property TYPE REF TO /iwbep/if_mgw_odata_property.
lo_annotation->add( iv_key = 'semantics' iv_value = 'fixed-values').
lo_property = model->get_entity_type('Product')->get_property('CategoryID').
lo_property->set_value_list( /iwbep/if_mgw_odata_property=>gcs_value_list_type_property-fixed_values ).
DATA:
lo_ann_target TYPE REF TO /iwbep/if_mgw_vocan_ann_target,
lo_annotation TYPE REF TO /iwbep/if_mgw_vocan_annotation,
lo_collection TYPE REF TO /iwbep/if_mgw_vocan_collection,
lo_record TYPE REF TO /iwbep/if_mgw_vocan_record,
lo_property TYPE REF TO /iwbep/if_mgw_vocan_property,
lo_simp_value TYPE REF TO /iwbep/if_mgw_vocan_simple_val.
" annotations for entity type Product
lo_ann_target = vocab_anno_model->create_annotations_target( 'Product' ).
lo_ann_target->set_namespace_qualifier( 'ODataDemoService' ).
" Columns to be displayed by default
lo_annotation = lo_ann_target->create_annotation( iv_term = 'UI.LineItem' ).
lo_collection = lo_annotation->create_collection( ).
lo_record = lo_collection->create_record( iv_record_type = 'UI.DataField' ).
lo_property = lo_record->create_property( 'Value' ).
lo_simp_value = lo_property->create_simple_value( ).
lo_simp_value->set_path( 'Name' ).
@OData.publish: true
define view Z_Products
as select from Products
{
key Products.ID,
@UI: {
lineItem: {position: 20}
}
Products.Name
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
37 | |
10 | |
6 | |
4 | |
3 | |
3 | |
3 | |
2 | |
2 | |
2 |