Skip to content

Instantly share code, notes, and snippets.

View fleischr's full-sized avatar

Ryan Fleischmann fleischr

View GitHub Profile
@fleischr
fleischr / sapui5-get-bound-js-object.js
Created January 8, 2024 21:04
Get JSON object bound to a SAPUI5 element
//get the binding for json object
oEvent.getSource().getBindingContext().getObject();
//get the binding for the json object for a specific model
oEvent.getSource().getBindingContext("modelName").getObject();
@fleischr
fleischr / getsubjectaccountdetails.txt
Last active January 13, 2023 16:50
How to retrieve the subject account details for PRVD Shuttle workgroup
# Authenticate if you havent already
prvd authenticate
# Navigate to the workgroup
prvd baseline subject-accounts list
# copy the relevant subject account id for your scenario (ex: subject_account_id in protocol message)
# ought to be sha256 hash of workgroup.organization
@fleischr
fleischr / refreshtokengenerate.txt
Created January 12, 2023 17:28
Generate a PRVD refresh token
#Enter the following commands in command line after creating a workflow in Shuttle
#More info on https://docs.provide.services/api/quickstart/cli-quickstart
#Authenticate using credentials you created in Shuttle
prvd authenticate
#Find the organization ID you created in Shuttle
prvd organizations list
#Generate a refresh token to a file
report zwritebinaryfiletohttp.
part = client->request->add_multipart( ).
CALL METHOD part->set_header_field
EXPORTING
name = 'content-disposition'
report zreadfilefromuri.
DATA:
lo_http_client TYPE REF TO IF_HTTP_CLIENT.
DATA:
lv_str TYPE XSTRING,
lv_i TYPE I.
CALL METHOD cl_http_client=>create_by_url
report zreadfromappserver.
*originally posted on https://blogs.sap.com/2020/03/19/read-an-excel-file-from-al11-directory/
*Introduction :
*There are scenarios where the user will upload a file in the Application Server which needs to be consumed to manipulate that data (such as updating in a table or sending it as a mail). In that case, we can use the DATASET to read the file in the Application Server.
*Problem Statement:
*The user uploads an Excel File in the Application Server. That Excel file is picked from the list of files in the Application server and stored in an internal table and then the data is uploaded to a custom table in SAP.
REPORT ztest_download.
"&-------------------------------------------------------------*
"& Declarations
"&-------------------------------------------------------------*
TYPES: BEGIN OF ty_pa0001,
pernr TYPE pa0001-pernr,
bukrs TYPE pa0001-bukrs,
werks TYPE pa0001-werks,
persg TYPE pa0001-persg,
ename TYPE pa0001-ename,
REPORT zdynamic.
DATA: struct_type TYPE REF TO cl_abap_structdescr, "Structure
table_type TYPE REF TO cl_abap_tabledescr,"Table type
dataref TYPE REF TO data. "Dynamic data
*-Component Table and Work area
DATA: comp_tab TYPE cl_abap_structdescr=>component_table,
comp_wa LIKE LINE OF comp_tab.
FIELD-SYMBOLS: <t_table> TYPE STANDARD TABLE,
REPORT ZTEST_SELECTION_SCREEN.
CONSTANTS : rbSelected TYPE c LENGTH 1 VALUE 'X'.
DATA : p_txt type c LENGTH 100.
SELECTION-SCREEN BEGIN OF BLOCK frame1 WITH FRAME TITLE text-001.
SELECTION-SCREEN ULINE /10(40).
SELECTION-SCREEN BEGIN OF LINE.
@fleischr
fleischr / README.txt
Created March 18, 2022 03:36
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.7+commit.e28d00a7.js&optimize=false&runs=200&gist=
REMIX EXAMPLE PROJECT
Remix example project is present when Remix loads for the very first time or there are no files existing in the File Explorer.
It contains 3 directories:
1. 'contracts': Holds three contracts with different complexity level, denoted with number prefix in file name.
2. 'scripts': Holds two scripts to deploy a contract. It is explained below.
3. 'tests': Contains one test file for 'Ballot' contract with unit tests in Solidity.
SCRIPTS