!--a11y-->
Enhancing the Context Menu 
As well as being able to make entries in the context menu visible, entries in the enhanced menu visible or entries in the enhanced menu invisible, you can also hang scenario-specific entries in the menu. You have two options:
· You define the new entries using the Web Template Properties object tag.
· You add the new entries to the menu using the JavaScript function.
The first way is described in this section.
In both cases, you have to write a JavaScript function that transfers the processing when you select the menu entry. You can find out more about this under Command Processing.
New entries are defined using different series of attributes in the Web template properties as follows:
|
Attribute |
Description |
|
CMENU_LABEL_I |
Labeling text in the menu |
|
CMENU_FUNCTION_I |
JavaScript function for processing the command You implement this function in JavaScript and use it to execute commands after you have selected the menu entry. |
|
CMENU_PARAMETER_I |
Free parameter This attribute is passed to the JavaScript function 'CMENU_FUNCTION' and can be evaluated there as required. The attribute makes it possible to use a function for more than one menu entry. |
|
CMENU_CELL_TYPE_I ‘ ’ = No restriction ‘CHARACTERISTIC’ = Characteristic ‘CHARACTERISTIC_VALUE’ = Characteristic value ‘STRUCTURE’ = Structure ‘STRUCTURE_VALUE’ = Structure component value ‘DATA’ = Data cell ‘EXCEPTIONS’ = Exceptions item ‘CONDITIONS’ = Conditions item 'DOCUMENT_LIST' = Document list item |
Context of the entry If you want the menu entry to appear only in certain contexts and not in all context menus, you can define this with ‘cell_type’ and ‘filter’. |
|
CMENU_FILTER_I
|
Context of the entry According to the value of ‘cmenu_cell_type’, different values are useful here: ‘CHARACTERISTIC’, ‘CHARACTERISTIC_VALUE’, ‘STRUCTURE’, ‘STRUCTURE_VALUE’: Iobjnm ‘EXCEPTIONS’: Exception ID ‘CONDITIONS’: Condition ID ‘DOCUMENT_LIST’: Document ID See Examples. |
|
CMENU_VISIBILITY_I ‘ ’= Not displayed ‘X’= Displayed in the “basic menu” ‘E’= Displayed in the “enhanced menu” |
Visibility of the entry You specify whether the entry is to appear in the basic menu or also in the enhanced menu. |
|
CMENU_POSITION_I ‘TOP’ = Before the “normal” entries ‘BOTTOM’ = After the “normal” entries |
Position of the entry The entries are inserted in the order in which they were called up. You can choose whether the entry is to appear before the “normal” entries or after them in the menu. You cannot position the entries in between the “normal” entries. |
.
<object>
// Menu entry at the beginning and only on customer cells
<param name=’OWNER’
value=’SAP_BW’>
<param name='CMD'
value='SET_PROPERTIES'>
<param
name='CMENU_LABEL_1' value='Customer details'>
<param
name='CMENU_FUNCTION_1' value='myMenuProcessor'>
<param
name='CMENU_PARAMETER_1' value='1'>
<param
name='CMENU_CELL_TYPE_1' value='CHARACTERISTIC_VALUE'>
<param
name='CMENU_FILTER_1' value='0CUSTOMER'>
<param
name='CMENU_VISIBILITY_1' value='X'>
<param
name='CMENU_POSITION_1' value='TOP'>
// Menu entry at the end for IT homepage
<param name='CMENU_LABEL_2' value='Customer details'>
<param
name='CMENU_FUNCTION_2' value='myMenuProcessor'>
<param
name='CMENU_PARAMETER_2' value='2'>
<param
name='CMENU_VISIBILITY_2' value='X'>
<param
name='CMENU_POSITION_2' value='BOTTOM'>
// Menu entry at the beginning and only on material groups
<param name='CMENU_LABEL_3'
value='Materials'>
<param
name='CMENU_FUNCTION_3' value='myMenuProcessor'>
<param
name='CMENU_PARAMETER_3' value='3'>
<param
name='CMENU_CELL_TYPE_3' value='CHARACTERISTIC_VALUE'>
<param
name='CMENU_FILTER_3' value='0MATGROUP'>
<param
name='CMENU_VISIBILITY_3' value='X'>
<param
name='CMENU_POSITION_3' value='TOP'>
</object>
You can find an example implementation for the JavaScript function “myMenuProcessor” under JavaScript.