ABAP constants with %_ as prefix

The constants with a value of %_ as prefix are defined in ABAP for its internal use of the system. These need to be used as such and cannot be modified by the user.

Understanding %_ Prefixed Constants

In ABAP, constants that begin with %_ are system-reserved constants used internally by the SAP system. These constants serve specific purposes within the ABAP runtime environment and various system components.

Key Characteristics

The %_ prefixed constants have the following important characteristics ?

  • Read-only ? They cannot be modified or redefined by developers
  • System-managed ? Their values are controlled by the SAP system
  • Reserved namespace ? The %_ prefix is exclusively for system use

Example Usage

Here's how these constants typically appear in ABAP code ?

DATA: lv_result TYPE string.

" System constants with %_ prefix (examples)
IF sy-uname = %_USER.
  lv_result = 'Current user matches system user'.
ENDIF.

" These constants are predefined and cannot be changed
WRITE: 'System constant value:', %_SYSTEM_ID.

Best Practices

When working with %_ prefixed constants ?

  • Always use them as read-only values
  • Do not attempt to modify or redefine them
  • Avoid creating custom constants with %_ prefix to prevent conflicts

Conclusion

ABAP constants with %_ prefix are system-reserved elements that provide essential functionality for internal SAP operations. They must be treated as immutable values and used only for reading purposes in your ABAP programs.

Updated on: 2026-03-13T18:46:00+05:30

450 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements