on 2025 Mar 10 6:22 PM
For example, the Manage Sales Contracts app has:
I'm currently using this in my app for navigation:
Request clarification before answering.
I recommend removing the action in your snippet but most likely you are still missing something..
Check the $metadata of your service you mention (App ID F5987)
<Annotations Target="SAP__self.SalesContractManageType/SalesContract">
<Annotation Term="SAP__core.Computed"/>
<Annotation Term="SAP__common.IsUpperCase"/>
<Annotation Term="SAP__common.SemanticObject" String="SalesContract"/>
<Annotation Term="SAP__common.Label" String="Sales Contract"/>
<Annotation Term="SAP__common.Heading" String="SC"/>
</Annotations>See this annotation has a property as its target not an entity type. From your snippet, you are annotating something which is unknown with a single record. The Common.SemanticObject term it not part of a collection so you are probably annotating the wrong part of your metadata.
You should have more apps with SemanticObject "AccountingDocument"? Does your user have access to such apps? The popup you mention only shows apps sharing the same semantic object.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Regarding question "So I’m not sure what you mean by making it a target instead of an entity."
I wrote: "See this annotation has a property as its target not an entity type."
Background knowledge: OData vocabularies (such as UI, Common, Core) are a collection of Terms (such as Common.SemanticObject, UI.DataField) . Each Term can target different OData 'things' like entity types, entity set, properties, actions, etc. Each Term is designed by a Type. Annotations are the usage of such terms. For a Term which is linked with a Structure Type, you have <Records> inside the <Annotation> tag. For a Terms which is linked with a Collection Type, you have a <Collection> tag inside the <Annotation> tag and a bunch of <Records> inside this <Collection>
It's unclear how you are annotating your metadata so I am assuming you are changing the local 'annotation' file inside your UI5 app. Doing that requires that:
On your question, you provided a <Record> tag - which makes it hard to understand what you are annotating.
<Record Type="UI.DataFieldWithIntentBasedNavigation">
<PropertyValue Property="Label" String="Sales Document"/>
<PropertyValue Property="Value" Path="SalesDocument"/>
<PropertyValue Property="SemanticObject" String="AccountingDocument"/>
<PropertyValue Property="Action" String="flowDisplay"/>
</Record>
From here I can conclude:
Now, which Term are you using? There are 4 Terms in this single vocabulary which are based on the "DataFieldAbstract" type:
Of course, most likely you are using the "LineItem" term as we are talking about columns of a table: OK.
Let's check what are the possible "Targets" for a `UI.lineItem` - https://github.com/SAP/odata-vocabularies/blob/main/vocabularies/UI.xml#L147
So, in case you want to use the LineItem, you must annotate an entity type only. In other words, the "LineItem" cannot be used to annotate properties.
Now you are saying that the <Record> you have is inside a
<Annotations Target="SAP.ZZ1_C_SLCNTRINFOQRYType">
<!-- you have still not provided the Term you are using which should be here -->
<Record Type="UI.DataFieldWithIntentBasedNavigation">
<PropertyValue Property="Label" String="Sales Document"/>
<PropertyValue Property="Value" Path="SalesDocument"/>
<PropertyValue Property="SemanticObject" String="AccountingDocument"/>
<PropertyValue Property="Action" String="flowDisplay"/>
</Record>
So, I image it's something like
<Annotations Target="SAP.ZZ1_C_SLCNTRINFOQRYType">
<Annotation Term="SAP__UI.LineItem">
<Record Type="UI.DataFieldWithIntentBasedNavigation">
<PropertyValue Property="Label" String="Sales Document"/>
<PropertyValue Property="Value" Path="SalesDocument"/>
<PropertyValue Property="SemanticObject" String="AccountingDocument"/>
<PropertyValue Property="Action" String="flowDisplay"/>
</Record>
The "SAP__UI" is just an alias which can be different for you - check the vocabularies references at the top of the file and you should have something like
<edmx:Reference Uri="/sap/opu/odata/IWFND/CATALOGSERVICE;v=2/Vocabularies(TechnicalName='%2FIWBEP%2FVOC_UI',Version='0001',SAP__Origin='LOCAL')/$value">
<edmx:Include Namespace="com.sap.vocabularies.UI.v1" Alias="SAP__UI"/>
</edmx:Reference>
If you get it until here, great. What you are trying to achieve here is basically having a single column which is a link pointing to an app based on its intent (#AccountingDocument-flowDisplay) but what you are asking is to have a popup with a list of apps. From my research based on app F5987 this is achieved by another term from a diffent vocabulary: `SAP__common.SemanticObject`
- SAP__common is just an alias for the Common vocabulary - https://sap.github.io/odata-vocabularies/vocabularies/Common.html
- 'SemanticObject' is the Term
Now this other term can be applied to different OData things such as: Entity sets, entity types, properties and navigation properties.
However from the same app you provided, F5987, this annotation is being used on a property as its target - not on an entity type (like the LineItem)
<Annotations Target="SAP__self.SalesContractManageType/SalesContract">
<Annotation Term="SAP__core.Computed"/>
<Annotation Term="SAP__common.IsUpperCase"/>
<Annotation Term="SAP__common.SemanticObject" String="SalesContract"/>
<Annotation Term="SAP__common.Label" String="Sales Contract"/>
<Annotation Term="SAP__common.Heading" String="SC"/>
</Annotations>Target = SAP__self.SalesContractManageType/SalesContract
where,
SAP__Self = Schema namespace from the metadata
SalesContractManageType = Entity Type
SalesContract = Property
Now you said in the comments
So I tried adding this above to see if it would replace the value in a normal DataField annotation: <Annotations Target="SAP.ZZ1_C_SLCNTRINFOQRYType/SalesDocument"> <Annotation Term="Common.SemanticObject" Path="SalesContract"/> </Annotations> But there’s an error on the path, and the field remains normal (and SAP__common gives me an Unsupported Vocabulary error, so I did not try it)so you have...
<Annotations Target="SAP.ZZ1_C_SLCNTRINFOQRYType/SalesDocument">
<Annotation Term="Common.SemanticObject" Path="SalesContract"/>
</Annotations>I personally have never seen "SAP" being the schema namespace but imagining it's correct
+
Assuming 'ZZ1_C_SLCNTRINFOQRYType' is an entity type which contains property 'SalesDocument'
+
Imagining that you are not using the UI.DataFieldWithIntentBasedNavigation anymore on such column
Then still is different
<Annotation Term="SAP__common.SemanticObject" String="SalesContract"/>
<-- is different than -->
<Annotation Term="Common.SemanticObject" Path="SalesContract"/> Despite the alias which can be different from time to time, you are using a Path instead of a hard coded value. That means your entity type has another property called "SalesContract" which the values are valid SemanticObjects. That might imply you have a table/CDS view where you store semantic object names. I don't think this is what you have or want based on your question. Please use String="YourHardCodedSemanticObject" instead such as
<Annotation Term="SAP__common.SemanticObject" String="SalesContract"/>
Also if I want both apps connected to the semantic object of AccountingDocument and SalesContract, would I have to have two data fields? Or could I create two annotations and both would be applied to the field? I only need one app from AccountingDocument, but I need multiple from SalesContract. Please let me know if you have any extra advice!
If I got it right, you want different apps apps using different semantic objects on the same popup. I suspect this is not possible. The popup most likely is generated by fetching all apps for a single semantic object. That is why the Term was designed to be a single string. You can create 2 columns with links using the Common.SemanticObject if that is ok. Maybe it makes more sense to create your own tiles/target mappings with the semantic object you want and avoid having this mix.
Sorry for the long reply. Hopefully this explanation helps you and others in the future how to better understand OData vocabularies, terms and annotations are those are the foundation for Fiori Elements.
Great! Do not forget to leave some Kudos! 🙂 I see you posted another question about SmartLink and it's an interesting one.
| User | Count |
|---|---|
| 11 | |
| 6 | |
| 5 | |
| 4 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.