Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Create one or more instance of a class

Hey experts,

I have a question about good abap oo coding.

I have a class (e.g. cl_adjust) which will adjust some attributes of promotions.

In my Programm I have do to many things, but at a certain point, due to some Information, I have to adjust a promotion.

Now I will call the class cl_adjust to do that.

My Question now is, should I create a new Instance for every promotion (everytime I come to the point, where I have to adjust a promotion) or should I create one Instance of the class and call a method (e.g. cl_adjust->execute( IMPORTING io_promotion = lo_promotion )?

I guess, the programm ist faster, if I just create one instance?

Thanks in advance and BR,

Sebastian

Tags:
Former Member
Not what you were looking for? View more on this topic or Ask a question