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

Run multiple instances at the same time

Former Member
0 Likes
1,726

Hello,

How to run 3 Instances of a classes (i.e objects are created) at the same time , all 3 are independent on each other.

Parallel processing?

Rgds,

Ö

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,256

Hello,

you can have as many instances as you want:


DATA: lo_obj1 TYPE REF TO ZCL_ANY_CLASS,
      lo_obj2 TYPE REF TO ZCL_ANY_CLASS,
      lo_obj3 TYPE REF TO ZCL_ANY_CLASS.

CREATE OBJECT lo_obj1.
CREATE OBJECT lo_obj2.
CREATE OBJECT lo_obj3.

CALL METHOD lo_obj1->do_something.
CALL METHOD lo_obj2->do_the_same.
CALL METHOD lo_obj3->do_something_else.

Or is your question about parallel processing, i.e. multi-threading?

Best regards

David

Hello,

How to run 3 Instances of a classes (i.e objects are created) at the same time , all 3 are independent on each other.

Parallel processing?

Rgds,

Ö

4 REPLIES 4
Read only

Former Member
0 Likes
1,257

Hello,

you can have as many instances as you want:


DATA: lo_obj1 TYPE REF TO ZCL_ANY_CLASS,
      lo_obj2 TYPE REF TO ZCL_ANY_CLASS,
      lo_obj3 TYPE REF TO ZCL_ANY_CLASS.

CREATE OBJECT lo_obj1.
CREATE OBJECT lo_obj2.
CREATE OBJECT lo_obj3.

CALL METHOD lo_obj1->do_something.
CALL METHOD lo_obj2->do_the_same.
CALL METHOD lo_obj3->do_something_else.

Or is your question about parallel processing, i.e. multi-threading?

Best regards

David

Read only

0 Likes
1,256

Hi David,

Thanks your reply.

CALL METHOD lo_obj1->do_something.

CALL METHOD lo_obj2->do_the_same.

CALL METHOD lo_obj3->do_something_else.

This i am doign currently already, what i want to achieve is to call method of obj2 with out waiting for the method of Object one to be completed (as eahc object is independent of what they do).

Yes, i am more for Multi Threading , how do i implement the same.

Regds,

Ö

Read only

0 Likes
1,256

Hi David,

Thanks your reply.

CALL METHOD lo_obj1->do_something.

CALL METHOD lo_obj2->do_the_same.

CALL METHOD lo_obj3->do_something_else.

This i am doing currently already, what i want to achieve is to call method of obj2 with out waiting for the method of Object one to be completed (as each object is independent of what they do).

Yes, i am more for Multi Threading , how do i implement the same.

Regds,

Ö

Edited by: One Family on Jan 26, 2010 4:22 AM

Read only

0 Likes
1,256

Hello,

please refer to this [thread|http://forums.sdn.sap.com/click.jspa?searchID=37566999&messageID=8625569].

Regards

David