You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 14 Next »

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.

Amount in Words

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 NameDescriptionParameters
GET_AMOUNT_IN_WORDSConverts an amount into words in different languages

i_currency

i_amount

i_language

e_in_words

GET_AMOUNT_IN_WORDS_RUConverts an amount into words in Russian

i_currency

i_amount

i_language

e_in_words

Application Logging

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 NameDescriptionParameters




Conversions

This utility class has the required logic to convert to and from strings, xstrings, and binaries.

Class Name/SYQ/CL_CONVERSION_UTILITY
Method NameDescriptionParameters




Sending of emails

This utility class unifies the email sending process in case it is part of a requirement.

Class Name/SYQ/CL_EMAIL_UTILITY
Method NameDescriptionParameters




Enterprise Structure Constants

This utility class provides a unified access to enterprise structure constants.

Class Name/SYQ/CL_CONSTANT_UTILITY
Method NameDescriptionParameters




Dynamic Logo for form outputs

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 NameDescriptionParameters
GET_COMPANY_LOGO_FROM_BUKRSRetrieve the company logo path

i_bukrs

e_logo_path

READ_FILE_FROM_MIMERetrieve 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 file is called Default_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. Company code 0000 is set up for the default logo.


Launchpad Notifications

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 NameDescriptionParameters
CREATE_NOTIFICATIONCreates 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.


Switch framework

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 NameDescriptionParameters
CHECK_SWITCHReturns 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.



  • No labels