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

Parallel processing

Former Member
0 Likes
997

Hi Experts,

My requirement is to read material change history based on plant. Selection screen in having plant field. So, based on plant entered by user and MARC I'm populating an internal with all materials. Now, the requirement is get some data for all the materials from CDHDR and CDPOS (cluster table), which is taking very long times. User do not want to schedule as background job.

Approximately, every plant is having around 30,000 materials. Can we implement parallel processing by dividing the no. of materials in small packages (say 3000 materials)? If yes, in this scenario which one is better to use among 'CALL FUNCTION func STARTING NEW TASK' or 'CALL FUNCTION func IN BACKGROUND TASK' and how?

Thanks in Advance,

Siva Sankar

1 ACCEPTED SOLUTION
Read only

naimesh_patel
Active Contributor
0 Likes
915

You should implement the Parallel processing using the CALL FUNCTION func STARTING NEW TASK. The option IN BACKGROUND TASK doesn't return the control back to the program.

You need to first check the number of available processes. Based on that, you should decide the number of "packets". You should also consider setting the maximum limit of processed can be used by a single execution. Because the same report can be executed by multiple users at the same time.

Check out the blog [ABAP on Steroids: practical use of parallel processing|http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/26775] from

Regards,

Naimesh Patel

7 REPLIES 7
Read only

naimesh_patel
Active Contributor
0 Likes
916

You should implement the Parallel processing using the CALL FUNCTION func STARTING NEW TASK. The option IN BACKGROUND TASK doesn't return the control back to the program.

You need to first check the number of available processes. Based on that, you should decide the number of "packets". You should also consider setting the maximum limit of processed can be used by a single execution. Because the same report can be executed by multiple users at the same time.

Check out the blog [ABAP on Steroids: practical use of parallel processing|http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/26775] from

Regards,

Naimesh Patel

Read only

0 Likes
915

Hi Naimesh,

Thanks a lot for your prompt response. Can you please elaborate on "You should also consider setting the maximum limit of processed can be used by a single execution" ?

Thanks,

Siva Sankar

Read only

0 Likes
915

When you first run the program and you figured out that about 100 processes are available, so you have occupied all of them. At the same time, user2 is running the program and there isn't any process available for him to process the request. There would be many other users in the system as well who's processes will be on wait status unless the first 100 gets free.

These are few of the reasons, that you should consider giving say 5 or 10 processes to the each execution even though there are many more processes available.

Regards,

Naimesh Patel

Read only

0 Likes
915

Hi

When you set parallel processing you must make sure that how many work processors can be used for parallel processing at a single point in time. Example if you have 10 WP available for parallel processing then you can decide how many you want to use for this process alone.

Few tips:

Check in SMLG transaction if you have created Logon Group claled as parallel_generators.

Use the FM 'TH_USER_INFO' to get the number of available sessions.

Use the FM 'SPBT_GET_CURR_RESOURCE_INFO' for getting the resource information.

You can also refer to the send materials and send customer program where they used similar kinds of logic with number of customer.

Br

Vijay V

Edited by: Vijay Venkataraman on Feb 22, 2012 10:05 PM

Read only

0 Likes
915

Thank you Naimesh,

So, can we hardcode the magic number for no.of processes say 5 or 10? Infact, when I check the no. of available processes using function module SPBT_INITIALIZE, the count was varying between 12 and 20. In this case, what will be the magic figure?

Is there any way to check for no. of available processes otherthan using above function module?

Appreciate your response.

Thanks,

Siva Sankar

Read only

0 Likes
915

The magic figure is not absolute, but whatever SPBT_INITIALIZE returns minus a number of dialog processes you need to keep available for other users or tasks, depends on local circumstances, usual system load around the time of your process, time of day or night...consult your system administrator.

Thomas

Read only

0 Likes
915

I echo what Thomas has suggested. The Magic number can be only derived after certain round of testing. The number should be dependent on the pick time when most users do the activity. Based on that you should set up the number. This number should be parameterized, so you can change on fly in testing.

Regards,

Naimesh Patel