To add a controller extension to a SAP Fiori application, you need to follow these steps:
Identify the SAP Fiori application where you want to add the controller extension.
Inside the function, you can define your custom logic by adding new methods or overriding existing methods from the base controller. For example:
In the SAP Fiori application, locate the view or XML file where you want to use the controller extension.
In the XML file, add the controllerExtension attribute to the view definition and provide the name of your controller extension file without the file extension. For example:
Save the XML file and run the SAP Fiori application. The SAPUI5 framework will automatically load and apply your controller extension to the corresponding view.
By following these steps, you can extend the controller of a SAP Fiori application to add custom logic and behavior as per your requirements.