sapdev logo background
sapdev logo sapdev logo
Comments

SAP NEW CONSTRUCTOR PARAMS INITIAL documentation, setup help and example usage



Return to SAP documentation index


ARTICLE

NEW - Initial Value for All Types

Syntax
... NEW dtype|class|#( ) ...

Effect
If no parameters are specified,
  • an anonymous data object retains its type-specific initial value,

  • no values are passed to the instance constructor of an object.

  • This is possible for every non-generic data type dtype . The instance constructor of a class class can either have only optional input parameters or no input parameters at all. The # symbol can stand for appropriate types.

    Example
    After the following program section is executed, dref points to an empty internal table with the row type T100 . Both constructor expressions have the same function.
    TYPES t_itab TYPE TABLE OF t100 WITH EMPTY KEY.

    DATA dref TYPE REF TO t_itab.

    dref = NEW #( ).
    dref = NEW t_itab( ).
    Documentation extract taken from SAP system, � Copyright SAP AG. All rights reserved




    NEW_CONSTRUCTOR_PARAMS_CLASS
    NEW_CONSTRUCTOR_PARAMS_ITAB




    comments powered by Disqus