*----------------------------------------------------------------------*
* Example: Reading header and position text items                      *
*----------------------------------------------------------------------*
PROGRAM ZZBGS003.
TABLES: TLINE  .

DATA: BEGIN OF XTHEAD OCCURS 10.
        INCLUDE STRUCTURE THEAD.
DATA: END OF XTHEAD.

DATA: BEGIN OF ZZTLINE OCCURS 10.
        INCLUDE STRUCTURE TLINE.
DATA: END OF ZZTLINE.

  XTHEAD-TDID     = '0001'.           "TEXT-ID
  XTHEAD-TDSPRAS  = SY-LANGU.         "Language
  XTHEAD-TDNAME   = '0000000335'.     "Document identification
  XTHEAD-TDOBJECT = 'VBBP'.           "Object type top/position

  CALL FUNCTION 'READ_TEXT'
       EXPORTING
            ID              = XTHEAD-TDID
            LANGUAGE        = XTHEAD-TDSPRAS
            NAME            = XTHEAD-TDNAME
            OBJECT          = XTHEAD-TDOBJECT
       IMPORTING
            HEADER          = XTHEAD
       TABLES
            LINES           = ZZTLINE
       EXCEPTIONS
            ID              = 01
            LANGUAGE        = 02
            NAME            = 03
            NOT_FOUND       = 04
            OBJECT          = 05
            REFERENCE_CHECK = 06.

  BREAK-POINT.                       "Look into the table to see
                                     "what you found