No, we can have an inline declaration of the new variable on LHS and just mention the method call on RHS without writing RETURNING parameters to directly capture the returning parameter from the method.
Static methods are methods which can be called irrespective of the class instance. Only static attributes and static events can be accessed within the Static method. Memory is allocated once. Instance methods are methods which can be ONLY called using the object reference. Instance methods can access instance attributes and instance events. Memory is allocated for each object instance.
1. Create a Private Class
2. Declare a private attribute with reference to the same class, in which it is being declared.
3. Create a public static method with returning parameter, having a reference of the same class.
2. Declare a private attribute with reference to the same class, in which it is being declared.
3. Create a public static method with returning parameter, having a reference of the same class.
data: lo_ref type ref to object.
create object lo_Ref type ('ZCLASS').
call method lo_ref->('METH_1').
create object lo_Ref type ('ZCLASS').
call method lo_ref->('METH_1').