Skip to content

Instantly share code, notes, and snippets.

View svict4's full-sized avatar
🏦
shilling crypto

Simon Victory svict4

🏦
shilling crypto
View GitHub Profile
@svict4
svict4 / valueFromContextNode.abap
Created January 17, 2018 08:53
ABAP SAP CRM - Get value from Context Node
DATA: lr_entity TYPE REF TO if_bol_bo_property_access.
lr_entity ?= me->typed_context->btadminh->collection_wrapper->get_current( ).
CHECK lr_entity IS BOUND.
IF lr_entity->get_property_as_string( iv_attr_name = 'PROCESS_TYPE' ) = 'process type here'. "added process type check, can never be too careful
ENDIF.
@svict4
svict4 / appendNodeToCollection.abap
Created January 17, 2018 08:55
ABAP SAP CRM - Add node to a collection
DATA: lr_entity TYPE REF TO if_bol_bo_property_access,
lr_node TYPE REF TO cl_bsp_wd_value_node,
lr_col TYPE REF TO if_bol_bo_col,
lr_node_struc TYPE REF TO <structure of your node>.
TRY.
lr_col ?= me->typed_context->node->collection_wrapper.
lr_col->clear( ).
CREATE DATA lr_node_struc.
@svict4
svict4 / instructions.md
Last active January 17, 2018 09:18
ABAP SAP CRM - Create a Tree Table

Your context node class’ inheritance must be changed to: CL_BSP_WD_CONTEXT_NODE_TREE.

image

You then must redefine the β€œRefresh” method and write similar code to the following:

DATA: lr_value_node TYPE REF TO cl_bsp_wd_value_node,
      lr_iterator TYPE REF TO if_bol_bo_col_iterator,
 lr_root TYPE REF TO if_bsp_wd_tree_node.
@svict4
svict4 / reportStructure.abap
Created January 17, 2018 09:19
ABAP SAP CRM - Standard Report Program structure
REPORT Z_REPORT_PROGRAM_1.
*--------------------------------------------------------------------*
* Data declarations
*--------------------------------------------------------------------*
*--------------------------------------------------------------------*
* LOAD-OF-PROGRAM
* This is essentially the program's constructor.
*--------------------------------------------------------------------*
@svict4
svict4 / SAPCRMClassesAndFMs.md
Last active November 15, 2024 06:26
Cheat Sheet of Classes/Function Modules, Transaction Codes and Views in SAP CRM

Classes and Function Modules

Name Type Description Purpose
cl_scmg_case_api CL Case: API A useful API class for performing operations against CRM Cases. This class implements the IF_SCMG_CASE_API interface.
rh_struc_get FM Read Structures A function module useful for reading the Organisation structure based on the Evaluation path and object you provide it. An example is that you can determine a user's organisational heirarchy.
end_time_determine FM Calendar: Determine end date and time A function module that will determine the end date based off the duration you provide (also depends on Calendar. E.g. working calendar).
if_crm_ui_navigation_service IF Navigation Service
cl_crm_ui_navigation_service CL Navigation Service
cl_crm_ui_descriptor_obj_srv CL Creation Service
@svict4
svict4 / a.md
Last active May 6, 2018 12:47
accessible aria-label header links in div-ul-li-a table

An accessible way to listen to the newly sorted headers of a horrible data table/list structure like so:

<div>
    <dl>
        <ul>
            <li>
                <a></a>
            </li>
        </ul>
@svict4
svict4 / canvas-discussion-forum-exporter.py
Created August 13, 2019 03:05
Exports Canvas LMS discussion forums and comments/replies/entries
# I'm surprised this doesn't already exist
# Just add Institute, Course ID and your bearer token
# check settings, default only selects threads which are 'closed for comments'
import requests
import json
import urllib.request
# Define the Canvas Discussion Variable
@svict4
svict4 / elmo.curl
Last active May 16, 2023 00:34
Save time
# you need the quiz id, question number
curl "https://elmocoursebuilder.com.au/lmsAssess/getResult/id/Zp6Vg6U=/uid/8097/mid/235/cid/221/sd/ahri.elmotalent.com.au/newPlayer/" -H "Accept: application/json, text/javascript, */*; q=0.01" -H "Origin: https://elmocoursebuilder.com.au" -H "X-Requested-With: XMLHttpRequest" -H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36" -H "Sec-Fetch-Mode: cors" -H "Content-Type: application/x-www-form-urlencoded; charset=UTF-8" --data "point=10^&remainingAttempts=-1" --compressed
@svict4
svict4 / isSubjectToMoratorium.js
Created December 10, 2019 02:19
AGPT General/Rural Pathway Eligibility Flow
// determine if OTD and FGAMS applicants are subject to Section 19AB of the Health Insurance Act 1973
// https://www.agpt.com.au/ArticleDocuments/185/AGPT-Eligibility-Guidelines-2020-Pathway.pdf.aspx
// Conditions
// a You obtained your medical qualification overseas
// b ANZ citizen when you enrolled in your medical degree and current resident
// c By Feb 2020 you have been medically registered for 10 years or more
// e Assessed as eligible to sit AMC examinations prior to 1 Jan 1997
@svict4
svict4 / decrypt.py
Created December 13, 2019 01:23
ASIO 70th Anniversary 2019 50c Uncirculated Coin: Coincryption Competition
# this code is shit πŸ’©
# and probably more unreadable than ths cipher πŸ˜…
import string
COIN = ['UWGJM', 'MNLQH', 'DFREA', 'JZLHI', 'GGHHQ', 'UTUJN', 'GNKYF', 'VNVLQ',
'MZZRQ', 'TLBTA', 'OSZHU', 'PKWKV', 'FZDTX', 'VTYGV', 'UIOKQ', 'IYQNU',
'TWUWB', 'DYOLF', 'AXMPD', 'GMRTY', 'NZGIS', 'GUQXN', 'AEOMI', 'HWBKE']
OTP = ['MWPZJ', 'FUBVM', 'FQICV', 'ZTAFD',
'ZCZLJ', 'SNYMT', 'CSXIG', 'ZTXKJ',