|Home • Trainings • Quiz • Tips • Tutorials • Functional • Cert Q's • Interview Q's • Jobs • Testimonials • Advertise • Contact Us|
Working with constructors (Global Class)
are special methods that cannot be called using CALL METHOD. Instead, they are
called automatically by the system to set the starting state of a new object or
are methods with a predefined name. To use them, you must declare them
explicitly in the class.
are two types of constructors - Instance constructors and Static constructors.
The Instance constructor of a class is the predefined instance
The constructor's signature can have only importing parameters or
Instance Constructor is a special instance method can access the
Instance Variables and Static Variables.
This method is used to set the default values in a class.
The Static constructor of a class is the predefined static
The constructor's signature cannot have importing
parameters or exceptions.
The static constructor is as special static method can access the
These are used to set default values for the global attributes
irrespective of instances.
Multiple Instance and Static Constructors cannot be used in
Creating the Instance
Constructor and Static Constructor
using SE24 (Global class)
Go to SE24 à
Create Global Class ZCONSTRUCTOR_SALES
Select the Class and Click on Continue.
Continue with the default settings
Go to Methods à
Constructor Method can be created 2 ways.
to Menu à
on Constructor as shown below
As soon click on Constructor à
Constructor Method is automatically defaulted in the Methods.
This method is used o initial the values for the object
Create another method Select to fetch the data from the VBAK table
Select the Constructor Method à
Select the Parameters and Create the Parameter
The parameter IM_VBELN is used to importing into Constructor Method. Used to
initialize the value
For the Constructor, parameter type is always importing. No other Parameter type
can be assigned
Go to Type Tab à
Create Structure ty_vbak and Visibility (Public)
Click on Direct Type Entry
To declare the Structure (with required fields) and Table
Please send us your feedback/suggestions at webmaster@SAPTechnical.COM
©2006-2007 SAPTechnical.COM. All rights reserved.
product names are trademarks of their respective companies. SAPTechnical.COM
is in no way affiliated with SAP AG.
Graphic Design by Round the Bend Wizards