Skip to content

efeumutaslan/SAP-SKILLS / skills/sap-s4hana-extensibility

sap-s4hana-extensibility

Verified

SAP S/4HANA extensibility and Clean Core development skill. Use when implementing BAdIs, creating Custom Business Objects, checking released API compliance, building side-by-side or in-app extensions, using Key User tools, wrapping classic APIs for ABAP Cloud, or planning extension architecture. If the user mentions Clean Core, S/4HANA extension, BAdI, released API, Tier 1/Tier 2, or Key User extensibility, use this skill. Covers Public Cloud, Private Cloud, and On-Premise.

templates/tier2-wrapper.abap

View on GitHub
"! Tier 2 Wrapper Template
"! Creates a clean interface (released C1) around a classic BAPI
"!
"! Structure:
"!   1. Interface (ZIF_*) — Released with C1 contract
"!   2. Factory (ZCL_*_FACTORY) — Released with C1 contract
"!   3. Implementation (ZCL_*_IMPL) — NOT released (Tier 2, classic ABAP)
"!
"! Replace {{PLACEHOLDER}} values with your actual names

" ============================================================
" PART 1: Interface (release with C1)
" ============================================================
INTERFACE {{ZIF_WRAPPER_NAME}} PUBLIC.

  TYPES:
    BEGIN OF ty_input,
      " Define clean input fields (don't expose BAPI structures)
      {{field1}} TYPE {{data_element1}},
      {{field2}} TYPE {{data_element2}},
    END OF ty_input,

    BEGIN OF ty_result,
      {{key_field}} TYPE {{key_type}},
      success      TYPE abap_bool,
      messages     TYPE bapiret2_t,
    END OF ty_result.

  METHODS execute
    IMPORTING is_input         TYPE ty_input
    RETURNING VALUE(rs_result) TYPE ty_result
    RAISING   {{ZCX_ERROR_CLASS}}.

ENDINTERFACE.

" ============================================================
" PART 2: Factory (release with C1)
" ============================================================
CLASS {{ZCL_WRAPPER_FACTORY}} DEFINITION PUBLIC FINAL CREATE PUBLIC.
  PUBLIC SECTION.
    CLASS-METHODS create
      RETURNING VALUE(ro_instance) TYPE REF TO {{ZIF_WRAPPER_NAME}}.
ENDCLASS.

CLASS {{ZCL_WRAPPER_FACTORY}} IMPLEMENTATION.
  METHOD create.
    ro_instance = NEW {{ZCL_WRAPPER_IMPL}}( ).
  ENDMETHOD.
ENDCLASS.

" ============================================================
" PART 3: Implementation (DO NOT release — classic ABAP)
" ============================================================
CLASS {{ZCL_WRAPPER_IMPL}} DEFINITION PUBLIC FINAL CREATE PUBLIC.
  PUBLIC SECTION.
    INTERFACES {{ZIF_WRAPPER_NAME}}.
ENDCLASS.

CLASS {{ZCL_WRAPPER_IMPL}} IMPLEMENTATION.
  METHOD {{ZIF_WRAPPER_NAME}}~execute.

    " Map interface types to BAPI types
    DATA ls_bapi_input TYPE {{BAPI_INPUT_STRUCTURE}}.
    ls_bapi_input-{{bapi_field1}} = is_input-{{field1}}.
    ls_bapi_input-{{bapi_field2}} = is_input-{{field2}}.

    DATA lt_return TYPE bapiret2_t.
    DATA lv_key TYPE {{key_type}}.

    " Call classic BAPI
    CALL FUNCTION '{{BAPI_NAME}}'
      EXPORTING
        {{bapi_import_param}} = ls_bapi_input
      IMPORTING
        {{bapi_export_param}} = lv_key
      TABLES
        return               = lt_return.

    " Check result and commit/rollback
    IF lv_key IS NOT INITIAL.
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
        EXPORTING wait = abap_true.
      rs_result = VALUE #( {{key_field}} = lv_key success = abap_true messages = lt_return ).
    ELSE.
      CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
      rs_result = VALUE #( success = abap_false messages = lt_return ).
    ENDIF.

  ENDMETHOD.
ENDCLASS.
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.Stars: 323kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 323kUpdated Claude CodeCodexVerifiedInstall
executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is availableStars: 323kUpdated Claude CodeCodexVerifiedInstall