A simple message with context, implemented in ABAP programming language.
Basic usage example:
data(message) = new zmsg(
template = 'Hello &1! This is a &2 &3 message.'
context = value #(
( id = 1 value = sy-uname )
( id = 2 value = 'Foo' )
( id = 3 value = 'Bar' )
)
).
data(message_string) = message->to_string( ).
You can get a string value using static method:
data(message_string) = zmsg=>str(
template = 'Hello &1! This is a &2 &3 message.'
context = value #(
( id = 1 value = sy-uname )
( id = 2 value = 'Foo' )
( id = 3 value = 'Bar' )
)
).
Also, you can get a message text when checking sy-subrc
:
data(message_string) = zmsg=>symsg( ).