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

is there any function for multi-threads in ABAP

Former Member
0 Likes
1,713

Hi,

is there any function module for multi-threads in ABAP?

i faced a problme during the coding. i need call a same report 15 times at the same time but with different variants so i think i need create 15 sessions by a multi-threads function.

Many thanks in advance for your help!

Best regards,

Cliff

1 ACCEPTED SOLUTION
Read only

matt
Active Contributor
0 Likes
1,153

Parallel processing is possible in ABAP using

CALL FUNCTION func STARTING NEW TASK task 
              [DESTINATION {dest|{IN GROUP {group|DEFAULT}}}] 
              parameter_list 
              [{PERFORMING subr}|{CALLING meth} ON END OF TASK]. 

in conjunction with ABAP keywords RECEIVING, and WAIT UNTIL. Read the ABAP help for how these work, and also search SDN for blogs and SAP documentation on parallel processing for details and examples.

matt

Parallel processing is possible in ABAP using

CALL FUNCTION func STARTING NEW TASK task 
              [DESTINATION {dest|{IN GROUP {group|DEFAULT}}}] 
              parameter_list 
              [{PERFORMING subr}|{CALLING meth} ON END OF TASK]. 

in conjunction with ABAP keywords RECEIVING, and WAIT UNTIL. Read the ABAP help for how these work, and also search SDN for blogs and SAP documentation on parallel processing for details and examples.

matt

7 REPLIES 7
Read only

Former Member
0 Likes
1,153

Hi Cliff,

Please check whether the following link is useful,

Best Regards.

  • Reward points if it is helpful.

Read only

0 Likes
1,153

Hi,

Thanks for your help. however it seems that my problme is not as same as the other.

Thanks and Best regards,

Cliff

Read only

Former Member
0 Likes
1,153

Form my understanding of what you are trying to do, I would suggest having a table with all the variant names that you would need, looping over it and use the statement

SUBMIT REPORT...AND RETURN and use the addition USING SELECTION-SET.

You can also explore creating your functionality as a function module....enable it for RFC and call it via SEPRATE TASKor BACKGROND TASK additions

Read only

matt
Active Contributor
0 Likes
1,154

Parallel processing is possible in ABAP using

CALL FUNCTION func STARTING NEW TASK task 
              [DESTINATION {dest|{IN GROUP {group|DEFAULT}}}] 
              parameter_list 
              [{PERFORMING subr}|{CALLING meth} ON END OF TASK]. 

in conjunction with ABAP keywords RECEIVING, and WAIT UNTIL. Read the ABAP help for how these work, and also search SDN for blogs and SAP documentation on parallel processing for details and examples.

matt

Read only

Former Member
0 Likes
1,153

Hi Matt,

thanks very much for your answer. however i need around 15 sessions together but starting new task only support six at same moment. is there any way to write a FM to over this limit such as logging on the system again to get another six sessions?

Many thanks!

Cliff

Edited by: Cliff Ma on May 8, 2008 8:02 AM

Read only

matt
Active Contributor
0 Likes
1,153

Even if you logged in again in some way, you're still limited to the number of available processes on the application server. If you've got 16 dialog processes available, and 17 users send a request to the appserver to do something at the same time, then one of them will have to wait. It's just the way SAP works.

But the limit of 6 (I guess that's how your system is set up) is only a limit of how many can run at once - not how many can be launched.

If you throw all 15 of your threads at the system, then first of all it will run 6 of them, the rest wait. As each of the running threads finishes, then one of the waiting ones will run, until all 15 have run. The control of how many threads are actually running at one time is in the server group - which is usually defined by your basis team.

If you actually have to have them running simultaneously for some reason you'd have to have a system with 15 free processes - which could mean you need more appservers etc. Even then, in practice, it would be hard to guarantee that all 15 would actually run at the same time.

I have an application that runs 10 different checking jobs. I launch all ten jobs into seperate tasks. The system is configured so I never use more than 50% of available processes. In practice that means I have around 5 actually running at one time. But the programming is identical to how it would be if my system had 1000 available processes to use.

matt

Read only

Former Member
0 Likes
1,153

Thanks very much!