Skip to main content

YCLASSICAL_JOINING

*&---------------------------------------------------------------------* *& Report  YCLASSICAL_JOINING *& *&---------------------------------------------------------------------* *& *& *&---------------------------------------------------------------------* REPORT   yclassical_joining  NO   STANDARD   PAGE  HEADING                               LINE - SIZE   110                               LINE - COUNT   255                               MESSAGE - ID  zsan. ** T Y P E    D E C L A R A T I O N ** TYPES  :  BEGIN   OF  ty_mara,          matnr  TYPE  matnr,          ernam  TYPE  ernam,          pstat  TYPE  pstat_d,          END   OF  ty_mara,          BEGIN   OF  ty_makt,          matnr  TYPE  matnr,          spras  TYPE  spras,          maktx  TYPE  maktx,          END   OF  ty_makt,          BEGIN   OF  ty_final,          matnr  TYPE  matnr,          ernam  TYPE  ernam,          pstat  TYPE  pstat_d,          maktx  TY

All about Classes in ABAP Object Oriented Programming?

All about Classes in ABAP Object Oriented Programming?

Class describes real world Object that may be car ,home and Animal .In ABAP Object Oriented (OO)Programming ,Class concept is first and Fore most Topic ,so through this post ,we will learn class in ABAP and Types of class and How to create classes and Methods in SAP ABAP.
Class consists the Properties and Attributes.
Properties are Methods or Functions or Procedures.
Attributes are Variables .
One class can have Any number of Objects that is Object is like a class but object can never be a Class.
Example :Car is a class ,Here class contains some common Properties for its related Objects.
Object may be different companies like Ford Maruthi etc.
Objects are instances of a class ,so for one class ,we can create many objects
Class Definition in SAP ABAP
Class: we can build an Object properties using class.
The attributes of objects are defined by the components of the class, which describe the state and behavior of Objects.
Local and Global Classes
Classes in ABAP Objects can be declared either globally or locally. You define global classes and interfaces in the Class Builder (Transaction SE24) in the ABAP Workbench.
Local Classes are Custom Classes which created by us to use it in our Local Program which starts with the X or Y ,These classes are created in class Builder.
Creating Local Classes
Class Definition contains the declaration for all components (attributes, methods, events) of the class.
CLASS class DEFINITION.
...
ENDCLASS.
The implementation part of a class contains the implementation of all methods of the class.
CLASS class IMPLEMENTATION.
...
ENDCLASS.
Class Functionality
A class contains components
Each component is assigned to a visibility section
Classes implement methods
Class Elements:
All components are declared in the declaration part of the class.
Attributes
Attributes are internal data fields within a class that can have any ABAP data type.
Instance Attributes
The contents of instance attributes define the instance-specific state of an object. You declare them using the DATA statement.
Static Attributes
The contents of static attributes define the state of the class that is valid for all instances of the class. Static attributes exist once for each class. You declare them using the CLASS-DATA statement.
Methods
Methods are internal Functions in a class that define the behavior of an object. They can access all of the attributes of a class.
METHOD meth.
...
ENDMETHOD.
Instance Methods
You declare instance methods using the METHODSstatement. They can access all of the attributes of a class, and can trigger all of the events of the class.
Static Methods
You declare static methods using the CLASS-METHODS statement. They can only access static attributes and trigger static events.
Special Methods
As well as normal methods, which you call using CALL METHOD, there are two special methods called constructor and class_constructor that are automatically called when you create an object or when you first access the components of a class.
Events
Objects or classes can use events to trigger event handler methods in other objects or classes.
Instance Events
You declare instance events using the EVENTSstatement. An instance event can only be triggered in an instance method.
Static Events
You declare static events using the CLASS-EVENTSstatement.
Types
You can define your own ABAP data types within a class using the TYPESstatement.
Visibility Sections or Access Specifiers
You can divide the declaration part of a class into up to three visibility areas:
CLASS class DEFINITION.
PUBLIC SECTION.
...
PROTECTED SECTION.
...
PRIVATE SECTION.
...
ENDCLASS.
Public Section
All of the components declared in the public section are accessible to all users of the class.
Protected Section
All of the components declared in the protected section are accessible to all methods of the class and of classes that inherit from it.
Private Section
Components that you declare in the private section are only visible in the methods of the same class.
Classes with Non-Public Instantiation
Using the statement
CLASS class DEFINITON CREATE PROTECTED|PRIVATE.
If you learn Object Oriented Programming ,there is more choice to select for interview among ABAP peers.

Comments

Popular posts from this blog

How to Create SAP ABAP Query Using SQ01 Step by Step Guide

How to Create SAP ABAP Query Using SQ01 Step by Step. You can create ABAP query objects ,if they are not exist in the SAP system. You can create SAP query without  ABAP programming knowledge. ABAP Query provides users with a variety of ways to define and create different types of  reports , such as  Basic Lists ,  Stats , and  Sorted Lists . ABAP query consists of four elements: Queries InfoSets Groups Translation query Queries The query component is used by end users for Queries. You can create queries, change and queries executed. Transaction  SQ01. Trnslation component / QUERY Many texts to define queries, InfoSets and user groups are generated. These texts are displayed in the language we choose to access the SAP system. We can compare the text or languages ​​that use this component. InfoSets InfoSets are the views of the Special Data Sources. An InfoSet Describes the fields of a data source that can be reported in the query. An InfoSet can be assig

BADI in SAP ABAP Step by Step

BADI in SAP ABAP Step by Step BAdI Acronym of Business Add Ins As a customer outsider, it helps BAdI to improve SAP functionality. Why is BADI? Unlike previous improvement methods, BADI continues the approach aimed at re-use objectives. BADI can be used in a number of times that these standard evaluation techniques can only be used once. For example, if you are upgrading a custom project, you can not map the extension on other custom projects. In order to overcome this disadvantage, SAP provided a new evaluation technique called BADI. Code of transaction for BADI definition: SE18 When you create a BAdI definition, you create a class interface automatically and you can define the methods in the interface. The application of the methods can be made in SE19 transactions. When created BAD, they are generated automatically: An interface with 'IF_EX_' is inserted between the first and second characters of the BAdi name Class classified as 'CL_EX_' inserted betwee

SAP Table Structure T-codes

SAP table structure tcodes E11 - ABAP Dictionary Maintenance Basis - Dictionary Maintenance SE14 - Utilities for Dictionary tables Basis - Activation Program, Conversion Program, DB Utility, MC,  SPDDCU61 - Create table structure Cross Application - Object Dependencies CU63 - Display table structure Cross Application - Object Dependencies CU62 - Change table structure Cross Application - Object Dependencie CU64 - table structure List Cross Application - Object Dependencies LBWE - LO Data Ext.: Customizing Cockpit Logistics - Logistics Information System (LIS)RSA6 - Maintain DataSources Basis - BW Service APIRSO2 - Oltp Metadata Repository Basis - BW Service  APISE84 - Repository Information System Basis - Workbench Tools: Editors, Painters, Modelers SE38 - ABAP Editor Basis - ABAP Editor SE16 - Data Browser Basis - Workbench Utilities SM30 - Call View Maintenance Basis - Table Maintenance Tool SE37 - ABAP Function Modules Basis - Function Builder SE80 - Object Navigator