SPBT_INITIALIZE ??

Hi..
I am able to create a master IDOC from transaction BD10 but I am unable to create a Communication IDOC .
I have configured the settings in BD64 for it too.
After debugging I came to know that the error is in the FM-->SPBT_INITIALIZE called in the program RBDMIDOC(BD10).
The sy-subrc is coming 5 in this case which is NO_PBT_RESOURCES_FOUND.
I dont know what is PBT resource?
I would appreciate a quick response if anyone can give me some information about this .
Thank You

hi,
If you have configured everything in BD64, try creating communication idocs again by opening BD10 session again.
SPBT_INITIALIZE is used to determine the availability of resources for parallel processing.
Due to the non availability of resources, you are unable to create communication idocs.
Regards,
Sailaja.

Similar Messages

  • RFC function Short dump - Function code SPBT_INITIALIZE

    Hi ALL,
        We are trying to change the Sales orders using the RFC function with Paraller processing. When the function is doing the paraller processing we are getting the runtime error when it tries to initialize using the function module SPBT_INITIALIZE. How can we fix this error.
    Here is the description of the error:
    Short text of error message:                                             
    Init. group IBM_IDOC_CHG not possible as another group IBM_IDOC_ADD is a 
    lready init.                                                                               
    Technical information about the message:                                 
    Diagnosis                                                               
         The system tried to initialize the environment for processing       
         parallel RFCs using the function code SPBT_INITIALIZE. Here it was  
         established that the environment was already initialized for other  
         PBT groups.                                                         
         This is a programming error in an application program that uses     
         parallel RFCs. You can find the name of the program in the ABAP     
         call stack.                                                         
    Appreciate your help in this,
    Thanks,
    Satya

    Hi,
    you need a wrapper RFC to do achive result.
    Go tru the thread below you problem should be resolved,
    RFC to FILE
    You need to map the multi structured file to new RFC structure.
    Hope this helps.
    Prasad Babu.
    Message was edited by:
            PrasadBabu Koribilli

  • Can I CALL FUNCTION 'SPBT_INITIALIZE' many times ?

    Hi ABAP Expert,
    I need your advise whether is recommended to calling FUNCTION 'SPBT_INITIALIZE' to get updated information regarding available background process for parallel processing in ABAP.
    Because if i just call this program 1 time at the beginning and the report running quite long, the information is not updated anymore.
    Please advise.
    Thank you in advance
    Fernand.

    Hi
    what you can do is create form and perform
    write your code for that FM in Form part and use perform wherever in your program you want to use.
    whenever the perform will be triggered it will go to the form part where you are calling the FM.
    I hope this way you can use it multiple time without calling it every time from pattern.
    But I am not sure whether it is a good approach or not?
    thanks
    Lalit Gupta

  • How to take back the control from RFC function module to calling program

    Hi,
    In our system landscape, more than 200 child systems are connected to Solution manager(SMP). I have copied a RFC enabled function module into all the child systems and calling that FM from Sol Man in sychronous mode.
    Here goes my code in SolMan.
    LOOP AT it_dest INTO wa_dest.
      CALL FUNCTION 'Z_GET_LOGIN_DETAILS' DESTINATION wa_dest-rfcdest
        EXPORTING
          date_fr               = s_date-low
          date_to               = s_date-high
        TABLES
          tab_data              = it_val
        EXCEPTIONS
          communication_failure = 1
          system_failure        = 2
          OTHERS                = 3.
      IF sy-subrc EQ 0.
    *     Updates zuserlogon
          MODIFY zt_logon_det FROM TABLE it_val.
          COMMIT WORK.
          WRITE:/'RFC for Destination', wa_dest-rfcdest, 'succesfully updated.'.
      ELSE.
          WRITE:/'RFC for Destination', wa_dest-rfcdest, ' failed.'.
      ENDIF.
    ENDLOOP.
    Few child systems are very slow & takes more than 20 minutes(Many of the times system hangs) to return the result. But I should not wait for so long. Even if the child system doesn't return any values in 5 minutes I shoud continue with other system ignoring the current one.
    I tried calling the FM in asynchronous mode(STARTING NEW TASK) but no success because only 6 DIA processes possible but as I said I have more than 200 systems connected to SolMan.
    Please help me resolving this problem.
    Thanks,
    Prathap

    If there are only few child systems with bad response time, use asynchronous call using a CALL FUNCTION func STARTING NEW TASK task DESTINATION dest PERFORMING subr or CALLING meth ON END OF TASK. Count asynchronous calls still running/waiting (increment a counter when creating a task (not the one used for task id). In the form/method performed at end of a call decrement the counter. When counter is lower than a limit, 4-5 if 6 processes (*), perform an asynchronous call else perform a synchronous call or wait until the counter falls below the limit.
    Regards,
    Raymond
    (*) Use SPBT_INITIALIZE at start of program to get actual number of free/available processes.

  • How to find out number of background work processe available in the system?

    Hi All,
    I have a FM that triggers a background job using JOB_OPEN, ABAP_SUBMIT and JOB_CLOSE. But the problem is if there are no background work processes available at that moment, it does not return error. Not sure whether the job is even scheduled!
    Is there a way to find out if there are any background work processes available in the system? I know a FM SPBT_INITIALIZE which gives info about dialog work processes. Is there any other FM similar to this which gives info about background wp??
    Regards,
    Shailesh

    your Job will remain in a queue by message handler. once workprocess is free, your job gets scheduled
    by the way, you can use the functionality used in FM TH_DISPLAY_WORKPROCESS_LIST to read the workprocesses
    the command which gets you the workprocess is:
    CALL 'ThWpInfo' ID 'OPCODE' FIELD OPCODE_WP_LIST
                      ID 'TAB' FIELD LIST_STATE_WPLST-TABL
                      ID 'CPU' FIELD LIST_STATE_WPLST-CPU.
    check how its written in include LSDEBF01, form SET_LIST_WPLST
    Edited by: Soumyaprakash Mishra on Dec 12, 2011 12:17 PM

  • NO PBT RESOURCE FOUND

    HI,
        i am working in bw 3.5. when i am trying to execute datasource 0CRM_SALES_ACT_1 through RSA3 , it is giving ABAP run time error. NO PBT RESOURCE FOUND .Error occured in SPBT_INITIALIZE function module. Please guide me how to solve this problem.
    I have pasted error description here.
    Regards
    deepon
    The current application triggered a termination with a short dump.
    What happened?
    The current application program detected a situation which really
    should not occur. Therefore, a termination with a short dump was
    triggered on purpose by the key word MESSAGE (type X).
    What can you do?
    Print out the error message (using the "Print" function)
    and make a note of the actions and input that caused the
    error.
    To resolve the problem, contact your SAP system administrator.
    You can use transaction ST22 (ABAP Dump Analysis) to view and administer
    termination messages, especially those beyond their normal deletion
    date.
    is especially useful if you want to keep a particular message.
    Error analysis
    Short text of error message:
    No PBT resources available in system
    Technical information about the message:
    Diagnosis
         The system tried to initialize the environment for processing      parallel RFCs using the function module SPBT_INITIALIZE. Here the      system established that there are no resources in the system. This
         is a configuration problem. Only those application servers with at      least three dialog work processes can be used to process parallel      RFCs.
    System response
    Procedure
         1.  If no specific server group name is specified for processing   parallel RFCs:
             All application servers in your system have less than three    dialog work processes. If you want to process parallel RFCs, at   least one application server must have at least three dialog   work processes.
         2.  If a server group name was specified using Transaction RZ12 for  processing parallel RFCs:
             All application servers in the server group have less than   three dialog work processes. If you want to process parallel    RFCs, then at least one application server in the server group must have at least three dialog work processes.
    Message classe...... "BT"
    Number.............. 834
    How to correct the error
    Probably the only way to eliminate the error is to correct the program.
    You may able to find an interim solution to the problem
    in the SAP note system. If you have access to the note system yourself,
    use the following search criteria:
    "MESSAGE_TYPE_X" C
    "SAPLSPBT" or "LSPBTU01"
    "SPBT_INITIALIZE"
    If you cannot solve the problem yourself, please send the following documents to SAP:
    1. A hard copy print describing the problem.
       To obtain this, select the "Print" function on the current screen.
    2. A suitable hardcopy prinout of the system log.
       To obtain this, call the system log with Transaction SM21
       and select the "Print" function to print out the relevant
       part.
    Edited by: DEEPON KUMAR on Mar 22, 2008 8:11 PM

    Hi,
    problem is caused by the following reasons:
    1. The aRFC quotas for the application servers were not configured correctly in transaction RZ12.
    2. You have used a server group for the parallel RFC that does not exist in transaction RZ12. Example of a call for parallel RFCs:
    CALL FUNCTION <func> STARTING NEW TASK <taskname>
                        DESTINATION IN GROUP <group> ...
    3. You have entered an invalid server group name in transaction SMQS or transaction SMQR.
    4. The dynamic settings of the profile parameters do not take effect. Therefore, the new settings in transaction RZ11 or RZ12 do not correct the resource bottlenecks.
    Solution
    1. Check the settings of the aRFC quotas in transaction RZ12 (as described in the F1 help for each field) and refer to the documentation attached in note #74141 for information on the relevant profile parameters.
    Information: You can use transaction SARFC to check the configurations set in transaction RZ12.
    2. In the short dump, you can use the "GROUP_NAME" variable to determine the server group that was used for the parallel RFC. Compare the value with the names of the active server groups in transaction RZ12.
    Information: The default server group is "SPACE".
    3. As of a qRFC version higher than 45 with supplement 11, you are already made aware of the error that occurs when you enter an invalid server group. Before this supplement, however, you must correct the error as described in solution 2 above.
    Check SAP NOTE 727709 - MESSAGE_TYPE_X short dump and SPBT_INITIALIZE
    Regards
    Andreas

  • Parallel processing using ABAP objects

    Hello friends,
                        I had posted in the performance tuning forum , regarding a performance issue problem , I am reposting it as it involves OO concept .
    the link for the previous posting
    Link: [Independent processing of elements inside internal table;
    Here is the scenario,
    I have a internal table with 10 records(indepentent) , and i need to process them .The processing of one record doesnt have any influence on the another . When we go for loop , the performance issue is that , the 10 th record has to wait until the 9 records get processed even though there is no dependency on the output.
    Could some one tell a way out to improve the performance..
    If i am not clear with the question , i would explain it still clearer...
    A internal table has 5 numbers , say( 1,3,4,6,7)
    we are trying to find square of each number ,,,
    If it is a loop the finding of suare of 7 has to wait until 6 is getting completed and it is waste of time ...
    This is related to parallel processing , I have refered to parallel processing documents,But I want to do this conceptually ..
    I am not using conventional procedural paradigm but Object orientedness...I am having a method which is performing this action .What am I supposed to do in that regard.
    Comradely ,
    K.Sibi

    Hi,
    As examplified by Edward, there is no RFC/asynchronous support for Methods of ABAP Objects as such. You would indeed need to "wrap" your method or ABAP Object in a Function Module, that you can then call with the addition "STARTING NEW TASK". Optionally, you can define a Method that will process the results of the Function Module that is executed asynchronously, as demonstrated as well in Edward's program.
    You do need some additional code to avoid the situation where your program takes all the available resources on the Application Server. Theoretically, you cannot bring the server or system down, as there is a system profile parameter that determines the maximum number of asynchronous tasks that the system will allow. However, in a productive environment, it would be a good idea to limit the number of asynchronous tasks started from your program so that other programs can use some as well.
    Function Group SPBT contains a set of Function Modules to manage parallel processing. In particular, FM SPBT_INITIALIZE will "initialize" a Server Group and return the maximum number of Parallel Tasks, as well as the number of free ones at the time of the initialization. The other FM of interest is SPBT_GET_CURR_RESOURCE_INFO, that can be called after the Server Group has been initialized, whenever you want to "fork" a new asynchronous task. This FM will give you the number of free tasks available for Parallel Processing at the time of calling the Function Module.
    Below is a code snippet showing how these Function Modules could be used, so that your program always leaves a minimum of 2 tasks for Parallel Processing, that will be available for other programs in the system.
          IF md_parallel IS NOT INITIAL.
            IF md_parallel_init IS INITIAL.
    *----- Server Group not initialized yet => Initialize it, and get the number of tasks available
              CALL FUNCTION 'SPBT_INITIALIZE'
              EXPORTING
                GROUP_NAME                           = ' '
                IMPORTING
                  max_pbt_wps                          = ld_max_tasks
                  free_pbt_wps                         = ld_free_tasks
                EXCEPTIONS
                  invalid_group_name                   = 1
                  internal_error                       = 2
                  pbt_env_already_initialized          = 3
                  currently_no_resources_avail         = 4
                  no_pbt_resources_found               = 5
                  cant_init_different_pbt_groups       = 6
                  OTHERS                               = 7.
              md_parallel_init = 'X'.
            ELSE.
    *----- Server Group initialized => check how many free tasks are available in the Server Group
          for parallel processing
              CALL FUNCTION 'SPBT_GET_CURR_RESOURCE_INFO'
                IMPORTING
                  max_pbt_wps                 = ld_max_tasks
                  free_pbt_wps                = ld_free_tasks
                EXCEPTIONS
                  internal_error              = 1
                  pbt_env_not_initialized_yet = 2
                  OTHERS                      = 3.
            ENDIF.
            IF ld_free_tasks GE 2.
    *----- We have at leasr 2 remaining available tasks => reserve one
              ld_taskid = ld_taskid + 1.
            ENDIF.
        ENDIF.
    You may also need to program a WAIT statement, to wait until all asynchronous tasks "forked" from your program have completed their processing. Otherwise, you might find yourself in the situation where your main program has finished its processing, but some of the asynchronous tasks that it started are still running. If you do not need to report on the results of these asynchronous tasks, then that is not an issue. But, if you need to report on the success/failure of the processing performed by the asynchronous tasks, you would most likely report incomplete results in your program.
    In the example where you have 10 entries to process asynchronously in an internal table, if you do not WAIT until all asynchronous tasks have completed, your program might report success/failure for only 8 of the 10 entries, because your program has completed before the asynchronous tasks for entries 9 and 10 in your internal table.
    Given the complexity of Parallel Processing, you would only consider it in a customer program for situations where you have many (ie, thousands, if not tens of thousands) records to process, that the processing for each record tends to take a long time (like creating a Sales Order or Material via BAPI calls), and that you have a limited time window to process all of these records.
    Well, whatever your decision is, good luck.

  • Reading hierarchies when running in background.

    Currently we have an abap that captures the hierarchy information via the function K_HIERARCHY_TABLES_READ.  We then use the results to collect additional data.  The report works in the foreground but gets different results when running in the background.  We traced the issue back to the function read.  We checked with SAP and SAP's response is that the function K_HIERARCHY_TABLES_READ cannot be used in the background.  Does anyone run any reports in the background which reads hierarchies?  If so, how do you do it?
    thanks,
    Larry

    Paul,
    Starting new task will start a new LUW in dialog process and not in background. This is the reason you are having a problem. While technically STARTING NEW TASK is used for parallel processing, you need to consider whether the program will be run in foreground or background mode.
    In case of background, you need consider using multiple jobs via job open, submit, job close. This way you can initiate more than one process in your server group to do the work.
    You will need to consider the # of background WP available and the # of WPs you can use for this program.
    So if there are 100 WPs available and you can use only 10 at any give time, then you should schedule 10 jobs and then check the status of the 10 jobs before you can start scheduling the next jobs.
    You can use the FM SPBT_INITIALIZE to check the # of WPs that are currently available in the server group.
    Hope this helps.
    Thanks,
    Vikram.M

  • MESSAGE_TYPE_X

    Hello Experts
    I am encountering below dump in development server , even after required settings being done in RZ12 by basis team.
    BI develoment is recently refreshed from quality.
    Dump:MESSAGE_TYPE_X
    Analysis:
    Invalid PBT server group name: BWXXX                                                                               
    Technical information about the message:                                
    Diagnosis                                                              
         The system tried to initialize the environment for processing      
         parallel RFCs using the function module SPBT_INITIALIZE. The server
         group name specified was found to be invalid. The server group name
         describes a group of servers on which the parallel RFCs should be  
         processed.                                                         
    System response                                                        
    Procedure                                                              
         You can use Transaction RZ12 to determine which PBT server groups  
         are configured in your system. You should only use one of the      
         server group names listed there to process parallel RFCs. 
    Anybody has faced such kind of issue?

    Hi Kanchan,
    This error means function module SPBT_INITIALIZE is being run with an incorrect GROUP_NAME parameter.
    To verify this, you can goto transaction se37 and run function SPBT_INITIALIZE with same group name, & you should get the same dump directly.
    Please do following steps to solve this problem.
    1. In RSA1, choose the affected ODS object under InfoProvider and go to the manage screen
    2. In the menu choose Goto -> ODS Object Customizing
    3. Maintain the right Server Group
    Also, make sure that the name of the server group is in upper case in RSODSO_SETTINGS.
    Make sure that this note has been implemented:
    1292280  P21:BATCH: Dialog server group permitted in uppercase only
    The dump can also happen due to improper resource allocation, so please also check:
    727709   MESSAGE_TYPE_X short dump and SPBT_INITIALIZE
    356750   module SPBT_INITIALIZE generates short dump
    74141     Resource Management for tRFC and aRFC
    Please check the profile parameter settings as described in Note 74141 to ensure that every server can provide at least one dialog process for processing.
    Rgds,
    Colum
    Edited by: Colum Cronin on Mar 19, 2010 8:52 AM

  • Regading getting data to and forth between 2 programs through SUBMIT

    Hi All,
    I have a issue regarding fetching internal table data from one program to another.
    Actually I have <b>Main Program</b> from that through SUBMIT statement i am calling another program and executing it for every 100 records - Actually this program is having BAPI running in it, By result i will get an internal table data. Now i want to get that internal table data back into my MAIN Program so that i can use it for next process.
    <b>EXPORT & IMPORT statements are working from MAIN Program to Other Program.</b>
    <b>EXPORT & IMPORT statements are not working from Other Program[SUBMIT'ed Program] to MAIN Program.</b>
    So can anybody tell me how can i get that data in other program into MAIN Program[Back].
    Thanks in advance.
    Thanks & Regards,
    Rayeez.

    When you submit the program is then running in parallel with the program which submitted it.  There is no mechism that you are using to stop the calling program and wait for the submitted program to finish and bring back some data.   Most likly program 1 ends before program 2 is finished updating the material master. You can do this kind of thing with Function modules.   You would put your call to the submitted program inside of a function module,  then call that function module saying STARTING IN NEW TASK,  then you can wait for it to be done and get the results using the RECIEVING statement.
    Here is the F1 Help.
    +
    CALL FUNCTION
    Variant 2
    CALL FUNCTION func ...STARTING NEW TASK task name.
    Additions:
    1. ... DESTINATION dest
    2. ... DESTINATION IN GROUP group name
    3. ... DESTINATION IN GROUP DEFAULT
    4. ... PERFORMING form ON END OF TASK
    5. ... EXPORTING  p1 = f1    ... pn = fn
    6. ... TABLES     p1 = itab1 ... pn = itabn
    7. ... EXCEPTIONS syst_except = rc MESSAGE mess
    Effect
    Starts the function module func asynchronously ina new session. In contrast to normal function module calls, the callingprogram resumes processing as soon as the function module is started inthe target system. It does not wait until the function module hasfinished. Through CALL SCREEN,the called function module can, for example, display a screen and thusinteract with the user.
    Notes
    This variant applies only from R/3 Release 3.0, so boththe client system and the server system must have Release 3.0 orhigher.
    With this variant, the called function module must also be flagged inthe Function Builder as externally callable, even if it is executedlocally (without the addition DESTINATION).
    There can be no function call to the destination 'BACK' in thecalled function module (for more information about the destination 'BACK', see CALLFUNCTION func DESTINATION dest).
    This variant does not support the execution of externalprograms accessible via the destination of the TCP/IP type asasynchronous calls (see the Transaction Tools ¨Administration, Administration ¨ Network ¨ RFC destinations formaintaining destinations).
    You cannot display screens (screens or lists asamodal windows in RFC communication using SAP Router.
    From Release 4.0, you can check the load of each RFC destination moreclosely (in the RFC destination maintenance for an R/3 connection, choose Destination -> ARFC options). This checks whetherthe target host has sufficient resources before the function module isexecuted. If the target host is overloaded, the system delays executingthe function module. The algorithm for calculating the load on thetarget host is the same one used in an asynchronous RFC call using the DESTINATION IN GROUP addition. Note that this option can only beused with target hosts running Release 3.1H or higher. Note also thatit is the default setting.
    In principle, parallelization makes sense whenever applicationservers have the necessary resources. In this case, the applicationservers must be configured with at least 3 dialog work processes.
    A program that is run in the background and uses RFC parallelizationrequires at least 1 dialog work process per application server becausedialog processes use parallel execution.
    If the instance profile parameter 'auth/rfc_authority_check'is set (to 1), the system automatically performs an RFC authorizationcheck. The authorization check refers to the relevant function groupfor the function module to be called. If no authorization is found, aruntime error occurs. You can check the authorization in advance withthe function module AUTHORITY_CHECK_RFC. If the communication takes place in the same system with thesame user context (same client and user ID), there is no authorizationcheck. For further information, refer to the RFCAuthorization Concept.
    When you are using asynchronous RFC to implement parallel windows,all these windows are closed if the caller session is the only sessionand terminates.
    ABAP_ADDITION_1&
    ... DESTINATION dest
    Effect
    Executes the function module externally as a RemoteFunction Call (RFC); dest can be a literal or a variable.The R/3 System where the function module is executed depends on thespecified destination. Externally callable function modules must beflagged as such in the Function Builder (of the target system).
    Note
    If the destination is not explicitly specified, the systemuses the default destination 'NONE'.
    Note
    If, during a RemoteFunction Call, an error occurs in the target system, detailsof the error message are passed bac to the calling system in thefollowing system fields: SY-MSGNO, SY-MSGID, SY-MSGTY, SY-MSGV1,SY-MSGV2, SY-MSGV3, and SY-MSGV4. These fields areinitialized before every RFC. If a short dump or a type X messageoccurs, the short text of the dump is transferred to the caller, andthe contents of SY-MSGID, SY-MSGTY, SY-MSGNO, and SY-MSGV1 assigned by the system.
    In RFC-enabled function modules, no ABAP statements are allowed thatwould end the RFC connection (for example, LEAVE, SUBMIT or the ANDRETURN addition).
    Note
    Note that a database commit occurs at eachRemote Function Call (RFC). Consequently, you may not use RemoteFunction Calls between pairs of statements that open and close adatabase cursor (such as SELECT ... ENDSELECT).
    Addition 2
    ... DESTINATION IN GROUP group name
    Addition 3
    ... DESTINATION IN GROUP DEFAULT
    Effect
    You use this addition to perform parallel execution offunction modules (asynchronous calls) on a predefined group of R/3System application servers.
    You use addition 2 (DESTINATION IN GROUP group name) toperform parallel execution of function modules on a predefined group ofapplication servers. To maintain the RFC groups, choose Tools ¨ Administration ¨ Administration ¨ Network ¨ RFCdestinations ¨ RFC ¨ RFC groups. The application programmer isresponsible for the availability of RFC groups in the productionsystem.
    You use addition 3 (DESTINATION IN GROUP DEFAULT) to performparallel execution of function modules (asynchronous calls) on all currently available R/3 System application servers. However,instead of this variant, you are recommended to use an RFC group withappropriate resources for parallel processing of asynchronous calls (atleast for performance reasons). Please note that the additionDESTINATION IN GROUP ' ' has the same effect as the additionDESTINATION IN GROUP DEFAULT.
    When you first call a function module with these additions, thesystem initializes the specified RFC group (provided no explicitinitialization has already been performed).
    To obtain current information about resources (that is, the number ofresources available to process function modules), you can alsoinitialize the RFC group explicitly in the program via the functionmodule SPBT_INITIALIZE. You must perform this actionbefore the first function module call.
    In both cases, the system first determines the number of currentlyavailable resources (work processes) on the available applicationservers (either a group of servers or all servers). By checking thecurrent system load of each application server, the system determineshow many work processes are available to execute asynchronous calls.
    After determining the available resources, the asynchronous call isexecuted at one of the destinations. If no resources are available atthat particular time, the system executes the exception routine RESOURCE_FAILURE (see the addition EXCEPTIONS). In thecase of an asynchronous function module call, this exception must be handled by the application program (see example).
    Parallel processing cannot take place if any of the resourcethresholds are exceeded.
    Notes
    In order to be taken into consideration for RFC parallelprocessing, an application server must have at least 3 freedialog processes.
    The system triggers the exception RESOURCE_FAILURE only forasynchronous RFCs with the additions DESTINATION IN GROUP groupname and DESTINATION IN GROUP DEFAULT.
    At present, only one RFC group per program environment issupported for parallel execution of asynchronous calls. Using both theadditions DESTINATION IN GROUP group name and DESTINATION INGROUP DEFAULT in a program is thus not allowed.
    To find out which destination was automatically selected, call thefunction module SPBT_GET_PP_DESTINATION immediately after thefunction module call with the two additions. This returns the selectedRFC destination.
    If you want to delete an application server from the list of theconfigured RFC group at runtime (for example, when the applicationserver is not accessible for technical reasons), use the functionmodule SPBT_DO_NOT_USE_SERVER.
    Addition 4
    ... PERFORMING form ON END OF TASK
    While the parameters for receiving results (i.e. IMPORTING andTABLES parameters) are specified directly as additions in thecase of "conventional" function modules (see variant 2), these arelogged in the FORM routine form when making anasynchronous call (see RECEIVE).
    Notes
    If a function module returns no result, and you are notinterested in error messages that arise when executing the functionmodule, this addition (... PERFORMING form ON END OF TASK) canbe omitted.
    If you want to handle the error messages that arise when executingthe asynchronous function module call, you must use thisaddition. Also, when receiving the results in the FORM routine(see RECEIVE), you must reactaccordingly to the system exceptions SYSTEM_FAILURE andCOMMUNICATION_FAILURE.
    With asynchronous RFC, the task name uniquely identifies theasynchronous connection and thus the context called.
    If several asynchronous function modules are executed consecutivelyto the same destination, you must assign a different task name to each.
    A calling program that starts an asynchronous RFC with PERFORMINGform ON END OF TASK cannot switch roll areas or change to aninternal session. This is because the asynchronous function module callreply cannot be passed on to the relevant program. You can perform aroll area switch with SUBMIT or CALL TRANSACTION.
    If a calling program makes asynchronous calls, finishes, and thenexpects responses, these responses cannot be delivered.
    To wait for the reply to a started asynchronous function module, usethe WAIT command with the additionPERFORMING form ON END OF TASK. Here, WAIT must be in thesame program context (session).
    Note that the execution of the asynchronous calls involves a changeof roll area. This means that the FORM routines for receivingthe external calls can be processed while you are making furtherexternal calls. This means that the developer must ensure thatthe FORM routines can be executed at any time. You cannotmake any assumptions about the processing sequence.
    Addition 5
    ... EXPORTING p1 = f1 ... pn = fn
    Effect
    EXPORTING passes values of fields and fieldstrings from the calling program to the function module. In thefunction module, the formal parameters are defined as importparameters.
    Addition 6
    ... TABLES p1 = itab1 ... pn = itabn
    Effect
    TABLES passes the contents of internal tables.
    Addition 7
    ... EXCEPTIONS syst_except = rc MESSAGE mess
    Effect
    While any exceptions arising in the called functionmodule are handled by the second addition (in the FORM routine),this addition can handle two special system exceptions, as withfunction module calls with the addition DESTINATION:
    SYSTEM_FAILURE
    is triggered, if a system crash occurs on the receiving side.
    COMMUNICATION_FAILURE
    is triggered if there is a connection or communication problem.
    In both cases, you can get a description of the error with theoptional addition
    ... MESSAGE msg
    Note
    In principle, you should always react to these twosystem exceptions, whether you are making an asynchronous functionmodule call or receiving results.
    Examples
    Asynchronous call to a transaction and display in a separate session.
    DATA: MSG_TEXT(80) TYPE C. "Message text
    Asynchronous call to Transaction SM59 -->
    Create a new session
    CALL FUNCTION 'ABAP4_CALL_TRANSACTION' STARTING NEW TASK 'TEST'
      DESTINATION 'NONE'
      EXPORTING
          TCODE = 'SM59'
      EXCEPTIONS
        COMMUNICATION_FAILURE = 1 MESSAGE MSG_TEXT
        SYSTEM_FAILURE        = 2 MESSAGE MSG_TEXT.
      IF SY-SUBRC NE 0.
        WRITE: MSG_TEXT.
      ELSE.
        WRITE: 'O.K.'.
      ENDIF.
    Using RFC groups to parallelize function module calls (RFC parallelprocessing)
    TYPES: BEGIN OF TASKLIST_TYPE,
           TASKNAME(4) TYPE C, "Task administration
           RFCDEST LIKE RFCSI-RFCDEST
           END OF TASKLIST_TYPE.
    DATA: INFO LIKE RFCSI, C,  "Message text
          JOBS TYPE I VALUE 10,  "Number of parallel jobs
          SND_JOBS TYPE I VALUE 1,  "Sent jobs
          RCV_JOBS TYPE I VALUE 1,  "Received replies
          EXCP_FLAG(1) TYPE C,  "Number of RESOURCE_FAILUREs
          TASKNAME(4) TYPE N VALUE '0001',  "Task name administration
          TASKLIST TYPE TABLE OF TASKLIST_TYPE,
          WA_TASKLIST TYPE TASKLIST_TYPE.
    DO.
      CALL FUNCTION 'RFC_SYSTEM_INFO'
           STARTING NEW TASK TASKNAME DESTINATION IN GROUP DEFAULT
           PERFORMING RETURN_INFO ON END OF TASK
           EXCEPTIONS
             COMMUNICATION_FAILURE = 1
             SYSTEM_FAILURE        = 2
             RESOURCE_FAILURE      = 3.
      CASE SY-SUBRC.
        WHEN 0.
    Administration of asynchronous tasks
          WA_TASKLIST-TASKNAME = TASKNAME.
          CLEAR WA_TASKLIST-RFCDEST.
          APPEND WA_TASKLIST TO TASKLIST.
          WRITE: /  'Started task: ', WA_TASKLIST-TASKNAME COLOR 2.
          TASKNAME = TASKNAME + 1.
          SND_JOBS = SND_JOBS + 1.
          JOBS     = JOBS - 1.  "Number of existing jobs
          IF JOBS = 0.
            EXIT.  "Job processing finished
          ENDIF.
        WHEN 1 OR 2.
    Handling of communication and system failure
        WHEN 3.  "No resources available at present
    Receive reply to asynchronous RFC calls
          IF EXCP_FLAG = SPACE.
             EXCP_FLAG = 'X'.
    First attempt for RESOURCE_FAILURE handling
             WAIT UNTIL RCV_JOBS >= SND_JOBS UP TO '0.01' SECONDS.
          ELSE.
    Second attempt for RESOURCE_FAILURE handling
             WAIT UNTIL RCV_JOBS >= SND_JOBS UP TO '0.1' SECONDS.
          ENDIF.
          IF SY-SUBRC = 0.
            CLEAR EXCP_FLAG.  "Reset flag
          ELSE.  "No replies
            "Endless loop handling
          ENDIF.
        ENDCASE.
    ENDDO.
    Receive remaining asynchronous replies
    WAIT UNTIL RCV_JOBS >= SND_JOBS.
    LOOP AT TASKLIST INTO WA_TASKLIST.
      WRITE:/   'Received task:', WA_TASKLIST-TASKNAME COLOR 1,
            30  'Destination: ', WA_TASKLIST-RFCDEST COLOR 1.
    ENDLOOP
    FORM RETURN_INFO USING TASKNAME.
      RECEIVE RESULTS FROM FUNCTION 'RFC_SYSTEM_INFO'
        IMPORTING RFCSI_EXPORT = INFO
        EXCEPTIONS
          COMMUNICATION_FAILURE = 1
          SYSTEM_FAILURE        = 2.
      RCV_JOBS = RCV_JOBS + 1.  "Receiving data
        IF SY-SUBRC NE 0.
    Handling of communication and system failure
        ELSE.
          READ TABLE TASKLIST WITH KEY TASKNAME = TASKNAME
                              INTO WA_TASKLIST
          IF SY-SUBRC = 0.  "Register data
            WA_TASKLIST-RFCDEST = INFO_RFCDEST.
            MODIFY TASKLIST INDEX SY-TABIX FROM WA_TASKLIST.
          ENDIF.
        ENDIF.
    ENDFORM
    Note
    If you encounter problems, refer toTypical RFC problems and theirsolutions.
    Note
    Runtime errors:
    Note
    Runtime errors:
    CALL_FUNCTION_NO_RECEIVER:
    Data received for an unknown CPI-C connection.
    CALL_FUNCTION_DEST_TYPE:
    Destination type not allowed.
    CALL_FUNCTION_NO_DEST:
    Specified destination does not exist.
    CALL_FUNCTION_NO_LB_DEST:
    Specified destination (in load distribution mode) does not exist.
    CALL_FUNCTION_TABINFO:
    Data error (info internal table) in a Remote Function Call.
    CALL_BACK_ENTRY_NOT_FOUND:
    The called function module is not released for use in RFC.
    CALL_FUNCTION_FIELD_NOT_FOUND:
    The function parameter that you passed is not recognized on therecipient side.
    RFC_NO_AUTHORITY:
    The user does not have RFC authorization.
    CALL_FUNCTION_SINGLE_LOGIN_REJ:
    No authorization to log on as a trusted system. The error codeshave the following meanings:
    0) Valid security key but wrong logon data 1) Calling system is not a trusted system, or security key is invalid 2) User either does not have RFC authorization (authorization object S_RFCACL), or logged on as one of the protected users 'DDIC' or 'SAP*' 3) Timestamp of the logon data is invalid
    CALL_FUNCTION_DESTINATION_NO_T:
    Missing communication type (I for internal connection, 3 for R/3) in anasynchronous RFC
    CALL_FUNCTION_NOT_REMOTE:
    The function module called is not flagged as "RFC supported"
    CALL_FUNCTION_REMOTE_ERROR:
    An error occurred during the Remote Function Call. This has been loggedin the target system.
    CALL_FUNCTION_SIGNON_INCOMPL:
    The logon data for the user is incomplete.
    CALL_FUNCTION_SIGNON_INTRUDER:
    You cannot log onto a target system using an internal call.
    CALL_FUNCTION_SIGNON_INVALID:
    External RFC without a valid user name.
    CALL_FUNCTION_SIGNON_REJECTED:
    Attempt to log onto a target system without a valid user name. Theerror code can have the following meanings:
    1) Wrong password or invalid user ID
    2) User locked
    3) Too many logon attempts
    4) Error in authorization buffer (internal error)
    5) No external user check
    6) Invalid user type
    7) Validity period of user has expired
    CALL_FUNCTION_SYSCALL_ONLY:
    RFC without a valid user name only allowed when calling system functionmodules. For the meaning of the error codes, refer toCALL_FUNCTION_SINGLE_LOGIN_REJ.
    CALL_FUNCTION_TABLE_NO_MEMORY:
    No memory available for a table to be imported
    CALL_FUNCTION_TASK_IN_USE:
    Asynchronous RFC only: Task name already in use.
    CALL_FUNCTION_TASK_YET_OPEN:
    Asynchronous RFC only: The specified task is already open.
    CALL_FUNCTION_SNC_ERROR:
    Error reading the SNC information for the destination.
    CALL_RPERF_SLOGIN_READ_ERROR:
    No valid trusted system entry for the calling system.
    CALL_RPERF_SLOGIN_AUTH_ERROR:
    No trusted authorization for the RFC caller and trusted system.
    +
    Regards,
    Rich Heilman

  • Parallel processing in background

    Hi All,
    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.
    Is there any other solutions using that i can reduce total processing time.
    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.
    Please note that all other performance tunings done.
    Thanks,
    Rajesh.

    Hi Rajesh,
    Refer sample code for <b>Parallel Processing</b>:
    By doing this your <b>processing</b> time will be highly optimized.
    Go thru the description given in the code at each level.
    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.
    Hope it helps.
    REPORT PARAJOB.
    Data declarations
    DATA: GROUP LIKE RZLLITAB-CLASSNAME VALUE ' ',
    "Parallel processing group.
    "SPACE = group default (all
    "servers)
    WP_AVAILABLE TYPE I, "Number of dialog work processes
    "available for parallel processing
    "(free work processes)
    WP_TOTAL TYPE I, "Total number of dialog work
    "processes in the group
    MSG(80) VALUE SPACE, "Container for error message in
    "case of remote RFC exception.
    INFO LIKE RFCSI, C, "Message text
    JOBS TYPE I VALUE 10, "Number of parallel jobs
    SND_JOBS TYPE I VALUE 1, "Work packets sent for processing
    RCV_JOBS TYPE I VALUE 1, "Work packet replies received
    EXCP_FLAG(1) TYPE C, "Number of RESOURCE_FAILUREs
    TASKNAME(4) TYPE N VALUE '0001', "Task name (name of
    "parallel processing work unit)
    BEGIN OF TASKLIST OCCURS 10, "Task administration
    TASKNAME(4) TYPE C,
    RFCDEST LIKE RFCSI-RFCDEST,
    RFCHOST LIKE RFCSI-RFCHOST,
    END OF TASKLIST.
    Optional call to SBPT_INITIALIZE to check the
    group in which parallel processing is to take place.
    Could be used to optimize sizing of work packets
    work / WP_AVAILABLE).
    CALL FUNCTION <b>'SPBT_INITIALIZE'</b>
    EXPORTING
    GROUP_NAME = GROUP
    "Name of group to check
    IMPORTING
    MAX_PBT_WPS = WP_TOTAL
    "Total number of dialog work
    "processes available in group
    "for parallel processing
    FREE_PBT_WPS = <b>WP_AVAILABLE</b>
    "Number of work processes
    "available in group for
    "parallel processing at this
    "moment
    EXCEPTIONS
    INVALID_GROUP_NAME = 1
    "Incorrect group name; RFC
    "group not defined. See
    "transaction RZ12
    INTERNAL_ERROR = 2
    "R/3 System error; see the
    "system log (transaction
    "SM21) for diagnostic info
    PBT_ENV_ALREADY_INITIALIZED = 3
    "Function module may be
    "called only once; is called
    "automatically by R/3 if you
    "do not call before starting
    "parallel processing
    CURRENTLY_NO_RESOURCES_AVAIL = 4
    "No dialog work processes
    "in the group are available;
    "they are busy or server load
    "is too high
    NO_PBT_RESOURCES_FOUND = 5
    "No servers in the group
    "met the criteria of >
    "two work processes
    "defined.
    CANT_INIT_DIFFERENT_PBT_GROUPS = 6
    "You have already initialized
    "one group and have now tried
    "initialize a different group.
    OTHERS = 7..
    CASE SY-SUBRC.
    WHEN 0.
    "Everything’s ok. Optionally set up for optimizing size of
    "work packets.
    WHEN 1.
    "Non-existent group name. Stop report.
    MESSAGE E836. "Group not defined.
    WHEN 2.
    "System error. Stop and check system log for error
    "analysis.
    WHEN 3.
    "Programming error. Stop and correct program.
    MESSAGE E833. "PBT environment was already initialized.
    WHEN 4.
    "No resources: this may be a temporary problem. You
    "may wish to pause briefly and repeat the call. Otherwise
    "check your RFC group administration: Group defined
    "in accordance with your requirements?
    MESSAGE E837. "All servers currently busy.
    WHEN 5.
    "Check your servers, network, operation modes.
    WHEN 6.
    Do parallel processing. Use CALL FUNCTION STARTING NEW TASK
    DESTINATION IN GROUP to call the function module that does the
    work. Make a call for each record that is to be processed, or
    divide the records into work packets. In each case, provide the
    set of records as an internal table in the CALL FUNCTION
    keyword (EXPORT, TABLES arguments).
    DO.
    CALL FUNCTION 'RFC_SYSTEM_INFO' "Function module to perform
    "in parallel
    STARTING NEW TASK TASKNAME "Name for identifying this
    "RFC call
    DESTINATION IN GROUP group "Name of group of servers to
    "use for parallel processing.
    "Enter group name exactly
    "as it appears in transaction
    "RZ12 (all caps). You may
    "use only one group name in a
    "particular ABAP program.
    PERFORMING RETURN_INFO ON END OF TASK
    "This form is called when the
    "RFC call completes. It can
    "collect IMPORT and TABLES
    "parameters from the called
    "function with RECEIVE.
    EXCEPTIONS
    COMMUNICATION_FAILURE = 1 MESSAGE msg
    "Destination server not
    "reached or communication
    "interrupted. MESSAGE msg
    "captures any message
    "returned with this
    "exception (E or A messages
    "from the called FM, for
    "example. After exception
    "1 or 2, instead of aborting
    "your program, you could use
    "SPBT_GET_PP_DESTINATION and
    "SPBT_DO_NOT_USE_SERVER to
    "exclude this server from
    "further parallel processing.
    "You could then re-try this
    "call using a different
    "server.
    SYSTEM_FAILURE = 2 MESSAGE msg
    "Program or other internal
    "R/3 error. MESSAGE msg
    "captures any message
    "returned with this
    "exception.
    RESOURCE_FAILURE = 3. "No work processes are
    "currently available. Your
    "program MUST handle this
    "exception.
    YOUR_EXCEPTIONS = X. "Add exceptions generated by
    "the called function module
    "here. Exceptions are
    "returned to you and you can
    "respond to them here.
    CASE SY-SUBRC.
    WHEN 0.
    "Administration of asynchronous RFC tasks
    "Save name of task...
    TASKLIST-TASKNAME = TASKNAME.
    "... and get server that is performing RFC call.
    CALL FUNCTION 'SPBT_GET_PP_DESTINATION'
    EXPORTING
    RFCDEST = TASKLIST-RFCDEST
    EXCEPTIONS
    OTHERS = 1.
    APPEND TASKLIST.
    WRITE: / 'Started task: ', TASKLIST-TASKNAME COLOR 2.
    TASKNAME = TASKNAME + 1.
    SND_JOBS = SND_JOBS + 1.
    "Mechanism for determining when to leave the loop. Here, a
    "simple counter of the number of parallel processing tasks.
    "In production use, you would end the loop when you have
    "finished dispatching the data that is to be processed.
    JOBS = JOBS - 1. "Number of existing jobs
    IF JOBS = 0.
    EXIT. "Job processing finished
    ENDIF.
    WHEN 1 OR 2.
    "Handle communication and system failure. Your program must
    "catch these exceptions and arrange for a recoverable
    "termination of the background processing job.
    "Recommendation: Log the data that has been processed when
    "an RFC task is started and when it returns, so that the
    "job can be restarted with unprocessed data.
    WRITE msg.
    "Remove server from further consideration for
    "parallel processing tasks in this program.
    "Get name of server just called...
    CALL FUNCTION 'SPBT_GET_PP_DESTINATION'
    EXPORTING
    RFCDEST = TASKLIST-RFCDEST
    EXCEPTIONS
    OTHERS = 1.
    "Then remove from list of available servers.
    CALL FUNCTION 'SPBT_DO_NOT_USE_SERVER'
    IMPORTING
    SERVERNAME = TASKLIST-RFCDEST
    EXCEPTIONS
    INVALID_SERVER_NAME = 1
    NO_MORE_RESOURCES_LEFT = 2
    "No servers left in group.
    PBT_ENV_NOT_INITIALIZED_YET = 3
    OTHERS = 4.
    WHEN 3.
    "No resources (dialog work processes) available at
    "present. You need to handle this exception, waiting
    "and repeating the CALL FUNCTION until processing
    "can continue or it is apparent that there is a
    "problem that prevents continuation.
    MESSAGE I837. "All servers currently busy.
    "Wait for replies to asynchronous RFC calls. Each
    "reply should make a dialog work process available again.
    IF EXCP_FLAG = SPACE.
    EXCP_FLAG = 'X'.
    "First attempt at RESOURCE_FAILURE handling. Wait
    "until all RFC calls have returned or up to 1 second.
    "Then repeat CALL FUNCTION.
    WAIT UNTIL RCV_JOBS >= SND_JOBS UP TO '1' SECONDS.
    ELSE.
    "Second attempt at RESOURCE_FAILURE handling
    WAIT UNTIL RCV_JOBS >= SND_JOBS UP TO '5' SECONDS.
    "SY-SUBRC 0 from WAIT shows that replies have returned.
    "The resource problem was therefore probably temporary
    "and due to the workload. A non-zero RC suggests that
    "no RFC calls have been completed, and there may be
    "problems.
    IF SY-SUBRC = 0.
    CLEAR EXCP_FLAG.
    ELSE. "No replies
    "Endless loop handling
    ENDIF.
    ENDIF.
    ENDCASE.
    ENDDO.
    Wait for end of job: replies from all RFC tasks.
    Receive remaining asynchronous replies
    WAIT UNTIL RCV_JOBS >= SND_JOBS.
    LOOP AT TASKLIST.
    WRITE:/ 'Received task:', TASKLIST-TASKNAME COLOR 1,
    30 'Destination: ', TASKLIST-RFCDEST COLOR 1.
    ENDLOOP.
    This routine is triggered when an RFC call completes and
    returns. The routine uses RECEIVE to collect IMPORT and TABLE
    data from the RFC function module.
    Note that the WRITE keyword is not supported in asynchronous
    RFC. If you need to generate a list, then your RFC function
    module should return the list data in an internal table. You
    can then collect this data and output the list at the conclusion
    of processing.
    FORM RETURN_INFO USING TASKNAME.
    DATA: INFO_RFCDEST LIKE TASKLIST-RFCDEST.
    RECEIVE RESULTS FROM FUNCTION 'RFC_SYSTEM_INFO'
    IMPORTING RFCSI_EXPORT = INFO
    EXCEPTIONS
    COMMUNICATION_FAILURE = 1
    SYSTEM_FAILURE = 2.
    RCV_JOBS = RCV_JOBS + 1. "Receiving data
    IF SY-SUBRC NE 0.
    Handle communication and system failure
    ELSE.
    READ TABLE TASKLIST WITH KEY TASKNAME = TASKNAME.
    IF SY-SUBRC = 0. "Register data
    TASKLIST-RFCHOST = INFO_RFCHOST.
    MODIFY TASKLIST INDEX SY-TABIX.
    ENDIF.
    ENDIF.
    ENDFORM
    Reward points if that helps.
    Manish
    Message was edited by:
            Manish Kumar

  • Doubt in call function

    Hi,
    Call Function 'FM' starting new task task-name
    Exporting
    What does this statement does.

    Hi
    chk this out
    CALL FUNCTION STARTING NEW TASK
    Variant 2
    CALL FUNCTION func ...STARTING NEW TASK task name.
    Extras:
    1. ... DESTINATION dest
    2. ... DESTINATION IN GROUP group name
    3. ... DESTINATION IN GROUP DEFAULT
    4. ... PERFORMING form ON END OF TASK
    5. ... EXPORTING  p1 = f1    ... pn = fn
    6. ... TABLES     p1 = itab1 ... pn = itabn
    7. ... EXCEPTIONS syst_except = rc MESSAGE mess
    Effect
    Starts the function module func asynchronously in a new session. In contrast to normal function module calls, the calling program resumes processing as soon as the function module is started in the target system. It does not wait until the function module has finished. Using CALL SCREEN, the called function module can, for example, display a screen and thus interact with the user. Note that taskname must be a valid string of at least 2 characters, preferably fewer than 8 characters. You cannot use either ' ' or SPACE as tasknames.
    Notes
    Note that under certain circumstances, an RFC may cause a database commit. For this reason, do not insert an RFC between two OpenSQL statements that open and close a database cursor (such as SELECT...ENDSELECT).
    This variant applies only from R/3 Release 3.0, so both the client system and the server system must have Release 3.0 at least.
    With this variant, the called function module must also be flagged in the Function Builder as externally callable, even if it is executed locally (without the addition Destination).
    There can be no function call to the destination 'BACK' in the called function module (for more information about the destination 'BACK', see CALL FUNCTION func DESTINATION dest).
    This variant does not allow you to execute external programs that you access from a TCP/IP-type detination asynchronously. (See the Transaction Tools -> Administration, Administration -> Network -> RFC destinations for maintaining destinations).
    Neither does this variant allow you to display images such as lists or screens in a separate window during RFC communication using a SAProuter.
    From Release 4.0 onwards, you can carry out a new, stricter system load check on RFC destinations. (In RFC destination maintenance of an R/3 connection, choose Destination -> ARFC-Optionen). Before the function module is executed, the system checks that the destination has sufficient resources available. If not, the system delays execution of the function module for a given period of time. The algorithm used to determine the system load on the target machine is the same as that used for an asynchronous RFC with the DESTINATION IN GROUP addition. Note that this option is only available for target systems from Release 3.1H onwards. This procedure is active as default.
    In principle, parallel processing makes sense whenever application servers have the necessary resources. In this case, the application servers must be configured with at least 3 dialog work processes.
    A program that is run in the background and uses RFC parallel processing requires at least 1 dialog work process per application server (because parallel processing takes place in a dialog work process).
    If the instance profile parameter 'auth/rfc_authority_check' is set to 1, the system automatically performs an RFC authorization check. The authorization check refers to the relevant function group for the function module to be called. If no authorization is found, a runtime error occurs. You can check the authorization in advance with the function module AUTHORITY_CHECK_RFC. If the RFC communication takes places in one system and in the same user context (that is, the same client and User ID) the system does not perform an RFC authority check. For more information, see: RFC Authorization Concept.
    When you are using asynchronous RFC to implement parallel windows, all these windows are closed if the caller session is the only session and terminates.
    Note that asynchronous tasks that have been started are not necessarily closed when the calling program ends.
    See also RFC Logons to the Target System (Remote Logon).
    Addition 1
    ... DESTINATION dest
    Effect
    Executes the function module externally as a Remote Function Call (RFC); dest can be a literal or a variable. The R/3 System where the function module is executed depends on the specified destination. Externally callable function modules must be flagged as such in the Function Builder (of the target system).
    Note
    If the destination is not explicitly specified, the system uses the default destination 'NONE'.
    Note
    If, during a Remote Function Call, an error occurs in the target system, details of the error message are passed back to the calling system in the following system fields: SY-MSGNO, SY-MSGID, SY-MSGTY, SY-MSGV1, SY-MSGV2, SY-MSGV3, and SY-MSGV4. These fields are initialized before every RFC. If a short dump or a type X message occurs, the short text of the dump is transferred to the caller, and the contents of SY-MSGID, SY-MSGTY, SY-MSGNO, and SY-MSGV1 assigned by the system.
    In RFC-enabled function modules, no ABAP statements are allowed that would end the RFC connection (for example, either LEAVE or SUBMIT without the AND RETURN addition).
    Note
    Note that a database commit occurs at each Remote Function Call (RFC). Consequently, you cannot use Remote Function Calls between pairs of statements that open and close a database cursor (such as SELECT ... ENDSELECT).
    Addition 2
    ... DESTINATION IN GROUP group name
    Addition 3
    ... DESTINATION IN GROUP DEFAULT
    Effect
    You use this addition to perform parallel execution of function modules (asynchronous calls) on a predefined group of R/3 System application servers.
    You use addition 2 (DESTINATION IN GROUP group name) to perform parallel execution of function modules on a predefined group of application servers. To maintain the RFC groups, choose Tools -> Administration -> Administration ->Network -> RFC destinations -> RFC -> RFC groups. The application programmer is responsible for the availability of RFC groups in the production system. In this case the group name variable must be of the type RZLLITAB-CLASSNAME
    You use addition 3 (DESTINATION IN GROUP DEFAULT) to perform parallel execution of function modules (asynchronous calls) on all currently available R/3 System application servers. However, instead of this variant, you are recommended to use an RFC group with appropriate resources for parallel processing of asynchronous calls (at least for performance reasons). Please note that the addition DESTINATION IN GROUP ' ' has the same effect as the addition DESTINATION IN GROUP DEFAULT.
    When you first call a function module with these additions, the system initializes the specified RFC group (unless the group has already been explicitly identified).
    To obtain current information about resources (that is, the resources available to process function modules), you can also initialize the RFC group explicitly in the program using the function module SPBT_INITIALIZE. You must perform this action before the first function module call.
    In both cases, the system first ascertains the currently available resources (work processes) on the available application servers (either a group of servers or all servers). By checking the current system load of each application server, the system determines how many work processes are available to execute asynchronous calls.
    After ascertaining the available resources, the asynchronous call is executed to one of the
    destinations. If no resources are available at that particular time, the system executes the
    exception routine RESOURCE_FAILURE (see the addition EXCEPTIONS). In the case of
    an asynchronous function module call, this exception must be handled by the application
    program (see example).
    No resources are made available by the system if resource availability limits are exceeded:
    Notes
    To be taken into consideration for RFC parallel processing, an application server must have at least 3 free dialog processes.
    The system triggers the exception RESOURCE_FAILURE only for asynchronous RFCs with the additions DESTINATION IN GROUP group name and DESTINATION IN GROUP DEFAULT.
    At present, only one RFC group per program environment is supported for parallel execution of asynchronous calls. Using both the additions DESTINATION IN GROUP group name and DESTINATION IN GROUP DEFAULT in a program is thus not allowed.
    To find out which destination was automatically selected, call the function module SPBT_GET_PP_DESTINATION immediately after the function module call with the two additions. This returns the selected RFC destination.
    If you want to delete an application server from the list of the configured RFC group at runtime (for example, when the application server is not accessible for technical reasons), use the function module SPBT_DO_NOT_USE_SERVER.
    Addition 4
    ... PERFORMING form ON END OF TASK
    While the parameters for receiving results (that is IMPORTING and TABLES parameters) are specified directly as additions in the case of "conventional" function modules (see variant 2), these are logged in the FORM routine form when making an asynchronous call (see RECEIVE).
    Notes
    If a function module returns no result, and you are not interested in error messages that arise when executing the function module, this addition (... PERFORMING form ON END OF TASK) can be omitted.
    If you want to handle the error messages that arise when executing the asynchronous function module call, you must use this addition. Also, when receiving the results in the FORM routine (see RECEIVE), you must react accordingly to the system exceptions SYSTEM_FAILURE and COMMUNICATION_FAILURE.
    With asynchronous RFC, the task name uniquely identifies the asynchronous connection and thus the context called.
    If several asynchronous function modules are executed consecutively to the same destination, you must assign a different task name to each.
    A calling program that starts an asynchronous RFC with the PERFORMING form ON END OF TASK addition cannot switch roll areas or change to an internal mode. This is because the asynchronous function module call reply cannot be passed on to the relevant program. You can perform a roll area switch with SUBMIT or CALL TRANSACTION.
    If a calling program makes asynchronous calls, finishes, and then expects responses, it cannot receive these responses.
    To wait for the reply to a started asynchronous function module, use the WAIT command with the addition PERFORMING form ON END OF TASK. Here, WAIT must be in the same program context (mode).
    Note that executing asynchronous calls is subject to a roll area change.That is, subroutines performed to receive asynchronous calls can take place while other asynchronous calls are being made. Thus as a developer you must ensure that subroutines can be executed at any time. You must not make assumptions about the implicit processing sequence.
    Addition 5
    ... EXPORTING p1 = f1 ... pn = fn
    Effect
    Passes values of fields and field strings from the calling program to the function module. In the function module, the formal parameters are defined as import parameters.
    Addition 6
    ... TABLES p1 = itab1 ... pn = itabn
    Effect
    Passes references to internal tables.
    Addition 7
    ... EXCEPTIONS syst_except = rc MESSAGE mess
    Effect
    While any exceptions arising in the called function module are handled by the second
    addition (see the FORM subroutine RETURN_INFO), this addition can handle two special
    system exceptions, (as with function module calls with the DESTINATION addition):
    SYSTEM_FAILURE
    is triggered, if a system crash occurs on the receiving side.
    COMMUNICATION_FAILURE
    is triggered if there is a connection or communication problem.
    In both cases, you can get a description of the error with the optional ... MESSAGE messaddition
    Note
    In principle, you should always react to these two system exceptions, whether you are making an asynchronous function module call or receiving results.
    Examples
    Calling a transaction in a seperate session.
    DATA: MSG_TEXT(80) TYPE C. "Message text
    Asynchronous call to Transaction SM59 -->
    Create a new session
    CALL FUNCTION 'ABAP4_CALL_TRANSACTION' STARTING NEW TASK 'TEST'
      DESTINATION 'NONE'
      EXPORTING
          TCODE = 'SM59'
      EXCEPTIONS
        COMMUNICATION_FAILURE = 1 MESSAGE MSG_TEXT
        SYSTEM_FAILURE        = 2 MESSAGE MSG_TEXT.
      IF SY-SUBRC NE 0.
        WRITE: MSG_TEXT.
      ELSE.
        WRITE: 'O.K.'.
      ENDIF.
    Using RFC groups to parallelize function module calls(RFC parallel processing)
    TYPES: BEGIN OF TASKLIST_TYPE,
             TASKNAME(4) TYPE C, "Verwaltung der Tasks
             RFCDEST     LIKE RFCSI-RFCDEST,
          END OF TASKLIST_TYPE.
    DATA: INFO LIKE RFCSI, C,  "Message text
          JOBS TYPE I VALUE 10,  "Number of parallel jobs
          SND_JOBS TYPE I VALUE 1,  "Sent jobs
          RCV_JOBS TYPE I VALUE 1,  "Received replies
          EXCP_FLAG(1) TYPE C,  "Number of RESOURCE_FAILUREs
          TASKNAME(4) TYPE N VALUE '0001',  "Task name administration
          TASKLIST TYPE TABLE OF TASKLIST_TYPE,
          WA_TASKLIST TYPE TASKLIST_TYPE.
    DO.
      CALL FUNCTION 'RFC_SYSTEM_INFO'
           STARTING NEW TASK TASKNAME DESTINATION IN GROUP DEFAULT
           PERFORMING RETURN_INFO ON END OF TASK
           EXCEPTIONS
             COMMUNICATION_FAILURE = 1
             SYSTEM_FAILURE        = 2
             RESOURCE_FAILURE      = 3.
      CASE SY-SUBRC.
        WHEN 0.
    Administration of asynchronous tasks
            WA_TASKLIST-TASKNAME = TASKNAME.
            CLEAR WA_TASKLIST-RFCDEST.
            APPEND WA_TASKLIST TO TASKLIST.
            WRITE: /  'Started Task: ', WA_TASKLIST-TASKNAME COLOR 2.
          TASKNAME = TASKNAME + 1.
          SND_JOBS = SND_JOBS + 1.
          JOBS     = JOBS - 1.  "Number of existing jobs
          IF JOBS = 0.
            EXIT.  "Job processing finished
          ENDIF.
        WHEN 1 OR 2.
    Handling of communication and system failure
        WHEN 3.  "No resources available at present
    Receive reply to asynchronous RFC calls
          IF EXCP_FLAG = SPACE.
             EXCP_FLAG = 'X'.
    First attempt for RESOURCE_FAILURE handling
             WAIT UNTIL RCV_JOBS >= SND_JOBS UP TO '0.01' SECONDS.
          ELSE.
    Second attempt for RESOURCE_FAILURE handling
             WAIT UNTIL RCV_JOBS >= SND_JOBS UP TO '0.1' SECONDS.
          ENDIF.
          IF SY-SUBRC = 0.
            CLEAR EXCP_FLAG.  "Reset flag
          ELSE.  "No replies
            "Endless loop handling
          ENDIF.
        ENDCASE.
    ENDDO.
    Receive remaining asynchronous replies
    WAIT UNTIL RCV_JOBS >= SND_JOBS.
    LOOP AT TASKLIST INTO WA_TASKLIST.
        WRITE:/   'Received Task:', WA_TASKLIST-TASKNAME COLOR 1,
              30  'Destination: ', WA_TASKLIST-RFCDEST COLOR 1.
    ENDLOOP.
    FORM RETURN_INFO USING TASKNAME.
      RECEIVE RESULTS FROM FUNCTION 'RFC_SYSTEM_INFO'
        IMPORTING RFCSI_EXPORT = INFO
        EXCEPTIONS
          COMMUNICATION_FAILURE = 1
          SYSTEM_FAILURE        = 2.
      RCV_JOBS = RCV_JOBS + 1.  "Receiving data
        IF SY-SUBRC NE 0.
    Handling communication and system failure
       ELSE.
         READ TABLE TASKLIST WITH KEY TASKNAME = TASKNAME
                    INTO WA_TASKLIST.
         IF SY-SUBRC = 0. "Daten registrieren
           WA_TASKLIST-RFCDEST = INFO-RFCDEST.
           MODIFY TASKLIST INDEX SY-TABIX FROM WA_TASKLIST.
         ENDIF.
       ENDIF.
    ENDFORM.
    plz reward if useful

  • Table in function

    Hi all,
    I would like to use the content of tables LQUA and LAGP and some other SAP tables in a own function.
    I don't want much data transfer on the system, but these tables are very big.
    How do I reach the data in the tables?
    Do I have to supply the records through the tables section of the function?
    And if so how do I do that with minimal data transfer?
    gteetings Fred

    hi
    see this sample
    REPORT PARAJOB.
    Data declarations
    DATA: GROUP LIKE RZLLITAB-CLASSNAME VALUE ' ',
    "Parallel processing group.
    "SPACE = group default (all
    "servers)
    WP_AVAILABLE TYPE I, "Number of dialog work processes
    "available for parallel processing
    "(free work processes)
    WP_TOTAL TYPE I, "Total number of dialog work
    "processes in the group
    MSG(80) VALUE SPACE, "Container for error message in
    "case of remote RFC exception.
    INFO LIKE RFCSI, C, "Message text
    JOBS TYPE I VALUE 10, "Number of parallel jobs
    SND_JOBS TYPE I VALUE 1, "Work packets sent for processing
    RCV_JOBS TYPE I VALUE 1, "Work packet replies received
    EXCP_FLAG(1) TYPE C, "Number of RESOURCE_FAILUREs
    TASKNAME(4) TYPE N VALUE '0001', "Task name (name of
    "parallel processing work unit)
    BEGIN OF TASKLIST OCCURS 10, "Task administration
    TASKNAME(4) TYPE C,
    RFCDEST LIKE RFCSI-RFCDEST,
    RFCHOST LIKE RFCSI-RFCHOST,
    END OF TASKLIST.
    Optional call to SBPT_INITIALIZE to check the
    group in which parallel processing is to take place.
    Could be used to optimize sizing of work packets
    work / WP_AVAILABLE).
    CALL FUNCTION 'SPBT_INITIALIZE'
    EXPORTING
    GROUP_NAME = GROUP
    "Name of group to check
    IMPORTING
    MAX_PBT_WPS = WP_TOTAL
    "Total number of dialog work
    "processes available in group
    "for parallel processing
    FREE_PBT_WPS = WP_AVAILABLE
    "Number of work processes
    "available in group for
    "parallel processing at this
    "moment
    EXCEPTIONS
    INVALID_GROUP_NAME = 1
    "Incorrect group name; RFC
    "group not defined. See
    "transaction RZ12
    INTERNAL_ERROR = 2
    "R/3 System error; see the
    "system log (transaction
    "SM21) for diagnostic info
    PBT_ENV_ALREADY_INITIALIZED = 3
    "Function module may be
    "called only once; is called
    "automatically by R/3 if you
    "do not call before starting
    "parallel processing
    CURRENTLY_NO_RESOURCES_AVAIL = 4
    "No dialog work processes
    "in the group are available;
    "they are busy or server load
    "is too high
    NO_PBT_RESOURCES_FOUND = 5
    "No servers in the group
    "met the criteria of >
    "two work processes
    "defined.
    CANT_INIT_DIFFERENT_PBT_GROUPS = 6
    "You have already initialized
    "one group and have now tried
    "initialize a different group.
    OTHERS = 7..
    CASE SY-SUBRC.
    WHEN 0.
    "Everything’s ok. Optionally set up for optimizing size of
    "work packets.
    WHEN 1.
    "Non-existent group name. Stop report.
    MESSAGE E836. "Group not defined.
    WHEN 2.
    "System error. Stop and check system log for error
    "analysis.
    WHEN 3.
    "Programming error. Stop and correct program.
    MESSAGE E833. "PBT environment was already initialized.
    WHEN 4.
    "No resources: this may be a temporary problem. You
    "may wish to pause briefly and repeat the call. Otherwise
    "check your RFC group administration: Group defined
    "in accordance with your requirements?
    MESSAGE E837. "All servers currently busy.
    WHEN 5.
    "Check your servers, network, operation modes.
    WHEN 6.
    Do parallel processing. Use CALL FUNCTION STARTING NEW TASK
    DESTINATION IN GROUP to call the function module that does the
    work. Make a call for each record that is to be processed, or
    divide the records into work packets. In each case, provide the
    set of records as an internal table in the CALL FUNCTION
    keyword (EXPORT, TABLES arguments).
    DO.
    CALL FUNCTION 'RFC_SYSTEM_INFO' "Function module to perform
    "in parallel
    STARTING NEW TASK TASKNAME "Name for identifying this
    "RFC call
    DESTINATION IN GROUP group "Name of group of servers to
    "use for parallel processing.
    "Enter group name exactly
    "as it appears in transaction
    "RZ12 (all caps). You may
    "use only one group name in a
    "particular ABAP program.
    PERFORMING RETURN_INFO ON END OF TASK
    "This form is called when the
    "RFC call completes. It can
    "collect IMPORT and TABLES
    "parameters from the called
    "function with RECEIVE.
    EXCEPTIONS
    COMMUNICATION_FAILURE = 1 MESSAGE msg
    "Destination server not
    "reached or communication
    "interrupted. MESSAGE msg
    "captures any message
    "returned with this
    "exception (E or A messages
    "from the called FM, for
    "example. After exception
    "1 or 2, instead of aborting
    "your program, you could use
    "SPBT_GET_PP_DESTINATION and
    "SPBT_DO_NOT_USE_SERVER to
    "exclude this server from
    "further parallel processing.
    "You could then re-try this
    "call using a different
    "server.
    SYSTEM_FAILURE = 2 MESSAGE msg
    "Program or other internal
    "R/3 error. MESSAGE msg
    "captures any message
    "returned with this
    "exception.
    RESOURCE_FAILURE = 3. "No work processes are
    "currently available. Your
    "program MUST handle this
    "exception.
    YOUR_EXCEPTIONS = X. "Add exceptions generated by
    "the called function module
    "here. Exceptions are
    "returned to you and you can
    "respond to them here.
    CASE SY-SUBRC.
    WHEN 0.
    "Administration of asynchronous RFC tasks
    "Save name of task...
    TASKLIST-TASKNAME = TASKNAME.
    "... and get server that is performing RFC call.
    CALL FUNCTION 'SPBT_GET_PP_DESTINATION'
    EXPORTING
    RFCDEST = TASKLIST-RFCDEST
    EXCEPTIONS
    OTHERS = 1.
    APPEND TASKLIST.
    WRITE: / 'Started task: ', TASKLIST-TASKNAME COLOR 2.
    TASKNAME = TASKNAME + 1.
    SND_JOBS = SND_JOBS + 1.
    "Mechanism for determining when to leave the loop. Here, a
    "simple counter of the number of parallel processing tasks.
    "In production use, you would end the loop when you have
    "finished dispatching the data that is to be processed.
    JOBS = JOBS - 1. "Number of existing jobs
    IF JOBS = 0.
    EXIT. "Job processing finished
    ENDIF.
    WHEN 1 OR 2.
    "Handle communication and system failure. Your program must
    "catch these exceptions and arrange for a recoverable
    "termination of the background processing job.
    "Recommendation: Log the data that has been processed when
    "an RFC task is started and when it returns, so that the
    "job can be restarted with unprocessed data.
    WRITE msg.
    "Remove server from further consideration for
    "parallel processing tasks in this program.
    "Get name of server just called...
    CALL FUNCTION 'SPBT_GET_PP_DESTINATION'
    EXPORTING
    RFCDEST = TASKLIST-RFCDEST
    EXCEPTIONS
    OTHERS = 1.
    "Then remove from list of available servers.
    CALL FUNCTION 'SPBT_DO_NOT_USE_SERVER'
    IMPORTING
    SERVERNAME = TASKLIST-RFCDEST
    EXCEPTIONS
    INVALID_SERVER_NAME = 1
    NO_MORE_RESOURCES_LEFT = 2
    "No servers left in group.
    PBT_ENV_NOT_INITIALIZED_YET = 3
    OTHERS = 4.
    WHEN 3.
    "No resources (dialog work processes) available at
    "present. You need to handle this exception, waiting
    "and repeating the CALL FUNCTION until processing
    "can continue or it is apparent that there is a
    "problem that prevents continuation.
    MESSAGE I837. "All servers currently busy.
    "Wait for replies to asynchronous RFC calls. Each
    "reply should make a dialog work process available again.
    IF EXCP_FLAG = SPACE.
    EXCP_FLAG = 'X'.
    "First attempt at RESOURCE_FAILURE handling. Wait
    "until all RFC calls have returned or up to 1 second.
    "Then repeat CALL FUNCTION.
    WAIT UNTIL RCV_JOBS >= SND_JOBS UP TO '1' SECONDS.
    ELSE.
    "Second attempt at RESOURCE_FAILURE handling
    WAIT UNTIL RCV_JOBS >= SND_JOBS UP TO '5' SECONDS.
    "SY-SUBRC 0 from WAIT shows that replies have returned.
    "The resource problem was therefore probably temporary
    "and due to the workload. A non-zero RC suggests that
    "no RFC calls have been completed, and there may be
    "problems.
    IF SY-SUBRC = 0.
    CLEAR EXCP_FLAG.
    ELSE. "No replies
    "Endless loop handling
    ENDIF.
    ENDIF.
    ENDCASE.
    ENDDO.
    Wait for end of job: replies from all RFC tasks.
    Receive remaining asynchronous replies
    WAIT UNTIL RCV_JOBS >= SND_JOBS.
    LOOP AT TASKLIST.
    WRITE:/ 'Received task:', TASKLIST-TASKNAME COLOR 1,
    30 'Destination: ', TASKLIST-RFCDEST COLOR 1.
    ENDLOOP.
    This routine is triggered when an RFC call completes and
    returns. The routine uses RECEIVE to collect IMPORT and TABLE
    data from the RFC function module.
    Note that the WRITE keyword is not supported in asynchronous
    RFC. If you need to generate a list, then your RFC function
    module should return the list data in an internal table. You
    can then collect this data and output the list at the conclusion
    of processing.
    FORM RETURN_INFO USING TASKNAME.
    DATA: INFO_RFCDEST LIKE TASKLIST-RFCDEST.
    RECEIVE RESULTS FROM FUNCTION 'RFC_SYSTEM_INFO'
    IMPORTING RFCSI_EXPORT = INFO
    EXCEPTIONS
    COMMUNICATION_FAILURE = 1
    SYSTEM_FAILURE = 2.
    RCV_JOBS = RCV_JOBS + 1. "Receiving data
    IF SY-SUBRC NE 0.
    Handle communication and system failure
    ELSE.
    READ TABLE TASKLIST WITH KEY TASKNAME = TASKNAME.
    IF SY-SUBRC = 0. "Register data
    TASKLIST-RFCHOST = INFO_RFCHOST.
    MODIFY TASKLIST INDEX SY-TABIX.
    ENDIF.
    ENDIF.
    ENDFORM
    regards
    Arun

  • Internal error occured when processing parallel RFC

    Dear Experts,
    I have created one FM and calling that FM as prallel process in a report program.
    CALL FUNCTION 'ZHR_TIME_EVAL_PARALLEL_PROCESS'
          STARTING NEW TASK first_task
          DESTINATION IN GROUP srv_grp
          EXPORTING
            p_job     = sub_job
          TABLES
            rspar_tab = rspar_tab.
    In development system its working fine. In quality it throwing a dump saying "Internal error occured when processing parallel RFC" . Error mesage number - BT 857.
    Any body came across this problem.Please help me to resolve.
    Thanks in advance

    Hi chen,
    I have executed the function modules.Its throwing the floowing exceptions.
    SPBT_INITIALIZE     is throwing the exception INVALID_GROUP_NAME  Message number  BT  - 831.
    Function modules SPBT_GET_CURR_RESOURCE_INFO , SPBT_FIND_FREE_SERVER, SPBT_GET_CURR_RESOURCE_INFO are throwing the exception PBT_ENV_NOT_INITIALIZED_YET  message number BT - 838 .
    How to resolve this problem.
    Thanks in advance.

  • CRM_ORDER_MAINTAIN Performance Tuning

    I am working on a development , which does the following
    closes all Activities in teh system ( of a vcertain process type )
    creates 1 activity eack for all accounts present in the system
    also map the marketing attributes per account
    create a survey with the responses as the corresponsdng marketing attribute and attach the survey to the account
    Now there are 16000 accounts in the system
    and i have used CRM_ORDER_MAINTAIN thrice
    Once while closing the Activities
    Once while creating new activities without a survey ( based on certain conditions)
    and once while creating activities with surveys
    I am facing prformance issues, the code is taking 40000 odd hours to complete in a batch job
    I have performed SE30 /SAT , sm50 ..the major time s consumed by CRM_ORDER_MAINTAIN.Could you kindly suggest a way out to improve the performance .
    I pasting the portion of the code here :
    call function 'CRM_ORDER_MAINTAIN'
          exporting
            it_activity_h     = lt_activity_h
            it_appointment    = lt_appointment
            it_partner        = lt_partner
            it_status         = lt_status
          changing
            ct_orderadm_h     = lt_orderadm_h
            ct_input_fields   = ct_input_fields2
          exceptions
            error_occurred    = 1
            document_locked   = 2
            no_change_allowed = 3
            no_authority      = 4
            others            = 5.
        if sy-subrc eq 0.
    *          *   build save table
          loop at lt_orderadm_h into ls_orderadm_h.
            ls_objects_to_save = ls_orderadm_h-guid.
            append ls_objects_to_save to lt_objects_to_save.
            clear:ls_orderadm_h, ls_objects_to_save.
          endloop.
        endif.
        if lt_objects_to_save[] is not initial.
          call function 'CRM_ORDER_SAVE'
            exporting
              it_objects_to_save   = lt_objects_to_save
              iv_update_task_local = 'X'
              iv_save_frame_log    = 'X'
            importing
              et_saved_objects     = lt_saved_objects
    *         et_exception         = lt_exception
    *         et_objects_not_saved = lt_objects_not_saved
            exceptions
              document_not_saved   = 1
              others               = 2.
          if sy-subrc eq 0.
            clear: lt_return2.
            call function 'BAPI_TRANSACTION_COMMIT'            "#EC FB_NORC
            exporting
                wait =  'X'
             importing
                  return = lt_return2.
            call function 'CRM_ORDER_INITIALIZE'
              exporting
                it_guids_to_init  = lt_objects_to_save
                iv_initialize_whole_buffer = 'X'
                iv_init_frame_log = 'X' ""true
                iv_keep_lock      = ' '  "false
              exceptions
                error_occurred    = 1
                others            = 2.
          endif.

    Hi Luis/Gurus,
    Thanks , Actually I tried Parallel Prrocessing , again thrice ,
    Activity Change :16000 account
    Activity Create :16000 account
    Inbetween
    when I do   SPBT_INITIALIZE , to get the no of servers available, at times it shows 0.
    I do a loop wait  5 seconds and again  SPBT_INITIALIZE , but its still 0 and the system runs.
    However this process happens alternately .
    Run 1 works excellent .
    Run 2 ...hangs ..even if i run it 10 mins later
    Run 3 ..works excellent..
    Im a bit zapped with this..
    Please help.

Maybe you are looking for