ABAP Objects – Class and objects
Why do you need ABAP Objects?
ABAP Objects oriented programming lets you to be at par with the others as this is better methodology. To understand the recent concept of ABAP ,such as BAPI, BADI, WORKFLOW etc. For integration of ABAP with Microsoft Technologies and JAVA as these are build on OOPS concept. To exploit the class resources that has been provided by SAP.
What is ABAP Objects all about?
Class and objects
- Global Class: Global Classes can be accessed in any program. These classes can be accessed from anywhere and are stored in the class repository and this is created using SE24 and should start with Z or Y.
- Local Class: Local Classes are limited to the program in which they are defined. These classes can be accessed from the program in which they are created and it can have any namespace.
Class Declaration in ABAP Objects
A Class declaration would contain two parts. 1) Definition 2) Implementation
CLASS test DEFINITION. {class definition is done here} ENDCLASS. CLASS test IMPLEMENTATION. {method implementation is done here} ENDCLASS.
The above statements would define a local class.
Objects in ABAP Objects
Objects are instance of a Class or in other words they are run time entities. We can create any number of objects for a class.
Creating and accessing Objects.
Data: obj type ref to test.
Create object obj.
WRITE : OBJ->ATTRIBUTE1. (i.e. object name->attribute name)
If you like this post, you may as well like these too:
- ABAP Objects: Components of Class in ABAP Objects Components of Class in ABAP Objects DATA – for instance attributes METHODS – for instance methods EVENTS – for instance events Static components: CLASS-DATA – for static attributes CLASS-METHODS –...
- Not Yet Using ABAP Objects? Eight Reasons why every ABAP Developer should give it a second look. SAP Introducted ABAP objects for a while ago now. Many ABAP Developers turned in and tapped the advantages...
- ABAP Objects – Pros and Cons ABAP Objects establishes a different level of data encapsulation. In procedural programming the state of an application is held by global variables. In object-oriented programming, however, the state is kept...
- ABAP Programs: Copying structured objects * Using move-corresponding to copy fields with the same nameDATA: BEGIN OF MY_CUSTOMER, ID(8) TYPE N, NAME(25), CITY(25), END OF MY_CUSTOMER, BEGIN OF CITY_OF_CUSTOMER, CITY LIKE MY_CUSTOMER-CITY, TEXT(30), ID LIKE...
- ABAP Objects for JAVA Pro’s Contains : Similarities Between Java and ABAP ABAP Special Features Download from rapidshare or mediafire....
- ABAP Source Code: Three approaches to define data objects REPORT ZSOURCE0401.* 1. Elementary typesDATA: CUSTOMER_NAME_1(25) TYPE C, VENDOR_NAME_1(25) TYPE C. * 2. Reference to an existing fieldDATA: CUSTOMER_NAME_2(25) TYPE C, VENDOR_NAME_2 LIKE CUSTOMER_NAME_2. * 3. Reference to a non-elementary...
- ABAP Programs: Complex Non-Elementary Types and Data Objects REPORT ZSOURCE0408. * Nested recordsTYPES: BEGIN OF ADDRESS, CITY(25), STREET(30), END OF ADDRESS, BEGIN OF PERSON, NAME(25), ADDRESS TYPE ADDRESS, END OF PERSON.DATA RECEIVER TYPE PERSON.RECEIVER-NAME = ‘Smith’.RECEIVER-ADDRESS-CITY = ‘Big...
- What is Valuation Class? The Valuation Class in the Accounting 1 View in Material Master is the main link between Material Master and Finance. This Valuation Class along with the combination of the transaction...
- Difference between Class and Object In Object Oriented Programing, A class can be considered as a blueprint or template for a object that specified the attributes and behaviour that all objects of that class will...
- How to Create a Material Class Class is defined as the group of characteristics, which can be attributed to a product. Use Transaction CL01. Enter the value for the Class name and a small description. Select...
- Asset Class The asset class is the main criterion for classifying assets. Every asset must be assigned to only one asset class. Examples of asset class are Plant& Machinery, Furniture & Fixtures,...



















Leave a Reply