Skip to content

Instantly share code, notes, and snippets.

View njames's full-sized avatar

Nigel James njames

View GitHub Profile
@njames
njames / base-reveal.js.html
Last active December 10, 2015 23:31
Base file for Reveal.js presentation using markdown
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Using reveal.js with external markdown</title>
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<link rel="stylesheet" href="/js/reveal.js/css/reveal.css"/>
<style type="text/css">code{white-space: pre;}</style>
@njames
njames / navigate_bol.abap
Last active December 16, 2015 07:48
example on how to navigate the bol
DATA:
lr_core TYPE REF TO cl_crm_bol_core
, lr_entity TYPE REF TO cl_crm_bol_entity
, lv_partner_guid TYPE bu_partner_guid
, lv_object_guid TYPE crmt_object_guid
.
** get guid and navigate to the partner and get Description_name
current->get_property_as_value( EXPORTING iv_attr_name = 'CRM_GUID'
@njames
njames / logo.php
Created April 17, 2013 00:33
SAP Inside Track Logo Generator
<?php
/**
* @author Nigel James
* @email nigel.james@sapinsidetrack.org
* @date 15 Apr 2013
*
* Create an image for SAP Inside Track events with Year and City
*/
function LoadPNG($pngName)
@njames
njames / size_bol_collection.abap
Last active December 17, 2015 01:48
Determine the size of a BOL collection
* the last two buttons are displayed only if there is data in the table
lv_btn_enabled = abap_true.
lv_col_wrapper = typed_context->builactivity->collection_wrapper.
IF lv_col_wrapper->size( ) > 0.
lv_btn_enabled = abap_false.
ENDIF.
REPORT z_hello_datetime.
data:
dt type REF TO zcl_datetime
, fs type string
, ts type timestamp
.
get time STAMP FIELD ts.
@njames
njames / ABAP_compare_set.abap
Last active December 17, 2015 15:29
Two ways of comparing a set of values in ABAP.
METHOD ENABLE_OCA_BUTTONS.
DATA: lv_status TYPE j_estat
, lo_current TYPE REF TO if_bol_bo_property_access
, table_rows TYPE i
.
FIELD-SYMBOLS: <status> type RSDSSELOPT.
* default condition to false and change if in correct status
@njames
njames / Types_include.abap
Created May 23, 2013 03:11
Example of including a structure with a types command in ABAP
TYPES: BEGIN OF line,
date_from TYPE d,
time_from TYPE t,
date_to TYPE d,
time_to TYPE t.
INCLUDE TYPE crmst_date_btil.
TYPES: END OF line.
CREATE DATA rv_sample TYPE line.
@njames
njames / copy_structure.abap
Created December 13, 2013 05:25
copy from one structure to another copy of the same structure and only overwrite the new items
METHOD copy_structure .
* parameters
* i_new type any
* i_old type any
* final - changing type any
* copy by component only if the new value is populated else take
* the existing component
DATA: _componentno TYPE i VALUE 0
.
@njames
njames / get_assignement_group.abap
Created August 14, 2019 05:02
example code for integrating into service now from fiori
method get_assignment_group.
data: uri type string
, group type ref to data
, group_row type ref to data
, group_name type string
, response type ref to if_rest_entity
.
* read the group name from config * hard coded from now