Parallel Processing in ABAP - Team ABAP
Parallel Processing in ABAP - Team ABAP
HOME ABAP WEBDYNPRO ABAP SAP UI5 SAP HANA UI5 DEMO ADOBE FORMS Search...
In recent time I got a requirement where i was supposed to process a huge amount of data provided by the
user in the excel sheet and update this data in the HR infotypes. Unfortunately the function module that
updates the infotype ‘HR_INFOTYPE_OPERATION’ updates only one infotype at a time. So i was forced to
call the function module in a loop, which sometimes results with time out error when the data volume is more.
Thinking the possibilities of avoiding the timeout error i came to know the concept of parallel processing in
ABAP which is processed in asynchronous mode. With parallel processing, there is a possibility of increase
the performance to a huge extent. There are some limitations though. One should be careful when using this
process.
Whenever we are processing a function module in a loop what happens is the looping will be performed by a
dialog work process and it wait till the execution of the function module completes and then resume the
operation from there (Synchronous). Here in the case of parallel processing the function module is assigned to
be executed with a new work process, here there is no need for the dialog work process processing the loop to
wait till the execution of the function module it continues to resume the process with the next set of
data(Asynchronous mode).
The below mentioned reference link will teach you lot about parallel processing.
Reference link
http://help.sap.com/saphelp_nw70/helpdata/en/fa/096e92543b11d1898e0000e8322d00/content.htm
http://help.sap.com/saphelp_nwpi71/helpdata/en/22/0425c6488911d189490000e829fbbd/content.htm
http://sapignite.com/learn-parallel-processing-in-abap/
Here are few things that i learnt:
1. Parallel processing is not suitable for data that are to be processed sequentially. Hence logically
independent work can only be processed by this method.
2. All function modules that are RFC enabled can be processed by this mode.
3. When RFC enabled function module is called we are supposed to specify a group in which the rfc is
supposed to be executed. You can find this RFC group in Tcode RZ12. A group includes the
application server instances and that instance in turn can contain any no of dialog work process
configured by the basis team. I noticied that there was group created with ‘parallel_generator’ and i
guess it must be available in all servers for parallel processing.
4. Before we are going to process the task lets check for the available no of dialog work process and split
our processing accordingly. Try to utilize only a min of work process that are free so as not to soak up
the jobs running in other applications
Below is a simple example to demonstrate the difference between the two modes of processing data.
Step 1: Created a table with the following structure.
http://www.teamabap.com/2014/05/parallel-processing-in-abap.html 1/8
11/08/2017 Parallel processing in ABAP - Team ABAP
Step 2: I have created a function module that update data to the table one by one.
Now to check the difference in performance between parallel processing and normal procedure I have created
two programs.
Code:
data : wa_data type zzcsk_emp.
data : it_data type standard table of zzcsk_emp.
data : lv_result type flag.
start-of-selection.
do 1000 times.
wa_data-mandt = sy-mandt.
wa_data-field1 = sy-index.
append wa_data to it_data.
clear wa_data.
enddo.
if lv_result = abap_true.
write : / 'Success'.
else.
write : / 'Failed'.
endif.
http://www.teamabap.com/2014/05/parallel-processing-in-abap.html 2/8
11/08/2017 Parallel processing in ABAP - Team ABAP
start-of-selection.
* Call the function module spbt_initialize the list of application server available and
those that are free
http://www.teamabap.com/2014/05/parallel-processing-in-abap.html 3/8
11/08/2017 Parallel processing in ABAP - Team ABAP
lv_split = lv_available div 2.
endif.
endif.
do 1000 times.
wa_data-mandt = sy-mandt.
wa_data-field1 = sy-index.
append wa_data to it_data.
enddo.
do lv_split times.
lv_index = sy-index.
if lv_index = 1.
lv_start = 0.
endif.
if lv_split = lv_index.
lv_end = 0.
endif.
it_data_temp[] = it_data[].
if sy-subrc = 0.
lv_sent = lv_sent + 1.
endif.
enddo.
*&---------------------------------------------------------------------*
http://www.teamabap.com/2014/05/parallel-processing-in-abap.html 4/8
11/08/2017 Parallel processing in ABAP - Team ABAP
*& Form UPDATE_STATUS
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_DATA text
* -->P_= text
* -->P_IT_DATA_TEMP text
*----------------------------------------------------------------------*
form update_status using lv_task.
lv_comp = lv_comp + 1.
if lv_result is initial.
lv_result_string = 'Success'.
else.
lv_result_string = 'Failure'.
endif.
concatenate 'The data passed via task' lv_task 'updation is' lv_result_string into
lv_result_string separated by space.
write : / lv_result_string.
RELATED POSTS
http://www.teamabap.com/2014/05/parallel-processing-in-abap.html 5/8
11/08/2017 Parallel processing in ABAP - Team ABAP
Exercise 1- Usage of New keyword Ge... Debugging a function module execute... Logging on to sap environment
4 Comments:
Hi Arun Krishnamoorthy,
firstly thanks for the post, Very informative and self explaining.
But i have one doubt, insted of "DO lv_split TIMES" if we use "DO ENDDO" while calling parallel FM, how
many times it will execute?
Because it is not mandatory to use FM SPBT_INITIALIZE. If we dont use it then i think we Need to use
only Do and END Do.
** In your example if i remove DO lv_split TIMES with DO i am getting Resource failure error. please
suggest why is this happening.
Thanks in advance,
regards,
Narsireddy.
Reply
Replies
The reason why i am calling the SPBT_INTIALIZE method is to get to know how many
work process are available in the system at that point of time of execution. By knowing that
i utilize a max of 1/3 rd of process for my self and leave the rest for the process executed
by others.
In your case, when you are blindly using do statement, what might happen is that, say you
have 9 work process left in the system to be utilized and in each loop you are assigning
the task to one work process at the 10th loop you will not have any work process to carry
out your job and you will end up with errors. say a resource failure might be..
So please ensure before you assign a task that the work process is available to carry out
that job.
Best Regards,
Arun Krishnamoorthy
Can you help me how to log the data that is processed and can be restarted with
unprocessed data if an error occurs.
http://www.teamabap.com/2014/05/parallel-processing-in-abap.html 6/8
11/08/2017 Parallel processing in ABAP - Team ABAP
Thanks & regards,
Cheruku
Reply
Hello,
Reply
Publish Preview
SOCIAL SHARE
450 7
FANS FOLLOWERS
77 1
SUBSCRIBERS SUBSCRIBERS
SUBSCRIBE
TO RSS FEED
Webdynpro ABAP
Maintenance View
Adobe forms
LABELS
ABAP 25
http://www.teamabap.com/2014/05/parallel-processing-in-abap.html 7/8
11/08/2017 Parallel processing in ABAP - Team ABAP
ABAP Objects 2
Adobe Forms 12
SAP HANA 19
SAP UI5 25
Webdynpro ABAP 97
Team ABAP
528 curtidas
Team ABAP
há ± 4 meses
► 2017 (15)
Webdynpro ABAP 8 8 1 7 5 6
► 2016 (12)
ABAP Objects
► 2015 (12)
▼ 2014 (165)
Arun krishnamoorthy December (2) SAP UI5
Follow 153 November (5)
September (8) Introduction to webdynpro ABAP
I am an SAP Technical Consultant August (2)
currently working in Yash Technologies July (19) Field Symbols and Data Reference
pvt ltd. I am expertise in the areas of SAP June (6) Variables.
UI5, SAP HANA, ABAP, OO ABAP and May (123)
Webdynpro ABAP. I am a blogger and Different types of controller in
trainer love to share knowledge. Webdynpro ABAP
http://www.teamabap.com/2014/05/parallel-processing-in-abap.html 8/8