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

Call Method starting new task?

Former Member
7,917

hi!

Is it possible to paralyze processing in a class instance?

Processflow something like:

  • constructor prepares general data

  • two methods collect data in parallel

  • once both methods finished, a 4th method uses data prepared by the other 3 methods (constructor and the two data collector classes)

There is something for "CALL FUNCTION .. IN NEW TASK", but is there a similar way like "call method ... in new task", maybe raising an event in my last method to start processing there?

Thanks a lot!

Roland

1 ACCEPTED SOLUTION
Read only

naimesh_patel
Active Contributor
0 Likes
3,963

STARTING NEW TASK can be only achieved on Remote Enabled Modules. Since Methods can't be Remote enabled, we can use this addition in the CALL METHOD. As Kiran has suggested, you need to wrap your logic in the RFC FM and call the FM in the method.

To get the data back, you can use the Method: CALLING method AT END OF TASK. See this [CALL FUNCTION - STARTING NEW TASK|http://help.sap.com/saphelp_nw04/helpdata/en/3d/a846df17c1014e928626637ab06838/frameset.htm]

Regards,

Naimesh Patel

4 REPLIES 4
Read only

Kiran_Valluru
Active Contributor
0 Likes
3,963

Hi.,

I think OO method cal doest not support this.. To Do this in OO Context Call Function Module Starting New Task With in your Methods., i.e Wrap the FMs in your Method.,

Thanks & Regards,

Kiran

Read only

3,963

I guess OP was aware of the fact that you can call function modules from within class methods. However, by using function modules at all you do lose most of the advantages OOP provides by design. So yes: Calling differenc async function modules inside a single method is in fact a solution. But no, it's not elegant because you're restricted to call all the async FMs you'd like to process in parallel inside a single method that cannot be processed asynchronously itself.

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
3,963

> There is something for "CALL FUNCTION .. IN NEW TASK", but is there a similar way like "call method ... in new task", maybe raising an event in my last method to start processing there?

No, there isn't any addition with CALL METHOD which facilitates parallel processing!

Processflow something like:

1. constructor prepares general data

2. two methods collect data in parallel

3. once both methods finished, a 4th method uses data prepared by the other 3 methods (constructor and the two data collector classes)

I'm not sure if you can achieve step 2. Let's see what the OO gurus have to add.

BR,

Suhas

Read only

naimesh_patel
Active Contributor
0 Likes
3,964

STARTING NEW TASK can be only achieved on Remote Enabled Modules. Since Methods can't be Remote enabled, we can use this addition in the CALL METHOD. As Kiran has suggested, you need to wrap your logic in the RFC FM and call the FM in the method.

To get the data back, you can use the Method: CALLING method AT END OF TASK. See this [CALL FUNCTION - STARTING NEW TASK|http://help.sap.com/saphelp_nw04/helpdata/en/3d/a846df17c1014e928626637ab06838/frameset.htm]

Regards,

Naimesh Patel