Several custom utility classes are available in S/4HANA. These utility classes are reusable and reduce the need to "reinvent the wheel" for basic, reoccurring needs in custom ABAP code. There are to be used to avoid unnecessary code duplication and slightly different implementation approaches.
All utility classes sit in package /SYQ/UTILITY and have the release contract C1 set to be able to be used in the ABAP Cloud standard.
This utility class simplifies the conversion of amounts into their written form in words including the currency, based on passed language key.
| Class Name | /SYQ/CL_AMOUNT_IN_WORDS |
|---|
| Method Name | Description | Parameters |
|---|---|---|
| GET_AMOUNT_IN_WORDS | Converts an amount into words in different languages | i_currency i_amount i_language e_in_words |
| GET_AMOUNT_IN_WORDS_RU | Converts an amount into words in Russian | i_currency i_amount i_language e_in_words |
This utility class unifies the way we use the application log and has all needed functionality to create log entries.
| Class Name | /SYQ/CL_APPLOG_UTILITY |
|---|
| Method Name | Description | Parameters |
|---|---|---|
This utility class has the required logic to convert to and from strings, xstrings, and binaries.
| Class Name | /SYQ/CL_CONVERSION_UTILITY |
|---|
| Method Name | Description | Parameters |
|---|---|---|
This utility class unifies the email sending process in case it is part of a requirement.
| Class Name | /SYQ/CL_EMAIL_UTILITY |
|---|
| Method Name | Description | Parameters |
|---|---|---|
This utility class provides a unified access to enterprise structure constants.
| Class Name | /SYQ/CL_CONSTANT_UTILITY |
|---|
| Method Name | Description | Parameters |
|---|---|---|
This utility class provides the logic to determine and retrieve the required logo to be output on a form and removes the need to maintain it in each form build.
| Class Name | /SYQ/CL_DYNAMIC_LOGO_UTILITY |
|---|
| Method Name | Description | Parameters |
|---|---|---|
| GET_COMPANY_LOGO_FROM_BUKRS | Retrieve the company logo path | i_bukrs e_logo_path |
| READ_FILE_FROM_MIME | Retrieve logo binary from MIME repository | i_mime_path e_logo_binary |
Logos are maintained in the MIME Repository, transaction code SO2_MIME_REPOSITORY. Folder is under SAP->PUBLIC→SYENSQO. Default logo is called 0000_Logo.png. It is only needed to add additional and different logos than the default.
Table /SYQ/T_LOGO_PATH contains the logo location path per company code.
This utility class provides a simplified and unified approach to trigger custom launchpad notifications. Functionality provided is the sending of notifications with or without navigation targets.
| Class Name | /SYQ/CL_NOTIF_PROVIDER |
|---|
| Method Name | Description | Parameters |
|---|---|---|
| CREATE_NOTIFICATION | Creates a launchpad notification | i_type_key i_recipient i_parameter i_nav_parameters |
Message class /SYQ/NOTIFICATION to be updated to add a new notification text with parameters.
Table /SYQ/T_NOTIF_CNF to be updated with the Notification type and created message ids.
Table /SYQ/T_NOTIF_NAV to be updated with navigation target, if required, having the semantic object and action.
This utility class provides the logic to switch on or off certain functionality in custom code in each system separately. Each enhancement requires the switch to be implemented to be able to quickly deactivate it in case of an issue. it is also useful to implement endless loops to allow background task debugging when active.
| Class Name | /SYQ/CL_SWITCH_FRAMEWORK |
|---|
| Method Name | Description | Parameters |
|---|---|---|
| CHECK_SWITCH | Returns a boolean based on a check in the switch table | i_enhancement_id i_enhancement_step r_check_value |
Table /SYQ/T_SWITCHES to be updated with the switch definition and activation indicator. Table to be maintained in each system/client where and when needed.