1

I am using parallel processing.

CALL FUNCTION 'ZABC' STARTING NEW TASK taskname
          DESTINATION IN GROUP srv_grp PERFORMING come_back ON END OF TASK
EXPORTING
 ...
EXCEPTIONS
...
.

I am calling this FM inside a loop. sometimes, my records are skipped. I am not getting a desired output. Sometimes 2000 records are processed and sometimes 1000. The numbers are varying. what can be the problem ? Can you provide me some cases where records can be skipped in parallel processing ?

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
user3757558
  • 55
  • 4
  • 12
  • 2
    Please provide more information. Is the size of the input always the same e.g. 2000 records? What is the function call doing? Selecting data? Updating data? – Tapio Reisinger Jun 26 '17 at 08:53
  • If the FM you call in parallel generates a dump it might look like it was skipped because it will never call the ON END OF TASK routine. Check ST22 to see if this is the case for you. – Gert Beukema Jun 26 '17 at 15:51
  • @Gert No, this is not correct. It will send a exception, even if it dumps. But of course you have to deal with it. – Tapio Reisinger Jun 26 '17 at 17:45
  • And how do you find that the records are skipped? – jhamu Jun 26 '17 at 20:19
  • @Tapio, It looks like the functionality has been improved since I last used it or I am remembering things incorrectly (very well possible). A little test program I wrote now does not dump in the called FM but on the RECEIVING command, that's way better. – Gert Beukema Jun 26 '17 at 21:20
  • @jhamu, more of you code would really be helpful. In the code provided you have no mechanism to handle cases where you run out of available processes. Check SAP's example aRFC program in the help for more info. – Gert Beukema Jun 26 '17 at 21:28
  • I am getting resource failure exception. So my records are skipped. Now I have set my number of parallel process counter as 2 and my available dialogues process is 20. Then why I am getting resource failure exception? Is there some other processes executed during arfc call apart from the function module task which is causing resource failure? – user3757558 Jul 05 '17 at 15:45

2 Answers2

0

See the example code SAP provides: https://help.sap.com/viewer/753088fc00704d0a80e7fbd6803c8adb/7.4.16/en-US/4892082ffeb35ed2e10000000a42189d.html

Look at how they handle the resource exceptions. A resource exception means that you tried to start a new aRFC but there were no more processes available. Your program has to handle these cases. Without handling these cases the entries will be skipped. The normal handling is to just wait a little time for some of the active processes to finish, in the example program:

WAIT UNTIL rcv_jobs >= snd_jobs
     UP TO 5 SECONDS.
Gert Beukema
  • 2,510
  • 1
  • 17
  • 18
0
  gv_semaphore = 0.
  " your internal table size. 
  DESCRIBE TABLE lt_itab LINES lv_lines.

  LOOP AT lt_itab INTO ls_itab.

    " parallel proc. -->>
    CALL FUNCTION 'ZABC' STARTING NEW TASK taskname
      DESTINATION IN GROUP srv_grp PERFORMING come_back ON END OF TASK
    EXPORTING
    ...
    EXCEPTIONS
    ...
    .
  " <<--
ENDLOOP.
" wait until all parallel processes have terminated. ** 
WAIT UNTIL gv_semaphore = lv_lines.

NOTE: You should check total parallel process count. There should be some upper limits for opened threads.

Thanks.

Oguz
  • 1,867
  • 1
  • 17
  • 24