<?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 Re: 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/1769200#M332252</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;instead what u can do it for every 10000 records u can create 1 job which is submitted to background. So, more jobs will be created and submitted and will wait for its turn to get active and finish the task.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 06 Dec 2006 15:59:28 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-12-06T15:59:28Z</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/1769198#M332250</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;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Dec 2006 12:01:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/parallel-processing-in-background/m-p/1769198#M332250</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-06T12:01:00Z</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/1769199#M332251</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;If you can't split by selection criteria (planning more jobs), then only internal splitting is possible, indeed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The parallel tasks you (can) start are usually dialog processes - there are usually more in the system. You might try to call the additional tasks 'in background' - but I don't know, if the 'receive result' will work (probably not).&lt;/P&gt;&lt;P&gt;So you need to split your data into smaller chunks. I think an optimum runtime for a parallel task is between 1 and 5 minutes - less and you have more handling overhead, more and you might get into trouble of a 10 min time-out at some times.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So it's more a question, which parts you let run in the parallel task and how big this portions are. But in the end it's an often used technique and the only way (after all other improvements were done).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Christian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Dec 2006 15:48:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/parallel-processing-in-background/m-p/1769199#M332251</guid>
      <dc:creator>christian_wohlfahrt</dc:creator>
      <dc:date>2006-12-06T15:48: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/1769200#M332252</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;instead what u can do it for every 10000 records u can create 1 job which is submitted to background. So, more jobs will be created and submitted and will wait for its turn to get active and finish the task.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Dec 2006 15:59:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/parallel-processing-in-background/m-p/1769200#M332252</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-06T15:59:28Z</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/1769201#M332253</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;&lt;/P&gt;&lt;P&gt;Refer sample code for Parallel Processing: &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 at each step.&lt;/P&gt;&lt;P&gt; This program sends Data in packets to the Workprocess available and process data parallel.&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 &amp;lt;b&amp;gt;SBPT_INITIALIZE&amp;lt;/b&amp;gt; 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 'SPBT_INITIALIZE' &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 = WP_AVAILABLE &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 &amp;lt;b&amp;gt;'RFC_SYSTEM_INFO'&amp;lt;/b&amp;gt; "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 &amp;lt;b&amp;gt;'SPBT_GET_PP_DESTINATION'&amp;lt;/b&amp;gt; &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 &amp;lt;b&amp;gt;'SPBT_GET_PP_DESTINATION'&amp;lt;/b&amp;gt; &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;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Dec 2006 16:58:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/parallel-processing-in-background/m-p/1769201#M332253</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-06T16:58:55Z</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/1769202#M332254</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;   while selecting the 1 millian records,do like below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select * from your table into your internal table pakage size 40000&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    your logic to process the records..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endselect.&lt;/P&gt;&lt;P&gt;each time it will select the 40000 records process sends to XI .Each time records get reduce amd memory will increse.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pls reward points for helpful answers.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Dec 2006 06:31:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/parallel-processing-in-background/m-p/1769202#M332254</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-07T06:31:09Z</dc:date>
    </item>
  </channel>
</rss>

