cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Two fields using WITH_INTENT_BASED_NAVIGATION always using one of the field as basis in navigation

Yanxing
Discoverer
0 Kudos
363

I've developed a fiori app using cds annotation. It has two fields which are accounting document and a reclass accounting document.

I've added an WITH_INTENT_BASED_NAVIGATION on both fields. When I click on the accounting document value it goes to the manage journal entries as expected but when I click on the reclass accounting document, in goes into manage journal entries but the value its taking is the accounting document column and not the reclass.

How can I make the navigation know which field to take to be used when navigating to another app?

Accepted Solutions (0)

Answers (1)

Answers (1)

Chuma
Active Contributor
0 Kudos

Hello @Yanxing 

What you’re observing is not a bug. Both links direct to Manage Journal Entries, but your annotations are sending identical parameter mappings to the target app. Assign each field its own unique mapping to ensure the target receives the correct keys.

What needs to be changed

Map each parameter of the target app, such as CompanyCode, FiscalYear, and AccountingDocument, individually for each column.

ABAP CDS (field-level mapping)

@UI.lineItem: [

  { type: #DATA_FIELD_FOR_INTENT_BASED_NAVIGATION,

    label: 'Accounting Doc',

    value: AccountingDocument,

    semanticObject: 'JournalEntry',

    semanticObjectAction: 'manage' }

]

@Consumption.semanticObject: 'JournalEntry'

@Consumption.semanticObjectAction: 'manage'

@Consumption.semanticObjectMapping.additionalBinding: [

  { element: 'CompanyCode',        localElement: 'CompanyCode'        },

  { element: 'FiscalYear',         localElement: 'FiscalYear'         },

  { element: 'AccountingDocument', localElement: 'AccountingDocument' }

]

AccountingDocument;

 

@UI.lineItem: [

  { type: #DATA_FIELD_FOR_INTENT_BASED_NAVIGATION,

    label: 'Reclass Doc',

    value: ReclassAccountingDocument,

    semanticObject: 'JournalEntry',

    semanticObjectAction: 'manage' }

]

@Consumption.semanticObject: 'JournalEntry'

@Consumption.semanticObjectAction: 'manage'

@Consumption.semanticObjectMapping.additionalBinding: [

  { element: 'CompanyCode',        localElement: 'CompanyCode'              },

  { element: 'FiscalYear',         localElement: 'FiscalYear'               },

  { element: 'AccountingDocument', localElement: 'ReclassAccountingDocument'}

]

ReclassAccountingDocument;

Important: For the second link, map the target AccountingDocument to your local ReclassAccountingDocument. If you have an entity-level mapping, either remove it or override it with these field-level bindings.

Quick checks

  • Both local properties are present in your projection view.
  • Company code and fiscal year are present within the row context.
  • Clear the cache and retest; check the URL hash to confirm the correct parameters are passed.

How to Set Up Outbound (Intent-Based) Navigation and When to Use the Demo Kit / Learning sapui5.hana.ondemand.com-Discover New Enterprise Grade Horizons       

SAP Learning-Configuring External Navigation

Common vocabulary, SemanticObjectMapping, what Mapping does and why each field needs its own mapping to pass the right parameters, sap.github.io

Manage Journal Entries (F0717), app reference, and KBA listing supported semantic objects for intent-based navigation. SAP Support Portal

With kind regards

Chuma Ofole