cancel
Showing results for 
Search instead for 
Did you mean: 

I can't see data from my related entities in a smart table odata v2

Santiago789
Explorer
0 Kudos
628

Hello experts, I want to show data of my entity agreements and its business_partner_per_agreement in a smart table but it comes up empty

Santiago789_0-1716592102717.png

Este es mi metadata

<EntityType Name="Agreements">
                <Key>
                    <PropertyRef Name="ID"/>
                    <PropertyRef Name="VALID_FROM"/>
                </Key>
                <Property Name="ID" Type="Edm.Guid" Nullable="false"/>
                <Property Name="CREATED_AT" Type="Edm.DateTimeOffset" Precision="7"/>
                <Property Name="CREATED_BY" Type="Edm.String" MaxLength="255"/>
                <Property Name="MODIFIED_AT" Type="Edm.DateTimeOffset" Precision="7"/>
                <Property Name="MODIFIED_BY" Type="Edm.String" MaxLength="255"/>
                <Property Name="DELETED" Type="Edm.Boolean"/>
                <Property Name="DELETED_AT" Type="Edm.DateTimeOffset" Precision="7"/>
                <Property Name="DELETED_BY" Type="Edm.String" MaxLength="255"/>
                <Property Name="VALID_FROM" Type="Edm.DateTimeOffset" Precision="7" Nullable="false"/>
                <Property Name="VALID_TO" Type="Edm.DateTimeOffset" Precision="7"/>
                <Property Name="DESCRIPTION" Type="Edm.String" MaxLength="250"/>
                <Property Name="CURRENCY" Type="Edm.String" MaxLength="3"/>
                <Property Name="EXTERNAL_CONTRACT_IDENTIFIER" Type="Edm.String" MaxLength="15"/>
                <Property Name="STATUS" Type="Edm.Boolean"/>
                <Property Name="DEACTIVATED_AT" Type="Edm.DateTimeOffset" Precision="7"/>
                <Property Name="TYPE_CODE" Type="Edm.Int32"/>
                <Property Name="PRIORITY_CODE" Type="Edm.Int32"/>
                <NavigationProperty Name="BUSINESS_PARTNERS_PER_AGREEMENT" Relationship="Agreement.Agreements_BUSINESS_PARTNERS_PER_AGREEMENT" FromRole="Agreements" ToRole="Business_partners_per_agreement"/>
                <NavigationProperty Name="SITE_BUNDLES_HEADER" Relationship="Agreement.Agreements_SITE_BUNDLES_HEADER" FromRole="Agreements" ToRole="Site_bundles_headers"/>
                <NavigationProperty Name="ADDED_ELEMENT_TO_AGREMMENT" Relationship="Agreement.Agreements_ADDED_ELEMENT_TO_AGREMMENT" FromRole="Agreements" ToRole="Added_element_to_agremment"/>
                <NavigationProperty Name="SERVICES_PER_AGREEMENT" Relationship="Agreement.Agreements_SERVICES_PER_AGREEMENT" FromRole="Agreements" ToRole="services_per_agreement"/>
            </EntityType>

<EntityType Name="Business_partners_per_agreement">
                <Key>
                    <PropertyRef Name="ID"/>
                </Key>
                <Property Name="ID" Type="Edm.Guid" Nullable="false"/>
                <Property Name="CREATED_AT" Type="Edm.DateTimeOffset" Precision="7"/>
                <Property Name="CREATED_BY" Type="Edm.String" MaxLength="255"/>
                <Property Name="MODIFIED_AT" Type="Edm.DateTimeOffset" Precision="7"/>
                <Property Name="MODIFIED_BY" Type="Edm.String" MaxLength="255"/>
                <Property Name="DELETED" Type="Edm.Boolean"/>
                <Property Name="DELETED_AT" Type="Edm.DateTimeOffset" Precision="7"/>
                <Property Name="DELETED_BY" Type="Edm.String" MaxLength="255"/>
                <Property Name="VALID_FROM" Type="Edm.DateTimeOffset" Precision="7"/>
                <Property Name="VALID_TO" Type="Edm.DateTimeOffset" Precision="7"/>
                <Property Name="BUSINESS_PARTNER" Type="Edm.String" MaxLength="10"/>
                <Property Name="BUSINESS_PARTNER_NAME" Type="Edm.String" MaxLength="255"/>
                <Property Name="AGREEMENT_ID" Type="Edm.String" MaxLength="36"/>
                <NavigationProperty Name="AGREEMENT" Relationship="Agreement.Business_partners_per_agreement_AGREEMENT" FromRole="Business_partners_per_agreement" ToRole="Agreements"/>
            </EntityType>


