Start with components open sap ui5

first steps, sap ui5

So, first steps!

1 Go to


2 load the last openui5 release!


3 after that just use it:

<!DOCTYPE html>  
      <meta http-equiv='X-UA-Compatible' content='IE=edge' />  
      <title>Hello World</title>  
      <script id='sap-ui-bootstrap' 
           src='[INSTALLATION LOCATION]/resources/sap-ui-core.js'  
         var btn = new sap.m.Button({  
            text:'Hello World',  

   <body id='content' class='sapUiBody'>

So, and it didn’t work!


You can solved it 2 ways:

1 use  <script src=»»>

2 You need use web server!

for chrome use Web Server for Chrome 

and that you need choose folder with you app and release!


So, now it will work!

SetHours for Date in sap ui5, how do if date reduce -1 day, or you filter not working

Blog, Odata, What???


First situation when in the backend server you saw rhat date less on -1 day!
What happend? It odata sevices do crayzy date!
What you can do?

just try use that:
var conv = function(conv_date){
var dateFormat = sap.ui.core.format.DateFormat.getDateTimeInstance({pattern : "yyyy-MM-ddTKK:mm:ss" });
var lv_date_val = new Date(conv_date);
var dateStr = dateFormat.format(lv_date_val);
return dateStr;

in you data request use
odata.validdate = conv(odata.validdate);

second situation, when you use filter,
and you neded use setHours on the date.
How you can understund how match hours set?

Try use that
var sHours = new Date().getHours() - new Date().getUTCHours();

var value = new Date();


sap ui5, Shell

Where you can find it:
use se80, bsp application /UI2/USHELL

add button to user interface:

zFioriRenderer.getRenderer = function(){
zFioriRenderer.renderer = sap.ushell.Container.getRenderer("fiori2");
setTimeout(zFioriRenderer.getRenderer, 1000);
zFioriRenderer.helpBtn.button = new {
icon: "sap-icon://sys-help",
tooltip: "Вызов справки",
press: zFioriRenderer.helpBtn.helpFunc

zFioriRenderer.helpBtn.button = zFioriRenderer.renderer.addActionButton("sap.m.Button", { id: "favBtn",
text: "Фавориты",
tooltip: "Добавить на главную",
icon: "sap-icon://add-favorite",
press: zFioriRenderer.favBtn.favFunc }, true, false, ["app","home"]);


more information about add button you can find on api.

Shell toolbar Icon


If you want add button to shell, you cross with few interesting things:

If you you want use right toolbar It support only 3 button!


So, What???


okm if you want do it use jquery!

for exapmle:

onAfterRendering: function(){
var pl = document.getElementById("shell-header-hdr-end");
$(pl).append( "Test" );
var b = new sap.m.Button();
catch (err){



extend method for component sapui5

Fiori, sap ui5


I needed extend sap ui5 component, and use my method after rendering,

How you can use it?

For example

var form = new sap.ui….

«onAfterRendering»: function() {
if (typeof(Top) !== ‘undefined’) {
oPage.scrollTo(0, Top);
}, this);


that really perfect work!



//Create model

var url = ""; //your services url
var OdataInfo = new sap.ui.model.odata.v2.ODataModel(url, true);

//Create success and error function
var suc_func = function(obj){
var er_func = function(obj){

//Create filters
var filt;

function(Filter, FilterOperator) {
filt = new Filter({
path: "areaId",
operator: FilterOperator.EQ,
value1: '0000000116'

//Made Request
var rr ="/MY_INFO",
filters: [filt],
success: suc_func}



Sap Abap!!!


    data: lv_filter_options type /iwbep/t_mgw_select_option .

    lv_filter_options = io_tech_request_context->get_filter( )->get_filter_select_options( ).



if you want create Entity, this we have one secrets ) Thanks for SAP for use our brain to open code

var url = «********/ZSEM_SRV/»;

var OdataInfo = new sap.ui.model.odata.v2.ODataModel( {serviceUrl:url} );

//Create success and error function

var suc_func = function(obj) { debugger; };

var er_func = function(obj) { debugger; };

var oData = { IdSource: «23123», Source: «fdffasdffsadfasdfasdfsadfsdfsdfsfddfsdfsdf», Title: «rrr», Type:»sdf» };

var sPath = ‘/ZSEM_SOURCESet’;

OdataInfo.create(sPath, oData, {success: suc_func, error: er_func});

and now in your class you must use structure for get keys

    try .
        data ls_s type html_sourc.   //<<you must set this or you could have a dump!!!

           es_data    = ls_s
      catch cx_root into data(lo_cx).
        data(lv_t) = lo_cx->get_text( ).

Add custom button on header shell sap ui5

Hi guys I tell you how add custom button on header shell!

So I hope it will be help for you!

setfavbutton: function() {
* ADD Chat Support Button
function onSupportHeaderItemPress() {
var button = new sap.ushell.ui.footerbar.AddBookmarkButton();

var info = »;
var title = »;
var subtitle = »;
var icon = »;

if (icon === «») {
//set default icon
icon = «sap-icon://home»;
var button = new sap.ushell.ui.footerbar.AddBookmarkButton();
title: title, // default: «»
subtitle: subtitle, // default: «»
info: info, // default: «»
icon: icon // default: undefined
// add button to the right side of the shellbar
try {

if (typeof(window.favbutton) === «undefined») {
var oRendererExtensions =‘sap.ushell.renderers.fiori2.RendererExtensions’);
window.favbutton = new‘supportChatBtn’, {
icon: sap.ui.core.IconPool.getIconURI(‘add-favorite’),
tooltip: ‘add to main’,
showSeparator: true,
press: onSupportHeaderItemPress
} catch (err) {;