Skip to Content
avatar image
Former Member

Breaking a Program Execution into Multiple Threads

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

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Aug 10, 2004 at 03:08 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 10, 2004 at 04:21 PM

    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

    Add comment
    10|10000 characters needed characters exceeded