sapdev logo background
sapdev logo sapdev logo
Comments

SAP OO OBS READ DBTAB 1 documentation, setup help and example usage



Return to SAP documentation index


INCLUDE
ARTICLE

Cannot Use READ TABLE

You cannot use READ TABLE to read data from database tables in ABAP Objects.

  • In ABAP Objects, the following statements cause an error message:


  • t100 = space.
    t100-sprsl = 'D'.
    t100-arbgb = 'BC'.
    t100-msgnr = '100'.

    READ TABLE t100.
  • Correct syntax:


  • DATA wa TYPE t100.

    SELECT SINGLE * FROM t100 INTO wa WHERE sprsl = 'D' AND
    arbgb = 'BC' AND
    msgnr = '100'.
  • Cause:


  • The Open-SQL statement SELECT has replaced READ TABLE
    . The latter works only with database tables whose names correspond to the naming conventions for R/2-ATAB tables (maximum of 5 characters, starting with T) and with table work areas declared using TABLES , which are not supported in ABAP Objects. Generic key values are used for accesses, which are taken from the filled area of the table work area from left to right. Instead, declare the key explicitly in the WHERE clause of the SELECT statement.
    Documentation extract taken from SAP system, � Copyright SAP AG. All rights reserved




    OO_OBS_READ_1
    OO_OBS_REFERENCE_1




    comments powered by Disqus