cancel
Showing results for 
Search instead for 
Did you mean: 

Breaking a Program Execution into Multiple Threads

Former Member
0 Kudos

Hi,

We want to run a BAPI with Differenet parameters synchronoulsy in the same program as the BAPI is taking a very lon time for execution.

We are Planning to break up the execution and the call o the BAPI into multiple threads that can run synchronously. How can this concept implemented in SAP ABAP.

Thanks in advance.

Arunava

Accepted Solutions (0)

Answers (2)

Answers (2)

nablan_umar
Active Contributor
0 Kudos

I am using parallel processing in my current client. Basis define a dialog processes group that we can use. This way our program will be limited to the number of processing give in the group. For example, our production system has 5 servers and each servers has 15 dialog processes. Basis reserve in the group 5 dialog processes for each group. So when we run our program, we are limited to 25 processes. We use function module SPT_INITIALIZE to find out the number of dialog processes and free processes for our group.

The logic of the program as follow:

Do loop

Call function module with starting new task and destination in group performing end of task subroutine

Enddo

Wait until all task completed (check help on wait-you need to keep track of the number of record completed)

In end of task subroutine, use command receive results from function to get the return parameters.

Hope this helps.

Cheers

Former Member
0 Kudos

Hi,

You can implement parallel processing in SAP. Look at the documentation of "CALL FUNCTION func ... STARTING NEW TASK task name ... ".

Basically, each of the call function is executed in a separate dialog task. The result can be returned to the main program using one of the options of call function "PERFORMING form ON END OF TASK".

The SAP help for call function is very detailed and will give you all the information required. Additional information can also be obtained in SAP Help at

SAP Library -> Basis Component -> Basis Services/Communication Interface -> Remote Communication -> RFC Programming in ABAP -> Calling remote function modules in ABAP -> Using Asynchronous Remote function module.

The 4 topics under that heading should provide enough detail to get you started.

Hope this helps.

Raj