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

OO question

Former Member
0 Likes
601

Hi,

What is The Diff Between Build Class Code in program (se 80 like below )

and build Class in Se24 like the same.

What is Recommended ?

----


  • CLASS lcl_airplane IMPLEMENTATION *

----


CLASS lcl_airplane IMPLEMENTATION.

  • Method set_attributes

METHOD set_attributes.

name = im_name.

planetype = im_planetype.

n_o_airplanes = n_o_airplanes + 1.

ENDMETHOD.

  • Method display_attributes

METHOD display_attributes.

WRITE: / 'Name of the airplane: '(001), AT pos_1 name,

/ 'Plane type: '(002), AT pos_1 planetype.

ENDMETHOD.

  • Method display_n_o_airplanes

METHOD display_n_o_airplanes.

WRITE: /, / 'Total number of airplanes: '(ca1),

AT pos_1 n_o_airplanes LEFT-JUSTIFIED, /.

ENDMETHOD.

ENDCLASS.

1 ACCEPTED SOLUTION
Read only

naimesh_patel
Active Contributor
0 Likes
566

Local Class (inside the program) can only be referred in that Program. If you want to refer that in the other program you will not able to do it.

Whereas Global class (created in SE24) can be referred in more than one program.

I would suggest to create class in SE24, as it has good features for entering method's signature and it would make the navigation easy.

Think like, in your application you have 10 local class and all those local class has 100 methods and they have Super Class relations and so on. So, it would be hard to navigate if you have implemented all class locally (inside the program).

Regards,

Naimesh Patel

4 REPLIES 4
Read only

naimesh_patel
Active Contributor
0 Likes
567

Local Class (inside the program) can only be referred in that Program. If you want to refer that in the other program you will not able to do it.

Whereas Global class (created in SE24) can be referred in more than one program.

I would suggest to create class in SE24, as it has good features for entering method's signature and it would make the navigation easy.

Think like, in your application you have 10 local class and all those local class has 100 methods and they have Super Class relations and so on. So, it would be hard to navigate if you have implemented all class locally (inside the program).

Regards,

Naimesh Patel

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
566

In SE24, the class is global, which means it can be used in any other program, or class. In your below code, it is a local class, which is only available in your program.

Regards,.

Rich Heilman

Read only

former_member69765
Contributor
0 Likes
566

Technically there is no difference ...

You can use any thing ..

I personally will prefer to use SE24 because everything is easy there ...

Another difference is... when you create a class in SE24.. it is global.. means others can also use it .. it will exist in that system just like a DDIC object..

When you create a class in your program.. its scope is limited till the program continues.. no one else can make use of that class..

Cheers.

Varun.

Read only

Former Member
0 Likes
566

Hi,

If your question is the difference between global class( SE24) and Local class ( In our Programs ).

The Global class is used to define the class for Multiple Use and the Local Class for Particular program. In most of the cases we will prefer to develop classes in SE24

There is One more option in SE80 ( Class/ Interface ) which will create class globally.

If i am not answered your question let me know

Regards

Pavan