Mis anotaciones

<Annotation Term="UI.LineItem">
                    <Collection>
                    <Record Type="UI.DataField">
                        <PropertyValue Property="Value" Path="BUSINESS_PARTNERS_PER_AGREEMENT/BUSINESS_PARTNER_NAME" />
                    </Record> 
                        <Record Type="UI.DataField">
                            <PropertyValue Property="Value" Path="ID" />
                            <PropertyValue Property="Label" String="{@i18n>id}" />
                            <Annotation Term="HTML5.CssDefaults">
                                <Record Type="HTML5.CssDefaultsType">
                                    <PropertyValue Property="width" String="14.28%" />
                                </Record>
                            </Annotation>
                        </Record>
                        <Record Type="UI.DataField">
                            <PropertyValue Property="Value" Path="VALID_FROM" />
                            <PropertyValue Property="Label" String="{@i18n>startDate}" />
                            <Annotation Term="HTML5.CssDefaults">
                                <Record Type="HTML5.CssDefaultsType">
                                    <PropertyValue Property="width" String="14.28%" />
                                </Record>
                            </Annotation>
                        </Record>
                        <Record Type="UI.DataField">
                            <PropertyValue Property="Value" Path="VALID_TO" />
                            <PropertyValue Property="Label" String="{@i18n>endDate}" />
                            <Annotation Term="HTML5.CssDefaults">
                                <Record Type="HTML5.CssDefaultsType">
                                    <PropertyValue Property="width" String="14.28%" />
                                </Record>
                            </Annotation>
                        </Record>
                        <Record Type="UI.DataField">
                            <PropertyValue Property="Value" Path="EXTERNAL_CONTRACT_IDENTIFIER" />
                            <PropertyValue Property="Label" String="{@i18n>externalContractIdentifier}" />
                            <Annotation Term="HTML5.CssDefaults">
                                <Record Type="HTML5.CssDefaultsType">
                                    <PropertyValue Property="width" String="14.28%" />
                                </Record>
                            </Annotation>
                        </Record>
                    </Collection>
                </Annotation>

                <Annotation Term="UI.SelectionFields">
                    <Collection>
                        <PropertyPath>BUSINESS_PARTNERS_PER_AGREEMENT/VALID_FROM</PropertyPath>
                        <PropertyPath>VALID_FROM</PropertyPath>
                        <PropertyPath>VALID_TO</PropertyPath>
                        <PropertyPath>STATUS</PropertyPath>
                    </Collection>
                </Annotation>
            <smartTable:SmartTable
                id="LineItemsSmartTable"
                entitySet="Agreements"
                smartFilterId="smartFilterBar"
                tableType="ResponsiveTable"
                enableExport="true"
                beforeExport="onBeforeExport"
                useVariantManagement="false"
                useTablePersonalisation="true"
                header="Agreements"
                showRowCount="true"
                persistencyKey="SmartTableAnalytical_Explored"
                enableAutoBinding="true"
                showFullScreenButton="true"
                class="sapUiResponsiveContentPadding"
                customData:useSmartToggle="true"                
            >

Additionally, my business partner per agreement filter does not appear on the screen either.

 

Manifest

