Keyboard Shortcuts

Keyboard Shortcuts

SAP Fiori elements provides keyboard shortcuts for basic operations.

The table shows the available keyboard shortcuts.

Action Shortcut (Microsoft Windows) Shortcut (Mac OS) Prerequisite Relevant Floorplans Result

Cancel/Discard Draft

Esc

Esc

The focus is set anywhere on the object page in edit mode.

Object page

The same as when user clicks on Cancel in the non draft apps and Discard Draft in the draft apps.

Create

Ctrl Enter

CMD Enter

The focus is set on the table.

List report

Object page

The same as when a user chooses Create.

Create with filters

(This keyboard shortcut is not applicable to SAP Fiori elements for OData V4)

Shift Ctrl Enter

Shift CMD Enter

The focus is on the table.

List report

The same as when a user chooses Create With Filters.

Delete page level

Ctrl Del

CMD fn delete (use ← if there is no delete key

The focus is set anywhere on the object page in display mode.

Object page

The same as when a user chooses Delete on the object page.

Delete table entry

Ctrl D

Cmd D

The focus is set on the table.

List report

Object page

The same as when a user chooses Delete in a table.

Note

This requires a selection for multiple deletions or a focus position for deleting single items.

Only works on read-only/display-only content. Edit fields map Del/Backspace on their own.

Edit page level

Ctrl E

CMD E

The focus is set anywhere on the object page.

Object page

The same as when a user chooses Edit on the object page.

Export as

Shift Ctrl E

Shift CMD E

The focus is set on the table.

Analytical list page

List report

Object page

The same as when a user chooses Export to Excel Export As

Go

Enteror Return

Enteror Return

The focus is set anywhere on the SmartFilterBar.

Analytical list page

List report

Object page

In the SmartFilterBar, the search is triggered when the focus is in one of the filter bar's input fields.

Go

(This keyboard shortcut is not applicable to SAP Fiori elements for OData V4)

Ctrl Enter

CMD Enter

The focus is on any element in the visual filter panel or on the entire visual filter.

Analytical list page (visual filter)

Go is triggered when the focus is on any element in the visual filter panel or on the entire visual filter.

Open error list

Ctrl Shift M

CMD Shift M

The focus is set anywhere on the object page in edit mode.

Object page

The same as when a user chooses the Error button.

Save page level

Ctrl S

CMD S

The page is in edit mode. The focus is set anywhere on the object page.

Object page

The same as when a user chooses Save on the object page

Select row in analytical or grid tables

Shift Space

Shift Space

The focus is on a table cell.

Analytical list page

List report

Object page

If the focus is on a cell, the entire row is selected

Share

(This keyboard shortcut is not applicable to SAP Fiori elements for OData V4)

Shift Ctrl S

Shift CMD S

The focus is set anywhere on the list report or object page.

Analytical list page

List report

Object page

If the focus is on the filter bar, the share-ActionSheet opens near the Share button

Table settings

Ctrl ,

Ctrl ,

The focus is set on the table.

Analytical list page

List report

Object page

The same as when a user chooses the Table Settings button.

Additional Features in SAP Fiori Elements for OData V2

Redirecting Standard Shortcuts to Custom Actions

Keyboard shortcuts for standard actions such as create, delete, and edit can get redirected to extension actions that replaces the standard action. To do so, you must add the logicalAction property in the manifest of custom action implementation.

Sample Code

Example for Standard Create Action Redirect to a Custom Create Action

Hidden
"sap.suite.ui.generic.template.ListReport.view.ListReport": {
    "controllerName": "STTA_SO_ND.ext.controller.ListReportExtension",
    "sap.ui.generic.app": {
        "STTA_C_SO_SalesOrder_ND": {
            "EntitySet": "STTA_C_SO_SalesOrder_ND",
            "Actions": {
                "CreateExt": {
                    "id": "CreateExt",
                    "text": "Create (Ext)",
                    "press": "onCreateWithParameters",
                    "logicalAction": "Create"
                }
            }
        }
    }
}

In this example, the standard create functionality is replaced with onCreateWithParameters. It means that when the shortcut for create ( Ctrl Enter ) is triggered, the onCreateWithParameters function written in application extension code is executed. For the annotated buttons, you can add an extra piece of logic that is custom implemented inside the standard functionality.

Custom action with a valid logicalAction setting takes over the general properties of the standard action. It overrides the keyboard shortcut, the place where the button is rendered on the UI, and the properties such as ID, event handler, text etc., that are not explicitly defined in the manifest.json. This also means that in order to override any standard action, application must meet all the conditions required to render the corresponding standard action. For example, if you want to override the standard Create button, you should make sure that the Create button is eligible to be rendered on the UI for your application

The prerequisite for the shortcut remains unchanged.

Sample Code

Example for Delete Action in the Object Page Redirected to a Custom Delete Action

Hidden
 "sap.suite.ui.generic.template.ObjectPage.view.Details": {
    "controllerName": "STTA_SO_ND.ext.controller.DetailsExtension",
    "sap.ui.generic.app": {
        "STTA_C_SO_SalesOrder_ND": {
            "EntitySet": "STTA_C_SO_SalesOrder_ND",
            "Header": {
                "Actions": {
                    " MySmartTableDelete": {
                        "id": "customdelete",
                        "text": "Custom Delete",
                        "press": "fnCustomDelete",
                        "logicalAction": "Delete"
                    }
                }
            },
            "Sections": {
                "to_Item::com.sap.vocabularies.UI.v1.LineItem": {
                    "id": "to_Item::com.sap.vocabularies.UI.v1.LineItem",
                    "Actions": {
                        "MySmartTableCreate": {
                            "id": "customcreate",
                            "text": "CustomCreate",
                            "press": " fnCustomCreate",
                            "logicalAction": "Create"
                        }
                    }
                }
            }
        }
    }
},

The object page follows the same concept as the list report. You must add the logicalAction property to the manifest.

Currently, redirection of the following shortcuts is supported:

  • For List Report:

    • Create: Ctrl Enter

    • CreateWithFilters: Shift Ctrl Enter

    • Delete: Ctrl D

  • For Object Page:

    • For Header:

      • Save: Ctrl S

      • Edit: Ctrl E

      • Delete: Ctrl Del

    • For Sections:

      • Create: Ctrl Enter

      • Delete: Ctrl D

Defining New Keyboard Shortcuts for Custom Action

Applications can define their own keyboard shortcuts for custom actions. For more information, see Adding Custom Actions Using Extension Points.

Defining Custom Shortcuts for Application-Defined Action Buttons and Navigation Buttons

Action Buttons

You can define custom keyboard shortcut for DataFieldForAction using the following manifest settings:

Sample Code

DataFieldForAction annotation

Hidden
<Record Type="UI.DataFieldForAction">
    ...
    <PropertyValue Property="Action" String="<Schema Namespace>.<EntityContainer Name>/<FunctionImport Name>" />
</Record>

Sample Code

manifest.json

Hidden
"sap.ui5": {
    "extends": {
        "extensions": {
            "sap.ui.commands": {
                "<Component Name>#<Component ID without app ID prefix>": {
                    "<Command Name>": {
                        "shortcut": "Ctrl+B"
                    }
                }
            }
        }
    }
},
"sap.ui.generic.app": {
    "pages": {
        "ListReport|<Entity Set Name>": {
            "component": {
                "settings": {
                    "annotatedActions": {
                        "<FunctionImport Name>": {
                            "command": "<Command Name>"
                        }
                    }
                }
            }
        }
    }
}

Navigation Actions

You can define custom keyboard shortcut for DataFieldForIntentBasedNavigation using the manifest settings mentioned here. A corresponding outbound navigation must exist for the action, for which you are providing a keyboard shortcut. This outbound navigation should have the same set of semantic object and action as of the navigation action.

Sample Code

DataFieldForIntentBasedNavigation annotation

Hidden
<Record Type="UI.DataFieldForIntentBasedNavigation">
    <PropertyValue Property="SemanticObject" String="<Semantic Object>" />
    <PropertyValue Property="Action" String="<Action>" />
</Record>

Sample Code

manifest.json

Hidden
"sap.app": {
    "crossNavigation": {
        "inbounds": {},
        "outbounds": {
            "<Outbound Navigation Name>": {
                "semanticObject": "<Semantic Object>",
                "action": "<Action>"
            }
        }
    }
},
"sap.ui5": {
    "extends": {
        "extensions": {
            "sap.ui.commands": {
                "<Component Name>#<Component ID without app ID prefix>": {
                    "<Command Name>": {
                        "shortcut": "Ctrl+B"
                    }
                }
            }
        }
    }
},
"sap.ui.generic.app": {
    "pages": {
        "ListReport|<Entity Set Name>": {
            "component": {
                "settings": {
                    "outbounds": {
                        "<Outbound Navigation Name>": {
                            "command": "<Command Name>"
                        }
                    }
                }
            }
        }
    }
}

Note

To understand how you can determine "<Component Name>#<Component ID without app ID prefix>", see Adding Custom Actions Using Extension Points.

Custom keyboard shortcut for inline DataFieldForAction or DataFieldForIntentBasedNavigation actions are not supported.

Additional Features in SAP Fiori Elements for OData V4

You can use keyboard shortcuts for common actions.

Triggering the Default Positive Action with a Standard Shortcut

In a list report, object page or subobject page, CtrlEnter (Microsoft Windows) or CmdReturn (Mac OS) triggers the default positive action.

Note that this only happens if the focus isn't on a control that uses the same keys for a shortcut. For example, when the focus is on a table with a create button, the shortcut would trigger Table Create, not the default positive action.

The default positive actions for each template are as follows:

  • List report: Go button on the filter bar.

  • Object page: the positive semantic action defined by the application. If not defined, the default actions are Edit in display mode and Save in edit mode.

  • Subobject page: Application defined positive semantic action. If not defined, the default action is the Apply button.

Note that the standard shortcut doesn't trigger the inline primary action within tables even if the focus is on the table. Instead, it triggers the Table Create button (if applicable) or the primary action at the page level.

Defining Custom Shortcuts for Application-Defined Action Buttons and Navigation Buttons

Applications can add their own custom keyboard shortcuts for the following use cases:

  • action buttons

    • UI.DataFieldForAction-annotation based

    • manifest.json-based

  • annotation-based navigation buttons

    • UI.DataFieldForIntentBasedNavigation

Note

  • A keyboard shortcut is invoked only when the focus is within the control that holds the button. For example, the table toolbar action is invoked only when the focus is on the table and then the shortcut is pressed, but not if the focus is on a form.

  • The header and footer buttons are global, which means they are triggered with the defined shortcut – irrespective of where the keyboard focus is – unless the same shortcut is also mapped to a control that is much closer to the current keyboard focus.

Remember

Don't use a keyboard shortcut for a custom button that is already defined as a standard shortcut by SAP Fiori elements. This results in unexpected behavior.

Restriction

Keyboard shortcuts aren't supported for application-defined inline actions and inline navigation buttons in tables.

Add the shortcut definition in the manifest.json as follows:

  1. Associate a "command" with the action.

    Sample Code

    Hidden
    "@com.sap.vocabularies.UI.v1.LineItem": {
        "actions": {
            "DataFieldForAction::com.c_salesordermanage_sd.CreateWithSalesOrderType": {
                "command": "BOUND"
            }
        }
    }

  2. Map the "command" with the actual keyboard shortcut.

    Sample Code

    Hidden
    "sap.ui5": {
        "extends": {
            "extensions": {
                "sap.ui.commands": {
                    "sap.fe.templates.ListReport": {
                        "BOUND": {
                            "shortcut": "Ctrl+B"
                        }
                    },
                    "sap.fe.templates.ObjectPage": {
                        "IBNI": {
                            "shortcut": "Ctrl+K"
                        }
                    },
                    "sap.fe.templates.ObjectPage#SalesOrderManageObjectPage": {
                        "IBNI": {
                            "shortcut": "Ctrl+I"
                        }
                    }
                }
            }
        }
    }

    For a command on an object page, for example, you can append the "ID" of the object page with an #. This ensures that the command is mapped to the correct shortcut based on the object page instance where the shortcut is invoked. You can see this in the previous sample code for the SalesOrderManageObjectPage use case.