The primary benefit of enumerations is type safety. You should aim to make the compiler reject invalid values.
Using Native Enumerated Types
If using native enumerated types, define method parameters using the enumeration's type. This allows the compiler to catch errors at compile time.
METHODS log_contains
IMPORTING
minimum_severity TYPE /clean/message_severity=>type.
Valid usage:
IF log_contains( /clean/message_severity=>warning ).
Invalid usage (Syntax/Runtime error):
IF log_contains( 'W' ).
IF log_contains( CONV /clean/message_severity=>type( 'B' ) ).
Using the Object Pattern for Type Safety
If native enumeration cannot be used, you can achieve type safety by requiring a reference to the enumeration class:
METHODS log_contains
IMPORTING
minimum_severity TYPE REF TO /clean/message_severity.