Sunday, 13 April 2025

Using The “NEW” Constructor Operator in ABAP:

 In ABAP, the NEW constructor operator is used to dynamically create instances of objects. This is commonly used with object-oriented programming in ABAP.

Before

DATA lo_human TYPE REF TO class_human.

CREATE OBJECT lo_human EXPORTING NAME = ‘TONY’.

After:

lo_human = NEW class_human( name = ‘TONY’ ).

No comments:

Post a Comment