Skip to Content

Requirement: I had a requirement of adding a custom fied on the UserSettings of fiori launchpad and I was wondering how can I achieve it . Then I found a link documentation link provided by SAP and started working on it .

In general , the link says that we need use the Semantic object as a Shell and configure this on the admin URL of the Fiori Launchpad.

I started to do it by creating a sample SAP UI5 Application and with no views and controllers in it . Then I opened the Component.js and found that we need to extend only the faceless components i,e sap.ui.core.Component .

 

   SAPUI5 provides faceless components for services that deliver data from the back end                    system, UI components that extend components and add rendering functionality.

    As we are using a Shell Plugin , component which acts as shell plug-in is a plain component,           not a UIComponent.

       Faceless components (class: sap.ui.core.Component )

       Use sap.ui.core.Component in Component.js file and extend it .

       

Using the API sap.ushell.renderers.fiori2 add code in Component.js file to add the                       Custom Plant Field .

 In onInit() of Lifecycle method add the below code

var oRenderer = sap.ushell.Container.getRenderer("fiori2");
var oEntry = {
  title: "title",
  value: function() {
      return jQuery.Deferred().resolve("entryTitleToBeDisplayed");
  },
  content: function() {
      return jQuery.Deferred().resolve(new sap.m.Button("userPrefEntryButton", {text: "Button"}));
  },
  onSave: function() {
      return jQuery.Deferred().resolve();
  }
  };
oRenderer.addUserPreferencesEntry(oEntry);

Above Code is for Adding a button in the user preferences dialog box .

 Deploy the Application .

 FLP Configuration.(Refer other blogs for FLP configuration)

(i)     Go to lpd_cust Transaction Create a Role.

(ii)    Go to /n/UI2/SEMOBJ_SAP Transaction and check for “Shell” Semantic object .

        (If you do not find this, go to the /n/ui2/semobj Transaction )

(iii)   Add “Shell” Semantic Object .

       

  Go to the Admin URL under Catalog , add a Static Tile and do the Target Mapping and                     Tile Configuration as in the per below screen shots.

(Click on tile and do the config as per Screen Shot )

Tile Config :

                

Target Mapping :

Since the Semantic object is of “Shell” Type , we cannot see this as a tile even thought we have taken as a Static Tile .

We are done . 

 Go to Fiori Launchpad and Check the User Preferences Dialog Box you can see the                        Custom  field added .

On Clicking the title we get a button on the next view .

             

Reference Links :

            1)    Ushell Plugin

            2)   API Reference for Ushell

To report this post you need to login first.

1 Comment

You must be Logged on to comment or reply to a post.

  1. Jakob Straub

    In addition to that, you can also add the button to the launchpad menu or to the launchpad header with the renderer.

    User menu = oRenderer.addUserPreferencesEntry(oEntry)

    Launchpad menu = oRenderer.addActionButton(oEntry);

    Launchpad header =  oRenderer.addHeaderEndItem(oEntry);

    (0) 

Leave a Reply