RFC  IN  BACKGROUND TASK

Hai all,
I created RFC 'ZBAPI_BACKPROCES' .
And Im using this RFC in my ABAP program.
BUT I having to call this FUNCTION MODULE in background Task .But I dont know how its working and also this FM does not returning any values.
Can anyone Say  example with explaination (how its working).
Thanks In Advance.
regards,
Ekadevi.S

Here's a good explanation of the RFC types:
[Master the five remote function call (RFC) types in ABAP|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f078394a-4469-2910-c4bf-853c75674694]
Tim

Similar Messages

  • RFC in background task LUW

    Hello,
    I've two RFC in user-exit. Both, using IN BACKGROUND TASK DESTINATION XI
    When i execute the transaction, the user-exit is raising and i can see the follow error in SM58:
    maximum size of requests for one LUW has been reached(1).
    I've changing in the CC the parameter Maximum Conecction, however the error continue.
    If i comment the second call function in the user-exit, the first call function is executed OK, the interface is right,
    ¿how can i do to execute two functions in the same LUW?
    thanks

    Hi,
    >>¿how can i do to execute two functions in the same LUW?
    you cannot - you need to do "commit work." after each RFC call
    Regards,
    Michal Krawczyk

  • RFC in background process.

    Hi All,
    I hve to process a RFC in background process.
    For doing that firstlly i hve creted va rfc n it's wkg fine then using this syntax i called this rfc for background task
    CALL FUNCTION 'Y_DYNTABLE1_AJ' IN BACKGROUND TASK
    DESTINATION 'rfc_bacground'
    buy whenever any error raise this rfc created a error log in sm58 n i can watch it in sm58 but whenever it's work fine then i'm unble to see there result in sp01, beco'z  it's nt creating any spool in sp01 n my result is in table form.
    pls help me how to get my result
    regards,
    Anuj

    With this option you can EXPORT the whole internal table to INDX table and you can IMPORT the table for later usage.
    Please refer to demo programs DEMO_DATA_EXT_CLUSTER_EXPORT_D and DEMO_DATA_EXT_CLUSTER_DELETE.
    Make sure that you delete the the cluster after you import the data.

  • Calling RFC FM in update task / background task

    hi experts,
    I have a RFC FM in system B and i want to call it from system A. if the system B is down when the call happens then the call is lost. basically i want the call happen when the system B is up. somewhere i have read that when u call the RFC FM in update task/ background task , SAP will try to make the call to system B at periodic intervals of time till the system B is up. is that so? what is the difference between calling the RFC in update task and background task?
    thanks

    no replies

  • Calling RFC enabled FM IN BACKGROUND TASK

    Hi Frnds,
    I have a requirement where in I need to call a FM which executes 'VA02' BDC in some user exit.
    Since this has to be executed after the commit work is executed in the calling program i am using the background mode.
    something like below,
      CALL FUNCTION 'Z_SD_AVAILABILITY_CHECK_BDC'
        IN BACKGROUND TASK
        DESTINATION 'NONE'
        TABLES
          t_vbap = xvbap.
    This above FM is RFC enabled.
    And this FM is also called successfully and VA02 is executed without any error. But the FM's session does not get killed after its executed completly. Instead it creates another session of the same FM and executes the BDC again. This is goion on and on and multiple sessions are created at the end.
    Am I missing something here? Do I have to include the Performing RETURN_INFO ON END OF TASK  also?
    Please give ur suggestions.
    regards,
    Karthick C

    Hi,
    Check the SM58 to see how many calls are there. It might be that the function is called multiple times every time the user exit is triggered. So put a break point in the user exit and check that the function is actually only called once per transaction.
    As the SAP help says that the calls are stored in the tables ARFCSSTATE and ARFCSDATA, it might be worth checking the entries of this table for the function calls before the transaction commit work is executed. See [here|http://help.sap.com/saphelp_nw04/helpdata/en/8e/d05f3ce4dd3370e10000000a114084/frameset.htm]
    regards,
    Advait
    Edited by: Advait Gode on Jun 22, 2009 11:19 PM

  • Table parameter of RFC FM in background task

    hi
    I have a RFC FM in system A which has two table parameters, first table parameter table1 will have the data and the second table parameter table2 will be filled with in the FM with the error and success messages. Now i am calling this RFC FM in a program in system B in background task. I am passing the values to the first table paramter table1. after the call i am using commit work. now my question is can i read the values in the second table parameter table2?
    report
    call function 'ABC' destination dest in background task
    tables
    table1 = itab1
    table2  = itab2
    commit work
    will the values be populated in itab2.?
    thanks

    Hi,
    yes u can surely read the values of the second table ,
    what ever parameters you pass to the FM whether it is an RFC enabled or simple FM they can be accessed by the report in which you r calling it.
    Call Function <FM>.
    Tables
       table1 = itab1
       table2 = itab2
    loop at itab1 into wa.
    write: wa-field1.               " Read the values of table1
    endloop.
    loop at itab2 into wa1.
    write: wa1_field1.            " Read the values of table2
    endloop.
    thanks
    ravi

  • Calling RFC FM in update or background task

    hi experts,
    I have a RFC FM in system B and i want to call it from system A. if the system B is down when the call happens then the call is lost. basically i want the call happen when the system B is up. somewhere i have read that when u call the RFC FM in update task/ background task , SAP will try to make the call  to system B at periodic intervals of time till the system B is up. is that so? what is the difference between calling the RFC in update task and background task?
    thanks

    Hi,
    the transactional RFC (tRFC) implements true asynchronous communication.
    Remote system need not be available at the time of the RFC Client tRFC execution.
    If the call is sent while remote system is unavailable, the call remains in the local holding queue and the calling program can continue to run without waiting the response of the execution.
    If the RFC server is not activated until a certain period, the call is scheduled as a background job
    For the transactional call to a remote function module we use the statement:
    CALL FUNCTION <func> IN BACKGROUND TASK <task> (DESTINATION dest) u2026
    The update task that you mentioned is something different than the RFC technique and in the case of the function module, the function must have the 'Update Module' parameters marked.
    For more info about this topic please check the link:
    [http://help.sap.com/saphelp_nw04/Helpdata/EN/41/7af4daa79e11d1950f0000e82de14a/frameset.htm]
    [http://help.sap.com/saphelp_nw04/Helpdata/EN/41/7af4daa79e11d1950f0000e82de14a/frameset.htm]
    Kind regards.
    Andrea

  • Function module not working when used with 'In Background Task'

    hi,
    this is my code
    call function 'Z_IBD_FILL_ZINETACT'
                  in background task
                  destination  'SAPD220125'
                  tables
                      it_net1 = it_net1
                      it_net2 = it_net2
                      it_net3 = it_net3  .
    when this code is executed i am not getting any data in my internal tables i.e it_net1, it_net2, and it_net3
    but i changed this code see the below code
          call function 'Z_IBD_FILL_ZINETACT'
                 in background task (THIS IS COMMENTED)
                  destination  'SAPD220125'
                  tables
                      it_net1 = it_net1
                      it_net2 = it_net2
                      it_net3 = it_net3  .
    now i am getting data into my internal tables
    can any one tell me what can be the problem and how to solve it in my case
    its very urgent

    Hi,
    Pls. go through the  docu..
    CALL FUNCTION
    Variant 5
    CALL FUNCTION func IN BACKGROUND TASK.
    Additions:
    1. ... AS SEPARATE UNIT
    2. ... DESTINATION dest
    3. ... EXPORTING  p1 = f1    ... pn = fn
    4. ... TABLES     p1 = itab1 ... pn = itabn
    Effect
    Flags the function module func to be run asynchronously. It is not executed at once, but the data passed with EXPORTING or TABLES is placed in a database table and the next COMMIT WORK executes it in another work process.
    Note
    This variant applies only as of Release 3.0, so both the client system and the server system must be Release 3.0 or higher.
    Note
    qRFC with Outbound Queue
    This is an extension of tRFC. The tRFC is serialized using queues, ensuring that the sequence of LUWs required by the application is observed when the calls are sent.
    For further information about qRFC, refer to the Serialized RFC: qRFC With Outbound Queue section of the SAP Library.
    Addition 1
    ... AS SEPARATE UNIT
    Effect
    Executes the function module in a separate LUW under a new transaction ID.
    Addition 2
    ... DESTINATION dest
    Effect
    Executes the function module externally as a Remote Function Call (RFC); dest can be a literal or a variable.
    Depending on the specified destination, the function module is executed either in another R/3 System or as a C-implemented function module. Externally callable function modules must be flagged as such in the Function Builder (of the target system).
    Since each destination defines its own program context, further calls to the same or different function modules with the same destination can access the local memory (global data) of these function modules.
    Note
    Note that a database commit occurs at each Remote Function Call (RFC). Consequently, you may not use Remote Function Calls between pairs of statements that open and close a database cursor (such as SELECT ... ENDSELECT).
    Addition 3
    ... EXPORTING p1 = f1 ... pn = fn
    Effect
    EXPORTING passes values of fields and field strings from the calling program to the function module. In the function module, formal parameters are defined as import parameters. Default values must be assigned to all import parameters of the function module in the interface definition.
    Addition 4
    ... TABLES p1 = itab1 ... pn = itabn
    Effect
    TABLES passes references to internal tables. All table parameters of the function module must contain values.
    Notes
    If several function module calls with the same destination are specified before COMMIT WORK, these normally form an LUW in the target system. Calls with the addition 1 are an exception to this rule - they each have their own LUW.
    You cannot specify type 2 destinations (R/3 - R/2 connections).
    (See Technical details and Administration transaction.)
    Example
    REPORT  RS41503F.
    /* This program performs a transactional RFC.
    TABLES: SCUSTOM.
    SELECT-OPTIONS: CUSTID FOR SCUSTOM-ID DEFAULT 1 TO 2.
    PARAMETERS: DEST LIKE RFCDES-RFCDEST DEFAULT 'NONE',
                MODE DEFAULT 'N',
                TIME LIKE SY-UZEIT DEFAULT SY-UZEIT.
    DATA: CUSTITAB TYPE TABLE OF CUST415,
          TAMESS   TYPE TABLE OF T100,
          WA_CUSTITAB TYPE CUST415.
    SELECT ID NAME TELEPHONE INTO CORRESPONDING FIELDS OF TABLE CUSTITAB
                   FROM SCUSTOM WHERE ID IN CUSTID ORDER BY ID.
    PERFORM READ_CUSTITAB.
    EDITOR-CALL FOR CUSTITAB TITLE 'Editor for table CUSTITAB'.
    PERFORM READ_CUSTITAB.
    CALL FUNCTION 'TRAIN415_RFC_CALLTRANSACTION'
         IN BACKGROUND TASK
         DESTINATION DEST
         EXPORTING
              TAMODE    = MODE
         TABLES
              CUSTTAB   = CUSTITAB.
    CALL FUNCTION 'START_OF_BACKGROUNDTASK'
         EXPORTING
              STARTDATE = SY-DATUM
              STARTTIME = TIME
         EXCEPTIONS
              OTHERS    = 1.
    IF SY-SUBRC = 1.
      EXIT.
    ENDIF.
    COMMIT WORK.
    CALL TRANSACTION 'SM58'.
          FORM READ_CUSTITAB                                   *
    FORM READ_CUSTITAB.
      WRITE: / 'System ID:', SY-SYSID.
      SKIP.
      LOOP AT CUSTITAB into WA_CUSTITAB
        WRITE: / WA_CUSTITAB-ID, WA_CUSTITAB-NAME,
                 WA_CUSTITAB-TELEPHONE.
      ENDLOOP.
      ULINE.
    ENDFORM.
    Pls. reward if useful....

  • Creation of spool for job created by calling FM in background task

    Hi Gurus,
    1.Wanted to confirm if it is possible to attach spool to the job that has been created by calling a function module in background task.
    Currently I have created one RFC enabled FM and called it in background task. It runs fine, and the job is created which can be seen in SM37. But it does not contain the spool even if the RFC FM contains the code for list ALV.
    2. Also is it possible to control the name of the job created by calling the RFC FM in background task?
    Code for calling the FM is given below(ZK_XX is th RFC FM):
    CALL FUNCTION 'ZK_XX' IN BACKGROUND TASK
    CALL FUNCTION 'START_OF_BACKGROUNDTASK'
    EXPORTING
       startdate       = sy-datum
       starttime       = sy-uzeit
      NOSEND          = ' '
    COMMIT WORK.
    Thanks a lot for your help!!
    Warm Regards,
    Raveesh

    Thanks for replying.
    I need to do the processing in background. Hence using 'IN BACKGROUND TASK' addition.
    Please let me knowif you have some idea.
    Thanks & Warm Regards,
    Raveesh

  • IN BACKGROUND TASK as a different user ID

    Hi experts,
    I am performing a FM IN BACKGROUND TASK call in a BADI to automate creation of GR.
    Example:
    Step 1. User ABC performs GR for plant 0001.
    Step 2. BADI checks and automates another GR for plant 0002.
    The problem is user ABC only has authorization for plant 0001.
    During step 2, the BAPI returns an error saying that there is no authorization for plant 0002 as the BADI is triggered by user ABC.
    I am using FM BAPI_GOODSMVT_CREATE. I tried to pass in an ID with SAP_ALL to the PR_UNAME field to indicate this ID as the creator of the GR, but the authorization check still exists.
    Is there anyway I can force this background task to be executed by another ID instead of the triggering ID?
    Thanks in advance.

    Make sure to discuss this with the security team...
    The RFC destination you specify in your [call function - in background task|http://help.sap.com/abapdocu_70/en/ABAPCALL_FUNCTION_BACKGROUND_TASK.htm] can be used to specify a different user. Check for example the logical workflow destinations in transaction SM59...
    Cheers, harald

  • Rfc in background

    Hi all,
    i hve to call a rfc in background for this firstlly i call my rfc in background process
    CALL FUNCTION 'Y_DYNTABLE1_AJ' IN BACKGROUND task
    DESTINATION 'rfc_destination_aj' " AS SEPARATE UNITthen
    CALL FUNCTION 'ID_OF_BACKGROUNDTASK'  for determined transaction ID
    then
    CALL FUNCTION 'START_OF_BACKGROUNDTASK'  for scheduling background task time
    then
    CALL FUNCTION 'STATUS_OF_BACKGROUNDTASK'  for known background task status
    every thing is wkg fine n task is showing  scheduled n finished in sm37 but i 'm  not getting their data nor sp01 nor anyone n it also show duration 0 n dealy 0 in sm37 also nothing in sm58 and also without background rfc is wkg fine.
    suggest me how to get data
    regards,
    Anuj

    Thanx sourav,
    all the parameters in fm is passed by exporting n tables parameters n declarations is also on top.
    regards,
    Anuj

  • Call function IN BACKGROUND TASK don't work

    Hello,
    I've a interface RFC to JDBC asyncronous.
    When i call function in R3 (IN BACKGROUND TASK), sy-subrc = 0, however i don't see any message in SXMB_MONI and runtime workbench.
    The CC sender (for RFC) is OK,
    what happen?
    thanks very much

    Have this code after your call function:
    CALL FUNCTION 'START_OF_BACKGROUNDTASK'
         EXPORTING
              STARTDATE = SY-DATUM
              STARTTIME = TIME
         EXCEPTIONS
              OTHERS    = 1.
    IF SY-SUBRC = 1.
      EXIT.
    ENDIF.
    COMMIT WORK.
    Also, if you want to call your RFC function module in async mode, you can try
    Call function '<fm name>' in update task....
    Regards,
    Ravi Kanth Talagana

  • Calling RFC In background

    Hi All,
    I have a situation here.I need to call an rfc from  another SAP system.And I need to wait for that RFC to get completed before I process with my caller program.
    The problem here is that Function module is slow and it goes into timeout error in the source system since it starts the process in dialog process
    So I was wondering if I can run this RFC in background in the source system through my caller program and wait till the RFC gets executed completly befor my caller program proceeds.
    I tried using "In background Task " addition but it stil runs the function module in dialog process and also the wait command doesn't work.
    Can anybody help me.
    Thanks
    Umang

    Hi Umang,
    As far as I know, If the DESTINATION is not available for the processing then only it starts the processing in Background mode.
    Nut IN BACKGROUND TASK doesn't mean that it will process the FM in background.
    Reward points if useful.
    Regards,
    Atish

  • Facing issue with tRFC (CALL FUNCTION in BACKGROUND TASK DESTINATION

    In transcation CJ20N there is aBADI call ZCL_IM_CL_IM_PROJ_UPDATE in which there is a method
    IF_EX_PROJECTDEF_UPDATE~AT_SAVE.  My requirement is that when the status of the project is changed and saved then after the SAVE some actions are to be performed (BDC for transcation CJ30 & CJ9FS are to be called).
    Since this method is called AT SAVE and i need to call the bdc after the comit (of SAVE) is done. So I have made a RFC FM in which I am calling the bdc. and then calling the FM as
    CALL FUNCTION <FM> in BACKGROUND TASK DESTINATION <sy-sysid>.
    For the txn. CJ9FS bdc this method is working fine and bdc is called after SAVE but for txn. CJ30, at times,the bdc  is not working though if I run the BDC FM seperately using SE37 then its working fine.
    Can any body guide me where I am going wrong.

    The scenario works fine for me. The issue was unable to create a proper test condition in the RFC.
    CALL FUNCTION 'ZMY_RFCASYNC'
       IN BACKGROUND TASK
       EXPORTING...
       TABLES...
       EXCEPTIONS...
    Simulated error condition in 'ZMY_RFCASYNC'
    and got entry in SM58 by simply making an exception. 
    Thank you all.

  • CALL FUNCTION IN BACKGROUND TASK - enable tRFC

    Hi Experts,
    I want to call a Remote Function module 'IN bACKGROUND TASK' and get the status in SM58 within the same AS. Kindly help me to do this.
    Requirement is to call the remote function module asynchronously in a guarentied way.
    Thank you
    Nikhil

    The scenario works fine for me. The issue was unable to create a proper test condition in the RFC.
    CALL FUNCTION 'ZMY_RFCASYNC'
       IN BACKGROUND TASK
       EXPORTING...
       TABLES...
       EXCEPTIONS...
    Simulated error condition in 'ZMY_RFCASYNC'
    and got entry in SM58 by simply making an exception. 
    Thank you all.

Maybe you are looking for

  • Time Machine/Time Capsule backups successful, but take a long time

    I purchased a 512GB Time Capsule about a year ago. Since I got it, backups have been successful, but very slow. An average backup takes about 40-50 minutes, usually for less than 20 MB transferred. Here are a couple summaries of recent backups (see e

  • Why is Photoshop CS4 crashing under ...

    ... such seemingly unrelated conditions?: When I try to convert an RGB image with layers to CMYK or grayscale When I try to delete an adjustment layer or layer w/a vector mask by clicking on the layer palette trashcan (drag/drop, delete key and fly-o

  • Iphoto pics emailed too small

    Pictures emailed from my Mac on Iphoto 08 are too small even though I sent them 'actual size.'  Sent as 5.7MB, received as 151KB.

  • PMS color changes to CMYK when file is closed and reopened

    I got a .psb-document with a adjustmentlayer>solid color as a background. The color is a Pantone 354-C. When I save my document (CMYK), and then reopen it, I no longer get the Pantone color library but the default color picker box. I see no visible c

  • Loading popup: pt1:p1 during a full-page request is not supported.

    Hi., am using jdeveloper 11.1.1.6 Am trying to do a logout function in my jspx page by following this link http://tompeez.wordpress.com/2010/07/26/logout-with-confirmation-dialog/ While am pressing the logout link am getting the exception as Loading