on 09-14-2017 5:08 AM
this is my xml view
smartFilterBar:SmartFilterBar id="smartFilterBar"
entityType="WipTemplatesType">
<smartFilterBar:controlConfiguration>
<smartFilterBar:ControlConfiguration key="ProductType" visibleInAdvancedArea="true" preventInitialDataFetchInValueHelpDialog="false">
</smartFilterBar:ControlConfiguration>
</smartFilterBar:controlConfiguration>
</smartFilterBar:SmartFilterBar>
<smartTable:SmartTable tableType="TreeTable" id="smartTable_ResponsiveTable" smartFilterId="smartFilterBar" editable="false"
entitySet="WipTemplates"
tableBindingPath="/WipTemplates"
useVariantManagement="false" useTablePersonalisation="true" header="Products" showRowCount="true"
useExportToExcel="false" enableAutoBinding="true">
</smartTable:SmartTable>
this is the annotation for Columns
<Annotations Target="PMTS_SERVICES.WIPTemplateOdataSvc.WipTemplatesType" 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="WipTemplateId"/>
</Record>
<Record Type="com.sap.vocabularies.UI.v1.DataField">
<PropertyValue Property="Label" String="Order Item ID"/>
<PropertyValue Property="Value" Path="OrderItemId"/>
</Record>
<Record Type="com.sap.vocabularies.UI.v1.DataField">
<PropertyValue Property="Value" Path="PONumber"/>
</Record>
<Record Type="com.sap.vocabularies.UI.v1.DataField">
<PropertyValue Property="Value" Path="CalculationMethod"/>
</Record>
<Record Type="com.sap.vocabularies.UI.v1.DataField">
<PropertyValue Property="Value" Path="DepartmentId"/>
</Record>
<Record Type="com.sap.vocabularies.UI.v1.DataField">
<PropertyValue Property="Value" Path="Tasks"/>
</Record>
<Record Type="com.sap.vocabularies.UI.v1.DataField">
<PropertyValue Property="Value" Path="ProductType"/></Record>
<Record Type="com.sap.vocabularies.UI.v1.DataField">
<PropertyValue Property="Value" Path="Tasks"/>
</Record>
</Collection>
</Annotation>
</Annotations>
this is the controller
var sPath = jQuery.sap.getModulePath("attune.wipWIP.localService");
var oModel = new sap.ui.model.odata.v2.ODataModel("destinations/pmts/PMTS_SERVICES/WIPTemplateOdataSvc.xsodata/", {
annotationURI: sPath + "/metadata_wip_annotation.xml",
useBatch: true
});
oModel.setDefaultBindingMode("TwoWay");
this.getView().setModel(oModel);
I'm Getting following error
"Neither navigation paths parameters, nor (complete/valid) tree hierarchy annotations where provided to the TreeBinding"
here is the output
normal tree table (without smart table) out put as follows
Need to add "Task", "Planned Date", "Actual Date" Columns to smart tree table as well.
(these are the properties of children)
thank you very much
Hi,
I have done something like this with annotations
DATA: lo_reference TYPE REF TO /iwbep/if_mgw_vocan_reference.
DATA: lo_ann_target TYPE REF TO /iwbep/if_mgw_vocan_ann_target.
DATA: lo_annotation TYPE REF TO /iwbep/if_mgw_vocan_annotation.
DATA: lo_collection TYPE REF TO /iwbep/if_mgw_vocan_collection.
DATA: lo_record TYPE REF TO /iwbep/if_mgw_vocan_record.
DATA: lo_entity_type TYPE REF TO /iwbep/if_mgw_odata_entity_typ,
lo_property TYPE REF TO /iwbep/if_mgw_odata_property.
DATA lo_oanno TYPE REF TO /iwbep/if_mgw_odata_annotation. " OData Annotation
lo_entity_type = model->get_entity_type( iv_entity_name = gc_entity ). "Entity name
lo_property = lo_entity_type->get_property( iv_property_name = 'ElementId' ). "Property to be annotated
lo_oanno = lo_property->/iwbep/if_mgw_odata_annotatabl~create_annotation( /iwbep/if_mgw_med_odata_types=>gc_sap_namespace ).
lo_oanno->add( iv_key = /iwbep/if_ana_odata_types=>gcs_ana_odata_annotation_key-hierarchy_node_for iv_value = 'ElementId' ).
lo_property = lo_entity_type->get_property( iv_property_name = 'NodeLevel' ). "Property to be annotated
lo_oanno = lo_property->/iwbep/if_mgw_odata_annotatabl~create_annotation( /iwbep/if_mgw_med_odata_types=>gc_sap_namespace ).
lo_oanno->add( iv_key = /iwbep/if_ana_odata_types=>gcs_ana_odata_annotation_key-hierarchy_level_for iv_value = 'ElementId' ).
lo_property = lo_entity_type->get_property( iv_property_name = 'PElementId' ). "Property to be annotated
lo_oanno = lo_property->/iwbep/if_mgw_odata_annotatabl~create_annotation( /iwbep/if_mgw_med_odata_types=>gc_sap_namespace ).
lo_oanno->add( iv_key = /iwbep/if_ana_odata_types=>gcs_ana_odata_annotation_key-hierarchy_parent_node_for iv_value = 'ElementId' ).
lo_property = lo_entity_type->get_property( iv_property_name = 'Drillstate' ). "Property to be annotated
lo_oanno = lo_property->/iwbep/if_mgw_odata_annotatabl~create_annotation( /iwbep/if_mgw_med_odata_types=>gc_sap_namespace ).
lo_oanno->add( iv_key = /iwbep/if_ana_odata_types=>gcs_ana_odata_annotation_key-hierarchy_drill_state_for iv_value = 'ElementId' ).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Did you fine the solution ? I am facing similar issue. I have added the annotation yet I'm not getting the data in smart tree table.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.