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

Modularization in OO

Former Member
0 Likes
666

Hi!

In ABAP OO it´s impossible use PERFORM command. I would like to organize code in BADI NOTIF_EVENT_SAVE (method has more than 2000 lines).

How can i do that? Create function modules? Has any way better?

1 ACCEPTED SOLUTION
Read only

naimesh_patel
Active Contributor
0 Likes
554

You can create private methods in the same class for the modularization.

Regards,

Naimesh Patel

3 REPLIES 3
Read only

naimesh_patel
Active Contributor
0 Likes
555

You can create private methods in the same class for the modularization.

Regards,

Naimesh Patel

Read only

Former Member
0 Likes
554

If you want to use the code only inside the class, private method is the answer (or protected, if you want the method to be called by the inherited class in future). However, if you want to use the code outside the class (for example in a report), you should create the public method. The good practices suggest to avoid too long methods - instead of one big, it is better to create a number of small ones.

You can also create function module, and then call it in the method. You can call function modules inside methods.

Read only

alex_campbell
Contributor
0 Likes
554

Methods are the way to modularize OO routines. You can add methods to the BADI implementation by editing the Implementing Class in SE24 (You can find the 'Name of Implementing Class' in the Interface tab of SE19).