问题描述
我正在尝试使用SAP Web IDE中显式编写的本地元数据注释,使用包含智能过滤器的Smart Table开发基本报表。 SmartTable的视图有点自定义,因为其中有一个可编辑的列。但是现在除了可编辑列,我无法显示其中的任何列(列标题或数据)。此外,可编辑的列标题是可见的,但其中没有数据。我想显示总共9列,其中8列写在LineItem的注释文件中,一列写在XML视图中,还有4个过滤器写为SelectionFields。这是我第一次使用元数据注释。下面是我的代码。请帮忙。
元数据:
<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="TITAN_TEAM_FTE_SRV" xml:lang="en" sap:schema-version="1">
<EntityType Name="ProjectHelp" sap:content-version="1">
<Key>
<PropertyRef Name="Project"/>
</Key>
<Property Name="Project" Type="Edm.String" Nullable="false" MaxLength="7" sap:unicode="false" sap:label="Titan Project"
sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
<Property Name="Name" Type="Edm.String" MaxLength="100" sap:unicode="false" sap:label="Project Name" sap:creatable="false"
sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
<Property Name="Projectstatus" Type="Edm.String" MaxLength="10" sap:unicode="false" sap:label="Project Status" sap:creatable="false"
sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
<Property Name="ProjectSize" Type="Edm.String" MaxLength="2" sap:unicode="false" sap:label="Project Size" sap:creatable="false"
sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
</EntityType>
<EntityType Name="TeamHelp" sap:content-version="1">
<Key>
<PropertyRef Name="Teams"/>
</Key>
<Property Name="Teams" Type="Edm.String" Nullable="false" MaxLength="20" sap:unicode="false" sap:label="Team" sap:creatable="false"
sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
<Property Name="Description" Type="Edm.String" Nullable="false" MaxLength="32" sap:unicode="false" sap:label="Team Description"
sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
</EntityType>
<EntityType Name="StatusHelp" sap:content-version="1">
<Key>
<PropertyRef Name="Projectstatus"/>
</Key>
<Property Name="Projectstatus" Type="Edm.String" Nullable="false" MaxLength="10" sap:unicode="false" sap:label="Project Status"
sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
</EntityType>
<EntityType Name="FunnelHelp" sap:content-version="1">
<Key>
<PropertyRef Name="Funnel"/>
</Key>
<Property Name="Funnel" Type="Edm.String" Nullable="false" MaxLength="30" sap:unicode="false" sap:label="Project Funnel"
sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
</EntityType>
<EntityType Name="PortfolioHelp" sap:content-version="1">
<Key>
<PropertyRef Name="Portfolio"/>
</Key>
<Property Name="Portfolio" Type="Edm.String" Nullable="false" MaxLength="30" sap:unicode="false" sap:label="Project Portfolio"
sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
</EntityType>
<EntityType Name="TeamFTE" sap:content-version="1">
<Key>
<PropertyRef Name="Project"/>
<PropertyRef Name="Team"/>
</Key>
<Property Name="Funnel" Type="Edm.String" Nullable="false" MaxLength="30" sap:unicode="false" sap:label="Project Funnel"/>
<Property Name="Project" Type="Edm.String" Nullable="false" MaxLength="7" sap:unicode="false" sap:label="Titan Project"/>
<Property Name="Portfolio" Type="Edm.String" Nullable="false" MaxLength="30" sap:unicode="false" sap:label="Project Portfolio"/>
<Property Name="Team" Type="Edm.String" Nullable="false" MaxLength="20" sap:unicode="false" sap:label="Team"/>
<Property Name="Name" Type="Edm.String" MaxLength="100" sap:unicode="false" sap:label="Project Name"/>
<Property Name="Status" Type="Edm.String" MaxLength="10" sap:unicode="false" sap:label="Project Status"/>
<Property Name="StartDt" Type="Edm.DateTime" Precision="7" sap:unicode="false" sap:label="Project Start Date"/>
<Property Name="GoLiveDt" Type="Edm.DateTime" Precision="7" sap:unicode="false" sap:label="Go-Live Date"/>
<Property Name="ProjectSize" Type="Edm.String" MaxLength="2" sap:unicode="false" sap:label="Project Size"/>
<Property Name="Fte" Type="Edm.Decimal" Precision="7" Scale="2" sap:unicode="false" sap:label="FTE Count"/>
</EntityType>
<EntityContainer Name="TITAN_TEAM_FTE_SRV_Entities" m:IsDefaultEntityContainer="true" sap:supported-formats="atom json xlsx">
<EntitySet Name="ProjectHelpSet" EntityType="TITAN_TEAM_FTE_SRV.ProjectHelp" sap:creatable="false" sap:updatable="false"
sap:deletable="false" sap:pageable="false" sap:content-version="1"/>
<EntitySet Name="TeamHelpSet" EntityType="TITAN_TEAM_FTE_SRV.TeamHelp" sap:creatable="false" sap:updatable="false" sap:deletable="false"
sap:pageable="false" sap:content-version="1"/>
<EntitySet Name="StatusHelpSet" EntityType="TITAN_TEAM_FTE_SRV.StatusHelp" sap:creatable="false" sap:updatable="false" sap:deletable="false"
sap:pageable="false" sap:content-version="1"/>
<EntitySet Name="FunnelHelpSet" EntityType="TITAN_TEAM_FTE_SRV.FunnelHelp" sap:creatable="false" sap:updatable="false" sap:deletable="false"
sap:pageable="false" sap:content-version="1"/>
<EntitySet Name="PortfolioHelpSet" EntityType="TITAN_TEAM_FTE_SRV.PortfolioHelp" sap:creatable="false" sap:updatable="false"
sap:deletable="false" sap:pageable="false" sap:content-version="1"/>
<EntitySet Name="TeamFTESet" EntityType="TITAN_TEAM_FTE_SRV.TeamFTE" sap:creatable="false" sap:updatable="false" sap:deletable="false"
sap:pageable="false" sap:content-version="1"/>
</EntityContainer>
<atom:link xmlns:atom="http://www.w3.org/2005/Atom" rel="self"
href="https://webidetesting8209335-s0017437542trial.dispatcher.hanatrial.ondemand.com/sap/opu/odata/TITAN/TEAM_FTE_SRV/$Metadata"/>
<atom:link xmlns:atom="http://www.w3.org/2005/Atom" rel="latest-version"
href="https://webidetesting8209335-s0017437542trial.dispatcher.hanatrial.ondemand.com/sap/opu/odata/TITAN/TEAM_FTE_SRV/$Metadata"/>
</Schema>
</edmx:DataServices>
</edmx:Edmx>
注释文件:
<edmx:Edmx xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx" Version="4.0">
<edmx:Reference Uri="/sap/opu/odata/TITAN/TEAM_FTE_SRV/$Metadata">
<edmx:Include Alias="Metadata" Namespace="TITAN_TEAM_FTE_SRV"/>
</edmx:Reference>
<edmx:Reference Uri="https://wiki.scn.sap.com/wiki/download/attachments/448470968/UI.xml?api=v2">
<edmx:Include Alias="UI" Namespace="com.sap.vocabularies.UI.v1"/>
</edmx:Reference>
<edmx:Reference Uri="https://wiki.scn.sap.com/wiki/download/attachments/448470974/Common.xml?api=v2">
<edmx:Include Alias="Common" Namespace="com.sap.vocabularies.Common.v1"/>
</edmx:Reference>
<edmx:DataServices>
<Schema xmlns="http://docs.oasis-open.org/odata/ns/edm" Namespace="FTE_Report.annotation.annotation0.TITAN_TEAM_FTE_SRV">
<Annotations Target="Metadata.TeamFTE">
<Annotation Term="UI.LineItem">
<Collection>
<Record Type="UI.datafield">
<PropertyValue Property="Value" Path="Team"/>
<PropertyValue Property="Label" String="Team"/>
</Record>
<Record Type="UI.datafield">
<PropertyValue Property="Value" Path="Name"/>
<PropertyValue Property="Label" String="Name"/>
</Record>
<Record Type="UI.datafield">
<PropertyValue Property="Value" Path="Status"/>
<PropertyValue Property="Label" String="Status"/>
</Record>
<Record Type="UI.datafield">
<PropertyValue Property="Value" Path="StartDt"/>
<PropertyValue Property="Label" String="StartDt"/>
</Record>
<Record Type="UI.datafield">
<PropertyValue Property="Value" Path="GoLiveDt"/>
<PropertyValue Property="Label" String="GoLiveDt"/>
</Record>
<Record Type="UI.datafield">
<PropertyValue Property="Value" Path="ProjectSize"/>
<PropertyValue Property="Label" String="ProjectSize"/>
</Record>
<Record Type="UI.datafield">
<PropertyValue Property="Value" Path="Funnel"/>
<PropertyValue Property="Label" String="Funnel"/>
</Record>
<Record Type="UI.datafield">
<PropertyValue Property="Value" Path="Portfolio"/>
<PropertyValue Property="Label" String="Portfolio"/>
</Record>
</Collection>
</Annotation>
<Annotation Term="UI.SelectionFields">
<Collection>
<PropertyPath>Team</PropertyPath>
<PropertyPath>Status</PropertyPath>
<PropertyPath>Funnel</PropertyPath>
<PropertyPath>Portfolio</PropertyPath>
</Collection>
</Annotation>
</Annotations>
</Schema>
</edmx:DataServices>
</edmx:Edmx>
ReportView.xml:
<mvc:View xmlns:mvc="sap.ui.core.mvc" xmlns="sap.m" xmlns:core="sap.ui.core" xmlns:fb="sap.ui.comp.filterbar" xmlns:l="sap.ui.layout" xmlns:html="http://www.w3.org/1999/xhtml" displayBlock="true" class="sapUiSizeCompact" controllerName="titan.FTE_Report.controller.ReportView">
<Page showHeader="false" enableScrolling="false" xmlns:smartFilterBar="sap.ui.comp.smartfilterbar" xmlns:smartTable="sap.ui.comp.smarttable" xmlns:fb="sap.ui.comp.filterbar">
<content>
<smartFilterBar:SmartFilterBar id="smartFilterBar" entitySet="TeamFTESet" search="handleSearch" showFilterConfiguration="true">
<smartFilterBar:controlConfiguration>
<smartFilterBar:ControlConfiguration key="Team" label="Team" visibleInAdvancedArea="true"/>
<smartFilterBar:ControlConfiguration key="Status" label="Project Status" visibleInAdvancedArea="true"/>
<smartFilterBar:ControlConfiguration key="Funnel" label="Funnel" visibleInAdvancedArea="true"></smartFilterBar:ControlConfiguration>
<smartFilterBar:ControlConfiguration key="Portfolio" label="Portfolio" visibleInAdvancedArea="true"></smartFilterBar:ControlConfiguration>
</smartFilterBar:controlConfiguration>
<smartFilterBar:layoutData>
<FlexItemData shrinkFactor="0"/>
</smartFilterBar:layoutData>
</smartFilterBar:SmartFilterBar>
<!-- Report Table -->
<smartTable:SmartTable id="smartTable" entitySet="TeamFTESet" smartFilterId="smartFilterBar" tableType="ResponsiveTable"
useVariantManagement="false" useTablePersonalisation="true" showRowCount="true"
>
<smartTable:customToolbar>
<OverflowToolbar design="Transparent">
<ToolbarSpacer/>
<Button icon="sap-icon://edit" press="handleProjectCreate"/>
</OverflowToolbar>
</smartTable:customToolbar>
<Table sticky="ColumnHeaders,HeaderToolbar" mode="MultiSelect" includeItemInSelection="true">
<columns>
<Column id="FTE" width="100px" >
<customData>
<core:CustomData key="p13nData"
value='\{"columnKey": "Fte","columnIndex":"8"}'/>
</customData>
<Text text="FTE"/>
</Column>
</columns>
<items>
<ColumnListItem>
<cells>
<Input value="{Fte}" />
</cells>
</ColumnListItem>
</items>
</Table>
<smartTable:layoutData>
<FlexItemData growFactor="1" baseSize="0%"/>
</smartTable:layoutData>
</smartTable:SmartTable>
</content>
</Page>
</mvc:View>
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)