Qs about call FM in background task, and monitoring in SM37.

Hi, guys, i got a question here, if I call a FM using addition "in background task" in a Z program, does this mean the FM process is running in background? And can I monitor my task in sm37?
i've tried to do that, the FM was successfully proceeded, but I cannot see anything related to that task in SM37 under mine user ID.

No, you cannot see that in SM37.
What it means is that the function is being executed in a seprated thread and the program that called the function will continue the execution without waiting for the function finish execution, that means the function is called in a synchronous manner.
Regards,
Ravi
Note : Please mark all the helpful answers

Similar Messages

  • 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

  • Save Order - Call function in background Task

    Hi all,
    I have written a function module which is called in order save Badi and copies the system status on the Master contract to the sub contracts.
    This works fine but when I call this function in background task the status is not getting copied over.For testing I have created a program similar to function module and scheduled that in background and this was working as required.
    Can someone please let me know if I missed out anything or how can i resolve this issue.
    Any inputs in this regard would be very helpful.
    Thanks and regards,
    Vijay

    Hi Heinz,
    You can check the result in SM58 transaction.
    For more information pls. refer this thread :
    No IMPORTING parameters allowed in CALL FUNCTION IN BACKGROUND TASK
    Best regards,
    Prashant

  • 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.

  • Call function in background task... How to get the result?

    I want to use Call function in background task parameter.
    But I cannot find the result of this function. (No export parameter, no table result, no exception)
    How to get the result of this function module? Correct or not?

    Hi Heinz,
    You can check the result in SM58 transaction.
    For more information pls. refer this thread :
    No IMPORTING parameters allowed in CALL FUNCTION IN BACKGROUND TASK
    Best regards,
    Prashant

  • Difference between calling a function module in background task and update

    Hi experts,
    Can someone explain me the basic difference between calling a FM in  background and update tasks?
    Also what is the advantage of using backgroud RFCs over the above 2.
    Thanks in advance,
    reddy

    This is essentially a difference of synchronization with the main program calling this FM.
    For Update task, we specify explicitely that we want to update some rows in a database table. But Update task is essentially for waiting that all tasks to do before are done and updating database at the end. The main point is that MF called in Update task wait for a COMMIT WORK to be executed.
    On the other hand FM in background task are executed immediatly and are not specific to updating database table : it can be a function that would return some values or something else like that.
    If you want to see more about difference between background jobs / update jobs, you can also have a look at transaction SM51. Here you will see all the servers composing your SAP instance and what kind of task they can execute :
    - background jobs corresponds to BATCH
    - update tasks corresponds to UPDATE
    Those 2 kinds of tasks stands not necessarily on the same server...
    Best regards,
    Samuel

  • 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

  • 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.

  • Best practices for realtime communication between background tasks and main app

    I am developing (in fact, porting to WinRT Universal App) an application connecting to Bluetooth medical devices. In order to support background connectivity, it seems best is to use background tasks triggered by a device connection. However, some of these
    devices provide a stream of data which has to be passed to the main app in real time when it is active - i.e. to show an ECG on the screen. So my task ideally should receive and store data all the time (both background and foreground) and additionally make
    main app receive it live when it is in foreground.
    My question is: how do I make background task pass real-time data to the app when it is active? Documentation talks about using storage, but it does not seem optimal for realtime messaging.. Looking for best practices and advice. Platform is Windows 8.1
    and Windows Phone 8.1.

    Hi Michael,
    Windows phone app has resource quotas, to prevent it from interfering with real-time communication functionality, background task using the ControlChannelTrigger and PushNotificationTrigger receive guaranteed resource quotas for every running task. You can
    find more information from
    https://msdn.microsoft.com/en-us/library/windows/apps/xaml/Hh977056(v=win.10).aspx. See Background task resource guarantees for real-time communication section. ControlChannelTrigger is not supported on windows phone, so you can have a look at PushNotificationTrigger
    class.
    https://msdn.microsoft.com/en-us/library/windows/apps/xaml/windows.applicationmodel.background.pushnotificationtrigger.aspx.
    Regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. Click HERE to participate
    the survey.

  • Call Function in Background Task

    Hi all,
    I have written a method in which I call a function in background task, I would like to perform a task after the function has ended succesfully. this is possible with the addition PERFORMING 'next_task' ON END OF TASK.
    This is sadly not possible in a global class.
    How can I get info back on the state of the function in the background?
    greetings Fred.

    Hi,
       try using export import statement in FM
       call function ...
        flay = 'Y'.
        export flag to memory id 'TESt'
       endfunction
        import flag from memory id 'TEST'.
        if flag = 'Y'.
          perform next_task.
          endif.
    Regards
    amole

  • Function called IN BACKGROUND TASK goes to work process DIA, not BGD

    I'm calling a function IN BACKGROUND TASK
    In SM50, I see it running in a DIA work process.
    I want it to run in a BGD work process.
    Can this be done?  If so, how?  If not, why not?

    Hi...
    It looks like, it will always run in DIA process and not Background process...I am not sure that we can change the work process
    Check the below link..
    http://help.sap.com/saphelp_40b/helpdata/pt/69/c24f864ba111d189750000e8322d00/content.htm
    What is written in the link is...
    "Background updates (CALL FUNCTION IN BACKGROUND TASK) represent a variant of remote function call that is synchronous with the end of a transaction (COMMIT WORK). In background updating, an update is run in another dialog work process that may be in the same or in another application server and R/3 System. Because such updates run in their own LUWs, they may start only after all critical updates have been completed. Otherwise, it would not be possible to roll back background changes in the event of an error in another update component. "
    IF you get the answer of whether we can change the work process then please let us know...

  • Call FM remotely in Background task

    Hello,
    I need some help regarding calling function modules through RFC call in background task in 4.6C.
    We are calling some standard FMs in our Z program to perform some actions in a remotely called system and based on the return value from the RFC call we are deciding further processing steps in our program. The Z program takes lot of execution time (due to huge data) and hence is executed in background and when the RFC call is made to the standard FM, the FM also is taking long execution time. Because of the long execution time in the remote system (which also is 4.6C SAP system), a TIME_OUT dump is occuring and due to this  the original job (Zprogram) also gets cancelled.
    As a solution we are trying to implement the RFC call as a background task, so that both the zprogram and the RFC call happen in background and get executed successfully.
    But, while calling the RFC FM in background it is not allowing us to fetch any return values (which is in accordance with the standard SAP behaviour). For us to proceed further in our program we need the return value and hence want an idea to approach this issue.
    Please suggest any means to solve this problem.
    Many thanks,
    Chaithanya.

    Hi Ganesh,
    Thanks for the reply.
    We already have an alternate solution to adjust the design of the Z program but we want to try out any possible solutions from SAP standard (any flag to be set or any settings to be done) instead of changing the design of our Z program.
    We would be really glad to have such a solution as the design change would take a lot of effort and is similar to developing a new program.
    Regards,
    Chaithanya.

  • How to capture errors when a Function module is called as BACKGROUND TASK

    How to capture errors when a Function module is called as BACKGROUND TASK?.Please advise.
    FUNCTION ZRPM_DELETE_PROJECT_DATA_API.
    ""Local interface:
    *"  IMPORTING
    *"     VALUE(IV_EXTERNAL_ID) TYPE  RPM_TV_EXTID OPTIONAL
    *"     VALUE(IV_PROJECT_GUID) TYPE  RPM_TV_GUID OPTIONAL
    *"     VALUE(FLAG) TYPE  BOOLEAN OPTIONAL
    *"  EXPORTING
    *"     VALUE(EV_RC) TYPE  I
    *"     VALUE(EV_MSG) TYPE  STRING
    *"     VALUE(ET_MSG) TYPE  RPM_TT_MESSAGES
      IF flag = cl_rpm_co=>sc_true.
        Call function 'RPM_DELETE_PROJECT_DATA' IN BACKGROUND TASK
          EXPORTING
            IV_EXTERNAL_ID  = IV_EXTERNAL_ID
            IV_PROJECT_GUID = IV_PROJECT_GUID
          IMPORTING
            EV_RC           = EV_RC
            EV_MSG          = EV_RC
            ET_MSG          = ET_MSG.
        COMMIT WORK.
      ELSE.
        CALL FUNCTION 'RPM_DELETE_PROJECT_DATA'
          EXPORTING
            IV_EXTERNAL_ID  = IV_EXTERNAL_ID
            IV_PROJECT_GUID = IV_PROJECT_GUID
          IMPORTING
            EV_RC           = EV_RC
            EV_MSG          = EV_MSG
            ET_MSG          = ET_MSG.
      ENDIF.
    ENDFUNCTION.
    In above code how to capture 'EV_RC' when FM is called as background task.

    Prakash,
    CALL FUNCTION IN BACKGROUND TASK allows no IMPORTING parameters, so that your code will produce a syntax error.
    The calling program can only handle errors of remote function calls (RFC) if these are either
    - synchronous RFC  (that is CALL FUNCTION ... DESTINATION ...) or
    - asynchronous RFC (that is CALL FUNCTION STARTING NEW TASK ... DESTINATION ...).
    Both synchronous and asynchronous RFC allow the capturing of errors by means of exceptions. But that is a different topic.

  • COMMUNICATION_FAILURE in CALL FUNCTION STARTING NEW TASK/Background task

    Hi friends,
    I am trying to use a FM in a Print Program (when user prints a document), using
    CALL FUNCTION STARTING NEW TASK 'TASK' DESTINATION 'NONE'.
    The program is triggered from VL02N tcode.
    But it's giving an exception - COMMUNICATION_FAILURE. Message is Error when opening an RFC connection
    I also tried
    CALL FUNCTION IN BACKGROUND TASK as Separate Unit
    then error message pops up - Database error when recording transactional RFC
    We are attaching a PDF file of the print to content server within this function module and because the "attaching" takes a while, this part needs to be detached from the print program so that we can avoid performance issue.
    I can't figure out the issue. i gues this is happening because print program is already running in Update task. I also tried with RFC enabled FM. Please help me resolve/understand the issue.
    Appreciate your help.
    Regards,
    Ronjan.

    Hi Ronjan,
    COMMUNICATION_FAILURE. Message is Error when opening an RFC connection
    I guess the reason for the above is that every RFC call synchronous/Asynchronous issues a DB COMMIT and we cannot have DB COMMITs in the V1/V2 updates, please go through the link below.
    http://help.sap.com/saphelp_nw70ehp2/helpdata/en/23/e9aa61638e404d81575e939b5cd847/frameset.htm
    Now, the possible solutions i can think of are,
    1) Call the FM in update task delayed start and try.
    2) Or create a report program and use SUBMIT (look at the job options as well).
    @Mainak
    3. Write a statement COMMIT WORK AND WAIT. This will actually invoke the FM
    Mainak, this will lead to a Update termination, as the program is running in an update task.
    Regards,
    Chen

  • Calling function modules in background task

    Hi All,
    I am creating a notification in the background and linking it to an order. This I am doing inside a function module which is called in background task as a separate unit. I should change the user status of this newly created notification. This I am doing in another FM called as a separate unit. Now my requirement is that, I need to perform the status change only after the new notification is committed to the database. I would like to know if i can provide some time lag between the 2 FM execution. Can anyone tell me how much time will be consumed to commit the data to the database tables irrespective of the length of the data. Say for example, if i have hundreds of notifications within the object list tab of an order, I want to know what is the maximum time it will take to commit this to the database table so that I can put a wait conditionat the stat of the second FM call.
    Thanks

    Ok thanks. But let me tell you 1 thing, actually I am calling these 2 FMs within an enhancement section just before another FM CO_ZV_ORDER_POST which is actually doing a commit work. So is it OK if I call the 1st FM in background task and the second FM in update task in the same place as I am calling the FMs now(i.e., before CO_ZV_ORDER_POST)?

Maybe you are looking for

  • I am trying to install a program on my Mac and the Automator is interfering....can it be overridden or disabled?

    I purchased a program from a trusted website and was able to download it....however when I try to install it I get an "Apple Run Script Error"....the support team for the web site thinks it is Automator....so not sure how to get around this....anyone

  • Keynote can't export. Can't stop and start playback

    I have 45 slides. I have added audio (aiff and wav files) to 14 of them. 1. Regardless of which method, they won't export. I get a message that there is not enough room (which isn't so) or "something is wrong with the files. I think something's wring

  • Different content iTunes Stores

    hi, it is very ridiculous, i just buy apple product (iphone), but why there are different content between itunes in each country..?? then I must doing syncronize music from my CD/MP3 collection just because I can't buy such items in iTunes US or any

  • Two secondary indexes in a where clause

    Hi All, Can any one of you let me know wether DB optimizer will use two indexes if given in where clause........ example : primary index A,B.   secondary C,D,E. select ................ where A in ....                               B in ....          

  • Financial Reporting Studio client doesn't start in Windows 7 64-bit

    I have installed version (11.1.2.756) on my Windows 7 64 bit machine. When I try to start the application it will not start. I am getting the following message. Runtime Error 429 ActiveX component can not create object. Thanks