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

Parallel Processing : How to Handle Resource failure?

Former Member
0 Likes
8,164

Hi,

I have implemented the parallel processing/ asynchronous rfc call in my system because we have to process millions of records and processing is important. My Program does work fine in Development and quality for small number of records but during SVT I am encountering RESOURCE_FAILURE exception. As of now I have tried to wait for more time and then process it again and also on failure I have tried to process sequential but nothing worked with second approach that is on resource_failure execute normal FM call it is resulting in terminating Parallel processing.

Any Pointer on how to handle it is appreciated.

Regards,

Deepak Bhalla

4 REPLIES 4
Read only

Former Member
0 Likes
3,700

<b>Handling the RESOURCE_FAILURE exception:</b> As each parallel processing task is dispatched, the SAP system counts down the number of resources (dialog work processes) available for processing additional tasks. This count goes up again as each parallel processing task is completed and returns to your program.

Should your parallel processing tasks take a long time to complete, then the parallel processing resources may temporarily run out. In this case, CALL FUNCTION returns the exception RESOURCE_FAILURE. This means simply that all dialog work processes in the RFC group that your program is using are in use.

Your program must now wait until resources become available and then re-issue the CALL FUNCTION that failed. In the sample program, we use a simple, reasonably failsafe wait mechanism. The program waits for parallel processing tasks to return, freeing up resources. The WAIT also specifies a initial timeout of 1 second. If the CALL FUNCTION again fails, the WAIT is repeated with a longer time-out. You can increase the time-outs if you expect that your parallel tasks will take longer to complete. You should also add code to exit from the retry loop after a suitable number of iterations.

Use WAIT statement.

Hope this resolves u r issue.

- Raj

Read only

0 Likes
3,700

Hi Rajanya,

I am already doing it but even after 10 seconds it doesn't work. Is there any other way of handling it?

Regards,

Deepak Bhalla

Read only

0 Likes
3,700

Hi Deepak!

Do you count already the active sessions?

Because there is a syntax, where WAIT can compare variables (report RBDAPP01):


* Wait until processing is finished if that is required.
  if p_parall = c_true and p_wait = c_true.
**    WAIT UNTIL finish_counter >= output_total.
    while finish_counter < output_total.
      wait up to 1 seconds.
    endwhile.
  endif.

Looks like the version was changed, but the critical information 'finish_counter' is changed in the receiving form-routine of the RFC-call. That's the trick of counting.

Also in FM MASTERIDOC_CREATE_SMD_W_PDLD is a nice implementation of parallel processing.

Just have a look and copy the steps into your program.

Regards,

Christian

Read only

Former Member
0 Likes
3,700

Hi,

If you are trying to delete records from database

delete records in packets of 25000 using

delete ztable from table itab.

can you elaborate your requirement

Regards

Amole