Show TOC

Supplying Context Instances with Key ValuesLocate this document in the navigation structure

 Contexts are obsolete and should not be used. Contexts were introduced in Release 4.0 for high-performance access to frequently required data. Since the introduction of ABAP Objects for Release 4.5, contexts have not been developed further. Since Release 6.40, contexts can be replaced by shared objects .

Once you have created a context instance, you can supply values for its key fields. You do this using the SUPPLY statement:

Syntax

SUPPLY key 1 = f 1 ... key n = f n TO CONTEXT inst.

This statement supplies the values f 1 … f n to key fields key 1 … key n of a context instance inst. The fields of the context are contained in the Fields table.

When you have specified values for the key fields, you can derive the dependent fields of the context instance (see Querying Data from Context Instances ).

If you assign new key fields to a context instance after deriving the dependent fields, the derived values are automatically invalidated, and will be re-calculated the next time you derive dependent values.

Tip

REPORT rsgcon01.

CONTEXTS demo_travel.

DATA: demo_travel_inst1 TYPE context_demo_travel,      demo_travel_inst2 TYPE context_demo_travel.

SUPPLY carrid = 'LH'       connid = '400'       TO CONTEXT demo_travel_inst1.

SUPPLY carrid = 'AA'       connid = '017'       TO CONTEXT demo_travel_inst2.

This program extract generates two instances of the context demo_travel and supplies both with key values.