SAP ABAP objects are instances of classes. The attributes of objects are defined by components of class which describe the state and behaviour of objects. Objects contain data and perform services. These are known as methods. The data of object cannot be changed directly by the user, but it follows the methods opted by the objects.
An object is a pattern or instance of a class. It represents a real-world entity like variables and constants and programming entities like hardware and software components of a computer.
The three main characteristics of an object are −
The state of an object helps the user to determine a set of attributes and their values. For example, if the user creates a bank account details specified with a set of attributes i.e (data) such as Account Number, Name, Account Type, Balance, and values of all these attributes. That means the state of an object encloses the attributes of an object with its unique identity and the behavior of an object helps to sort out the changes that occur in its attributes over a period of time.
Every object has a unique identity with its distinguishing features from other objects. Two objects may possess the same behaviour, but they may differ in their state and never have the same identity. For example two persons may have the same name, age, and gender but they differ in identity. Likewise, the identity of an object will never change throughout its period of time.
Interaction between the objects takes place by sending messages. Objects contain data and code to manipulate the data. An object can also be used as a user-defined data type with the help of a class. Objects are also called data variables of the type class. The user can create any number of objects belonging. Each object is holds the data of the type class with which it has been created.
To create an object, the following are the steps to include-
Creating a reference variable with reference to the class. The syntax for which is −
Creating an object from the reference variable. The syntax for which is −
The above code produces the following output −
SAP ABAP Related Interview Questions
|SAP CRM Interview Questions||SAP BI Interview Questions|
|SAP MM Interview Questions||SAP BASIS Interview Questions|
|SAP ABAP Web Dynpro Interview Questions||SAP Workflow Interview Questions|
|Sap Abap Hr Interview Questions||SAP ABAP Dictionary Interview Questions|
|SAP ABAP Enhancement Interview Questions||SAP ABAP Module Pool Interview Questions|
|SAP ABAP Report Developer Interview Questions||SAP ABAP Data Dictionary Interview Questions|
|SAP ABAP ALV Reports Interview Questions|
All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.