Monday, June 8, 2009

only way of parallel or Multi Threading on SAP

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 anyway 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 all most all features on Parallel processing from this way.


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.
  
This is just a over view I got this document from Daniel Perecky
Multi Threading

this has lots of information no how to program this way.
I would love to see some comments about this :)

3 comments:

Tuncay Zaya said...

Hi Nafran,

thank u for this useful hint!

Regards

Zaya

Anonymous said...
This comment has been removed by a blog administrator.
Anonymous said...
This comment has been removed by a blog administrator.
Google