Quantcast
Channel: SAPUI5 Developer Center
Viewing all articles
Browse latest Browse all 789

Some debug tips for SAPUI5 application

$
0
0
  • How to get call stack when some exception happens
  • How to debug source code in product system such as ABAP Server?

 

  • How to manually change source code ?

For solve a issue, the normal process is that you investigate the issue, then change source code in Git, then do release build, then wait the source code transport from one system to another system, after the source code reach the system, then you do test to verify that the fix really work. If the fix not work,then repeat the process.

How can we easily check whether our solution can work ? The answer is:  manually change the source code by browser debug tool.

 

We need first understand how SAPUI5 application run:

When an SAPUI5 application ( for the Fiori application, it is a Component) first time run, the browser will load the source code and execute it. When you return to the launchPad,  the component instance will be deleted but the source code is still kept. The next time you run it, because the source code has been loaded, so the browser will directly create the new instance and run it. 

 

Understand function format

After following code executed, the browser will put the function into the class prototype

sap.ca.scfld.md.controller.BaseFullscreenController.extend("sap.suite.ui.smartbusiness.drilldown.view.Drilldown",
{    _getChartPercentFormatter  = function() {     ......   }
}

So if you want to change the function  _getChartPercentFormatter, you need paste following source code into Browser console window:

 

sap.suite.ui.smartbusiness.drilldown.view.Drilldown.prototype._getChartPercentFormatter = function() {  ......
}

 

  • How to run code in Chrome, Firefox, IE ?
  • for Chrome

    Choose "Develop tool" from menu, click the "Console" window, then directly paste you code, press 'Enter' to execute it

  • for Firefox

     Choose "Developer"-->"Developer Toolbar" from the menu, then paste code, press 'Enter' to execute it.  

Firefox_console.png

  • for IE

     Choose "F12 Developer Tool" from menu, click "Console" window, paste code, then press green triangle button to execute it.

IE_console.png


Viewing all articles
Browse latest Browse all 789

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>