Learn SAP-FIORI-EXTENSIONS with Real Code Examples
Updated Nov 27, 2025
Code Sample Descriptions
1
Fiori Controller Extension - Validation
sap.ui.controller("mycompany.ext.POExtension", {
onBeforeSave: function(oEvent) {
var amount = this.getView().byId("TotalAmount").getValue();
if (amount > 10000) {
sap.m.MessageToast.show("PO requires manager approval!");
oEvent.preventDefault();
}
}
});
Custom controller logic to validate a Purchase Order before submission.
2
Fiori XML View Extension - Custom Button
<Button
id="btnCustomAction"
text="Special Action"
press="onCustomAction"
/>
Injects a custom button into an SAP-delivered Fiori app view.