on 2024 Aug 14 10:03 AM
Hello,
I have Fiori Elements application with external odata service. The external service have following metadata for the entity I use in my List Page:
<EntityType Name="PIDLIST_NEW" sap:content-version="1">
<Key>
<PropertyRef Name="Clmno"/>
</Key>
<Property Name="Clmno" Type="Edm.String" Nullable="false" MaxLength="12" sap:label="Claim"/>
<Property Name="ClmtyDes" Type="Edm.String" Nullable="false" MaxLength="40" sap:label="Processing Status"/>
<Property Name="Clmty" Type="Edm.String" Nullable="false" MaxLength="4" sap:label="WtyClmType"/>
<Property Name="ZliabilityDesc" Type="Edm.String" Nullable="false" MaxLength="40" sap:label="Processing Status"/>
<Property Name="Refno" Type="Edm.String" Nullable="false" MaxLength="40" sap:label="External Number"/>
<Property Name="ZcatDesc" Type="Edm.String" Nullable="false" MaxLength="40" sap:label="Processing Status"/>
<Property Name="HPntext" Type="Edm.String" Nullable="false" MaxLength="60" sap:label="Info. Clm Head."/>
<Property Name="ZclmtyDesc" Type="Edm.String" Nullable="false" MaxLength="40" sap:label="Processing Status"/>
<Property Name="Zrefno10" Type="Edm.String" Nullable="false" MaxLength="11" sap:label="Ext Number for Claim"/>
<Property Name="ZrgnDesc" Type="Edm.String" Nullable="false" MaxLength="40" sap:label="Processing Status"/>
<Property Name="Zliability" Type="Edm.String" Nullable="false" MaxLength="3" sap:label="Confirmed Liability"/>
<Property Name="ZuspllDesc" Type="Edm.String" Nullable="false" MaxLength="40" sap:label="Processing Status"/>
<Property Name="Zcpm" Type="Edm.String" Nullable="false" MaxLength="20" sap:label="CPM Profile"/>
<Property Name="ZusppsDesc" Type="Edm.String" Nullable="false" MaxLength="40" sap:label="Processing Status"/>
<Property Name="AstateDesc" Type="Edm.String" Nullable="false" MaxLength="40" sap:label="Processing Status"/>
<Property Name="Zcat" Type="Edm.String" Nullable="false" MaxLength="4" sap:label="Macro Cat"/>
<Property Name="Zclmty" Type="Edm.String" Nullable="false" MaxLength="4" sap:label="Campaign Type"/>
<Property Name="ZzpidDesc" Type="Edm.String" Nullable="false" MaxLength="40" sap:label="Processing Status"/>
<Property Name="ZexecutionDesc" Type="Edm.String" Nullable="false" MaxLength="40" sap:label="Processing Status"/>
<Property Name="Zrgn" Type="Edm.String" Nullable="false" MaxLength="20" sap:label="Originating Region"/>
<Property Name="ZotaDesc" Type="Edm.String" Nullable="false" MaxLength="40" sap:label="Processing Status"/>
<Property Name="Zuspll" Type="Edm.String" Nullable="false" MaxLength="12" sap:label="User PLL"/>
<Property Name="Zuspts" Type="Edm.String" Nullable="false" MaxLength="12" sap:label="User PTS"/>
<Property Name="Zuspps" Type="Edm.String" Nullable="false" MaxLength="12" sap:label="User PPS"/>
<Property Name="Zfpt" Type="Edm.Decimal" Precision="16" Scale="3" sap:label="FPT Recovery"/>
<Property Name="Astate" Type="Edm.String" Nullable="false" MaxLength="4" sap:label="Processing Status"/>
<Property Name="Zzpid" Type="Edm.String" Nullable="false" MaxLength="3" sap:label="PID Attribute"/>
<Property Name="Zexecution" Type="Edm.String" Nullable="false" MaxLength="4" sap:label="Execution"/>
<Property Name="Zota" Type="Edm.String" Nullable="false" MaxLength="4" sap:label="Software Execution"/>
<Property Name="Zletter" Type="Edm.String" Nullable="false" MaxLength="15" sap:label="Letter"/>
<NavigationProperty Name="PLISTOVERSN" Relationship="ZIV_WT_PID_EXTRACT_SRV.PLISTTOVERSN" FromRole="FromRole_PLISTTOVERSN" ToRole="ToRole_PLISTTOVERSN"/>
</EntityType>
<EntityType Name="VERSN_NEW" sap:content-version="1">
<Key>
<PropertyRef Name="Clmno"/>
</Key>
<Property Name="Clmno" Type="Edm.String" Nullable="false" MaxLength="12" sap:label="Claim"/>
<Property Name="Versn" Type="Edm.String" Nullable="false" MaxLength="4" sap:label="Version"/>
<Property Name="Pnguid" Type="Edm.Guid" Nullable="false" sap:label="Internal Number"/>
<Property Name="HeaderGuid" Type="Edm.Guid" Nullable="false" sap:label="Internal Number"/>
<NavigationProperty Name="NVERSNTOSORG" Relationship="ZIV_WT_PID_EXTRACT_SRV.NVERSNTOSORGAsn" FromRole="FromRole_NVERSNTOSORGAsn" ToRole="ToRole_NVERSNTOSORGAsn"/>
<NavigationProperty Name="NVERSNTORESD" Relationship="ZIV_WT_PID_EXTRACT_SRV.NVERSNTORESDAsn" FromRole="FromRole_NVERSNTORESDAsn" ToRole="ToRole_NVERSNTORESDAsn"/>
<NavigationProperty Name="NVERSNTOMDL" Relationship="ZIV_WT_PID_EXTRACT_SRV.NVERSNTOMDLAsn" FromRole="FromRole_NVERSNTOMDLAsn" ToRole="ToRole_NVERSNTOMDLAsn"/>
<NavigationProperty Name="NVERSNTOLINK" Relationship="ZIV_WT_PID_EXTRACT_SRV.NVRSNTOLINKAsn" FromRole="FromRole_NVRSNTOLINKAsn" ToRole="ToRole_NVRSNTOLINKAsn"/>
<NavigationProperty Name="NVERSNTOPREAP" Relationship="ZIV_WT_PID_EXTRACT_SRV.NVERSNTOPREAPPAsn" FromRole="FromRole_NVERSNTOPREAPPAsn" ToRole="ToRole_NVERSNTOPREAPPAsn"/>
</EntityType>
<EntityType Name="LINK_NEW" sap:content-version="1">
<Key>
<PropertyRef Name="Clmno"/>
</Key>
<Property Name="Clmno" Type="Edm.String" Nullable="false" MaxLength="12" sap:label="Claim" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
<Property Name="Vhcle" Type="Edm.String" Nullable="false" MaxLength="10" sap:label="Batch vehicles" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
<Property Name="Zcostvehic" Type="Edm.String" Nullable="false" MaxLength="6" sap:label="Costed Vehicles" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
<Property Name="Zvalue" Type="Edm.Decimal" Precision="16" Scale="3" sap:label="Total Value EUR " sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
<Property Name="Zsupplier" Type="Edm.Decimal" Precision="16" Scale="3" sap:label="Supplier Recovery" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
<Property Name="Zfpt" Type="Edm.Decimal" Precision="16" Scale="3" sap:label="FPT Recovery" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
</EntityType>
<EntityType Name="MODEL_NEW" sap:content-version="1">
<Key>
<PropertyRef Name="Clmno"/>
</Key>
<Property Name="Pnguid" Type="Edm.String" Nullable="false" MaxLength="32" sap:label="Character field, length 32" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
<Property Name="Clmno" Type="Edm.String" Nullable="false" MaxLength="12" sap:label="Claim" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
<Property Name="Zdivision" Type="Edm.String" Nullable="false" MaxLength="20" sap:label="Division" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
<Property Name="Zgpl" Type="Edm.String" Nullable="false" MaxLength="20" sap:label="GPL" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
<Property Name="Zproduct" Type="Edm.String" Nullable="false" MaxLength="20" sap:label="Product" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
</EntityType>
<EntityType Name="PREAPP_NEW" sap:content-version="1">
<Key>
<PropertyRef Name="Clmno"/>
</Key>
<Property Name="Pnguid" Type="Edm.String" Nullable="false" MaxLength="32" sap:label="Character field, length 32"/>
<Property Name="Zdats" Type="Edm.String" Nullable="false" MaxLength="8" sap:label="Date"/>
<Property Name="Clmno" Type="Edm.String" Nullable="false" MaxLength="12" sap:label="Claim"/>
<Property Name="Zdatsppa" Type="Edm.String" Nullable="false" MaxLength="8" sap:label="Date"/>
<Property Name="Zdatsag" Type="Edm.String" Nullable="false" MaxLength="8" sap:label="Date"/>
<Property Name="Zppas" Type="Edm.String" Nullable="false" MaxLength="1" sap:label="PPA Condition"/>
<Property Name="Zcnetwrf" Type="Edm.Decimal" Nullable="false" Precision="16" Scale="3" sap:label="Preapproval fund"/>
<Property Name="Zdatsfa" Type="Edm.String" Nullable="false" MaxLength="8" sap:label="Date"/>
<Property Name="Zapprowner" Type="Edm.String" Nullable="false" MaxLength="200" sap:label="Current Owner"/>
</EntityType>
<EntityType Name="RESD_NEW" sap:content-version="1">
<Key>
<PropertyRef Name="Clmno"/>
</Key>
<Property Name="Pnguid" Type="Edm.String" Nullable="false" MaxLength="32" sap:label="Character field, length 32"/>
<Property Name="Zresp" Type="Edm.String" Nullable="false" MaxLength="4" sap:label="Responsibility"/>
<Property Name="Clmno" Type="Edm.String" Nullable="false" MaxLength="12" sap:label="Claim"/>
<Property Name="Name1" Type="Edm.String" Nullable="false" MaxLength="35" sap:label="Name"/>
</EntityType>
<EntityType Name="SORG_NEW" sap:content-version="1">
<Key>
<PropertyRef Name="Clmno"/>
</Key>
<Property Name="Pnguid" Type="Edm.String" Nullable="false" MaxLength="32" sap:label="Character field, length 32"/>
<Property Name="Refdt" Type="Edm.String" Nullable="false" MaxLength="8" sap:label="Date"/>
<Property Name="Cbactiondt" Type="Edm.String" Nullable="false" MaxLength="8" sap:label="Date"/>
<Property Name="Clmno" Type="Edm.String" Nullable="false" MaxLength="12" sap:label="Claim"/>
</EntityType>
<ComplexType Name="Bapiret2">
<Property Name="Type" Type="Edm.String" Nullable="false" MaxLength="1" sap:label="Message type" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
<Property Name="Id" Type="Edm.String" Nullable="false" MaxLength="20" sap:label="Message Class" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
<Property Name="Number" Type="Edm.String" Nullable="false" MaxLength="3" sap:label="Message Number" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
<Property Name="Message" Type="Edm.String" Nullable="false" MaxLength="220" sap:label="Message text" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
<Property Name="LogNo" Type="Edm.String" Nullable="false" MaxLength="20" sap:label="Log number" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
<Property Name="LogMsgNo" Type="Edm.String" Nullable="false" MaxLength="6" sap:label="Message no." sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
<Property Name="MessageV1" Type="Edm.String" Nullable="false" MaxLength="50" sap:label="Message Variable" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
<Property Name="MessageV2" Type="Edm.String" Nullable="false" MaxLength="50" sap:label="Message Variable" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
<Property Name="MessageV3" Type="Edm.String" Nullable="false" MaxLength="50" sap:label="Message Variable" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
<Property Name="MessageV4" Type="Edm.String" Nullable="false" MaxLength="50" sap:label="Message Variable" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
<Property Name="Parameter" Type="Edm.String" Nullable="false" MaxLength="32" sap:label="Parameter Name" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
<Property Name="Row" Type="Edm.Int32" Nullable="false" sap:label="Parameter line" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
<Property Name="Field" Type="Edm.String" Nullable="false" MaxLength="30" sap:label="Field name" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
<Property Name="System" Type="Edm.String" Nullable="false" MaxLength="10" sap:label="Logical system" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
</ComplexType>
I try to create the List Page table based on PIDLIST_NEW entity, but should also expose fields from the Associations in PLISTOVERSN, which is an association itself in PIDLIST_NEW.
I have following annotations.cds file so far:
annotate PidService.PID with @(
UI : {
LineItem : [
{
$Type : 'UI.DataField',
Value : PLISTOVERSN.Clmno,
![@HTML5.CssDefaults]: {width: 'auto'}
},
{
$Type : 'UI.DataField',
Value : Refno,
![@HTML5.CssDefaults]: {width: 'auto'}
},
{
$Type : 'UI.DataField',
Value : HPntext,
![@HTML5.CssDefaults]: {width: 'auto'}
},
{
$Type : 'UI.DataField',
Value : Clmty,
![@HTML5.CssDefaults]: {width: 'auto'}
},
{
$Type : 'UI.DataField',
Value : PLISTOVERSN.NVERSNTOSORG.Refdt,
![@HTML5.CssDefaults]: {width: 'auto'}
},
{
$Type : 'UI.DataField',
Value : PLISTOVERSN.NVERSNTOSORG.Cbactiondt,
![@HTML5.CssDefaults]: {width: 'auto'}
}
],
SelectionFields: [
Clmno,
HPntext,
Refno,
Clmty,
PLISTOVERSN.NVERSNTOSORG.Refdt,
PLISTOVERSN.NVERSNTOSORG.Cbactiondt,
],
HeaderInfo : {
$Type : 'UI.HeaderInfoType',
TypeName : '{i18n>pidlist.title}',
TypeNamePlural: '{i18n>pidlist.title}',
Title : {Value: Clmno},
Description : {Value: HPntext},
TypeImageUrl : '{icon}',
},
},
Capabilities : {
InsertRestrictions.Insertable: true,
UpdateRestrictions.Updatable : true,
DeleteRestrictions.Deletable : false
},
UI.DataPoint #HeaderFacetVersn: {
$Type: 'UI.DataPointType',
Title: PLISTOVERSN.Clmno,
Value: PLISTOVERSN.Versn
},
UI.HeaderFacets : [
{
$Type : 'UI.ReferenceFacet',
Target: '@UI.DataPoint#HeaderFacetVersn',
}
],
)
Which is making a correct request to the external service and I got response as:
{"@odata.context":"$metadata#PID(Clmno,Clmty,Refno,HPntext,PLISTOVERSN(Clmno,NVERSNTOSORG(Clmno,Refdt,Cbactiondt)))","@odata.metadataEtag":"W/\"05c889be296c72581a2623a8fa0a5a312e1b3a97711d93906e4d96fde99f9387\"","@odata.count":"1","value":[{"Clmno":"200500152350","Clmty":"XRC2","Refno":"TES","HPntext":"TEST HEAD PK","PLISTOVERSN":[{"Clmno":"200500152350","NVERSNTOSORG":[{"Clmno":"200500152350","Refdt":"20240224","Cbactiondt":"20240316"},{"Clmno":"200500152350","Refdt":"20240224","Cbactiondt":"20240316"}]},{"Clmno":"200500152350","NVERSNTOSORG":[]}]}]}
So first version has 2 records in its association and the second 0. But when trying to display into the table it sets strange dots on the fields, and trying to make so kind of aggregation.
And I believe here I should have 3 lines:
1. First version with empty values for association fields.
2. Second version with first value for association fields.
3. Second version with second value for association fields.
Is this somehow achievable through annotations and Fiori Elements?
Thanks a lot and regards,
Violina
User | Count |
---|---|
70 | |
8 | |
8 | |
7 | |
7 | |
6 | |
6 | |
6 | |
6 | |
6 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.