Using Contexts as Modules 

The following example demonstrates how to create a context called DOCU_TEST3, which uses two other contexts, DOCU_TEST1 and DOCU_TEST2, as modules. DOCU_TEST1 and DOCU_TEST2 have already been used in the preceding examples Using Tables as Modules and Using Function Modules as Modules.

  1. Enter DOCU_TEST1 and DOCU_TEST2 in the Name or Table/Module column of the Modules table and choose Enter. The system fills the tables on the context maintenance screen as follows:
  2. All fields from the two contexts are used as fields in this context. The system generates the names of the context fields.

  3. You do not have to use all of the context fields. You can also change the context field names in the Fields and Modules tables:
  4. In this example, we have kept the three key fields CARRID, CONNID and FLDATE, and deleted all dependent fields apart from SEATSMAX, SEATSOCC and FREE_SEATS. The output fields from module DOCU_TEST1, SEATSMAX and SEATSOCC are used as input fields for module DOCU_TEST2. The dependent field FREE_SEATS is filled from the output field FREE in DOCU_TEST2.

  5. Choose Save. Save the context.
  6. Choose Check. The system checks the context for errors.
  7. Choose Network graphic. The system displays the following graphic showing how values are derived within the context.
  8. Generate the context. The system checks and saves your context before generating it.

 

The context is finished and can be tested (see Testing a Context ) and used in programs (see Using Contexts in ABAP Programs).