Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Constructor

Former Member
0 Likes
597

Dear ABAP oops experts,

Can you please explain what is constructor in the oops language.

Thanks and regards,

Krish..........

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
576

Constructor is special method of class which initialize instance of this classes when it created

For more details

http://en.wikipedia.org/wiki/Constructor_(computer_science)

4 REPLIES 4
Read only

Former Member
Read only

Former Member
0 Likes
577

Constructor is special method of class which initialize instance of this classes when it created

For more details

http://en.wikipedia.org/wiki/Constructor_(computer_science)

Read only

Former Member
0 Likes
576

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.

Read only

Former Member
0 Likes
576

Thanks for provide helpfull information.

Krish....