Get the FREE Ultimate OpenClaw Setup Guide →

released-abap-classes

npx machina-cli add skill likweitan/abap-skills/released-abap-classes --openclaw
Files (1)
SKILL.md
7.0 KB

Released ABAP Classes

Reference for released ABAP classes available in ABAP for Cloud Development (SAP BTP ABAP Environment).

Quick Reference by Category

CategoryKey Classes
Console OutputIF_OO_ADT_CLASSRUN, CL_DEMO_CLASSRUN, CL_XCO_CP_ADT_SIMPLE_CLASSRUN
UUIDCL_SYSTEM_UUID, XCO_CP, XCO_CP_UUID
Time & DateCL_ABAP_CONTEXT_INFO, XCO_CP_TIME, CL_ABAP_TSTMP, CL_ABAP_UTCLONG, CL_ABAP_DATFM, CL_ABAP_TIMEFM
CalendarCL_FHC_CALENDAR_RUNTIME, CL_SCAL_UTILS
String ProcessingCL_ABAP_CHAR_UTILITIES, CL_ABAP_STRING_UTILITIES, XCO_CP
Numbers/MathCL_ABAP_MATH, CL_ABAP_DECFLOAT, CL_ABAP_BIGINT, CL_ABAP_RATIONAL
Random NumbersCL_ABAP_RANDOM_* (INT, INT8, FLOAT, PACKED, DECFLOAT16/34), CL_ABAP_PROB_DISTRIBUTION
Regular ExpressionsCL_ABAP_REGEX, CL_ABAP_MATCHER
Codepage/BinaryCL_ABAP_CONV_CODEPAGE, CL_ABAP_GZIP*, CL_WEB_HTTP_UTILITY
JSON/XMLXCO_CP_JSON, /UI2/CL_JSON, CL_SXML_*, CL_IXML_*
EmailCL_BCS_MAIL_MESSAGE
HTTP CallsCL_WEB_HTTP_CLIENT_MANAGER, CL_HTTP_DESTINATION_PROVIDER
RAPCL_ABAP_BEHV_AUX, CL_ABAP_BEHAVIOR_HANDLER, CL_ABAP_BEHAVIOR_SAVER
RTTSCL_ABAP_TYPEDESCR and hierarchy
Dynamic ProgrammingCL_ABAP_DYN_PRG, CL_ABAP_CORRESPONDING
User InfoCL_ABAP_CONTEXT_INFO, XCO_CP=>sy->user()
Unit TestingCL_ABAP_UNIT_ASSERT, CL_OSQL_TEST_ENVIRONMENT, CL_CDS_TEST_ENVIRONMENT
Parallel ProcessingCL_ABAP_PARALLEL
Application LogCL_BALI_LOG
Background JobsCL_BGMC_PROCESS_FACTORY
LockingCL_ABAP_LOCK_OBJECT_FACTORY
XLSXXCO_CP_XLSX
Zip FilesCL_ABAP_ZIP
PDF RenderingCL_FP_ADS_UTIL

Common Use Cases

Get Current Date/Time in UTC

"Using CL_ABAP_CONTEXT_INFO
DATA(sys_date) = cl_abap_context_info=>get_system_date( ).  "e.g. 20240101
DATA(sys_time) = cl_abap_context_info=>get_system_time( ).  "e.g. 152450

"Using XCO (various formats)
DATA(date_utc) = xco_cp=>sy->date( xco_cp_time=>time_zone->utc )->as( xco_cp_time=>format->abap )->value.
DATA(time_utc) = xco_cp=>sy->time( xco_cp_time=>time_zone->utc )->as( xco_cp_time=>format->iso_8601_extended )->value.
DATA(moment_utc) = xco_cp=>sy->moment( xco_cp_time=>time_zone->utc )->as( xco_cp_time=>format->iso_8601_extended )->value.

Send Email

TRY.
    DATA(mail) = cl_bcs_mail_message=>create_instance( ).
    mail->set_sender( 'sender@example.com' ).
    mail->add_recipient( 'recipient@example.com' ).
    mail->set_subject( 'Subject' ).
    mail->set_main( cl_bcs_mail_textpart=>create_instance(
      iv_content      = '<h1>Hello</h1><p>Message body.</p>'
      iv_content_type = 'text/html' ) ).
    mail->send( IMPORTING et_status = DATA(status) ).
  CATCH cx_bcs_mail INTO DATA(error).
ENDTRY.

Generate UUID

"CL_SYSTEM_UUID
DATA(uuid_x16) = cl_system_uuid=>create_uuid_x16_static( ).
DATA(uuid_c36) = cl_system_uuid=>create_uuid_c36_static( ).

"XCO
DATA(uuid) = xco_cp=>uuid( )->value.
DATA(uuid_c36_xco) = xco_cp=>uuid( )->as( xco_cp_uuid=>format->c36 )->value.

JSON Processing

"ABAP -> JSON
DATA(json) = xco_cp_json=>data->from_abap( some_structure )->to_string( ).

