cancel
Showing results for 
Search instead for 
Did you mean: 

SAP RAP ABAP : Navigate across business objects/CDS Root View Entities

ruchirsaxena
Participant
0 Kudos

Hi,

I have a managed RAP development with 2 root view entities having their own IAM apps. These 2 root view entities have a many-to-many relationship. This means that there are there are many instances of Root View Entity A associated to a single instance of Root View Entity B, and vice versa.

Now the requirement is to provide links of all associated Root View Entity A on the object page of every instance of Root View Entity B similar to line item table or child table, such that on clicking any link, the corresponding object page of the clicked instance of Root View Entity A is opened, and vice versa with the links to all associated Root View Entity B instances on the Object page of Root View Entity A.

Any suggestions for the same?

Thanks and Regards,

View Entire Topic
dhegde
Participant
0 Kudos

Hi Ruchir

Is my understanding correct that you have

  • 2 different RAP Managed BOs
  • 2 different Fiori Elements apps ?

If yes, then this is fairly simple, I think, to ahieve what you are trying to:

  • Create a [0..*] OR [1..*] association from Root entity of "A" to that of "B" and vice versa
  • Add a line item reference facet targeting this association in respective root entities

This should do the trick. Have you already tried this and faced any issues?

Regard,

Dhananjay

ruchirsaxena
Participant
0 Kudos

Hi Dhananjay,

Thanks for the response. I am yet to try this. would you be able to give a small example?

Best Regards,

Ruchir

dhegde
Participant
0 Kudos

Hello Ruchir

I do not have a ready example as such. I would do something like this to achive it -

  • let's say RAP BO "A" has a projection view ZC_RootEntityA and RAP BO "B" has ZC_RootEntityB
  • Create an assocaition from ZC_RootEntityA, create an 1..N association to ZC_RootEntityB, call it _RootEntityB and expose this association
  • Add a #LINEITEM_EFERENCE facet in ZC_RootEntityA and in the target element, provide the association _RootEntityB, with this, you will see a table of all association RootEntityB entries on an object of RootEntityA
  • Now, to enable navigation, you need to make use of Intent Based Navigation. In short,
  • Create a sematic obejct for RootEnttiyB, and an action, say "display"
  • For the key field of RootEntityB that is to be used for navigation, add a @UI.lineItem annotation with "type" as as #FOR_INTENT_BASED_NAVIGATION. Note this is to be addded in ZC_RootEntityB. This blog post might be helpful - Three types of Intent-Based Navigation in FIORI/RAP OR check this help documentation on enabling a link on a given property/field of CDS view with inent based navigation

Do the same for ZC_RootEnttiyB to show entries of associated ZC_RootEntityA on its object page and enable navigation

Hope this helps.

Cheers!