Get text description automatically

REPORT z_get_text.

DATA: text(255) TYPE c.

DATA: text_identifier_obj TYPE REF TO cl_text_identifier.

START-OF-SELECTION.
  CREATE OBJECT text_identifier_obj.

  CALL METHOD text_identifier_obj->read_text
    EXPORTING
      tabname                    = 'MARA'
      fieldname                  = 'MATNR'
      fieldvalue                 = 'C075'
    IMPORTING
      text                       = text
    EXCEPTIONS
      internal_error             = 1
      illegal_call               = 2
      illegal_table              = 3
      illegal_field              = 4
      no_text                    = 5
      record_required            = 6
      illegal_record             = 7
      table_record_required      = 8
      illegal_table_record       = 9
      special_parameter_mismatch = 10
      OTHERS                     = 11
          .

  WRITE: text.

Comments are closed.