Skip to content

Instantly share code, notes, and snippets.

View jasper07's full-sized avatar

John Patterson jasper07

View GitHub Profile
@jasper07
jasper07 / sapui5_contacts_crud2.html
Created August 18, 2012 02:02
sapui5:Contacts_crud
<!DOCTYPE html>
<html>
<head>
<meta http-equiv='X-UA-Compatible' content='IE=edge' />
<title>SAPUI5 Contacts Demo</title>
<script id="sap-ui-bootstrap"
type="text/javascript"
src="http://localhost/sapui5/resources/sap-ui-core.js"
data-sap-ui-theme="sap_goldreflection"
data-sap-ui-libs="sap.ui.commons,sap.ui.commons,sap.ui.table,sap.ui.ux3"
@jasper07
jasper07 / gist:3383918
Created August 18, 2012 02:05
abap_gw_contacts_get_entityset
METHOD contacts_get_entityset.
DATA:
lt_contacts TYPE STANDARD TABLE OF zat_contacts,
lra_handle TYPE RANGE OF zat_handle,
lra_firstname TYPE RANGE OF ad_namefir,
lra_lastname TYPE RANGE OF ad_namelas,
lv_property TYPE string.
FIELD-SYMBOLS:
<fs_contacts> LIKE LINE OF lt_contacts,
@jasper07
jasper07 / gist:3383937
Created August 18, 2012 02:15
abap_gw_contacts_delete_entity
ONTACTS_DELETE_EN
@jasper07
jasper07 / gist:3383938
Created August 18, 2012 02:15
abap_gw_contacts_update_entity
METHOD contacts_update_entity.
DATA: ls_contact TYPE zcl_ztest1_mpc=>ts_contac.
DATA: lv_set_exp TYPE string.
*--- get existing value
me->contacts_get_entity(
EXPORTING
iv_entity_name = iv_entity_name
iv_entity_set_name = iv_entity_set_name
iv_source_name = iv_source_name
@jasper07
jasper07 / gist:3383939
Created August 18, 2012 02:16
abap_gw_contacts_get_entity
METHOD contacts_get_entity.
DATA:
ls_key_tab LIKE LINE OF it_key_tab.
READ TABLE it_key_tab INTO ls_key_tab INDEX 1.
SELECT SINGLE *
INTO er_entity
FROM zat_contacts
WHERE handle = ls_key_tab-value.
@jasper07
jasper07 / gist:3395428
Created August 19, 2012 15:10
abap_contacts_create_entity
METHOD contacts_create_entity.
CONSTANTS:
co_folder TYPE string VALUE '/SAP/PUBLIC/ATCONTACTS'.
*--- get the values passed in
io_data_provider->read_entry_data( IMPORTING es_data = er_entity ).
*--- set handle to first 3 letters of firstname and first letter of last name
er_entity-handle = |{ er_entity-firstname(3) }{ er_entity-lastname(1) }|.
@jasper07
jasper07 / UI5MobileOData.html
Created December 27, 2012 01:20
SAPUi5 Mobile OData demo App
<!DOCTYPE html>
<html>
<head>
<meta http-equiv='X-UA-Compatible' content='IE=edge' />
<meta charset="UTF-8">
<title>Mobile OData Demo</title>
<script id='sap-ui-bootstrap'
src='resources/sap-ui-core.js'
@jasper07
jasper07 / base.css
Created July 2, 2013 13:17
Changes to base.css .sapUiTv, .sapUiBtnS #todo-list input:not([type='checkbox']) #filters .sapUiBtnFoc #filters .sapUiSegButtonSelected.sapUiBtnAct.sapUiBtnFoc
html,
body {
margin: 0;
padding: 0;
}
button {
margin: 0;
padding: 0;
border: 0;
@jasper07
jasper07 / gist:6017794
Created July 17, 2013 04:57
Android: Retrieve images from OData Media Link Entry
// cut down version
// for each customer
// retrieve image from OData Media Link Entries (Util.retrieveBitmap)
// store image on file (Util.writeBitmapToFile)
//
// later on when showing customer retrieve image from file (readBitmapFromFile - drawable)
public List<Customer> getCustomers() throws ProxyException {
List<Customer> customers = getContactsSVC().getCustomers();
@jasper07
jasper07 / static_server.js
Last active January 2, 2016 02:39
Node and express serving compressed and cached static sapui5 content
var express = require('express'),
open = require('open'),
app = express(),
port = process.env.PORT || 8888,
sapui5 = '/sapui5',
url = 'http://localhost:' + port + sapui5, // + "/latest";
year = 60 * 60 * 24 * 365 * 1000;
// Use compress middleware to gzip content
app.use(express.compress());