Ansicht
Dokumentation

ABENNEW_CONSTRUCTOR_PARAMS_SINGLE - NEW CONSTRUCTOR PARAMS SINGLE

ABENNEW_CONSTRUCTOR_PARAMS_SINGLE - NEW CONSTRUCTOR PARAMS SINGLE

General Material Data   CL_GUI_FRONTEND_SERVICES - Frontend Services  
This documentation is copyright by SAP AG.
SAP E-Book

NEW, Single Value for All Data Types

... NEW dtype$|#( $[let_exp$] dobj ) ...

Effect

If dtype is a non-generic elementary data type, a structured type, a table type, or a reference type or # is used for a type like this, a single data object dobj can be specified as a unnamed argument that is convertible to or from data type dtype. dobj is a general expression position. The value of dobj is assigned to the created anonymous data object. The assignment is made in accordance with the applicable assignment rules. Optionally, a LET expression let_exp can be specified in front of the data object to define local helper fields.

Notes

  • In particular, an expression specified for dobj can be a constructor expression itself or contain a constructor expression.
  • When a constructor expression is assigned to a reference variable using NEW, the original reference is available in the entire expression in the target variable. The target variable is not overwritten until the expression is completed.

Example

Construction of an anonymous data object of the type string, whose value is determined using a string expression.

Example

For each line read, a structured anonymous data object is created in a SELECT loop, to which the content of the line is assigned. The object is created in the general expression position of the statement APPEND and the created data reference is appended directly to an internal table with the appropriate line type. The result is a table that references all new anonymous data objects.






CPI1466 during Backup   SUBST_MERGE_LIST - merge external lists to one complete list with #if... logic for R3up  
This documentation is copyright by SAP AG.

Length: 2115 Date: 20240427 Time: 064124     sap01-206 ( 51 ms )