Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
Showing results forΒ 
Search instead forΒ 
Did you mean:Β 
Hello everyone,

In this blog I'll present to you an alternative way to override target mappings.


As a matter of example, let's say that you've developed an extension to a standard Fiori app.
Now, you have to make sure that the extended app runs (instead of the original one) when the end-users try to access it.

This can be done through one of the following ways:

  • As a manual process, by going through every single catalog in which the original app is included and modify them (which is a huge bummer, not to mention that it's not upgrade-safe at all 😊)

  • You can create a custom catalog, in which you create a new target mapping, taking advantage of the sap-priority parameter (that'll ensure that the app with the highest priority will be run) and assign this custom catalog to all users (more detail on this blog)

Even though the second one is pretty neat and near-perfection, there's a third way to do that - through a simple ABAP enhancement.


Basically, all you need to is the following:

Go to /UI2/CL_TM_PB_ACCESS and enhance the method GET_TARGET_MAPPINGS (implicit enhancement or a post-exit method, do as you please 😊).

In the enhancement, you can then adapt the returning table RT_TM (that contains the user's target mappings) to fit your needs.

For example:

Imagine you wanted to replace "Display Treasure Alerts" Fiori app with an extended one (for simplicity's sake, let's replace it with the MyInbox one):

Then you can include something like the following code in your enhancement (similarly to what you would configure in your new target mapping):
  METHOD ipo_zenh_bc_ui5_tmap_override~get_target_mappings.
*" Declaration of POST-method, do not insert any comments here please!
*" importing
*" changing
*" raising

LOOP AT rt_tm REFERENCE INTO DATA(ls_tm_ext) WHERE object = 'TreasuryAlert' AND action = 'displayPosting'.

ls_tm_ext->additional_data = 'SAPUI5.Component=cross.fnd.fiori.inbox'.
ls_tm_ext->application-sapui5-component = 'cross.fnd.fiori.inbox'.
ls_tm_ext->application-sapui5-uri = '/sap/bc/ui5_ui5/sap/ca_fiori_inbox'.



In other words, in this case we looped through every target mapping for #TreasuryAlert-displayPosting - the Semantic Object/Action combination for "Display Treasure Alert" app - and replaced the component and the URL with the MyInbox ones.

By doing that, when we try again to enter the aforementioned app, it will instead open MyInbox:

Note: you may need to clear the cache after implementing the enhancement.

This is a pretty straightforward example, but there's a lot you can do here... just make sure you know what you're doing 😊


  • Cleaner approach (since you don't have to create an additional catalog and target mapping)

  • No role maintenance nor user role assignment needed (since the enhancement will be applied globally)


None πŸ˜Š


To sum up, it is also possible to override target mappings by implementing a simple enhancement.
It doesn't invalidate at all the sap-priority approach, since it still is a clean one.
Thus, both approaches are pretty much valid.
Nevertheless, by doing it with this kind of enhancement we can reduce the maintenance effort a bit.


Any questions/comments/suggestions?

Feel free to leave them down below.


For more Fiori-related resources, feel free to:
– Follow the Fiori topic
– Post/answer Fiori-related questions
– Read other Fiori-related posts


Best regards,

Joaquim Perez
1 Comment
Labels in this area