SAP DEMAND ABAP Statements



Get Example source ABAP code based on a different SAP table
  


ID DEMAND
• DEMAND ABAP Statement
• FROM CONTEXT DEMAND (obsolete)

DEMAND
Short Reference

ABAP_SYNTAX_OBS
DEMAND val1 = f1 val2 = f2 ...
FROM CONTEXT context_ref
$[MESSAGES INTO itab$].

ABAP Addition
... MESSAGES INTO itab

What does it do?
This statement assigns the values of derived fields val1 val2 ... of a context instance to the data objects f1 f2 .... context_ref expects a data object that points to a context instance (see CONTEXTS). The names of derived fields of the corresponding context can be specified for val1 val2 .... f1 f2 ... expects data objects whose data type matches the corresponding context field val1 val2 ....
If the context instance contains valid derived values for the current key, these are assigned directly. Otherwise, the cross-transaction buffer of the context is searched for the corresponding data record, which is then passed to the context instance and from there to the data objects f1 f2 .... Only if no corresponding data is found here, are the values in the modules of the context derived and placed in the buffer, the context instance, and the data objects f1 f2 ....
If not all required values can be derived since not enough key fields are known, processing is terminated, the derived values are initialized, and the module sends the message specified in the context for this purpose.
System Fields sy-subrcMeaning 0The addition MESSAGES is not specified or the internal table specified after MESSAGES is empty Not 0The internal table specified after MESSAGES contains messages.



Latest notes:

The structured type context_t_con created using CONTEXTS can be used to create suitable fields.
ABAP_HINT_END
• MESSAGES INTO DEMAND (obsolete)

ABAP Addition

What does it do?
The addition MESSAGES is used for handling any messages sent by the modules of a context. If the addition MESSAGES is not specified, each message is sent in accordance with its definition in the context, as described under Messages. If the addition MESSAGES is specified, the messages are not sent. Instead, for each message, a line is appended to the internal table itab to be specified after INTO. The line type of the internal table must refer to the structure SYMSG in the ABAP Dictionary. The columns msgty, msgid, msgno, and msgv1 to msgv4 contain the message type, message class, message number, and content of any placeholders. The internal table itab is initialized at the start of the statement DEMAND.



Example ABAP Coding

Creates an instance of the context demo_travel, fills the key fields, and requests the derived values.
ABEXA 00217
ABAP_EXAMPLE_END

Return to menu