"JSON -> ABAP
xco_cp_json=>data->from_string( json_string )->write_to( REF #( target_structure ) ).

"Using /UI2/CL_JSON
DATA(json2) = /ui2/cl_json=>serialize( data = some_data ).
/ui2/cl_json=>deserialize( EXPORTING json = json2 CHANGING data = target ).

HTTP Client Call

TRY.
    DATA(dest) = cl_http_destination_provider=>create_by_url( 'https://api.example.com' ).
    DATA(client) = cl_web_http_client_manager=>create_by_http_destination( dest ).
    DATA(request) = client->get_http_request( ).
    DATA(response) = client->execute( if_web_http_client=>get ).
    DATA(status) = response->get_status( ).
    DATA(body) = response->get_text( ).
  CATCH cx_web_http_client_error cx_http_dest_provider_error INTO DATA(error).
ENDTRY.

Get Current User

"Using CL_ABAP_CONTEXT_INFO
DATA(user_alias) = cl_abap_context_info=>get_user_alias( ).
DATA(user_name) = cl_abap_context_info=>get_user_formatted_name( ).

"Using XCO
DATA(user) = xco_cp=>sy->user( )->name.

Detailed Reference

For comprehensive code examples and all available classes, read:

Reference File Structure

The reference file is organized into these sections (use grep patterns to search):

SectionSearch Pattern
Console OutputRunning a Class and Displaying Output
UUIDCreating and Transforming UUIDs
SY ComponentsXCO Representations of SY Components
RAP## RAP
Transactional ConsistencyTransactional Consistency
Numbers/CalculationsNumbers and Calculations
String ProcessingString Processing
Codepages/BinaryHandling Codepages and Binary
Regular ExpressionsRegular Expressions
Time and DateTime and Date
CalendarCalendar-Related Information
RTTSRuntime Type Services
Assignments## Assignments
Structure ComponentsNon-Initial Structure Components
Table ComparisonComparing Content of Compatible
Dynamic ProgrammingDynamic Programming
Current UserGetting the Current User Name
XML/JSONXML/JSON
Repository ObjectsABAP Repository Object Information
Generating ObjectsGenerating ABAP Repository Objects
Call StackCall Stack
EmailSending Emails
Tenant InfoTenant Information
ExceptionsException Classes
Parallel ProcessingParallel Processing
Application LogApplication Log
Background JobsRunning Code in the Background
Locking## Locking
HTTP CallsCalling Services
XLSXReading and Writing XLSX Content
Zip FilesZip Files
Unit TestingABAP Unit
Units of MeasurementUnits of Measurement
ATCProgrammatic ABAP Test Cockpit
Number RangesHandling Number Ranges
Releasing APIsReleasing APIs
Application JobsApplication Jobs
Generative AIGenerative AI
Transport RequestsProgrammatically Creating and Releasing Transport
HTML/XML CleanupRepairing and Cleaning up HTML
IDE ActionsCreating and Using IDE Actions
PDF RenderingOutput Management
CSV ExportWriting Internal Table Content to CSV
Garbage CollectionTriggering Garbage Collection

Source

git clone https://github.com/likweitan/abap-skills/blob/main/skills/released-abap-classes/SKILL.mdView on GitHub

Overview

Released ABAP Classes is a reference of ABAP Cloud Development classes that are released for use. It helps developers quickly locate ready-to-use classes across categories like email, UUID, time/date, JSON/XML, RAP, and more, streamlining common tasks.

How This Skill Works

The reference aggregates released ABAP Cloud classes by category and shows key class names you can use directly in your code. For example, use CL_BCS_MAIL_MESSAGE for email, CL_SYSTEM_UUID for UUIDs, and XCO_CP_JSON or /UI2/CL_JSON for JSON processing.

When to Use It

  • When you need to send an email from an ABAP Cloud environment and want a ready-to-use class (e.g., CL_BCS_MAIL_MESSAGE).
  • When you must generate UUIDs in ABAP Cloud Development (e.g., CL_SYSTEM_UUID, XCO_CP_UUID).
  • When you need robust time/date handling or UTC conversions (e.g., CL_ABAP_CONTEXT_INFO, XCO_CP_TIME).
  • When working with JSON/XML data and you need reliable parsing/serialization (e.g., XCO_CP_JSON, /UI2/CL_JSON).
  • When you require HTTP calls or web service integration (e.g., CL_WEB_HTTP_CLIENT_MANAGER, CL_HTTP_DESTINATION_PROVIDER).

Quick Start

  1. Step 1: Search the skill page for the released-abap-classes catalog to see available categories and class names.
  2. Step 2: Pick a category (e.g., Email, JSON, HTTP) and note the primary class recommended (e.g., CL_BCS_MAIL_MESSAGE, XCO_CP_JSON).
  3. Step 3: Implement a small ABAP snippet using the chosen class and test in your ABAP Cloud environment.

Best Practices

  • Verify the specific ABAP Cloud version and release supports the class you plan to use.
  • Prefer released ABAP classes for cloud development to ensure compatibility and support.
  • Keep a short reference map in your project for frequently used classes (e.g., email, UUID, JSON).
  • Test class usage in your ABAP environment with representative data before production.
  • Document any deviations or customizations when integrating these classes into RAP-based flows.

Example Use Cases

  • Send a formatted HTML email using CL_BCS_MAIL_MESSAGE and CATCH CX_BCS_MAIL.
  • Generate UUIDs with CL_SYSTEM_UUID=>create_uuid_x16_static( ) and map to your domain schema.
  • Serialize ABAP structures to JSON with xco_cp_json=>data->from_abap( … )->to_string( ).
  • Make an HTTP POST request using CL_WEB_HTTP_CLIENT_MANAGER to call an external API.
  • Log application events with CL_BALI_LOG for traceability within ABAP Cloud apps.

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers