Skip to content

Instantly share code, notes, and snippets.

View mbtools's full-sized avatar
📦
Busy building apm 😀

Marc Bernard mbtools

📦
Busy building apm 😀
View GitHub Profile
@mbtools
mbtools / zcl_abapgit_object_bobf.abap
Created April 22, 2025 09:02
Basic concept for BOBF implementation (abapGit v1.131.0)
* This is an *untested and incomplete* implementation for supporting Business Object Models in abapGit
* It's based on https://github.com/abapGit/abapGit/issues/165
* The syntax works with the developer version of abapGit v1.131.0 and SAP Basis 7.50 or higher
*
* To add this to core abapGit, the following todos must be completed:
* - Syntax downport to 7.02
* - Replace all /BOPF/* classes and DDIC with dynamic ABAP (they don't exist in 7.02)
* - Add error handling (evaluate EO_MESSAGE of BOPF calls)
* - Add test case to https://github.com/abapGit-tests
@mbtools
mbtools / ztest_abapgit_hash.abap
Created March 14, 2024 10:13
Test of HASH algorithm in abapGit
REPORT ztest_abapgit_hash.
PARAMETERS url TYPE string LOWER CASE.
DATA(raw) = zcl_abapgit_convert=>string_to_xstring_utf8( url ).
DATA(hash) = zcl_abapgit_hash=>sha1_raw( raw ).
WRITE:
/ url,
@mbtools
mbtools / zsysinfo.abap
Created March 14, 2024 10:10
ABAP System Info
REPORT zsysinfo.
TYPES:
BEGIN OF ys_info,
attname TYPE string,
attvalue TYPE string,
END OF ys_info,
yt_info TYPE STANDARD TABLE OF ys_info.
START-OF-SELECTION.
@mbtools
mbtools / zrepair_oo_shorttexts.abap
Created September 4, 2023 18:25
Check and repair program to address inconsistencies caused by abapGit deserializing of classes and interfaces
*&---------------------------------------------------------------------*
*& Report ZREPAIR_OO_SHORTTEXTS
*&---------------------------------------------------------------------*
*& Check and repair program to address inconsistencies caused by
*& abapGit deserializing of classes and interfaces
*&
*& See https://github.com/abapGit/abapGit/issues/6442
*&---------------------------------------------------------------------*
REPORT zrepair_oo_shorttexts.
@mbtools
mbtools / zabapgit_background_mode.abap
Created August 10, 2023 15:38
Run background logic for selected abapGit repositories
REPORT zabapgit_background_mode.
DATA lv_repo TYPE c LENGTH 60.
SELECT-OPTIONS so_repo FOR lv_repo OBLIGATORY.
INITIALIZATION.
%_so_repo_%_app_%-text = 'abapGit Repositories'.
FORM run.
@mbtools
mbtools / z_all_abap.abap
Last active June 4, 2023 17:07
List of all ABAP statements from https://github.com/abaplint/abaplint/tree/main/packages/core/test/abap/statements (pretty-printed and identifiers changed so they don't match any keywords)
*&---------------------------------------------------------------------*
*& Report Z_ALL_ABAP
*&---------------------------------------------------------------------*
*& All ABAP statements from
*& https://github.com/abaplint/abaplint/tree/main/packages/core/test/abap/statements
*&---------------------------------------------------------------------*
REPORT z_all_abap.
ADD 2 TO lv_foo.
@mbtools
mbtools / zabapgit_adjust_code.abap
Created April 20, 2023 15:40
Adjust method implementations for abapGit serializer classes
*&---------------------------------------------------------------------*
*& Report ZABAPGIT_ADJUST_CODE
*&---------------------------------------------------------------------*
*& Adjust method implementations for abapGit serializer classes
*&---------------------------------------------------------------------*
REPORT zabapgit_adjust_code.
PARAMETERS p_test AS CHECKBOX DEFAULT 'X'.
CLASS lcl_code DEFINITION.
@mbtools
mbtools / zcl_abapgit_syntax_po.clas.abap
Created April 5, 2023 11:08
PO Syntax Highlighter
CLASS zcl_abapgit_syntax_po DEFINITION
PUBLIC
INHERITING FROM zcl_abapgit_syntax_highlighter
CREATE PUBLIC.
PUBLIC SECTION.
CONSTANTS:
BEGIN OF c_css,
keyword TYPE string VALUE 'keyword',
@mbtools
mbtools / zvsi_test.abap
Created December 5, 2022 14:08
Test of the ABAP Virus Scan Interface (EICAR.EXE)
*----------------------------------------------------------------------*
* Test of the ABAP Virus Scan Interface *
*----------------------------------------------------------------------*
REPORT zvsi_test.
TYPE-POOLS:
abap.
DATA:
gf_rc TYPE i,
@mbtools
mbtools / zabapgit_repo_labels.abap
Created November 4, 2022 15:42
Tool for mass maintenance of abapGit repository labels
REPORT zabapgit_repo_labels.
********************************************************************************
* The MIT License (MIT)
*
* Copyright (c) 2022 abapGit Contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights