Skip to content

Instantly share code, notes, and snippets.

View weiserman's full-sized avatar

Warren Eiserman weiserman

View GitHub Profile
@weiserman
weiserman / ZCL_BRF2SQL_DERIVATION.abap
Created November 25, 2026 19:03
Convert BRF+ rule to Dynamic SQL
CLASS zcl_brf2sql_derivation DEFINITION
PUBLIC
FINAL
CREATE PUBLIC.
*----------------------------------------------------------------------*
* ZCL_BRF2SQL_DERIVATION - BRF+ derivation rule as dynamic ABAP SQL
*
* Alternative to the generated CDS view: no repository object is
* created. At runtime the BRF+ rule is read and turned into SQL text:
@weiserman
weiserman / ZBRF2CDS_GENERATE.abap
Created November 25, 2026 11:18
Generate a CDS based on BRF+ rule
*&---------------------------------------------------------------------*
*& ZBRF2CDS_GENERATE
*&
*& Generates a CDS view entity from an existing BRF+ rule.
*& No BRF+ objects are created or changed; the rule is only read.
*&
*& Selection screen
*& P_RULE ID of the BRF+ rule (32 characters, from the BRF+ workbench)
*& P_CDS name of the CDS view entity to create or overwrite
*& P_PACK package for the view ($TMP needs no transport)
@weiserman
weiserman / gist:4e4b45316599b4fbd1cf392eb6a35ed2
Created November 25, 2026 11:03
zcl_mdg_brf_demo1.abap
CLASS zcl_mdg_brf_demo DEFINITION
PUBLIC
FINAL
CREATE PUBLIC.
*----------------------------------------------------------------------*
* ZCL_MDG_BRF_DEMO - Demo: MDG derivation rule in BRF+ -> CDS view
*
* Purpose
* End-to-end demo of the BRF+ to CDS converter. Run it with F9 in ADT
@weiserman
weiserman / ZBRF.abap
Created October 29, 2026 14:23
ABAP to read BRF Plus rule
"! BRF+-backed implementation of YIF_MATDET_OFFSET_RULE. The
"! valid-from offset (in days) depends on the record's NEW/SUCCESSOR
"! classification:
"! NEW -> fixed 0 days (effective immediately, no BRF+ lookup)
"! SUCCESSOR -> read from the BRF+ decision table behind function
"! GET_VALID_FROM_OFFSET (application YMDG_MATDET,
"! per Sales Org, maintained in tx BRFPLUS). The
"! predecessor record is auto-end-dated by standard
"! condition maintenance at the successor's start - 1
"! (same condition key).
@weiserman
weiserman / z_custom_error_rate.abap
Created October 11, 2026 04:32
Automation error rate
REPORT z_custom_error_rate.
TABLES: tbtco, apqi, swwwihead.
*----------------------------------------------------------------------*
* Selection Screen
*----------------------------------------------------------------------*
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE TEXT-001.
" Default to the last 30 days to prevent full table scans
SELECT-OPTIONS: s_date FOR tbtco-enddate OBLIGATORY DEFAULT sy-datum - 30 TO sy-datum.
@weiserman
weiserman / zcl_prc_ntf_provider.abap
Created October 10, 2026 19:53
ABAP Process Center: Notification Provider
CLASS zcl_prc_ntf_provider DEFINITION
PUBLIC FINAL
CREATE PUBLIC.
PUBLIC SECTION.
INTERFACES /iwngw/if_notif_provider.
CONSTANTS c_provider_id TYPE /iwngw/if_notif_provider=>ty_s_provider-id VALUE 'ZPRC_NOTIF_PROVIDER'.
CONSTANTS c_type_version TYPE /iwngw/if_notif_provider=>ty_s_notification-type_version VALUE '1'.
@weiserman
weiserman / ABAP PRC.md
Created September 28, 2026 12:21
ABAP Processing Errors - Issues and Workarounds

ABAP-PRC on s4-2025: installation findings and fixes

System: S/4HANA 2025 (SAP_BASIS 816), client 100. Repository: https://github.com/brandeis-consulting/abap-prc (v0.1.0 + commit e6d006f "Improved jobs"). Status on 2026-09-28: core + demo installed and working; one open issue (#15).


A. Installation problems and how they were solved

@weiserman
weiserman / zcl_equip_scan.abap
Created August 22, 2026 09:31
Equipment Scan
CLASS zcl_equip_scan DEFINITION PUBLIC.
PUBLIC SECTION.
INTERFACES z2ui5_if_app.
TYPES:
BEGIN OF ty_s_issue,
issue_id TYPE string,
problem_text TYPE string,
severity TYPE string,
@weiserman
weiserman / YVB11_MAT_SUB_LOADER.abap
Created June 17, 2026 11:34
Condition Record Save (ABAP)
*&---------------------------------------------------------------------*
*& Report YVB11_MAT_SUB_LOADER
*&---------------------------------------------------------------------*
*& Material determination (VB11) loader using RV_MAT_SUB_SAVE.
*&
*& What this does:
*& - Allocates a fresh KNUMH from number range object KOND
*& - Builds VAKEDB (variable key) for condition table KOTD001
*& - Builds KONDDVB (substitution material + reason) row
*& - Builds KONDDPVB (additional substitution materials) — empty in
@weiserman
weiserman / ABAP Trial
Created April 7, 2026 11:53
SAP_Developer_Edition_Setup_Guide.md
# SAP ABAP Cloud Developer Trial 2023 — Docker Setup Guide
**Image:** `sapse/abap-cloud-developer-trial:2023`
**Add-on:** ABAP Accelerator MCP Server (AI-assisted development via Amazon Q Developer / Kiro)
**Environment:** Mac Studio → Docker Desktop (macOS) + SAP GUI for Windows via Parallels
**Last updated:** April 2026
---
## Prerequisites