Get Example source ABAP code based on a different SAP table
ID MESSAGE • MESSAGE ABAP Statement
MESSAGE> Short Reference >
ABAP_SYNTAX MESSAGE ${ msg> BEGIN_SECTION VERSION 5 OUT $| text> END_SECTION VERSION 5 OUT $} ${ BEGIN_SECTION VERSION 5 OUT ${ $[DISPLAY LIKE dtype$] $[WITH dobj1 ... dobj4$] $} $| ${ $[DISPLAY LIKE dtype$] $[WITH dobj1 ... dobj4$] RAISING exception> $} $| END_SECTION VERSION 5 OUT ${ $[WITH dobj1 ... dobj4$] INTO text> $} $}.>
ABAP Addition 1 ... DISPLAY LIKE dtype> 2 ... WITH dobj1 ... dobj4>
What does it do? The statement MESSAGE> sends BEGIN_SECTION VERSION 5 OUT either END_SECTION VERSION 5 OUT the short text of a message> specified in msg>> from the table T100>> in the logon language> of the current user BEGIN_SECTION VERSION 5 OUT or any text specified in text>> END_SECTION VERSION 5 OUT . BEGIN_SECTION VERSION 5 OUT The following variants are available:
If one of the additions RAISING> or INTO> is not specified, the statement MESSAGE> interrupts the program flow and sends the message. The exact behavior> of this basic form of the statement MESSAGE>, that is, how the message text is displayed and how the program flow is continued after the MESSAGE> statement, is context-dependent and is determined by a message type> specified in msg> or text>.
If the addition RAISING>> is specified, the statement MESSAGE> raises a non-class-based exception> in function modules or methods. If the exception is not handled, the message is sent in the same way as when the addition RAISING> is not specified. END_SECTION VERSION 5 OUT
If the addition INTO>> is specified, the program flow is not interrupted and the short text of the message is assigned to a field instead.