cancel
Showing results for 
Search instead for 
Did you mean: 

Add icon to Action label in RAP

HugoJ
Advisor
Advisor
0 Kudos

Hi, I would like to add an icon to a RAP action label however I'm unable to find any documentation about this so I'm not sure if it's possible at all.

I'm implementing a Fiori App with RAP and CDS, in S4/HANA on premise 2022 (not using UI5). My goal is to add an icon to an action's label, for example a custom action defined in the Behavior Definition "copyTravel".

Would there be any annotation or text that would make this possible in the metadata extension?

Example: 

@UI: { lineItem: [ { position: 10 },
                   { type: #FOR_ACTION, 
                     dataAction: 'copyTravel', 
                     label: 'Copy Travel <ICON>' } ] }

OR

@UI: { lineItem: [ { position: 10 },
                   { type: #FOR_ACTION, 
                     dataAction: 'copyTravel', 
                     label: 'Copy Travel',
                     imageURL: <ICON> } ] }

One additional question, is it possible in the on-premise release 2022 to change the standard create/update/delete action labels? (without creating new actions)

Thanks for your help

View Entire Topic
sandeep_rs
Advisor
Advisor
0 Kudos

Hi,

In general, using clear labels should be preferred over icons since icons are prone to issues with incorrect interpretation (not all cultures have the same icon for an action!). Fiori elements OData V4 allows for icon support but only for inline buttons and only really standard icons should be used! You could check the V4 specific section "Rendering Buttons with Icon Instead of Text" in page for more information.

For the second part of the question, you should check the texts allowed for override in page. I see, for example, that we offer T_OP_OBJECT_PAGE_CREATE / T_OP_OBJECT_PAGE_SAVE for the standard Create/Save buttons in the object page footer.

Best Regards,

   Sandeep

 

HugoJ
Advisor
Advisor
0 Kudos

Thank you for replying Sandeep. So if I understand correctly there is no way to add the icon via Fiori Elements annotations. Regarding the icon being prone to incorrect interpretation, that is a good point but I am converting an existing WebDynpro app which uses icons so I'm trying to replicate the buttons as much as possible.

sandeep_rs
Advisor
Advisor
0 Kudos
Adding icon is supported - please see V4 specific section "Rendering Buttons with Icon Instead of Text" in page I shared above for more information!
HugoJ
Advisor
Advisor
0 Kudos

So this can be done after deployment in UI adaptations is that correct?

I haven't reached this point yet so I'm unsure where this fit as it only mentions XML or CAP changes.

sandeep_rs
Advisor
Advisor
0 Kudos
Actually there is also ABAP CDS annotation mentioned there:
sandeep_rs
Advisor
Advisor
0 Kudos
Sorry for the incompelte post! The page shows how you can set the iconURL in the ABAP CDS annotation too. The only catch is INLINE was not supported in ABAP CDS. If this is the case, you will have to add the inline part via local XML annotation. The icon support is only for inline buttons!