Skip to Content

Sometimes you get programs where you might have done almost all the programming best practices and Indexing and other stuff but still the program will run very slow.On a time like this sometimes we might wonder is there a way to do parallel processing or something like multi treading on SAP.

 

Hmm…. There is only one way that I can think about in SAP and we can get most of  the features on Parallel processing from this way.

 You can define a remote function like bellow and start it in a new task. 

 

CALL FUNCTION 'Fetch_Data'
STARTING NEW TASK 'Fetch'
performing RETURN_FROM_WAIT ON END OF TASK
EXPORTING
  input            = input
TABLES
  output             = output
EXCEPTIONS
  COMMUNICATION_FAILURE = 1
  SYSTEM_FAILURE        = 2.
 

Important : You cant use any import parameters on the function. no this
method the only option is to using the RETURN_FROM_WAIT which is a
perform.
 

 

For Eg: When you want to fetch data parallel do it using 2 functions and using the perform you can have  a flag to make sure that fetching is completed.
 

I got this detail document from Daniel Perecky link.

This has lots of information no how to program this way.

 

 Apart from this I recently got demo program which has coded to work parallely 

SPTA_PARA_DEMO_1

 

These are the few ways I have got to know no how to write parallel programming in SAP. I would like to see others findings on this area and would love to see how sucessful they were by using them.

 

Thanks

Nafran

To report this post you need to login first.

7 Comments

You must be Logged on to comment or reply to a post.

  1. Joerg Wegener
    Hello,

    have a look at the ABA package “FS_PPF”. There is a framework for parallelisation that takes care of task allocation, restarts of failed tasks etc. This framework originated in SAP development for Banking and was later migrated to the ABA. It is used heavily in SAP banking applications.

    Then again, we could start a philosophical discussion about the difference between parallelisation using dialogue processes versus batch processes, but I honestly do not want to go down that road… 🙂

    (0) 
    1. Nafran Shiraz Post author
      HI Joerg,
      Thanks for the info I will look into it and get back with feedback. currently I am working on a customer development will get back to you one i look in to ABA.

      Nafran

      (0) 
    2. Roger Vandervort
      Another good example, if you’ve got an SCM system handy, is program /SAPAPO/RM60RR20 – Forecast realignment. Check FORM reorganize_adjust_parallel. There’s no pre-built framework used, but the technique is right on target. /SAPAPO/DM_ADJUSTMENT_PARALLEL is the function module that really kicks things off, but the aforementioned report will give you some of the necessary background.
      (0) 
      1. Nafran Shiraz Post author
        that’s what even i understood when i went trough some of the above mentioned programs that there is no pre-built framework.

        unfortunately i don’t have a SCM so unable to look at the code anyway thanks for the update.  

        (0) 
  2. Sandra Rossi
    Here you described aRFC (asynchronous RFC) with wait mode. SAP suggests to use pRFC (parallel RFC) for this kind of stuff, you invoke it just by adding “DESTINATION IN GROUP” (define the group via RZ12 transaction).

    I’m not sure that the blog was the right place to describe a single aspect of the CALL FUNCTION, as it is already described many times and more in depth on the net (especially in sap library, and I also remember a SAPPRO article (on SDN now) which is very accurate)

    (0) 

Leave a Reply