Entering content frame

Supplying Context Instances with Key Values Locate the document in its SAP Library structure

Caution Contexts are obsolete and should not be used. Contexts were introduced for 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 Structure linkshared objects.


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


SUPPLY key1 = f1 ... keyn = fn TO CONTEXT inst.

This statement supplies the values f1fn to key fields key1 keyn 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.


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.




Leaving content frame