Get Example source ABAP code based on a different SAP table
ARTICLE
NEW - Classes
Syntax ... NEW class|#( p1 = a1 p2 = a2 .. ) ...
Effect If a class class is specified or # stands for a class like this, the non-optional input parameters p1 p2 ... of the instance constructor of the instantiated class must be filled using the type-compliant actual parameters a1 a2 .... The optional input parameters do not need to be filled. The description of the statement CREATE OBJECT specifies how values are passed by parameter and which classes can be used. No parameters are passed for a class without an explicit instance constructor Like an object reference variable of the type class, a constructor expression NEW class( ... ) can be specified before the object component selector -> and in chained attribute accesses and chained method calls. A chained method call of this type can be specified as a standalone statement. This persists the result for the duration of the statement. Even a single expression without a following object component selector can be specified as a standalone statement. In this case, the only constructor executed is the constructor that needs to save a reference to the new object elsewhere (if it needs to be persisted). The following applies in particular to an attribute access NEW class( ... )->attr: