

{"id":92358,"date":"2021-05-06T09:00:12","date_gmt":"2021-05-06T03:30:12","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=85813"},"modified":"2021-05-06T12:13:01","modified_gmt":"2021-05-06T06:43:01","slug":"sap-abap-objects-and-classes","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/sap-abap-objects-and-classes\/","title":{"rendered":"Object Oriented SAP ABAP &#8211; Objects and Classes"},"content":{"rendered":"<p>In this tutorial, we\u2019ll be learning about one of the principles upon which ABAP is built &#8211; Object Oriented Programming.<\/p>\n<p>We will learn about what OOP means, and also what it entails in the world of SAP ABAP.<\/p>\n<h3>What is OOP?<\/h3>\n<ul>\n<li>Object Oriented programming breaks down tasks into objects that have data and function.<\/li>\n<li>This method makes software programming understandable, flexible and reusable.<\/li>\n<li>Object-Oriented Programing (OOP) was created with simplicity and eloquence in mind.<\/li>\n<li>It makes people communicate clearly, exchange information and ideas using a common language &#8211; the language of objects.<\/li>\n<li>These objects are made up of their two main characteristics &#8211; properties (data) and behaviour (or functions)<\/li>\n<\/ul>\n<p>The main characteristics of OOP are &#8211;<\/p>\n<ol>\n<li>Data abstraction<\/li>\n<li>Encapsulation<\/li>\n<li>Emphasis on data rather than procedure<\/li>\n<li>Usage of real-world entities called \u2018object\u2019<\/li>\n<li>Data privacy and protection<\/li>\n<\/ol>\n<h3>POP vs OOP<\/h3>\n<p>Procedure-Oriented Programming (POP) approaches problems in a top-down method. It emphasizes procedure rather than data in a linear fashion.<\/p>\n<p>Let us see a few differences between POP and OOP &#8211;<\/p>\n<table>\n<tbody>\n<tr>\n<td><b>POP<\/b><\/td>\n<td><b>OOP<\/b><\/td>\n<\/tr>\n<tr>\n<td>POP stands for Procedure-Oriented programming<\/td>\n<td>OOP stands for Object-Oriented programming<\/td>\n<\/tr>\n<tr>\n<td>It focuses on procedure (doing tasks) rather than data (tasks)<\/td>\n<td>It focuses on data\/tasks rather than procedure<\/td>\n<\/tr>\n<tr>\n<td>POP follows top-down fashion in problem-solving<\/td>\n<td>OOP follows bottom-up fashion in problem-solving<\/td>\n<\/tr>\n<tr>\n<td>It divides a program into smaller parts called functions or modules<\/td>\n<td>It divides a program into smaller parts called objects<\/td>\n<\/tr>\n<tr>\n<td>Functions share global data and data cannot be hidden from each other<\/td>\n<td>Functions do not share global data &#8211; you can decide who can access your data<\/td>\n<\/tr>\n<tr>\n<td>There is not much emphasis on data protection<\/td>\n<td>One of the main points of focus in OOP is data protection<\/td>\n<\/tr>\n<tr>\n<td>Extending functionality and addition of data is tedious and time-consuming<\/td>\n<td>It is very easy to extend functionality and add new data, by simply adding new objects<\/td>\n<\/tr>\n<tr>\n<td>Concepts of inheritance, polymorphism, encapsulation are not used<\/td>\n<td>Concepts of inheritance, polymorphism, encapsulation form the very basis of OOP<\/td>\n<\/tr>\n<tr>\n<td>E.g. C, Pascal, FORTRAN<\/td>\n<td>E.g. Java, Python, C++<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>OOP in ABAP<\/h3>\n<ul>\n<li>Initially, SAP developed ABAP as a POP language.<\/li>\n<li>However, as time progressed, they shifted it and transformed it into an OOP language<\/li>\n<li>Hence, ABAP now follows the tenets of object orientation and paradigms like objects.<\/li>\n<li>As part of OOP, ABAP uses the concepts of inheritance, overloading, data hiding, etc. for better functionality.<\/li>\n<\/ul>\n<p>Let us begin by understanding a few basic terms of OOP<\/p>\n<h4>Basic terms to know<\/h4>\n<table>\n<tbody>\n<tr>\n<td><b>TERM<\/b><\/td>\n<td><b>MEANING<\/b><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Object<\/span><\/td>\n<td><span style=\"font-weight: 400;\">a real-world entity that has data and behaviour<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Class<\/span><\/td>\n<td><span style=\"font-weight: 400;\">a complex collection of objects that mainly contain data fields and characteristics pertaining to the data<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Method<\/span><\/td>\n<td><span style=\"font-weight: 400;\">behaviour of an object i.e. function modules that the object performs<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Member<\/span><\/td>\n<td><span style=\"font-weight: 400;\">either the data member or member function of a class<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Instance<\/span><\/td>\n<td><span style=\"font-weight: 400;\">synonym of object, usually used as \u2018instance of a class\u2019<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Instantiation<\/span><\/td>\n<td><span style=\"font-weight: 400;\">creating a new object of a class<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>Objects in SAP ABAP<\/h3>\n<ul>\n<li>An object is a real-world entity that contains data and behaviour.<\/li>\n<li>These characteristics and behaviour define the state of the object, and the actions that the object will perform.<\/li>\n<li>An object, as mentioned previously, is a blueprint or instance of a class.<\/li>\n<li>For e.g. an employee, a book, an apple tree &#8211; all are objects.<\/li>\n<\/ul>\n<h3>Creating an Object in ABAP<\/h3>\n<p>Let us see how to create an object in ABAP &#8211;<\/p>\n<p><strong>Syntax:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">DATA: &lt;object_name&gt; TYPE REF TO &lt;class_name&gt;. \u201cCreate reference variable\r\n  CREATE Object: &lt;object_name&gt;. #Create object from ref. var.\r\n<\/pre>\n<p><strong>Example:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">DATA: dataflairobject TYPE REF TO dataflairclass.\r\n        CREATE Object: dataflairobject.<\/pre>\n<p><strong>Report example:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">REPORT ZR_SS_DATAFLAIR_SAMPLE_001.\r\n\r\nCLASS ClassDataFlair Definition.\r\nPublic Section.\r\nDATA: dataflairtext(45) VALUE 'Data Flair OOPS tutorial in ABAP: data.'.\r\nMETHODS: DataFlairMethod.\r\nENDCLASS.\r\n\r\nCLASS ClassDataFlair Implementation.\r\nMETHOD DataFlairMethod.\r\nWrite:\/ 'Data Flair OOPS tutorial in ABAP: method.'.\r\nENDMETHOD.\r\nENDCLASS.\r\n\r\nSTART-OF-SELECTION.\r\nDATA: ClassDataFlair TYPE REF TO ClassDataFlair.\r\nCREATE Object: ClassDataFlair.\r\nWrite:\/ ClassDataFlair-&gt;dataflairtext.\r\nCALL METHOD: ClassDataFlair-&gt;DataFlairMethod.<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\"><span style=\"font-weight: 400;\">Data Flair OOPS tutorial in ABAP: data.<\/span><br \/>\n<span style=\"font-weight: 400;\">Data Flair OOPS tutorial in ABAP: method.<\/span><\/div>\n<h3>Classes in SAP ABAP<\/h3>\n<ul>\n<li>A class is a complex collection of objects<\/li>\n<li>It contains data members (characteristics) and member methods (functions) together wrapped into a single entity called object<\/li>\n<li>Classes are where objects are created and defined<\/li>\n<li>We also define and declare function modules in a class<\/li>\n<li>We can describe the privacy of a class<\/li>\n<li>What this means is, we can define who all can have access to particular data of a class<\/li>\n<\/ul>\n<h3>Creating a Class in ABAP<\/h3>\n<p>Creating a class in ABAP has two steps &#8211;<\/p>\n<p><strong>1. Declaration<\/strong><\/p>\n<p><strong>Syntax &#8211;<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">CLASS &lt;class_name&gt; DEFINITION.\r\n\/\/define class\r\nENDCLASS.<\/pre>\n<p><strong>Example &#8211;<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">CLASS dataflairclass DEFINITION.\r\n\/\/define class\r\nENDCLASS.<\/pre>\n<p><strong>2. Definition<\/strong><\/p>\n<p><strong>Syntax &#8211;<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">CLASS &lt;class_name&gt; IMPLEMENTATION.\r\n\/\/define class\r\nENDCLASS.<\/pre>\n<p><strong>Example &#8211;<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">CLASS dataflairclass IMPLEMENTATION.\r\n\/\/define class\r\nENDCLASS.<\/pre>\n<h3><span style=\"font-weight: 400;\">Attributes in SAP ABAP<\/span><\/h3>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Attributes are the characteristics of the class<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">They can have any pre-defined data type like P, F, I, etc.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">We must declare attributes in class declaration section<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Attributes are of two types:<\/span>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\"><strong>Instance<\/strong>: this includes the instance-specific state of object, the changes are different for all objects, and this is declared by DATA statement<\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\"><strong>Static<\/strong>: this includes common state of the class to be shared by all instances of class, hence when we change one state then all other objects can see the change, declared by CLASS-DATA statement<\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h3><span style=\"font-weight: 400;\">Methods in SAP ABAP<\/span><\/h3>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">A method is a module or a function<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">It is the behaviour of the object of a class<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">A method can access any characteristic of a class<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">It contains actions to be performed by objects that call upon the class<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Method definition may or may not contain parameters, which are passed when the method is called<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">We can define a method using METHOD and ENDMETHOD statements<\/span><\/li>\n<\/ul>\n<p><strong>Syntax:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">METHOD\r\n\r\n\u2026\r\n\r\nENDMETHOD<\/pre>\n<h3><span style=\"font-weight: 400;\">Accessing Attributes and Methods in SAP ABAP<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">1. Methods and attributes can be accessed by objects of the class<\/span><\/p>\n<p><span style=\"font-weight: 400;\">2. The access specifiers &#8211; public, private and protected &#8211; work the same way as they do for class access specifiers<\/span><\/p>\n<ul>\n<li><span style=\"font-weight: 400;\">If we declare them public, they can be accessed by any class<\/span><\/li>\n<li>When we declare them private, they cannot be accessed by any class<\/li>\n<li>If we declare them protected, they can only be accessed by inheriting classes<\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">Let us see an example of how to write classes, attributes and methods and access them &#8211;<\/span><\/p>\n<p><span style=\"font-weight: 400;\"><strong>Example:<\/strong><\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">REPORT ZR_SS_DATAFLAIR_SAMPLE_001.\r\n\r\nCLASS dataflairclass Definition.\r\n   PUBLIC Section.\r\n      Data: dataflairtext01 Type char25 Value 'Public Data Flair'.\r\n      Methods dataflairmethod.\r\n\r\n   PROTECTED Section.\r\n      Data: dataflairtext02 Type char25 Value 'Protected Data Flair'.\r\n\r\n   PRIVATE Section.\r\n      Data: dataflairtext03 Type char25 Value 'Private Data Flair'.\r\nENDCLASS.\r\n\r\nCLASS dataflairclass Implementation.\r\n   Method dataflairmethod.\r\n      Write: \/ 'Public Method:',\r\n             \/ dataflairtext01,\r\n             \/ dataflairtext02,\r\n             \/ dataflairtext03.\r\n      Skip.\r\n   EndMethod.\r\nENDCLASS.\r\n\r\nStart-Of-Selection.\r\n   Data: Objectx Type Ref To dataflairclass.\r\n   Create Object: Objectx.\r\n   CALL Method: Objectx-&gt;dataflairmethod.\r\n   Write: \/ Objectx-&gt;dataflairtext01.\r\n\r\n<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\"><span style=\"font-weight: 400;\">Public Method:<\/span><br \/>\n<span style=\"font-weight: 400;\">Public Data Flair<\/span><br \/>\n<span style=\"font-weight: 400;\">Protected Data Flair<\/span><br \/>\n<span style=\"font-weight: 400;\">Private Data Flair<\/span><span style=\"font-weight: 400;\">Public Data Flair<\/span><\/div>\n<p><strong>Example of Static Attributes in SAP ABAP<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">REPORT ZR_SS_DATAFLAIR_SAMPLE_001.\r\n\r\nCLASS dataflairclass Definition.\r\n   PUBLIC Section.\r\n      CLASS-DATA: dataflairname Type char45,\r\n                  dataflairdata Type I.\r\n   Methods: dataflairmethod.\r\nENDCLASS.\r\n\r\nCLASS dataflairclass Implementation.\r\n   Method dataflairmethod.\r\n      Do 4 Times.\r\n         dataflairdata = 1 + dataflairdata.\r\n         Write: \/ dataflairdata, dataflairname.\r\n      EndDo.\r\n      Skip.\r\n   EndMethod.\r\nENDCLASS.\r\n\r\nStart-Of-Selection.\r\n   dataflairclass=&gt;dataflairname = 'ABAP Object Oriented Programming'.\r\n   dataflairclass=&gt;dataflairdata = 0.\r\n   Data: Object1 Type Ref To dataflairclass,\r\n         Object2 Type Ref To dataflairclass.\r\n\r\n   Create Object: Object1, Object2.\r\n   CALL Method: Object1-&gt;dataflairmethod,\r\n                Object2-&gt;dataflairmethod.\r\n<\/pre>\n<h3><span style=\"font-weight: 400;\">Constructors in SAP ABAP<\/span><\/h3>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Constructors are special types of methods<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">When we create an object, we need to initialise it and constructors do the job of initialising data for the objects<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">The program calls constructors automatically when an object of the class is created<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">The constructor will trigger the operation included whenever an object is newly created in execution<\/span><\/li>\n<\/ul>\n<p><strong>Example of ABAP Constructors<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">REPORT ZR_SS_DATAFLAIR_SAMPLE_001.\r\n\r\nCLASS dataflairclass Definition.\r\n   PUBLIC Section.\r\n      Methods: dataflairmethod, constructor.\r\nENDCLASS.\r\n\r\nCLASS dataflairclass Implementation.\r\n   Method dataflairmethod.\r\n      Write: \/ 'This is the method'.\r\n   EndMethod.\r\n\r\n   Method constructor.\r\n      Write: \/ 'This is the constructor'.\r\n   EndMethod.\r\nENDCLASS.\r\n\r\nStart-Of-Selection.\r\n   Data Object1 Type Ref To dataflairclass.\r\n   Create Object Object1.\r\n<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\"><span style=\"font-weight: 400;\">This is the constructor<\/span><\/div>\n<h3><span style=\"font-weight: 400;\">ME Operator in SAP ABAP<\/span><\/h3>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Whenever we redefine a variable within a method with a different value, that method will use the redefined value of the variable<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">However, if you want to access the originally declared value, then you can use the ME operator<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Let us see an example of using the ME operator<\/span><\/li>\n<\/ul>\n<p><strong>Example of ME Operator in ABAP<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">REPORT ZR_SS_DATAFLAIR_SAMPLE_001.\r\n\r\nCLASS dataflairclass Definition.\r\n   PUBLIC Section.\r\n\r\nData dataflairtext Type char25 Value 'Here we have class value'.\r\n   Methods dataflairmethod.\r\nENDCLASS.\r\n\r\nCLASS dataflairclass Implementation.\r\n   Method dataflairmethod.\r\n\r\nData dataflairtext Type char25 Value 'Here we have method value'.\r\n   Write: \/ ME-&gt;dataflairtext,\r\n          \/ dataflairtext.\r\n   ENDMethod.\r\nENDCLASS.\r\n\r\nStart-Of-Selection.\r\n   Data objectx Type Ref To dataflairclass.\r\n   Create Object objectx.\r\n   CALL Method objectx-&gt;dataflairmethod.\r\n<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\"><span style=\"font-weight: 400;\">Here we have <\/span><span style=\"font-weight: 400;\">class value<\/span><br \/>\n<span style=\"font-weight: 400;\">Here we have method value<\/span><\/div>\n<h3>Summary<\/h3>\n<p>Thus, in this tutorial, we learnt about the basics upon which ABAP and many other languages are built &#8211; object oriented programming. We learnt about how object orientation is different from procedure orientation, its importance and most important terms.<\/p>\n<p>In part #2 of this tutorial, we will dive into further concepts of object orientation like inheritance, polymorphism, etc.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial, we\u2019ll be learning about one of the principles upon which ABAP is built &#8211; Object Oriented Programming. We will learn about what OOP means, and also what it entails in the&#46;&#46;&#46;<\/p>\n","protected":false},"author":5,"featured_media":93908,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23786],"tags":[24074,24075,24076,24077],"class_list":["post-92358","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-sap-abap","tag-object-oriented-sap-abap-objects-and-classes","tag-sap-abap-classes","tag-sap-abap-object-orientation","tag-sap-abap-objects"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Object Oriented SAP ABAP - Objects and Classes - DataFlair<\/title>\n<meta name=\"description\" content=\"Learn What is OOP, POP vs OOP, OOP in ABAP and related terms, Objects and their creation, Classes and Creating a class in ABAP.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/data-flair.training\/blogs\/sap-abap-objects-and-classes\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Object Oriented SAP ABAP - Objects and Classes - DataFlair\" \/>\n<meta property=\"og:description\" content=\"Learn What is OOP, POP vs OOP, OOP in ABAP and related terms, Objects and their creation, Classes and Creating a class in ABAP.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/sap-abap-objects-and-classes\/\" \/>\n<meta property=\"og:site_name\" content=\"DataFlair\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DataFlairWS\/\" \/>\n<meta property=\"article:published_time\" content=\"2021-05-06T03:30:12+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-05-06T06:43:01+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/SAP-ABAP-OOPS-Part1-1.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"DataFlair Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:site\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"DataFlair Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Object Oriented SAP ABAP - Objects and Classes - DataFlair","description":"Learn What is OOP, POP vs OOP, OOP in ABAP and related terms, Objects and their creation, Classes and Creating a class in ABAP.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/data-flair.training\/blogs\/sap-abap-objects-and-classes\/","og_locale":"en_US","og_type":"article","og_title":"Object Oriented SAP ABAP - Objects and Classes - DataFlair","og_description":"Learn What is OOP, POP vs OOP, OOP in ABAP and related terms, Objects and their creation, Classes and Creating a class in ABAP.","og_url":"https:\/\/data-flair.training\/blogs\/sap-abap-objects-and-classes\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2021-05-06T03:30:12+00:00","article_modified_time":"2021-05-06T06:43:01+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/SAP-ABAP-OOPS-Part1-1.jpg","type":"image\/jpeg"}],"author":"DataFlair Team","twitter_card":"summary_large_image","twitter_creator":"@DataFlairWS","twitter_site":"@DataFlairWS","twitter_misc":{"Written by":"DataFlair Team","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/sap-abap-objects-and-classes\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/sap-abap-objects-and-classes\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/7f83c342f5d1632d6f7b4b0b0f447823"},"headline":"Object Oriented SAP ABAP &#8211; Objects and Classes","datePublished":"2021-05-06T03:30:12+00:00","dateModified":"2021-05-06T06:43:01+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/sap-abap-objects-and-classes\/"},"wordCount":1149,"commentCount":0,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/sap-abap-objects-and-classes\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/SAP-ABAP-OOPS-Part1-1.jpg","keywords":["Object Oriented SAP ABAP - Objects and Classes","SAP ABAP Classes","SAP ABAP Object orientation","SAP ABAP Objects"],"articleSection":["SAP ABAP Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/sap-abap-objects-and-classes\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/sap-abap-objects-and-classes\/","url":"https:\/\/data-flair.training\/blogs\/sap-abap-objects-and-classes\/","name":"Object Oriented SAP ABAP - Objects and Classes - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/sap-abap-objects-and-classes\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/sap-abap-objects-and-classes\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/SAP-ABAP-OOPS-Part1-1.jpg","datePublished":"2021-05-06T03:30:12+00:00","dateModified":"2021-05-06T06:43:01+00:00","description":"Learn What is OOP, POP vs OOP, OOP in ABAP and related terms, Objects and their creation, Classes and Creating a class in ABAP.","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/sap-abap-objects-and-classes\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/sap-abap-objects-and-classes\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/sap-abap-objects-and-classes\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/SAP-ABAP-OOPS-Part1-1.jpg","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/05\/SAP-ABAP-OOPS-Part1-1.jpg","width":1200,"height":628,"caption":"SAP ABAP OOPS"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/sap-abap-objects-and-classes\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"SAP ABAP Tutorials","item":"https:\/\/data-flair.training\/blogs\/category\/sap-abap\/"},{"@type":"ListItem","position":3,"name":"Object Oriented SAP ABAP &#8211; Objects and Classes"}]},{"@type":"WebSite","@id":"https:\/\/data-flair.training\/blogs\/#website","url":"https:\/\/data-flair.training\/blogs\/","name":"DataFlair","description":"Learn Today. Lead Tomorrow.","publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/data-flair.training\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/data-flair.training\/blogs\/#organization","name":"DataFlair","url":"https:\/\/data-flair.training\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","width":106,"height":48,"caption":"DataFlair"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DataFlairWS\/","https:\/\/x.com\/DataFlairWS","https:\/\/www.linkedin.com\/company\/dataflair-web-services-pvt-ltd\/","https:\/\/www.youtube.com\/user\/DataFlairWS"]},{"@type":"Person","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/7f83c342f5d1632d6f7b4b0b0f447823","name":"DataFlair Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/4cf3a74600d131330b8c481d519afd1574093ed89f6d3396a95393ad223eb7cd?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/4cf3a74600d131330b8c481d519afd1574093ed89f6d3396a95393ad223eb7cd?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4cf3a74600d131330b8c481d519afd1574093ed89f6d3396a95393ad223eb7cd?s=96&d=mm&r=g","caption":"DataFlair Team"},"description":"DataFlair Team creates expert-level guides on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. Our goal is to empower learners with easy-to-understand content. Explore our resources for career growth and practical learning.","url":"https:\/\/data-flair.training\/blogs\/author\/dfteam1\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/92358","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/comments?post=92358"}],"version-history":[{"count":1,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/92358\/revisions"}],"predecessor-version":[{"id":93909,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/92358\/revisions\/93909"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/93908"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=92358"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=92358"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=92358"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}