RibbonXML.xml Content
This section describes the content of the RibbonXML.xml file that you create and store in %LOCALAPPDATA%\SAP_IBP_AddIn.
In this file, you can create the following components that will be displayed in the ribbon:
- Button
- Toggle button
- Menu. A menu component can contain the following other components: button, toggle button, separator.
- Group. A group can contain the types of components: button, toggle button, menu.
All these components are created with the XML syntax.
Here is the RibbonXML.xml file that you create to get all the components described above:
<?xmlversion="1.0" encoding="UTF-8"?>
<EPMTab xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://xml.sap.com/2010/02/bpc">
<Group>
<label></label>
<Component>
<type>ToggleButton</type>
<label>Enable Double-Click</label>
<supertip>This toggle button is a shortcut to the user option "Enable Double-Click"</supertip>
<keytip></keytip>
<onAction></onAction>
<isEnabled></isEnabled>
<onPressed></onPressed>
</Component>
<Component>
<type>Button</type>
<label>Macro</label>
<supertip></supertip>
<keytip></keytip>
<onAction>EPMXLA.xla!DefaultAction</onAction>
<isEnabled></isEnabled>
<onPressed></onPressed>
</Component>
</Group>
<Group>
<label>All Components</label>
<Component>
<type>Button</type>
<label>Button</label>
<supertip>Just a simple button</supertip>
<keytip>eb</keytip>
<onAction>EPMXLA.xla!ButtonAction</onAction>
<isEnabled></isEnabled>
</Component>
<Component>
<type>ToggleButton</type>
<label>ToggleButton</label>
<supertip>A toggle button</supertip>
<keytip>et</keytip>
<onAction>EPMXLA.xla!ToggleButtonAction</onAction>
<isEnabled>EPMXLA.xla!ToggleButtonEnabled</isEnabled>
<onPressed>EPMXLA.xla!ToggleButtonPressed</onPressed>
</Component>
<Component>
<type>Menu</type>
<label>A menu</label>
<SubMenus>
<Component>
<type>Button</type>
<label>First button in the menu</label>
<supertip>First button in the menu</supertip>
<onAction>EPMXLA.xla!AnotherButtonAction</onAction>
</Component>
<Component>
<type>ToggleButton</type>
<label>Another toggle button</label>
<supertip>Second component in the menu</supertip>
<onAction>EPMXLA.xla!AnotherToggleButtonAction</onAction>
<isEnabled>EPMXLA.xla!AnotherToggleButtonEnabled</isEnabled>
<onPressed>EPMXLA.xla!AnotherToggleButtonPressed</onPressed>
</Component>
<Component>
<type>Separator</type>
</Component>
<Component>
<type>Button</type>
<label>Second button in the menu</label>
<supertip>A button after the separator</supertip>
<onAction>EPMXLA.xla!ButtonActionAgain</onAction>
</Component>
</SubMenus>
</Component>
</Group>
</EPMTab>
Here is the description of the various elements:
- The mandatory root tags:
- the open tag: <EPMTab xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://xml.sap.com/2010/02/bpc">
- the close tag: </EPMTab>
These tags can contain one or more <Group> tags.
- <Group>: creates a group in the Ribbon. A group is a set of components in the Ribbon.
A group contains no or one <label> tag that defines is name. It contains one or more <Component> tags.
- <Component>: creates an element in a group.
There can be several components for a group.
A component is defined with the following elements:- <type>: button, toggle button or menu. Enter them as follows: Button, ToggleButton or Menu.
- <label>: name of the component to be displayed in the Ribbon.
- <supertip>: text in the tooltip to be displayed when hovering on the component.
- <keytip>: keyboard shortcut of the component.
- <onAction>: name of the macro to execute when clicking the component. Applies only to button and toggle button components.
- <isEnabled>: name of the macro to execute, which defines whether the component is greyed out or not, disabled or enabled. Applies only to button and toggle button components.
- <onPressed>: name of the macro to execute, which defines whether the toggle button is pressed or not. Applies only to toggle button components.
- <SubMenus>: defines the components of a menu component. A <SubMenus> tag contains one or several <Component> tags.
If you add a menu component:
- You can add a grey separator line in a menu by adding the separator type of component: <Component><type>Separator</type></Component>
- A menu cannot contain another menu.