Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Question on Parallel Processing in ABAP

Former Member
0 Likes
684

Hi Experts,

I am trying to process my records using Parallel Processing concept making calls to Remote Function Module.

So, in simple terms it would look as shown below

loop.

call function <rfc_module> creating new task with <taskname>

endloop.

1. In the above scenario say it created 5 tasks.

2. If one of the tasks have been failed because of timeout error then what happens to that task.

In the below link it says that the dialog work proces can run only for 300 seconds.

http://help.sap.com/saphelp_nw70/helpdata/en/fa/096e92543b11d1898e0000e8322d00/content.htm

3. How do we track the task that has not been finished successfully?

4. Does that throw an error?

Thanks,

Babu Kilari

4 REPLIES 4
Read only

Former Member
0 Likes
634

Hi Experts,

Any replies on this would be helpful for me. I tried a lot but in vain.

Thanks,

Babu Kilari

Read only

Former Member
0 Likes
634

Here is an exmple from HELP

TYPES: BEGIN OF task_type, 
         name TYPE string, 
         dest TYPE string, 
       END OF task_type. 

DATA: snd_jobs  TYPE i, 
      rcv_jobs  TYPE i, 
      exc_flag  TYPE i, 
      info      TYPE rfcsi, 
      mess      TYPE c LENGTH 80, 
      indx      TYPE c LENGTH 4, 
      name      TYPE c LENGTH 8, 
      task_list TYPE STANDARD TABLE OF task_type, 
      task_wa   TYPE task_type. 

DO 10 TIMES. 
  indx = sy-index. 
  CONCATENATE 'Task' indx INTO name. 
  CALL FUNCTION 'RFC_SYSTEM_INFO' 
    STARTING NEW TASK name 
    DESTINATION IN GROUP DEFAULT 
    PERFORMING rfc_info ON END OF TASK 
    EXCEPTIONS 
      system_failure        = 1  MESSAGE mess 
      communication_failure = 2  MESSAGE mess 
      resource_failure      = 3. 
  CASE sy-subrc. 
    WHEN 0. 
      snd_jobs = snd_jobs + 1. 
    WHEN 1 OR 2. 
      MESSAGE mess TYPE 'I'. 
    WHEN 3. 
      IF snd_jobs >= 1 AND 
         exc_flag = 0. 
        exc_flag = 1. 
        WAIT UNTIL rcv_jobs >= snd_jobs 
             UP TO 5 SECONDS. 
      ENDIF. 
      IF sy-subrc = 0. 
        exc_flag = 0. 
      ELSE. 
        MESSAGE 'Resource failure' TYPE 'I'. 
      ENDIF. 
    WHEN OTHERS. 
      MESSAGE 'Other error' TYPE 'I'. 
  ENDCASE. 
ENDDO. 

WAIT UNTIL rcv_jobs >= snd_jobs. 
LOOP AT task_list INTO task_wa. 
  WRITE: / task_wa-name, task_wa-dest. 
ENDLOOP. 

FORM rfc_info USING name. 
  task_wa-name = name. 
  rcv_jobs = rcv_jobs + 1. 
  RECEIVE RESULTS FROM FUNCTION 'RFC_SYSTEM_INFO' 
    IMPORTING 
      rfcsi_export = info 
    EXCEPTIONS 
      system_failure        = 1 MESSAGE mess 
      communication_failure = 2 MESSAGE mess. 
  IF sy-subrc = 0. 
    task_wa-dest = info-rfcdest. 
  ELSE. 
    task_wa-dest = mess. 
  ENDIF. 
  APPEND task_wa TO task_list. 
ENDFORM.

Read only

0 Likes
634

Hi,

I know that this example is given in F1 Help. I have checked it already.

Actually my question was what happens to the main program if the timeout occurs.

Thanks,

Babu Kilari

Read only

Former Member
0 Likes
634

Got the solution for this. If the task fails, it throws an exception called SYSTEM_FAILURE.