Applications can define custom global actions by enhancing the manifest.json
file.
For more information, see Adding Custom Actions Using Extension Points.
The table toolbar in the list report contains buttons used to trigger actions for the entire list report or for selected items. These actions can include generic functions offered by SAP Fiori elements or app-specific actions. For more information, see Adding Actions to Tables.
Generic Actions
You can use the following generic actions in the table toolbar:
Create a new item if the entity set can be created.
Delete of one or more items if the entity set can be deleted.
App-Specific Actions
Depending on your use case, you can define actions that are displayed in the table toolbar for your app, for example, Copy and Approve. You can define the following types of actions for your app:
Actions that require user confirmation, for example, for critical actions that have severe consequences. The system opens a dialog in which the user has to confirm the action.
Actions that require additional user input, for example, an approval comment. The system opens a dialog with one or more entry elements in which the user enters the required data.
Actions that require none of the above. The system triggers the action.
Actions that trigger external navigation.
You can display actions to allow users to perform an action for one or more lines in the table:
Delete Action
Display the Delete button as an action on a table. For more information, see Adding Actions to Tables.
Create Action
Set up your annotations so that the Create action is rendered in the table toolbar of the list report.
Copy Action
The Copy button is not available by default. However, applications can define a standard copy action by annotating
dataFieldForAction
with isCopyAction
.
This Copy button is automatically placed after the Create button.
XML Annotation
<Annotation Term="UI.LineItem"> <Collection> <Record Type="UI.DataFieldForAction"> <PropertyValue Property="Label" String="Copy" /> <PropertyValue Property="Action" String="STTA_PROD_MAN.STTA_PROD_MAN_Entities/STTA_C_MP_ProductCopy" /> <Annotation Term="UI.IsCopyAction" Bool="true" /> </Record>
CAP CDS Annotation
UI.LineItem : [ { $Type : 'UI.DataFieldForAction', Label : 'Copy', Action : 'STTA_PROD_MAN.STTA_PROD_MAN_Entities/STTA_C_MP_ProductCopy', ![@UI.IsCopyAction] : true, }, ],
Applications can define a label for this button. If no custom label is provided, the default label is Copy.
The Create button in a list report is enabled based on the presence of NewAction
in the metadata. This is the default
behavior for
draft-based
applications:
XML Annotation
<Annotation Term="Common.DraftRoot"> <Record Type="Common.DraftRootType"> <PropertyValue Property="ActivationAction" String="com.c_salesordermanage_sd.draftActivate"/> <PropertyValue Property="EditAction" String="com.c_salesordermanage_sd.draftEdit"/> <PropertyValue Property="PreparationAction" String="com.c_salesordermanage_sd.draftPrepare"/> <PropertyValue Property="NewAction" String="com.c_salesordermanage_sd.ReturnInProcess"/> </Record> </Annotation>
The InsertRestrictions
on the table entity set is completely ignored
when
you enable Create
in a list report due to the presence of NewAction
. The button is always enabled, if visible, and the visibility can be
controlled via the OperationAvailable
property through the following logic:
If OperationAvailable=false
, then the Create button will not be displayed in the list report table.
If OperationAvailable=true
or is not specified, then the Create button will be displayed.
If OperationAvailable=null
is ignored and the Create button is displayed, this is equivalent to
OperationAvailable
not being specified.
For more information, see Adding Actions to Tables.