ABAP OO Class Methods

CONSTRUCTOR SAP Constructor Method of BC404_CL_AIRPLANE







Below is documentation, parameters and attributes of ABAP Method CONSTRUCTOR within SAP class BC404_CL_AIRPLANE. There is also a number of example ABAP code snipts to help you implement this method.

This method is available within SAP systems depending on your version and release level and you can view further information by entering the class name BC404_CL_AIRPLANE into relevant SAP transactions such as SE24 or SE80, and then selecting the method you are interested in. Also check out the contributions below to view or add related hints, tips, example screen shots and any other information.


SAP Class method belongs too

BC404_CL_AIRPLANE

Method Name

CONSTRUCTOR

Method Type

Instance Method:   This is an Instance Method so needs to be instantiated first before you can access any of the methods. I.e. you need to create a local variable of TYPE ref to the class.






Importing Parameters:

Below is a list of importing parameters associated with this method, including its name, description and data type


IM_NAME " Aircraft Name TYPE STRING
IM_PLANETYPE " Plane type TYPE SAPLANE-PLANETYPE

Exceptions:



Example ABAP coding

This method is a Class Constructor so it is called automatically when the class is accessed for the first time. The below code doesnt really make sense as it cant be executed as a stand alone method but this is how it would look if it was a normal static method.


DATA:
ld_IM_NAME TYPE STRING ,
ld_IM_PLANETYPE TYPE SAPLANE-PLANETYPE.

" ld_IM_NAME = "
" ld_IM_PLANETYPE = "

DATA: lo_AIRPLANE TYPE REF TO BC404_CL_AIRPLANE .
CALL METHOD lo_AIRPLANE->CONSTRUCTOR(
EXPORTING
IM_NAME = ld_IM_NAME
IM_PLANETYPE = ld_IM_PLANETYPE ).