SAP Knowledge Base Article - Public

3588799 - Error while accessing system fields "SY-DATUM" or "SY-TCODE" in S/4HANA Cloud Public Edition

Symptom

  • An error is encountered when attempting to use the system field parameters "SY-DATUM" or "SY-TCODE" in the coding BadI implementation (for example) in S/4HANA Cloud Public Edition.
  • The error message states: "Access to the field "SY-TCODE" / "SY-DATUM" is not permitted in the current ABAP language version."

Environment

  • SAP S/4HANA Cloud Public Edition
 

Reproducing the Issue

  1. Attempt to use the system field parameters "SY-TCODE" or "SY-DATUM" in the coding of a BAdI implementation or similar.
  2. Encounter the error: "Access to the field "SY-DATUM" is not permitted in the current ABAP language version."

Cause

The noted ABAP system fields "SY-TCODE" or "SY-DATUM" are intentionally not available for use in coding. For details on the available system fields please see the help article here

Resolution

This behaviour is intended. For the background on this please check through the following blog for details

The restricted ABAP has two targets:

  • De-couple custom code from the SAP core by enforcing the exclusive use of white-listed SAP APIs
  • Minimize the risk of damages to the system or the data integrity/security

See Also

Keywords

S/4HANA Cloud Public Edition, SY-TCODE, BAdI implementation, ABAP language version, error, SY-DATUM, system fields, fields, coding , KBA , FI-SL-VSR-2CL , Validation, Substitution and Rules (Public Cloud) , BC-SRV-APS-EXT-BL , Custom Business Logic , Problem

Product

SAP S/4HANA Cloud Public Edition all versions