{
    "_version": "1.59.0",
    "sap.app": {
        "id": "bim-agreement-ui5",
        "type": "application",
        "i18n": "i18n/i18n.properties",
        "applicationVersion": {
            "version": "0.0.1"
        },
        "title": "{{appTitle}}",
        "description": "{{appDescription}}",
        "resources": "resources.json",
        "sourceTemplate": {
            "id": "@sap/generator-fiori:basic",
            "version": "1.13.4",
            "toolsId": "cb7b014b-886b-4b84-a2a7-e1e3f58b144c"
        },
        "dataSources": {
            "USERINFO_SERVICE": {
                "uri": "/userinfo",
                "type": "OData",
                "settings": {
                    "odataVersion": "2.0"
                }
            },
            "mainService": {
                "uri": "/v2/Tarificator/",
                "type": "OData",
                "settings": {
                    "annotations": [
                        "annotation"
                    ],
                    "localUri": "localService/metadata.xml",
                    "odataVersion": "2.0"
                }
            },
            "annotation": {
                "type": "ODataAnnotation",
                "uri": "annotations/annotation.xml",
                "settings": {
                    "localUri": "annotations/annotation.xml"
                }
            }
        },
        "crossNavigation": {
            "inbounds": {
                "intent1": {
                    "signature": {
                        "parameters": {},
                        "additionalParameters": "allowed"
                    },
                    "semanticObject": "TarifficationTool",
                    "action": "Display",
                    "title": "{{appTitle}}",
                    "subTitle": "{{appDescription}}",
                    "icon": ""
                }
            }
        }
    },
    "sap.ui": {
        "technology": "UI5",
        "fullWidth": true,
        "icons": {
            "icon": "",
            "favIcon": "",
            "phone": "",
            "phone@2": "",
            "tablet": "",
            "tablet@2": ""
        },
        "deviceTypes": {
            "desktop": true,
            "tablet": true,
            "phone": true
        },
        "sap.platform.cf": {
            "ui5VersionNumber": "1.120.x" 
        }
    },
    "sap.ui5": {
        "flexEnabled": true,
        "dependencies": {
            "minUI5Version": "1.120.13",
            "libs": {
                "sap.m": {},
                "sap.ui.core": {},
                "sap.f": {},
                "sap.suite.ui.generic.template": {},
                "sap.ui.comp": {},
                "sap.ui.generic.app": {},
                "sap.ui.table": {},
                "sap.ushell": {}
            }
        },
        "contentDensities": {
            "compact": true,
            "cozy": true
        },
        "models": {
            "i18n": {
                "type": "sap.ui.model.resource.ResourceModel",
                "settings": {
                    "bundleName": "bim-agreement-ui5.i18n.i18n",
                    "supportedLocales": [
                        "en",
                        "de",
                        "it",
                        "fr",
                        "pt",
                        "es"
                    ],
                    "fallbackLocale": "en"
                }
            },
            "": {
                "dataSource": "mainService",
                "preload": true,
                "settings": {}
            },
            "USERINFO_SERVICE": {
                "preload": false,
                "dataSource": "USERINFO_SERVICE",
                "type": "sap.ui.model.odata.v2.ODataModel",
                "settings": {
                    "defaultBindingMode": "TwoWay"
                }
            },
            "@i18n": {
                "type": "sap.ui.model.resource.ResourceModel",
                "uri": "i18n/i18n.properties"
            }
        },
        "resources": {
            "css": [
                {
                    "uri": "css/style.css"
                }
            ]
        },
        "routing": {
            "config": {
                "routerClass": "sap.m.routing.Router",
                "viewType": "XML",
                "async": true,
                "viewPath": "bimagreementui5.view",
                "controlAggregation": "pages",
                "controlId": "app",
                "clearControlAggregation": false,
                "bypassed": {
                    "target": "NotFound"
                }
            },
            "routes": [
                {
                    "name": "RouteListReport_Agreements",
                    "pattern": ":?query:",
                    "target": [
                        "TargetListReport_Agreements"
                    ]
                },
                {
                    "pattern": "object/Agreements(ID=guid'{objectId}',VALID_FROM=datetimeoffset'{validFrom}')",
                    "name": "object",
                    "target": "ObjectPage_Agreements"
                },
                {
                    "pattern": "CreateAgreement",
                    "name": "CreateAgreement",
                    "target": "CreateAgreement"
                }
            ],
            "targets": {
                "TargetListReport_Agreements": {
                    "viewType": "XML",
                    "transition": "slide",
                    "clearControlAggregation": false,
                    "viewId": "ListReport_Agreements",
                    "viewName": "ListReport_Agreements",
                    "level": 1
                },
                "CreateAgreement": {
                    "viewName": "CreateAgreement",
                    "viewLevel": 2,
                    "viewId": "CreateAgreement",
                    "viewType": "XML",
                    "transition": "slide",
                    "level": 2
                },
                "ObjectPage_Agreements": {
                    "viewName": "ObjectPage_Agreements",
                    "viewLevel": 2,
                    "viewId": "ObjectPage_Agreements",
                    "viewType": "XML",
                    "transition": "slide",
                    "level": 2
                },
                "NotFound": {
                    "id": "NotFound",
                    "name": "NotFound",
                    "transition": "show"
                }
            }
        },
        "rootView": {
            "viewName": "bimagreementui5.view.App",
            "type": "XML",
            "async": true,
            "id": "App"
        }
    },
    "sap.cloud": {
        "public": true,
        "service": "bim-agreement-ui5"
    }
}
View Entire Topic
Santiago789
Explorer
0 Kudos

Solved using join because business partner is one to many related entitie