Procedure documentationReading a Multiline Object Reference from a Container (BOR) Locate this document in the navigation structure

Prerequisites

The following prerequisites must be fulfilled to read an object reference of a classic object (BOR) from a container:

  • For function modules, the include file <CNTN01> must be incorporated in the program. For ABAP classes, the include files <CNTN02> and <CNTN03> must be incorporated. For more information, see Macro Instructions for Processing a Container.

    Note Note

    These prerequisites are always fulfilled if you are in the implementation program. The container is then addressed with the name CONTAINER.

    End of the note.
  • The object references of the container must not be persistent.

    Note Note

    Containers passed using a function module interface always contain persistent object references. Before you read object references from a container and store them in a variable, you must make all object references in the container into runtime references. To do this, execute the following macro instruction:

    SWC_CONTAINER_TO_RUNTIME <Container>

    End of the note.

    Note Note

    You must process a container with this macro if you:

    End of the note.

Procedure

  1. Create a variable for the multiline object reference. Use the following command to do this:

    DATA <Object list> TYPE SWC_OBJECT OCCURS 0.

  2. Create a variable for an object reference. Use the following command to do this:

    DATA <Object> TYPE SWC_OBJECT.

  3. Read the multiline object reference from the container. Use the following command to do this:

    SWC_GET_TABLE <Container> <Containerelement> <Objectlist>.

  4. To access the individual object references, read the individual object references from the multiline object reference in a loop. Use the following command to do this:

    READ TABLE <ObjectList> <Index> <Object>.

You can read the object type and the key from the object reference. To do this, use the macros SWC_GET_OBJECT_TYPE and SWC_GET_OBJECT_KEY. For more information, see Macro Instructions for Accessing Objects, Attributes, and Methods.