sapdev logo background
sapdev logo sapdev logo
Comments

SAP OO OBS LIKE 1 documentation, setup help and example usage



Return to SAP documentation index


INCLUDE
ARTICLE

Cannot Use LIKE Reference to Dictionary Types

In classes, you can only use a TYPE reference to data types in the ABAP Dictionary. The LIKE reference can only be used for local data objects. This also covers the attributes of the class and the data objects of the main program . In global classes, you can only make a reference to the attributes of the class. This applies to data declarations and the typing of interface parameters or field symbols.

  • In ABAP Objects, the following statement causes an error message:


  • DATA f LIKE dbtab.
  • Correct syntax:


  • DATA f TYPE dbtab.
  • Cause:


  • The TYPE addition should be the only construction that allows a reference to data types, while the LIKE addition should only be used for data objects. The
    Repository objects in the ABAP Dictionary are data types, not data objects. Outside the ABAP Objects context, the LIKE reference to database tables and flat structures in the ABAP Dictionary is still allowed for compatibility reasons.
    Documentation extract taken from SAP system, � Copyright SAP AG. All rights reserved




    OO_OBS_LENGTH_1
    OO_OBS_LITERALS_1




    comments powered by Disqus