Documentation View

We are hiring and constantly growing! Have a look through our vacancies to find the right role for you!

ABAPCREATE_OBJECT_EXPLICIT - CREATE OBJECT EXPLICIT

ABAPCREATE_OBJECT_EXPLICIT - CREATE OBJECT EXPLICIT

General Data in Customer Master   RFUMSV00 - Advance Return for Tax on Sales/Purchases  
This documentation is copyright by SAP AG.
SAP E-Book

CREATE OBJECT, TYPE

Short Reference



CREATE OBJECT oref $[area_handle$]
                   TYPE ${ class  $[parameter_list$] $}
                      $| ${ (name) $[parameter_list$| parameter_tables$] $}.


Effect

Creation of an instance of an explicitly specified class. A concrete class that is more specific than or identical to the static type of the object reference variable oref can be specified. The reference variable oref can be a class reference variable or an interface reference variable. The name of the class can be specified as follows:

  • class
Direct static specification as class.
  • (name)
Specification as the content of a character-like data object name. The data object name must contain the name of the class in uppercase letters when the statement is executed. The class name in name can also be an absolute type name. The following can be specified for name:
  • Literal or constant

    If the data object name is specified as a character literal or as a constant, it can be evaluated statically and the specified class is recognized as the used object.

  • Variable

    If the data object name is specified as a variable, it is specified only dynamically and the content is not evaluated statically.

When the statement is executed, name is not evaluated until runtime (in both cases).

The class must be usable at the current position:

  • The addition CREATE of the class definition must allow objects to be created.
  • The package check must allow an object of a global class to be created.

Notes

Example

Creation of an instance of a class cls using an explicit reference to the class. The static type of the reference variable is the root class object and is therefore more general than any other class. Components must be accessed dynamically or a cast must be performed as shown here.






RFUMSV00 - Advance Return for Tax on Sales/Purchases   RFUMSV00 - Advance Return for Tax on Sales/Purchases  
This documentation is copyright by SAP AG.

Length: 4263 Date: 20221203 Time: 175219     sap01-206 ( 49 ms )