Skip to content

Instantly share code, notes, and snippets.

View maximgatilin's full-sized avatar

Maxim Gatilin maximgatilin

  • @hh.ru
View GitHub Profile
@maximgatilin
maximgatilin / filter.js
Created March 13, 2017 13:46
Simple Filter #tags:fiori
sap.ui.define([
"sap/ui/core/mvc/Controller",
"sap/ui/model/json/JSONModel",
"sap/ui/demo/wt/model/formatter",
"sap/ui/model/Filter",
"sap/ui/model/FilterOperator"
], function (Controller, JSONModel, formatter, Filter, FilterOperator) {
"use strict";
return Controller.extend("sap.ui.demo.wt.controller.InvoiceList", {
formatter: formatter,
@maximgatilin
maximgatilin / oneway.js
Last active March 14, 2017 06:37
One way data binding #tags:fiori
var oModel = new sap.ui.model.json.JSONModel({
firstName : "Harry",
lastName : "Hawk",
enabled : true,
panelHeaderText : "Data Binding Basics"
});
oModel.setDefaultBindingMode(sap.ui.model.BindingMode.OneWay);
// Assign the model object to the SAPUI5 core
sap.ui.getCore().setModel(oModel);
// Существует односторонняя и двухсторонняя связь, её можно указать для модели или для конкретной связки.
@maximgatilin
maximgatilin / bind.js
Created March 14, 2017 07:33
Bind Element to Model #tags:fiori
// XML view
// <Panel id="productDetailsPanel" headerText="{i18n>panel4HeaderText}" class="sapUiResponsiveMargin" width="auto">
// <l:Grid defaultSpan="L3 M6 S12" containerQuery="true">
// <Label text="{i18n>ProductID}:" />
// <Input value="{products>ProductID}" />
// <Label text="{i18n>ProductName}:" />
// <Input value="{products>ProductName}" />
// <Label text="{i18n>QuantityPerUnit}:" />
{
"message": "HTTP request failed",
"headers": [],
"statusCode": 500,
"statusText": "Internal Server Error",
"responseText": "{\"error\":{\"code\":\"0050569259751EE4BA9710043F8A5115\",\"message\":{\"lang\":\"ru\",\"value\":\"In the context of Data Services an unknown internal server error occurred\"},\"innererror\":{\"transactionid\":\"C06ED5070E3C11E7FFFFFFFFEF667C44\",\"timestamp\":\"20170321151546.4267120\",\"Error_Resolution\":{\"SAP_Transaction\":\"Run transaction /IWFND/ERROR_LOG on SAP Gateway hub system (System Alias ) and search for entries with the timestamp above for more details\",\"SAP_Note\":\"See SAP Note 1797736 for error analysis (https://service.sap.com/sap/support/notes/1797736)\"}}}}"
}
@maximgatilin
maximgatilin / request.txt
Last active March 22, 2017 08:04
request
--batch_40de-1581-c00b
Content-Type: application/http
Content-Transfer-Encoding: binary
GET ZTMOTI_DLV_STATSet/$count HTTP/1.1
sap-contextid-accept: header
Accept: text/plain, */*;q=0.5
Accept-Language: ru-RU
DataServiceVersion: 2.0
MaxDataServiceVersion: 2.0
@maximgatilin
maximgatilin / response.txt
Last active March 22, 2017 08:05
response
--D6B834707881ECCF13B8A7C976EECDF90
Content-Type: application/http
Content-Length: 20298
content-transfer-encoding: binary
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 20105
dataserviceversion: 2.0
sap-metadata-last-modified: Tue, 21 Mar 2017 14:32:02 GMT
@maximgatilin
maximgatilin / gist:e14fe36973803b7e6be4d10a7550073c
Created April 4, 2017 12:24
Uninstall npm modules from bash
npm uninstall `ls -1 node_modules | tr '/\n' ' '`
<?xml version="1.0" encoding="utf-8"?><error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"><code>/IWBEP/CM_MGW_RT/021</code><message xml:lang="ru">Method 'ZRA_ITEMS_OFFSET_GET_ENTITYSET' not implemented in data provider class.</message><innererror><application><component_id/><service_namespace>/SAP/</service_namespace><service_id>ZRA_ODATA_SERVICE_SRV</service_id><service_version>0001</service_version></application><transactionid>2EF05B94235011E7C90B000070670541</transactionid><timestamp>20170417093346.2730000</timestamp><Error_Resolution><SAP_Transaction>Run transaction /IWFND/ERROR_LOG on SAP Gateway hub system and search for entries with the timestamp above for more details</SAP_Transaction><SAP_Note>See SAP Note 1797736 for error analysis (https://service.sap.com/sap/support/notes/1797736)</SAP_Note></Error_Resolution><errordetails><errordetail><code>/IWBEP/CX_MGW_NOT_IMPL_EXC</code><message>Method 'ZRA_ITEMS_OFFSET_GET_ENTITYSET' not implemented in data provider class</message><p
Content-Length: 107854
content-transfer-encoding: binary
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 107754
dataserviceversion: 2.0
{"d":{"results":[{"__metadata":{"id":"http://194.87.32.240:8000/sap/opu/odata/sap/ZRA_ODATA_SERVICE_SRV/ZRA_ITEMS_OFFSet('001')","uri":"http://194.87.32.240:8000/sap/opu/odata/sap/ZRA_ODATA_SERVICE_SRV/ZRA_ITEMS_OFFSet('001')","type":"ZRA_ODATA_SERVICE_SRV.ZRA_ITEMS_OFF"},"Id":"001","Memo":"MEMO","Picture":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA+gAAAPoCAYAAABNo9TkAAAABmJLR0QA/wD/AP+gvaeTAAAgAElEQVR4nOzde5hdZXn//8+9nr0HkgAegCSAqFQDmYwIWCoeUQ5qPSFgRQmgosDkoGnV2tra2vHQk/3W1sDMniEq/jhKkH4VtR5AQayKNa3GuPeeCILHyikUD0DI7LXu3x/gV0Gyc5qZe62936/r8rqstfCubZL9mfXsZ0kAAAAAACCcRQcAANAvauOto+V+rMx2d/d5Mg3IbU+Z1SR/lFyZpMe4lJn8Ub/5n7SapD0f4S+5p6Taw/61jqRfPsK/95eSd377X3DZz03WkfznkrbI7B653yvz+032cxXeKWQ/l2mLud0jK+6RZb+worg7S9ndWzqdu7V7/W69cfEj/f0AAMAOYqADADBLUqP1dUnPiO6YAbmku3/rH/8r2d2S321udxemW01+u5nfYfKfTVl2u3522x0aOabT/S8LAEB/YaADADAbxluLkut70Rklc4ebbjfXHZL/j8nuKKQ7
{
"_version": "1.1.0",
"sap.app": {
"_version": "1.1.0",
"id": "retail.store.productlookups1.RT_PROD_LKPS1Extension",
"type": "application",
"applicationVersion": {
"version": "1.0"
},
"title": "{{SHELL_TITLE}}",