2008 May 07 7:26 AM
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
2008 May 07 9:24 AM
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
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
2008 May 07 7:46 AM
2008 May 07 8:02 AM
Hi,
Thanks for your help. however it seems that my problme is not as same as the other.
Thanks and Best regards,
Cliff
2008 May 07 9:13 AM
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
2008 May 07 9:24 AM
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
2008 May 08 7:01 AM
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
2008 May 08 10:16 AM
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
2008 May 08 10:28 AM
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |