The following instructions explain the creation of a class for a specification type and the implementation of basic logic for instantiation.

Prerequisites:

In this instruction:

  • Create and assign a package

  • Create a class for the specification type

  • Assign superclass

  • Assign interface

  • Maintain specification type object in Customizing

Example

Domain is a specification type for maintaining value lists for an element.

The steps described below can be reproduced using existing example objects in the /SCT/QP_DEMO package.

Create package

Create a sub-package for the specification type (ZQP_DOMAIN under ZQP_VART)

Create object

  • Create a class for specification type (example: ZCL_QP_DOMAIN)

  • Inherit class from the customer-specific superclass (example: ZCL_QP_VART)

  • Create an interface for specification type (example: ZIF_QP_DOMAIN)

Implement a method for instance determination

One instance of the corresponding specification type class is kept in memory as a singleton for each specification object.
A method for loading and returning an object for the specification type is therefore implemented here.

  • Define method GET_INSTANCE in the interface (see ZIF_QP_DOMAIN)

  • Implement the GET_INSTANCE method in the class (see ZCL_QP_DOMAIN)

In principle, two input parameters should be provided to identify the specific specification object.

  • IV_IDENT: Generic identifier, the actual required content is decided by the logic in GET_INSTANCE.
    This is usually VNR, VNRVVS, or VNAME.

  • IV_GUID: Unique technical identifier from administrative data of the specification object.

Maintain customizing

  • Call up basic settings and create specification type object DOMAIN

    • Assign class ZCL_QP_DOMAIN

  • Call up specification types and assign specification type object to DOMAIN