<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Parallel processing in background in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/parallel-processing-in-background/m-p/1769332#M332288</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am processing 1 million of records in background, which takes approximately around 10 hrs. I wanted to reduce the time to less than 1 hr and tried using parallel processing. But the tasks run in Dialog workprocesses and giving abap short dumps due to time out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any other solutions using that i can reduce total processing time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please note that i cannot split. I am getting 1 million records from a select query and after processing all those records in SAP, I am sending to XI and XI will post in legacy system.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please note that all other performance tunings done. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Rajesh.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 06 Dec 2006 12:03:05 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-12-06T12:03:05Z</dc:date>
    <item>
      <title>Parallel processing in background</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/parallel-processing-in-background/m-p/1769332#M332288</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am processing 1 million of records in background, which takes approximately around 10 hrs. I wanted to reduce the time to less than 1 hr and tried using parallel processing. But the tasks run in Dialog workprocesses and giving abap short dumps due to time out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any other solutions using that i can reduce total processing time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please note that i cannot split. I am getting 1 million records from a select query and after processing all those records in SAP, I am sending to XI and XI will post in legacy system.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please note that all other performance tunings done. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Rajesh.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Dec 2006 12:03:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/parallel-processing-in-background/m-p/1769332#M332288</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-06T12:03:05Z</dc:date>
    </item>
    <item>
      <title>Re: Parallel processing in background</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/parallel-processing-in-background/m-p/1769333#M332289</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can use the FM &amp;lt;b&amp;gt;TH_REDISPATCH&amp;lt;/b&amp;gt; to avoid the short dumps (see also Note 25528), however this will not reduce the processing time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I guess you have split. Isn't it possible to change the select query into some intervals?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Dec 2006 14:10:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/parallel-processing-in-background/m-p/1769333#M332289</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-06T14:10:45Z</dc:date>
    </item>
    <item>
      <title>Re: Parallel processing in background</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/parallel-processing-in-background/m-p/1769334#M332290</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rajesh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Refer sample code for &amp;lt;b&amp;gt;Parallel Processing&amp;lt;/b&amp;gt;: &lt;/P&gt;&lt;P&gt;By doing this your &amp;lt;b&amp;gt;processing&amp;lt;/b&amp;gt; time will be highly optimized.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Go thru the description given in the code at each level.&lt;/P&gt;&lt;P&gt;This code Checks available WORK PROCESSes and assigns data in packets for processing. This way you save a lot of time esp when data is in Millions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT PARAJOB.&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Data declarations&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;DATA: GROUP LIKE RZLLITAB-CLASSNAME VALUE ' ', &lt;/P&gt;&lt;P&gt;"Parallel processing group. &lt;/P&gt;&lt;P&gt;"SPACE = group default (all&lt;/P&gt;&lt;P&gt;"servers)&lt;/P&gt;&lt;P&gt;WP_AVAILABLE TYPE I, "Number of dialog work processes&lt;/P&gt;&lt;P&gt;"available for parallel processing&lt;/P&gt;&lt;P&gt;"(free work processes) &lt;/P&gt;&lt;P&gt;WP_TOTAL TYPE I, "Total number of dialog work &lt;/P&gt;&lt;P&gt;"processes in the group&lt;/P&gt;&lt;P&gt;MSG(80) VALUE SPACE, "Container for error message in &lt;/P&gt;&lt;P&gt;"case of remote RFC exception.&lt;/P&gt;&lt;P&gt;INFO LIKE RFCSI, C, "Message text &lt;/P&gt;&lt;P&gt;JOBS TYPE I VALUE 10, "Number of parallel jobs &lt;/P&gt;&lt;P&gt;SND_JOBS TYPE I VALUE 1, "Work packets sent for processing &lt;/P&gt;&lt;P&gt;RCV_JOBS TYPE I VALUE 1, "Work packet replies received &lt;/P&gt;&lt;P&gt;EXCP_FLAG(1) TYPE C, "Number of RESOURCE_FAILUREs &lt;/P&gt;&lt;P&gt;TASKNAME(4) TYPE N VALUE '0001', "Task name (name of &lt;/P&gt;&lt;P&gt;"parallel processing work unit)&lt;/P&gt;&lt;P&gt;BEGIN OF TASKLIST OCCURS 10, "Task administration &lt;/P&gt;&lt;P&gt;TASKNAME(4) TYPE C, &lt;/P&gt;&lt;P&gt;RFCDEST LIKE RFCSI-RFCDEST,&lt;/P&gt;&lt;P&gt;RFCHOST LIKE RFCSI-RFCHOST, &lt;/P&gt;&lt;P&gt;END OF TASKLIST. &lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Optional call to SBPT_INITIALIZE to check the &lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;group in which parallel processing is to take place. &lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Could be used to optimize sizing of work packets&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;work / WP_AVAILABLE).&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;CALL FUNCTION &amp;lt;b&amp;gt;'SPBT_INITIALIZE'&amp;lt;/b&amp;gt; &lt;/P&gt;&lt;P&gt;EXPORTING &lt;/P&gt;&lt;P&gt;GROUP_NAME = GROUP &lt;/P&gt;&lt;P&gt;"Name of group to check&lt;/P&gt;&lt;P&gt;IMPORTING &lt;/P&gt;&lt;P&gt;MAX_PBT_WPS = WP_TOTAL &lt;/P&gt;&lt;P&gt;"Total number of dialog work&lt;/P&gt;&lt;P&gt;"processes available in group&lt;/P&gt;&lt;P&gt;"for parallel processing&lt;/P&gt;&lt;P&gt;FREE_PBT_WPS = &amp;lt;b&amp;gt;WP_AVAILABLE&amp;lt;/b&amp;gt; &lt;/P&gt;&lt;P&gt;"Number of work processes &lt;/P&gt;&lt;P&gt;"available in group for &lt;/P&gt;&lt;P&gt;"parallel processing at this&lt;/P&gt;&lt;P&gt;"moment&lt;/P&gt;&lt;P&gt;EXCEPTIONS &lt;/P&gt;&lt;P&gt;INVALID_GROUP_NAME = 1 &lt;/P&gt;&lt;P&gt;"Incorrect group name; RFC &lt;/P&gt;&lt;P&gt;"group not defined. See &lt;/P&gt;&lt;P&gt;"transaction RZ12 &lt;/P&gt;&lt;P&gt;INTERNAL_ERROR = 2 &lt;/P&gt;&lt;P&gt;"R/3 System error; see the&lt;/P&gt;&lt;P&gt;"system log (transaction &lt;/P&gt;&lt;P&gt;"SM21) for diagnostic info &lt;/P&gt;&lt;P&gt;PBT_ENV_ALREADY_INITIALIZED = 3 &lt;/P&gt;&lt;P&gt;"Function module may be &lt;/P&gt;&lt;P&gt;"called only once; is called&lt;/P&gt;&lt;P&gt;"automatically by R/3 if you&lt;/P&gt;&lt;P&gt;"do not call before starting&lt;/P&gt;&lt;P&gt;"parallel processing &lt;/P&gt;&lt;P&gt;CURRENTLY_NO_RESOURCES_AVAIL = 4 &lt;/P&gt;&lt;P&gt;"No dialog work processes &lt;/P&gt;&lt;P&gt;"in the group are available;&lt;/P&gt;&lt;P&gt;"they are busy or server load&lt;/P&gt;&lt;P&gt;"is too high &lt;/P&gt;&lt;P&gt;NO_PBT_RESOURCES_FOUND = 5 &lt;/P&gt;&lt;P&gt;"No servers in the group &lt;/P&gt;&lt;P&gt;"met the criteria of &amp;gt; &lt;/P&gt;&lt;P&gt;"two work processes &lt;/P&gt;&lt;P&gt;"defined. &lt;/P&gt;&lt;P&gt;CANT_INIT_DIFFERENT_PBT_GROUPS = 6&lt;/P&gt;&lt;P&gt;"You have already initialized &lt;/P&gt;&lt;P&gt;"one group and have now tried &lt;/P&gt;&lt;P&gt;"initialize a different group.&lt;/P&gt;&lt;P&gt;OTHERS = 7.. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CASE SY-SUBRC.&lt;/P&gt;&lt;P&gt;WHEN 0.&lt;/P&gt;&lt;P&gt;"Everything&amp;#146;s ok. Optionally set up for optimizing size of &lt;/P&gt;&lt;P&gt;"work packets.&lt;/P&gt;&lt;P&gt;WHEN 1.&lt;/P&gt;&lt;P&gt;"Non-existent group name. Stop report.&lt;/P&gt;&lt;P&gt;MESSAGE E836. "Group not defined.&lt;/P&gt;&lt;P&gt;WHEN 2. &lt;/P&gt;&lt;P&gt;"System error. Stop and check system log for error &lt;/P&gt;&lt;P&gt;"analysis.&lt;/P&gt;&lt;P&gt;WHEN 3. &lt;/P&gt;&lt;P&gt;"Programming error. Stop and correct program.&lt;/P&gt;&lt;P&gt;MESSAGE E833. "PBT environment was already initialized.&lt;/P&gt;&lt;P&gt;WHEN 4. &lt;/P&gt;&lt;P&gt;"No resources: this may be a temporary problem. You &lt;/P&gt;&lt;P&gt;"may wish to pause briefly and repeat the call. Otherwise&lt;/P&gt;&lt;P&gt;"check your RFC group administration: Group defined &lt;/P&gt;&lt;P&gt;"in accordance with your requirements? &lt;/P&gt;&lt;P&gt;MESSAGE E837. "All servers currently busy.&lt;/P&gt;&lt;P&gt;WHEN 5. &lt;/P&gt;&lt;P&gt;"Check your servers, network, operation modes. &lt;/P&gt;&lt;P&gt;WHEN 6. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Do parallel processing. Use CALL FUNCTION STARTING NEW TASK&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;DESTINATION IN GROUP to call the function module that does the &lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;work. Make a call for each record that is to be processed, or &lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;divide the records into work packets. In each case, provide the &lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;set of records as an internal table in the CALL FUNCTION &lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;keyword (EXPORT, TABLES arguments). &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DO. &lt;/P&gt;&lt;P&gt;CALL FUNCTION 'RFC_SYSTEM_INFO' "Function module to perform &lt;/P&gt;&lt;P&gt;"in parallel &lt;/P&gt;&lt;P&gt;STARTING NEW TASK TASKNAME "Name for identifying this &lt;/P&gt;&lt;P&gt;"RFC call&lt;/P&gt;&lt;P&gt;DESTINATION IN GROUP group "Name of group of servers to &lt;/P&gt;&lt;P&gt;"use for parallel processing.&lt;/P&gt;&lt;P&gt;"Enter group name exactly &lt;/P&gt;&lt;P&gt;"as it appears in transaction &lt;/P&gt;&lt;P&gt;"RZ12 (all caps). You may &lt;/P&gt;&lt;P&gt;"use only one group name in a &lt;/P&gt;&lt;P&gt;"particular ABAP program.&lt;/P&gt;&lt;P&gt;PERFORMING RETURN_INFO ON END OF TASK &lt;/P&gt;&lt;P&gt;"This form is called when the &lt;/P&gt;&lt;P&gt;"RFC call completes. It can &lt;/P&gt;&lt;P&gt;"collect IMPORT and TABLES &lt;/P&gt;&lt;P&gt;"parameters from the called &lt;/P&gt;&lt;P&gt;"function with RECEIVE. &lt;/P&gt;&lt;P&gt;EXCEPTIONS &lt;/P&gt;&lt;P&gt;COMMUNICATION_FAILURE = 1 MESSAGE msg &lt;/P&gt;&lt;P&gt;"Destination server not &lt;/P&gt;&lt;P&gt;"reached or communication &lt;/P&gt;&lt;P&gt;"interrupted. MESSAGE msg &lt;/P&gt;&lt;P&gt;"captures any message &lt;/P&gt;&lt;P&gt;"returned with this &lt;/P&gt;&lt;P&gt;"exception (E or A messages&lt;/P&gt;&lt;P&gt;"from the called FM, for &lt;/P&gt;&lt;P&gt;"example. After exception&lt;/P&gt;&lt;P&gt;"1 or 2, instead of aborting &lt;/P&gt;&lt;P&gt;"your program, you could use &lt;/P&gt;&lt;P&gt;"SPBT_GET_PP_DESTINATION and&lt;/P&gt;&lt;P&gt;"SPBT_DO_NOT_USE_SERVER to &lt;/P&gt;&lt;P&gt;"exclude this server from &lt;/P&gt;&lt;P&gt;"further parallel processing.&lt;/P&gt;&lt;P&gt;"You could then re-try this &lt;/P&gt;&lt;P&gt;"call using a different &lt;/P&gt;&lt;P&gt;"server.&lt;/P&gt;&lt;P&gt;SYSTEM_FAILURE = 2 MESSAGE msg&lt;/P&gt;&lt;P&gt;"Program or other internal &lt;/P&gt;&lt;P&gt;"R/3 error. MESSAGE msg &lt;/P&gt;&lt;P&gt;"captures any message &lt;/P&gt;&lt;P&gt;"returned with this &lt;/P&gt;&lt;P&gt;"exception. &lt;/P&gt;&lt;P&gt;RESOURCE_FAILURE = 3. "No work processes are &lt;/P&gt;&lt;P&gt;"currently available. Your &lt;/P&gt;&lt;P&gt;"program MUST handle this &lt;/P&gt;&lt;P&gt;"exception. &lt;/P&gt;&lt;P&gt;YOUR_EXCEPTIONS = X. "Add exceptions generated by &lt;/P&gt;&lt;P&gt;"the called function module &lt;/P&gt;&lt;P&gt;"here. Exceptions are &lt;/P&gt;&lt;P&gt;"returned to you and you can &lt;/P&gt;&lt;P&gt;"respond to them here. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CASE SY-SUBRC. &lt;/P&gt;&lt;P&gt;WHEN 0. &lt;/P&gt;&lt;P&gt;"Administration of asynchronous RFC tasks &lt;/P&gt;&lt;P&gt;"Save name of task...&lt;/P&gt;&lt;P&gt;TASKLIST-TASKNAME = TASKNAME. &lt;/P&gt;&lt;P&gt;"... and get server that is performing RFC call. &lt;/P&gt;&lt;P&gt;CALL FUNCTION 'SPBT_GET_PP_DESTINATION' &lt;/P&gt;&lt;P&gt;EXPORTING &lt;/P&gt;&lt;P&gt;RFCDEST = TASKLIST-RFCDEST &lt;/P&gt;&lt;P&gt;EXCEPTIONS &lt;/P&gt;&lt;P&gt;OTHERS = 1. &lt;/P&gt;&lt;P&gt;APPEND TASKLIST. &lt;/P&gt;&lt;P&gt;WRITE: / 'Started task: ', TASKLIST-TASKNAME COLOR 2. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TASKNAME = TASKNAME + 1. &lt;/P&gt;&lt;P&gt;SND_JOBS = SND_JOBS + 1. &lt;/P&gt;&lt;P&gt;"Mechanism for determining when to leave the loop. Here, a &lt;/P&gt;&lt;P&gt;"simple counter of the number of parallel processing tasks. &lt;/P&gt;&lt;P&gt;"In production use, you would end the loop when you have &lt;/P&gt;&lt;P&gt;"finished dispatching the data that is to be processed. &lt;/P&gt;&lt;P&gt;JOBS = JOBS - 1. "Number of existing jobs &lt;/P&gt;&lt;P&gt;IF JOBS = 0. &lt;/P&gt;&lt;P&gt;EXIT. "Job processing finished &lt;/P&gt;&lt;P&gt;ENDIF. &lt;/P&gt;&lt;P&gt;WHEN 1 OR 2.&lt;/P&gt;&lt;P&gt;"Handle communication and system failure. Your program must &lt;/P&gt;&lt;P&gt;"catch these exceptions and arrange for a recoverable &lt;/P&gt;&lt;P&gt;"termination of the background processing job. &lt;/P&gt;&lt;P&gt;"Recommendation: Log the data that has been processed when&lt;/P&gt;&lt;P&gt;"an RFC task is started and when it returns, so that the &lt;/P&gt;&lt;P&gt;"job can be restarted with unprocessed data. &lt;/P&gt;&lt;P&gt;WRITE msg. &lt;/P&gt;&lt;P&gt;"Remove server from further consideration for &lt;/P&gt;&lt;P&gt;"parallel processing tasks in this program. &lt;/P&gt;&lt;P&gt;"Get name of server just called... &lt;/P&gt;&lt;P&gt;CALL FUNCTION 'SPBT_GET_PP_DESTINATION' &lt;/P&gt;&lt;P&gt;EXPORTING &lt;/P&gt;&lt;P&gt;RFCDEST = TASKLIST-RFCDEST &lt;/P&gt;&lt;P&gt;EXCEPTIONS &lt;/P&gt;&lt;P&gt;OTHERS = 1. &lt;/P&gt;&lt;P&gt;"Then remove from list of available servers.&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'SPBT_DO_NOT_USE_SERVER'&lt;/P&gt;&lt;P&gt;IMPORTING &lt;/P&gt;&lt;P&gt;SERVERNAME = TASKLIST-RFCDEST&lt;/P&gt;&lt;P&gt;EXCEPTIONS &lt;/P&gt;&lt;P&gt;INVALID_SERVER_NAME = 1 &lt;/P&gt;&lt;P&gt;NO_MORE_RESOURCES_LEFT = 2 &lt;/P&gt;&lt;P&gt;"No servers left in group.&lt;/P&gt;&lt;P&gt;PBT_ENV_NOT_INITIALIZED_YET = 3&lt;/P&gt;&lt;P&gt;OTHERS = 4.&lt;/P&gt;&lt;P&gt;WHEN 3. &lt;/P&gt;&lt;P&gt;"No resources (dialog work processes) available at &lt;/P&gt;&lt;P&gt;"present. You need to handle this exception, waiting&lt;/P&gt;&lt;P&gt;"and repeating the CALL FUNCTION until processing &lt;/P&gt;&lt;P&gt;"can continue or it is apparent that there is a &lt;/P&gt;&lt;P&gt;"problem that prevents continuation. &lt;/P&gt;&lt;P&gt;MESSAGE I837. "All servers currently busy.&lt;/P&gt;&lt;P&gt;"Wait for replies to asynchronous RFC calls. Each &lt;/P&gt;&lt;P&gt;"reply should make a dialog work process available again. &lt;/P&gt;&lt;P&gt;IF EXCP_FLAG = SPACE. &lt;/P&gt;&lt;P&gt;EXCP_FLAG = 'X'. &lt;/P&gt;&lt;P&gt;"First attempt at RESOURCE_FAILURE handling. Wait &lt;/P&gt;&lt;P&gt;"until all RFC calls have returned or up to 1 second.&lt;/P&gt;&lt;P&gt;"Then repeat CALL FUNCTION. &lt;/P&gt;&lt;P&gt;WAIT UNTIL RCV_JOBS &amp;gt;= SND_JOBS UP TO '1' SECONDS. &lt;/P&gt;&lt;P&gt;ELSE. &lt;/P&gt;&lt;P&gt;"Second attempt at RESOURCE_FAILURE handling &lt;/P&gt;&lt;P&gt;WAIT UNTIL RCV_JOBS &amp;gt;= SND_JOBS UP TO '5' SECONDS. &lt;/P&gt;&lt;P&gt;"SY-SUBRC 0 from WAIT shows that replies have returned. &lt;/P&gt;&lt;P&gt;"The resource problem was therefore probably temporary&lt;/P&gt;&lt;P&gt;"and due to the workload. A non-zero RC suggests that&lt;/P&gt;&lt;P&gt;"no RFC calls have been completed, and there may be &lt;/P&gt;&lt;P&gt;"problems. &lt;/P&gt;&lt;P&gt;IF SY-SUBRC = 0. &lt;/P&gt;&lt;P&gt;CLEAR EXCP_FLAG.&lt;/P&gt;&lt;P&gt;ELSE. "No replies &lt;/P&gt;&lt;P&gt;"Endless loop handling &lt;/P&gt;&lt;P&gt;... &lt;/P&gt;&lt;P&gt;ENDIF. &lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;ENDCASE. &lt;/P&gt;&lt;P&gt;ENDDO. &lt;/P&gt;&lt;P&gt;... &lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Wait for end of job: replies from all RFC tasks. &lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Receive remaining asynchronous replies &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;WAIT UNTIL RCV_JOBS &amp;gt;= SND_JOBS. &lt;/P&gt;&lt;P&gt;LOOP AT TASKLIST. &lt;/P&gt;&lt;P&gt;WRITE:/ 'Received task:', TASKLIST-TASKNAME COLOR 1, &lt;/P&gt;&lt;P&gt;30 'Destination: ', TASKLIST-RFCDEST COLOR 1. &lt;/P&gt;&lt;P&gt;ENDLOOP. &lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;This routine is triggered when an RFC call completes and &lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;returns. The routine uses RECEIVE to collect IMPORT and TABLE&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;data from the RFC function module. &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Note that the WRITE keyword is not supported in asynchronous &lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;RFC. If you need to generate a list, then your RFC function &lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;module should return the list data in an internal table. You &lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;can then collect this data and output the list at the conclusion &lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;of processing. &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;FORM RETURN_INFO USING TASKNAME. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: INFO_RFCDEST LIKE TASKLIST-RFCDEST.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RECEIVE RESULTS FROM FUNCTION 'RFC_SYSTEM_INFO' &lt;/P&gt;&lt;P&gt;IMPORTING RFCSI_EXPORT = INFO &lt;/P&gt;&lt;P&gt;EXCEPTIONS &lt;/P&gt;&lt;P&gt;COMMUNICATION_FAILURE = 1 &lt;/P&gt;&lt;P&gt;SYSTEM_FAILURE = 2. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RCV_JOBS = RCV_JOBS + 1. "Receiving data &lt;/P&gt;&lt;P&gt;IF SY-SUBRC NE 0. &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Handle communication and system failure &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;... &lt;/P&gt;&lt;P&gt;ELSE. &lt;/P&gt;&lt;P&gt;READ TABLE TASKLIST WITH KEY TASKNAME = TASKNAME. &lt;/P&gt;&lt;P&gt;IF SY-SUBRC = 0. "Register data &lt;/P&gt;&lt;P&gt;TASKLIST-RFCHOST = INFO_RFCHOST. &lt;/P&gt;&lt;P&gt;MODIFY TASKLIST INDEX SY-TABIX. &lt;/P&gt;&lt;P&gt;ENDIF. &lt;/P&gt;&lt;P&gt;ENDIF. &lt;/P&gt;&lt;P&gt;... &lt;/P&gt;&lt;P&gt;ENDFORM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward points if that helps.&lt;/P&gt;&lt;P&gt;Manish&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Manish Kumar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Dec 2006 14:18:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/parallel-processing-in-background/m-p/1769334#M332290</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-06T14:18:52Z</dc:date>
    </item>
  </channel>
</rss>

