Open Source Contribution: This project is community-driven and Open Source! 🚀
If you spot a bug or have an idea for a cool enhancement, your contributions are more than welcome. Feel free to open an Issue or submit a Pull Request.
- ABAP Point Gate
- Prerequisites
- License
- Contributors-Developers
- Motivation for Creating the Repository
- Key Technical Features
- Usage Examples
- Design Goals-Features
- Changelog
- Roadmap
ABAP Point Gate is a configuration-driven framework designed to decouple custom enhancements from standard SAP objects, ensuring a clean and maintainable architecture. By leveraging Dependency Injection and Type-Safe Context management, it enables seamless unit testing and granular, hierarchical control over enhancement execution.
- SAP S/4HANA 2021 (or higher) OR SAP BTP ABAP Environment.
- XCO library availability
This project is licensed under the MIT License.
The repository was created by George Drakos.
ABAP Point Gate to provide a standardized “gate” around ABAP exit points/enhancements, so custom logic stays isolated from the SAP core instead of being scattered across standard objects. This helps keep the system clean, maintainable, and upgrade-friendly, while offering a consistent way to implement enhancements that aligns with Clean Core / ABAP Cloud readiness practices and encourages quality through automated checks (e.g. abaplint) and unit testing.
- Hierarchical Activation: Control execution at both Point and Gate levels.
- Type-Safe Context: Easily pass and retrieve data with built-in type-safe getters.
- Dependency Injection: Built-in support for Mocking handles and configurations for Unit Testing.
- High Performance: Uses Hashed Tables (
$O(1)$ complexity) for context and configuration lookups. - Clean ABAP: Leverages modern 7.40+ syntax and robust exception handling.
⚙️ Hierarchical Activation Logic
ABAP Point Gate supports a sophisticated activation model:
- Status 'X': Globally Active.
- Status 'C' (Custom): Evaluation via a Custom Activation Class.
- Parent-Child Rule: If the Point is inactive (or its custom toggle returns false), none of its assigned Gates will execute, regardless of their individual status.
Prepare the data environment before triggering a gate.
DATA(lo_context) = NEW zcl_apg_context( ).
lo_context->set_data( i_name = 'BKPF' i_value = lr_bkpf ).
lo_context->set_data( i_name = 'STRING' i_value = REF #( 'TEST_STRING' ) ).
lo_context->set_data( i_name = 'DATE' i_value = REF #( syst-datum ) ).
lo_context->set_data( i_name = 'INTEGER' i_value = REF #( '123' ) ).Trigger the execution logic. The framework automatically identifies and runs all active handlers.
TRY.
" 2. Call the Gate
" The Point ID 'SAMPLE_SAVE_BEFORE' must be configured in table ZAPG_POINT
zcl_apg_execution=>execute_gate(
EXPORTING
i_point_id = 'SAMPLE_SAVE_BEFORE'
i_context = lo_context
CHANGING
co_message_container = lt_msg_cont ).
CATCH zcx_apg_error INTO DATA(lx_apg).
" Handle framework errors (e.g., configuration missing, instantiation failed)
MESSAGE lx_apg TYPE 'E'.
ENDTRY.Retrieve modified data or parameters without manual casting.
TRY.
" A. Check for validation messages returned by handlers
IF line_exists( lt_msg_cont[ type = 'E' ] ).
" Handle errors (e.g., abort save, show log)
ENDIF.
" B. Retrieve potentially modified data
" If a handler modified the data, we can get the updated reference back
lo_context->get_data( EXPORTING i_name = 'BKPF' IMPORTING e_value = DATA(lr_changed_bkpf) ).
DATA(lv_string) = lo_context->get_string( 'STRING' ).
DATA(lv_date) = lo_context->get_date( 'DATE' ).
DATA(lv_integer) = lo_context->get_integer( 'INTEGER' ).
CATCH zcx_apg_error INTO DATA(lx_apg).
" Handle framework errors (e.g., configuration missing, instantiation failed)
MESSAGE lx_apg TYPE 'E'.
ENDTRY.- Install via ABAPGit
- ABAP Cloud/Clean Core compatibility.Passed SCI check variant S4HANA_READINESS_2023 and ABAP_CLOUD_READINESS
- Unit Testing for Context and Execution Classes.Full support for ABAP Unit and Test Doubles.
- ABAPLint enabled
- Fiori App for Configuration Management (RAP based).Replace the cluster table to make it full ABAP Cloud compatible.
- Integrated Logging & Monitoring System.
- Parallel Processing for independent handlers.