‎2008 Nov 25 5:54 AM
Dear ABAP oops experts,
Can you please explain what is constructor in the oops language.
Thanks and regards,
Krish..........
‎2008 Nov 25 6:02 AM
Constructor is special method of class which initialize instance of this classes when it created
For more details
‎2008 Nov 25 6:00 AM
‎2008 Nov 25 6:02 AM
Constructor is special method of class which initialize instance of this classes when it created
For more details
‎2008 Nov 25 6:08 AM
Method CONSTRUCTOR
The CONSTRUCTOR method *is used to default* some member variables with class-specific values.
Sample source text:
METHOD constructor .
CALL METHOD super->constructor.
mv_table_name_for_alv_grid = 'SBRF142_ALV'.
if_maintenance_brf~mv_smartform_name = 'BRF_VALUE_REQUEST_TABLE'.
ENDMETHOD.
Description:
First of all, the obligatory call of the CONSTRUCTOR method of the super-class takes place.
Then the following names are set:
· Structure name for the ABAP List Viewer (ALV) grid that is used in transaction BRF_OVERVIEW.
This name is required for the method GET_TABLE_FOR_ALV_GRID. In turn, the method GET_TABLE_FOR_ALV_GRID is called by BRF_OVERVIEW.
· Name of the smart form
This name is required for the print output (method PRINT).
If you do not want to tackle the subject of history management right from the beginning, set the if_maintenance_brf~mv_history_available attribute in the method to false (in other words space). In doing so, you indicate that your maintenance class does not (yet) support history management.
‎2008 Nov 25 6:14 AM