cancel
Showing results for 
Search instead for 
Did you mean: 

Extend S4HANA Fiori Application

0 Kudos
271

Hi,

I'm trying to extend(extend with a copy of original code) the standard S/4 Hana Fiori application controller.

As the standard extension hook methods provided were not inline with my requirement, I need to write custom functions.

My Goal is to incorporate custom code within standard code and make both work smoothly.

However, when i extended(extend with a copy of original code) the standard controller, i observed that the code is in below format

sap.ui.define([ "

jquery.sap.global",

.......

"sap/m/MessageBox", "sap/m/MessageToast" ],

function (q, g, N) {

"use strict"; var m = sap.ui.controller("abc.efg.hjk.efgaaa", {

// Here onInit, onAfterRendering, onBeforeRendering and onExit hook methods were commented

// Step1:- I tried writing my custom functions here but not working eg

// omyButtonPress: function(){

//Error while rendering the app

//}

});

m.prototype.StandardFunctions = function () {

}, this); };

Step2:- I also tried m.prototype.omyButtonPress = function(){

//Error while rendering the app

}

Any advice is deeply appriciated.

Regards,

S. Natarajan

maheshpalavalli
Active Contributor
0 Kudos

What is omyButtonPress funciton? (from where the function is called?)

0 Kudos

@Mahesh Kumar Palavalli,

I had also extended view with original code and added a button.

On button press event im calling "omyButtonPress" funciton

maheshpalavalli
Active Contributor
0 Kudos

It should work ideally.. are the changes you have done in view and controller are reflecting when you run the extended applicaiton?

0 Kudos

maheshkumar.palavalli ,

Yes, i could see the changes in both view and controller, but while rendering the app im ending up with error

maheshpalavalli
Active Contributor
0 Kudos

Hi Natarajan Srikanta,

Ohh, What exaclty is the error? can you put the screen shot of the console?

Also, is it working ff you don't put the button event handler method in the controller?

BR,

Mahesh

Accepted Solutions (0)

Answers (0)