DEMAND val1 = f1 val2 = f2 ...
FROM CONTEXT context_ref
[MESSAGES INTO itab].
This statement assigns the values of derived fields
val1 val2 ... of a
context instance to data objects
f1 f2 .... For
context_ref, you have to specify
a data object that points to a context instance (see
val1 val2 ..., you can specify the names of fields derived for the corresponding
f1 f2 ..., you have to specify data objects whose data type conforms with the corresponding context field (
val1 val2 ...).
If the context instance contains valid values derived for the current key, these are assigned directly. Otherwise, the system searches the cross-transaction
buffer of the context to find the corresponding data
record, which is then transferred to the context instance and from there to 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 data objects
f1 f2 ....
If some values required cannot be derived because not enough key fields are known, processing is stopped, the values derived are initialized, and the module sends the message defined in the context for this purpose.
|Not equal to 0||The internal table specified after
You can use the structured type
context_t_con generated with
CONTEXTS to create suitable fields.
... MESSAGES INTO itab
MESSAGES addition is used for handling messages that may be sent by the
modules of a context. If the
MESSAGES addition is not specified, each message is sent according to its definition in the context, as described under
Messages. If the
addition is specified, the messages are not sent; instead, for each message, a row is attached to internal
itab, which must be specified after
The row type of the internal table must refer to the SYMSG structure in
the ABAP Dictionary. Columns
msgv4 then contain
the message type, message class, message number, and content of any placeholders. Internal table
itab is initialized at the start of the
An instance of the
demo_travel context is generated, the key fields are populated, and the values derived are requested.
CONTEXTS demo_travel. PARAMETERS: p_carrid TYPE context_t_demo_travel-carrid, p_connid TYPE context_t_demo_travel-connid. DATA: context_ref TYPE context_demo_travel, fields TYPE context_t_demo_travel. SUPPLY carrid = p_carrid connid = p_connid TO CONTEXT context_ref. DEMAND cityfrom = fields-cityfrom cityto = fields-cityto fltime = fields-fltime FROM CONTEXT context_ref. WRITE: / fields-cityfrom, fields-cityto, fields-fltime.