$npx -y skills add likweitan/abap-skills --skill abap-cloudHelp with ABAP Cloud development including the 3-tier extensibility model, ABAP Cloud language version restrictions, wrapper patterns for unreleased APIs, clean core principles, and key user vs developer extensibility. Use when users ask about ABAP Cloud, ABAP for Cloud Developme
| 1 | # ABAP Cloud / Clean Core |
| 2 | |
| 3 | Guide for developing with the ABAP Cloud programming model, understanding the 3-tier extensibility model, and applying clean core principles. |
| 4 | |
| 5 | ## Workflow |
| 6 | |
| 7 | 1. **Determine the user's context**: |
| 8 | - Understanding ABAP Cloud concepts and restrictions |
| 9 | - Choosing the right extensibility tier |
| 10 | - Wrapping unreleased APIs for use in ABAP Cloud |
| 11 | - Identifying released API alternatives |
| 12 | - Setting up clean core-compliant development |
| 13 | |
| 14 | 2. **Identify the extensibility tier**: |
| 15 | - Tier 1: Key user extensibility (no code) |
| 16 | - Tier 2: Developer extensibility (ABAP Cloud / ABAP for Cloud Development) |
| 17 | - Tier 3: Classic extensibility (standard ABAP, only on-premise/private cloud) |
| 18 | |
| 19 | 3. **Guide implementation** using clean core principles |
| 20 | |
| 21 | ## ABAP Language Versions |
| 22 | |
| 23 | | Language Version | Scope | Available In | |
| 24 | | ------------------------------ | ------------------------------------------------------------- | -------------------------------------------------- | |
| 25 | | **ABAP for Cloud Development** | Only released APIs and objects; restricted syntax; no SAP GUI | BTP ABAP Environment, S/4HANA (embedded Steampunk) | |
| 26 | | **Standard ABAP** | Full ABAP syntax; all repository objects accessible | On-premise, private cloud | |
| 27 | |
| 28 | ### Key Restrictions in ABAP for Cloud Development |
| 29 | |
| 30 | - Only released SAP APIs (C1 contract) can be used |
| 31 | - No direct database table access for SAP tables (use released CDS views instead) |
| 32 | - No classic dynpro, selection screens, or SAP GUI-dependent statements |
| 33 | - No `CALL TRANSACTION`, `SUBMIT`, `AUTHORITY-CHECK` (use `CL_ABAP_AUTHORIZATION` instead) |
| 34 | - No classic BAdIs or user exits |
| 35 | - No `EXEC SQL` or native SQL (use ABAP SQL or AMDP) |
| 36 | - No function modules (except released RFC-enabled ones) |
| 37 | - No `INCLUDE` programs |
| 38 | - No `WRITE` or classic list output |
| 39 | - Must use `if_oo_adt_classrun` for console output |
| 40 | |
| 41 | ## 3-Tier Extensibility Model |
| 42 | |
| 43 | ### Tier 1 — Key User Extensibility (No Code) |
| 44 | |
| 45 | - Custom fields and logic via SAP Fiori UIs |
| 46 | - Custom CDS views (basic) |
| 47 | - Custom business objects (simple) |
| 48 | - Custom analytical queries |
| 49 | - No ABAP development required |
| 50 | |
| 51 | ### Tier 2 — Developer Extensibility (ABAP Cloud) |
| 52 | |
| 53 | - ABAP for Cloud Development language version |
| 54 | - Only released APIs with stability contracts |
| 55 | - RAP-based business objects |
| 56 | - Side-by-side or embedded development |
| 57 | - Full lifecycle management via ADT |
| 58 | |
| 59 | ```abap |
| 60 | "Example: Tier 2 class using only released APIs |
| 61 | CLASS zcl_my_extension DEFINITION |
| 62 | PUBLIC FINAL CREATE PUBLIC. |
| 63 | PUBLIC SECTION. |
| 64 | INTERFACES if_oo_adt_classrun. |
| 65 | ENDCLASS. |
| 66 | |
| 67 | CLASS zcl_my_extension IMPLEMENTATION. |
| 68 | METHOD if_oo_adt_classrun~main. |
| 69 | "Only released CDS views — no direct table access |
| 70 | SELECT FROM I_BusinessPartner |
| 71 | FIELDS BusinessPartner, BusinessPartnerName |
| 72 | INTO TABLE @DATA(partners) |
| 73 | UP TO 10 ROWS. |
| 74 | out->write( partners ). |
| 75 | ENDMETHOD. |
| 76 | ENDCLASS. |
| 77 | ``` |
| 78 | |
| 79 | ### Tier 3 — Classic Extensibility (Standard ABAP) |
| 80 | |
| 81 | - Full ABAP language scope |
| 82 | - Access to all repository objects |
| 83 | - Classic enhancement points, BAdIs, user exits |
| 84 | - Only available on-premise or private cloud |
| 85 | - Not recommended for new cloud-ready development |
| 86 | |
| 87 | ## Wrapper Pattern |
| 88 | |
| 89 | When a needed API is not released (Level B/C), create a wrapper in Tier 3 that exposes the functionality via a released interface consumable from Tier 2. |
| 90 | |
| 91 | ### Wrapper Class Pattern |
| 92 | |
| 93 | ```abap |
| 94 | "Tier 3: Wrapper class (Standard ABAP language version) |
| 95 | "Released with C1 contract for use from Tier 2 |
| 96 | CLASS zcl_wrapper_material DEFINITION |
| 97 | PUBLIC FINAL CREATE PUBLIC. |
| 98 | PUBLIC SECTION. |
| 99 | INTERFACES zif_material_reader. |
| 100 | "Set as released API with C1 contract in ADT |
| 101 | ENDCLASS. |
| 102 | |
| 103 | CLASS zcl_wrapper_material IMPLEMENTATION. |
| 104 | METHOD zif_material_reader~get_material. |
| 105 | "Access unreleased API internally |
| 106 | SELECT SINGLE * FROM mara |
| 107 | WHERE matnr = @iv_matnr |
| 108 | INTO @DATA(ls_mara). |
| 109 | "Map to released structure |
| 110 | rs_material = VALUE #( |
| 111 | matnr = ls_mara-matnr |
| 112 | mtart = ls_mara-mtart |
| 113 | matkl = ls_mara-matkl ). |
| 114 | ENDMETHOD. |
| 115 | ENDCLASS. |
| 116 | ``` |
| 117 | |
| 118 | ### Wrapper via RFC Proxy (Remote Tier 2 to Tier 3) |
| 119 | |
| 120 | ```abap |
| 121 | "Tier 2 consumer calls released RFC wrapper |
| 122 | DATA(lo_dest) = cl_rfc_destination_provi |