PackagePackagetypeA library you install and call yourself.See every one →What this type is →independently maintainedindependently maintainedoriginPublished by one person or a small company outside SAP. Says nothing about quality; the readings say that.See every one →

abap-system-fields

An ABAP Cloud class that wraps SY system fields and calendar-date functions behind an injectable instance, so code that reads them stays stable under unit tests.

An instance created with zcl_syst=>create( ) stands in for SY: the README's example creates it in the constructor and assigns it to an attribute of the class, so that a unit test stays stable, and says SY can be overridden this way. Its table of methods gives user_id for sy-uname, system_date for sy-datum, return_code for sy-subrc and table_index for sy-tabix, and others for cl_abap_context_info=>get_user_alias, GET TIME STAMP or utclong_current( ). The date methods read I_CalendarDate and return the quarter, the week number, the weekday and the first or last day of a week or month. The README presents all of it as ABAP Cloud enabled, decoupled from coding and testable through the injector pattern.

Facts

Last pushLicenceMIT

Where it sits

Lives in
Provides
ABAP Cloud readinessABAPABAP Cloud readinesscapabilityWhether code can run in ABAP Cloud — released APIs only, no direct table access, no obsolete statements — and what to do with the code that cannot.
Flavors

Who is behind it

XexerXexerPersonMaintains this
In the atlas: maintains 7, contributes to 8
@Xexer
maintainer

What it declares

Every artifact

Type
Package
Origin
Independently maintained

As a package

Where it runs
does not say
Distributed through
does not say

Connections1

README

quoted from Xexer/abap-system-fields under MIT, read
Xexer/abap-system-fields/README.mdOn GitHub

ABAP System Fields

Introduction

ABAP Cloud enabled system fields and date functions.

  • Decoupled from coding
  • ABAP Cloud best practices
  • Testable (Injector Pattern)

Fields and Functions

Via this article you can get more informations to the actual structure and functions.

MethodFunction
user_idsy-uname
user_aliascl_abap_context_info=>get_user_alias
system_datesy-datum
system_timesy-uzeit
timestampGET TIME STAMP
timestamp_longGET TIME STAMP
utclongutclong_current( )
user_datesy-datlo
user_timesy-timlo
time_zonesy-zonlo
languagesy-langu
language_iso-
system_informationsy-mandt, sy-sysid, sy-cprog, sy-saprl
indexsy-index
table_indexsy-tabix
database_countsy-dbcnt
return_codesy-subrc
letter_uppersy-abcde
letter_lower-
weekdaysy-fdayw
messagesy-msgid, sy-msgno, sy-msgty, sy-msgv1, ...
message_bapiret2sy-msgid, sy-msgno, sy-msgty, sy-msgv1, ...
message_balisy-msgid, sy-msgno, sy-msgty, sy-msgv1, ...

Date Functions

In the newest classes we utilize I_CalendarDate to give easy and fast access to date functions. You will find methods for often used calculation methods.

MethodDescription
get_raw_dateReturn full data set from I_CalendarDate
get_quarterReturn the quarter
get_weekNumber of the week
get_weekdayWeekday as integer (constants available)
get_first_day_of_weekFirst day of the week
get_first_day_of_monthFirst day of the month
get_last_day_of_weekLast day of the week
get_last_day_of_monthLast day of the month
get_calendar_day_of_the_yearReturn the number of the day in the actual year

Example

Start in the constructor to create the instance and assign it to an attribute of the class, so your Unit Test should stay stable. We can override the "SY" with this method.

sy = zcl_syst=>create( ).

Using as SY-SUBRC in a function:

AUTHORITY-CHECK OBJECT 'S_APPL_LOG'
                ID 'ACTVT' FIELD '02'.

RETURN xsdbool( sy->return_code( ) = 0 ).

Using as SY-UNAME in a IF statement:

IF sy->user_id( ) = 'TECHUSER'.
  RETURN abap_true.
ELSE.
  RETURN abap_false.
ENDIF.

Creating a timestamp inline:

DATA(actual_time) = sy->timestamp_long( ).

Retrieve information about the weekday:

DATA(today) = sy->date_functions( ).
DATA(weekday) = today->get_weekday( ).

DATA(weekday_new) = sy->date_functions( )->get_weekday( ).
MIT, read
ABAP Cloud readiness
  1. abap-cloud-guiReport-style programming model for abap2UI5 on ABAP Cloud
  2. codepagePolyfill for CL_ABAP_CODEPAGE under Clean Core
  3. Modernization Agents for SAP on AWSAWS agents for ABAP, PI/PO and BW modernisation work
  4. ROSAMCP server answering whether SAP objects are released for ABAP Cloud
  5. Cloudification RepositorySAP's list of released APIs for SAP Cloud ERP with successors
  6. code pal for ABAP — Cloud EditionClean ABAP check set for ABAP Cloud
  7. Clean-Core.ioHosted workspace redrawing custom ABAP as BPMN and grading it
  8. Clean Core MeasurementReports Clean Core ATC results per system as Level A to D KPIs
  9. ABAP Select ConverterConverts classic Open SQL SELECTs to released CDS entities
  10. Cloudification Repository ViewerBrowser form over SAP's Cloudification Repository for ABAP Cloud

Details

Sources3
Added by handdiscovered herechecked
github.com/Xexer/abap-system-fieldstree, pushes, contributors, CIchecked
README.mdquoted, and what the entry declareschecked

Sources are graph entities: the same page may back several entries, and an unreachable source flags every row that rests on it.

Compatibility and provenance
discovered viaAdded by hand
first seen in the atlas
ecosystem and domainabap, operations-and-runtime
abaplint
issues under its own abaplint configuration194
lines1,156
statements664
objects10
files21
analysed, main
abaplint version2.120.84
Flavors1
ABAP Cloud
“ABAP Cloud enabled system fields and date functions.” — Xexer/abap-system-fields — README, Introductionchecked
History in the atlas1
  1. First seen.
For your agent
Ref
artifact:xexer-abap-system-fields
JSON
/artifacts/xexer-abap-system-fields.json
MCP
Connecting an agent