Skip to content

Instantly share code, notes, and snippets.

Avatar

Martin Ceronio mydoghasworms

View GitHub Profile
@mydoghasworms
mydoghasworms / json2data.abap
Created Apr 2, 2012
Very trusting JSON to (deep) ABAP data structure mapper
View json2data.abap
*&---------------------------------------------------------------------*
*& Form json_to_data
*&---------------------------------------------------------------------*
form json_to_data using json type string changing data type any.
data: lv_off type i.
data: lv_len type i.
data: lv_key type string.
data: lv_value type string.
data: lv_char type char1. "Current chacater
data: lv_pchar type char1. "Previous character
@mydoghasworms
mydoghasworms / json2data_test.abap
Created Apr 2, 2012
ABAP code to test JSON to ABAP subroutine
View json2data_test.abap
* Code to test https://gist.github.com/2282070
* Should result in COMP1 structure filled and an entry in COMP2 of LS_DEEP
data: ls_deep type veri_deep1.
json =
'{"COMP1": {"F1": "0123", F5: "ab cd\nef", F7: 20090802, "F8": 23123, "F11": 123.23}, '
& 'COMP2: [{"F1": "0123", F5: "gh ij\nkl", F7: 20090802, "F8": 1000, "F11": 543.23}] }'.
perform json_to_data using json ls_deep.
@mydoghasworms
mydoghasworms / json_util.abap
Last active Nov 30, 2020
ABAP Utility class for mapping JSON to ABAP data and vice versa - Rather use https://gist.github.com/mydoghasworms/4888a832e28491c3fe47
View json_util.abap
* Rather use https://gist.github.com/mydoghasworms/4888a832e28491c3fe47
* The alternative is a better parser although it is not an emmitter)
*----------------------------------------------------------------------*
* CLASS json_util DEFINITION
*----------------------------------------------------------------------*
class json_util definition.
public section.
class-methods:
data_to_json importing data type any
returning value(json) type string,
@mydoghasworms
mydoghasworms / json2data.abap
Created Apr 4, 2012 — forked from rplantiko/json2data.abap
Corrected unit test for deep structure
View json2data.abap
REPORT ZZ_TEST_JSON_MYDOG.
*
class lcl_test definition for testing " #AU Risk_Level Harmless
inheriting from cl_aunit_assert. " #AU Duration Short
private section.
methods :
test_string for testing,
test_number for testing,
@mydoghasworms
mydoghasworms / ZABAPSRC_SOLR_INDEX.abap
Created Oct 2, 2012
Program to index ABAP source code to a Solr index server
View ZABAPSRC_SOLR_INDEX.abap
*&---------------------------------------------------------------------*
*& Report ZABAPSRC_SOLR_INDEX
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT ZABAPSRC_SOLR_INDEX.
@mydoghasworms
mydoghasworms / AutoHotkey.ahk
Created Jul 24, 2013
AutoHotKey script that toggles the "Use a proxy server for your LAN" switch in WIndows
View AutoHotkey.ahk
^!p::
RegRead, ProxyOn,HKEY_CURRENT_USER,Software\Microsoft\Windows\CurrentVersion\Internet Settings,ProxyEnable
if (ProxyOn=1) {
ProxyOn = 0
ProxyState = Off
} else {
ProxyOn = 1
ProxyState = On
}
RegWrite, REG_DWORD,HKEY_CURRENT_USER,Software\Microsoft\Windows\CurrentVersion\Internet Settings,ProxyEnable,%ProxyOn%
@mydoghasworms
mydoghasworms / signal_slot.rb
Created Dec 12, 2013
Ruby and Qt; using 'qtbindings' example of using signals and slots, demonstrating how to use parameter-less, simple and class-parameter for sending signals.
View signal_slot.rb
require 'Qt'
# The class that will act as the receiver
class A < Qt::Object
slots :receive, 'receive_int(int)', 'receive_path(QString)'
def receive
puts 'event received'
end
@mydoghasworms
mydoghasworms / post_acc_doc.rb
Last active Jul 23, 2019
Example of using Ruby nwrfc gem to post documents to an SAP ECC system using BAPI_ACC_DOCUMENT_POST
View post_acc_doc.rb
#!/usr/bin/ruby
require 'nwrfc'
require 'logger'
include NWRFC
# This is an example of a Ruby script using the nwrfc gem to post Accounting documents to
# an SAP ECC system using BAPI_ACC_DOCUMENT_POST. You can obviously easily adapt it to
# your needs
@mydoghasworms
mydoghasworms / index.html
Last active Aug 29, 2015
Indexing and searching SAPI PI message payloads with a Ruby retrieval script and an HTML page
View index.html
<!DOCTYPE html>
<html>
<!--
This provides a simple, single-purpose search front-end for the an Elasticsearch index containing
SAP PI message payloads that were indexed with the accompanying script. For more information, visit
http://ceronio.net/2014/08/sap-pi-message-payload-search-using-elasticsearch/
-->
<head>
@mydoghasworms
mydoghasworms / turbol.reb
Last active Sep 12, 2017
Little Rebol program that demonstrates using 'parse' to interpret some rudimentary Logo commands with a turtle and visual interface
View turbol.reb
REBOL [
title: "Rudimentary implementation of Logo Turtle"
date: 2015-02-16
author: "Martin Ceronio"
]
{ Load the turtle image; you can find the original at https://edu.kde.org/images/icons/kturtle_32.png Thanks, KTurtle! }
turtle-img: do to-string debase
{bWFrZSBpbWFnZSEgWzMyeDMyICN7CjAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAowMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAKMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwCjAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAowMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAxMDAwNjdBMDcwNjdBMDcwNjdBMDcwNjdBMDcKMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwCjAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAowMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAxMDAwNjdBMDcwNjdBMDcKMDY3QTA3MDY3QTA3MDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMD