Skip to Content

Context menu customizing

In Design Studio we have the nice context menu on a standard crosstab. In BEx WAD a developer can specify, which items should be available to the user in the context menu. In Design Studio this is not possible using standard functionality of the context menu.

Fortunately there is a way to do the same in Design Studio, utilizing a custom CSS in your application.

The entries of the standard context menu are tagged with specific IDs, that can be used to show or hide them using CSS.

If you want to hide e.g. the entry “Sort” inside the context menu, you could create a custom CSS file for your application that contains following code:

#CONTEXT_MENU_sort { display: none; }

The following table shows all available IDs for the context menu, that can be used inside a CSS file to hide/show them:

Context Menu Entry ID Context Entry
CONTEXT_MENU_display Display
CONTEXT_MENU_attributes Attributes
CONTEXT_MENU_expand Expand
CONTEXT_MENU_collapse Collapse
CONTEXT_MENU_expandLevel Expand Level
CONTEXT_MENU_hierachySelect Select Hierarchy
CONTEXT_MENU_totals Show Totals
CONTEXT_MENU_keepFilters Keep Filters
CONTEXT_MENU_keepFilterAxis Keep Filter Axis
CONTEXT_MENU_filterSwap Swap Filter
CONTEXT_MENU_selectFilte Select Filter
CONTEXT_MENU_removeFilter Remove Filter
CONTEXT_MENU_suppressZeros Suppress Zeros
CONTEXT_MENU_drilldownBy Drill down by
CONTEXT_MENU_swapWith Swap With
CONTEXT_MENU_removeDrilldown Remove Drilldown
CONTEXT_MENU_swapAxis Swap Axis
CONTEXT_MENU_backOneStep Back one step
CONTEXT_MENU_number_format Number format
CONTEXT_MENU_calculations Calculations
CONTEXT_MENU_jump Jump to

Have fun!

You must be Logged on to comment or reply to a post.
  • Hello All,

    I see that you can do this through script as well. On Startup event, I used following script to remove the unwanted items.

    CONTEXT_MENU.setItemVisible(ContextMenuItemId.BACK_TO_START, false);

    I did this in Design Studio 1.6


    Pavan Kumar Yanmanagandla

  • Hi Folks ,

    We have 1 requirement where we need to keep only scaling factor in context menu and rest other options should be hidden .So I am following the approach of hiding the standard context menu fields except Number Format .
    Below are the challenges which I am facing :
    1.There are 3 fields for which I am not able to get the objects how to hide it ? I have attached the screenshot which I need to remove .
    2. Other fields are hidden now as per the list which is mentioned above but it is working only when I am executing the template in local host .It is not getting reflected in SAP Enterprise Portal .

    I have written the code in startup as mentioned by Pavan Kumar Yanmanagandla

    Thanks in advance !!! 🙂

    Suraj Grewal

    • Hi Suraj,

      Did you upload the css file to the mime repository so that the enterprise portal can retrieve it? You can do that using transaction SE80 (-> Mime Repository). If you check your browser's developer console (F12) you should see that it cannot find your css file if that is your problem.

      Kind regards

  • Hi Martin ,

    Thanks for the comment 🙂 .I am using Code
    CONTEXT_MENU.setItemVisible(ContextMenuItemId.BACK_TO_START, false);
    for hiding the context menu fields .So my issue is out of all the fields of context menu all gets hidden by the code but in portal it is not reflecting .

    • Hi Suraj,

      I just tested your code example on my Design Studio system successfully. I am also using the enterprise portal. The code works both ways, locally and on the portal. I would recommend that you update your Design Studio Add-On or report a bug to SAP to solve this.

      Kind regards

  • Hi,

    in the contect menu the "TOTALS" is by default set to 'Show Totals'. I would like to change it to 'Hide Totals'. any idea what parameters to use for that ?



    in an On Startup script I hide couple of crosstab measures (columns). I am surprised that immediately after the application is run (just prompts are entered) the context menu of the crosstab has the item Undo Previous Step active (!). How come? No step was done yet. Even worse, when this item is clicked, the crosstab is initialized the way that all measures are displayed. That is highly unwanted as there is a button to switch between two sets of measures.

    Is the On Startup script considered as the first step? It would be strange. How can I overcome this bug/feature?

    Further, Is there any way to script what is behind standard context menu items?

    Thank you,