Preview – OO ABAP: Constructors

Learn ABAP

Click here to download the source code and presentations for this video.

Constructors are methods that are generally called implicitly when a class is instantiated or defined.
This video will teach you about instance and static constructors in ABAP.

Constructors

  • Constructors are methods that are not generally called explicitly (CALL METHOD  or its short form), but are called implicitly.
  • The constructor is a special instance method in a class and is always named CONSTRUCTOR. This abbreviated term actually means the instance constructor.
  • The constructor is automatically called at runtime with the CREATE OBJECT  statement.

A constructor is necessary when, after the instantiation of a class:

  • You need to allocate resources
  • You need to initialize attributes
  • You need to modify static attributes
  • You need to send messages containing the information that a new object was  created

Instance Constructors

  • Each class can have no more than one (instance) constructor
  • The constructor must be defined in the public area
  • The constructor’s signature can only have importing parameters and exceptions
  • When exceptions are raised in the constructor, instances are not created, so no main memory space is occupied
  • Except for one exceptional case, you cannot normally call the constructor explicitly
  • There is no destructor in ABAP Objects.

Purchase a Premium Pass with an access link to watch the full video:
After completion of purchase , download the Premium Pass file where you will find the access link to the video.
You will also receive an email, shortly after the purchase, from Mendoza Learning Hub that will contain the Premium Pass and instructions for your video.


Or, become a Premium Member... - click here to become one

As a Premium member you get access to all of the videos, including this one. Log in to your Premium Account by clicking on 'Sign Up/Log In'. Visit your 'Member Profile' page where you will find access to all the Premium content. Alternately, you can visit the course's main page where you can access the premium videos.

If you didn't receive an email:
Check your spam folder. Many internet providers have spam filters that block emails that contain links. If you’re unable to find the confirmation email, then please contact us.

If you have problems with this video visit Help & Support, or contact us at info@carlosmdubon.com .


If you want a video on a particular topic, fill the form below.

[contact-form][contact-field label='Name' type='name' required='1'/][contact-field label='Email' type='email' required='1'/][contact-field label='Video Topic' type='text' required='1'/][contact-field label='Description' type='textarea' required='1'/][/contact-form]

Preview – OO ABAP: Classes, Attributes & Methods

Click here to download the source code and presentations for this video.

This simple example will show you how to define and implement classes, methods and attributes in ABAP.
Public and private visibility is explained as well as the difference between static and instance components.

This simple example will show you how to define and implement classes, methods and attributes in ABAP.
Public and private visibility is explained as well as the difference between static and instance components.

Classes, Attributes & Methods

  • The concept of classes is the foundation for all object-oriented thinking.
    • A class is a set of objects that have the same structure and the same behavior.
  • We will start with a simple demonstration, let’s create a class for our previous
    function group example, we will call it ZCL_VEHICLE.
  • Our class will have the following components:
    • ZCL_VEHICLE: Class Components:
      • Private Components:
        • Speed
        • Private Access, generally:
          • Attributes
          • Data Types
      • Public Components:
        • Increase_speed
        • Decrease_speed
        • Get_speed
        • Public Access, generally:
          • Methods
          • Events

Attributes can be one of three types:

  • Elementary
  • Structured
  • Table Type

Purchase a Premium Pass with an access link to watch the full video:
After completion of purchase , download the Premium Pass file where you will find the access link to the video.
You will also receive an email, shortly after the purchase, from Mendoza Learning Hub that will contain the Premium Pass and instructions for your video.


Or, become a Premium Member... - click here to become one

As a Premium member you get access to all of the videos, including this one. Log in to your Premium Account by clicking on 'Sign Up/Log In'. Visit your 'Member Profile' page where you will find access to all the Premium content. Alternately, you can visit the course's main page where you can access the premium videos.

If you didn't receive an email:
Check your spam folder. Many internet providers have spam filters that block emails that contain links. If you’re unable to find the confirmation email, then please contact us.

If you have problems with this video visit Help & Support, or contact us at info@carlosmdubon.com .


If you want a video on a particular topic, fill the form below.

[contact-form][contact-field label='Name' type='name' required='1'/][contact-field label='Email' type='email' required='1'/][contact-field label='Video Topic' type='text' required='1'/][contact-field label='Description' type='textarea' required='1'/][/contact-form]