What is the use of CALL FUNCTION MODULE - AT BACKGROUND TASK?

Hi experts,
I found Call functional module in background task will make the FM run at the next commit work as some people said. So I have some questions:
1 if we use COMMIT WORK commend, the pending FM will be called? If there are several FMs called at background task, what is the sequence of them? How many conditions will trigger the running of these FMs?
2 Where can I find the log of this pending FMs? In SAP library, it says there are 2 tables. But I checked these tables and can only find the FM name and user of it. And I can not understand content of these tables. It seems one is for the main information of FM, and the other is for the data of the FM, maybe the parameters.
3 If I call a FM in this way, Can I canncel it before the next commit work in some way?
Finally, thanks for reading and help.

HI,
When the COMMIT WORK statement is executed, the function modules registered for the current SAP-LUW are started in the order in which they were registered. ROLLBACK WORK deletes all previous registrations for the current SAP-LUW.
If the specified destination is not available when COMMIT WORK is executed, an executable program called RSARFCSE is started in background processing. By default, this tries to start the function modules registered for a SAP-LUW in their destination every 15 minutes and up to 30 times. These parameters can be changed in the transaction SM59. If the destination does not become available within the defined time, it is recorded in the database table ARFCSDATA as the entry "CPICERR". The entry in the database table ARFCSSTATE is deleted after a standard period of eight days

Similar Messages

  • Calling function module in background task

    Hello,
    There is one function module which is called in background task. Is there any chance that background task is not created and function module is not executed. That function module is supposed to send some outbound message. The FM is called in one user exit. I don't have any idea as why it is called as background task. The probem is that this message is not getting send sometimes.(sometimes it gets send ). Because of this I am not able to make any conclusion.
    Please respond if anyone has come across such scenario before.
    Thanks in advance,
    Minal

    Check the below link...it might be helpfull
    It should be executed....check it with different data as to what might fail
    http://help.sap.com/saphelp_nw04/helpdata/EN/8f/53b67ad30be445b0ccc968d69bc6ff/content.htm
    http://help.sap.com/abapdocu/en/ABAPCALL_FUNCTION_BACKGROUND_TASK.htm

  • 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)?

  • What are  the input parameters for Function Module

    Dear Experts,
    I want to generate a Sales Tax returns report,those fields are not available in my existing Datasources.
    For that i want to write a Generic Datasource with Function Module.
    audat
    bukrs
    vkorg
    vtweg
    spart
    aurat
    auart
    netwr
    mwsbp
    kschl zedp(consition type)
    kschl zvat(condition type)
    ksch   zcst(condition type)
    matkl     material group
    Here what are the Input parameters for Function Module.
    Thanks in Advance.
    Srinivasan.

    Srinivasan-
    For creating a Generic extractor based on a FM, you first of all need to know what is going to be your structure.. i.e. what all fields you need to pull from what all tables. A functional consultant may help you identify the exact DB tables.
    Once you know them, hand over the requirement and the pdf mentioned by Krishna to the ABAP guy, he would be able to take this up further.
    Also decide 1st whether you would be using a full load or delta. There is a slight difference in the way they are built.
    Let me know how it goes.
    -Bhushan.

  • Calling Function Module in Update Task

    Hello Experts,
                              Can anyone let me know about
    Calling Function Module in Update Task.
    Why do we use this " In Update Task "  ??
    How do we Use ??
    What is the Use... ??
    Kindly let me know....
    Thanks and Regards
    Pramod

    hi,
    Why do we use this " In Update Task " ??
    The main update technique for bundling database changes in a single database LUW is to use CALL FUNCTION... IN UPDATE TASK.
    How do we Use ??
    A typical R/3 installation contains dialog work processes and at least one update work process. The update work processes are responsible for updating the database. When an ABAP program reaches a COMMIT WORK statement, any function modules from CALL FUNCTION... IN UPDATE TASK statements are released for processing in an update work process. The dialog process does not wait for the update to finish. This kind of update is called asynchronous update.
    What is the Use... ??
    Asynchronous update is useful when response time from the transaction is critical, and the database updates themselves are so complex that they justify the extra system load
    Real time scenario.
    Suppose a user wants to change an entry in a database table, or add a new one. He or she enters the necessary data, and then starts the update process by choosing Save. This starts the following procedure in the ABAP program:
    Firstly, the program locks the database entry against other users, using the enqueue work process (or the message server in the case of a distributed system). This generates an entry in the lock table. The user is informed whether the update was successful, or whether the lock could not be set because of other users.
    If the lock is set, the program reads the entry that is to be changed and modifies it. If the user has created a new entry, the program checks whether a record with the same key values already exists.
    In the current dialog work process, the program calls a function module using CALL FUNCTION... IN UPDATE TASK, and this writes the change details as an entry in table VBLOG.
    When the program is finished (maybe after further dialog steps), a COMMIT WORK statement starts the final part of the SAP LUW. The work process that is processing the current dialog step starts an update work process.
    Based on the information passed to it from the dialog work process, the update work process reads the log entries belonging to the SAP LUW from table VBLOG.
    The update work process passes this data to the database for updating, and analyzes the return message from the database. If the update was successful, the update work process triggers a database commit after the last database change and deletes the log entries from table VBLOG.
    If an error occurred, the update work process triggers a database rollback, leaves the log entries in table VBLOG, flags them as containing errors, and sends a SAPoffice message to the user, who should then inform the system administrator.
    The corresponding entries in the lock table are reset by the update work process.
    Hope this is helpful, Do reward.

  • Call function module in backgrouns task and in update task

    Hi Gurus,Pls crear me on the " <b>Call function module in backgrouns task and in update task</b>".
    how it works and waht is the link with LUW  releated to these .
    also heard that commit work statement aslo linked with this.
    Pls clarfiy me with expalnation of code.

    Hi sridhar,
    the explanation already given is correct and good. Small add-on:
    All functions called during one LUW with addition IN UPDATE TASK are stored together with their actual parameters in a temporary memory area. The moment a COMMIT WORK is issued, the functions are released to be executed by a so-called update task which is running in the background. This explains why functions called in update task never return anything, no SY-SUBRC and no export or table parameters If a function called in update task raises an exception or runs into an error the calling user will get an express message informing about this. Also, all database updates done by this update process are rolled back to keep consistency.
    This proceeding helps to keep database tables consistent and allows the user to keep on doing his work before all database updates are complete. You may have seen messages like "material will be changed" after saving. If you open the same material immediately, you'll get a message "object locked by...<yourself>". This means the update task is still running.
    Regards,
    Clemens

  • Lock inheritance with "CALL FUNCTION func IN BACKGROUND TASK"

    I see that the "SAP Lock concept" documentation states that for locks obtained with _scope = '3', all UPDATE tasks (spawned via "CALL FUNCTION func IN UPDATE TASK" inherit the lock (which is released only once all such update tasks and the calling process have requested a DEQUEUE).
    What should happen when instead, I use "CALL FUNCTION func IN BACKGROUND TASK" (for doing the update in a queue)? Are the locks inherited here as well?
    Cheers!

    Hopefully not, as a background task may be executed late. While update tasks are to be executed quickly (if not, administrators should review the system configuration, like increasing the number of UPD workprocesses).
    Solution: In the background task, redo the locks, as if it was a background job.

  • Error in debugging tRFC Function module (in background task) in SM58

    Hi,
    I am trying to debug this statement:
    CALL FUNCTION 'CRM_UPLOAD_TRIGGER'                 
      IN BACKGROUND TASK                               
      DESTINATION gv_smof_erpsh-rfcdest AS SEPARATE UNIT
    I have followed these steps:
    When you debug a program that calls function modules using the IN BACKGROUND TASK addition, they are processed in a background work process (additional internal session). If you set the In background task: Do not process option, the system collects the function calls, but does not start the background work process. The Debugger assigns a transaction ID, which identifies the background work process uniquely. You can now start the Debugger for the background work process using transaction SM58. You can select the function module concerned here, and then execute it via the Edit menu.
    but still i cant find any entry in SM58.
    Can anybody help me out in this?
    Thanks a lot.
    Best Regards,
    Shweta

    HI,
    When the COMMIT WORK statement is executed, the function modules registered for the current SAP-LUW are started in the order in which they were registered. ROLLBACK WORK deletes all previous registrations for the current SAP-LUW.
    If the specified destination is not available when COMMIT WORK is executed, an executable program called RSARFCSE is started in background processing. By default, this tries to start the function modules registered for a SAP-LUW in their destination every 15 minutes and up to 30 times. These parameters can be changed in the transaction SM59. If the destination does not become available within the defined time, it is recorded in the database table ARFCSDATA as the entry "CPICERR". The entry in the database table ARFCSSTATE is deleted after a standard period of eight days

  • Function module in background task

    Hi,
    I have a user-exit, that must modify a value. But this value  have a lock entry (it's my own transaction that set this lock-entry). So I would like to call a function in background task to modify the value when the lock entry disapear.
    But ...
    I don't see anything append in the SM50.
    If I call the function not in background, I could debug the function.
    When I set background debugging nothing append.
    I have set the RFC option in the function module.
    CALL FUNCTION 'ZCALL_MB26_CONFIRMATION_OT'
      IN BACKGROUND TASK AS SEPARATE UNIT DESTINATION 'NONE'
    Rgd
    Frédéric

    Hello Fred,
    This is a sample code to wait for unlock (but if a user is in modification it can be endless).
      data : w_garg like  seqg3-garg.
      data : t_enq like seqg3 occurs 0.
      concatenate sy-mandt tplnr into w_garg.
      do.
        refresh t_enq.
        call function 'ENQUEUE_READ'
         exporting
           gclient                     = sy-mandt
           gname                       = 'IFLOT'
           garg                        = w_garg
      GUNAME                      = SY-UNAME
      LOCAL                       = ' '
    IMPORTING
      NUMBER                      =
      SUBRC                       =
          tables
            enq                         = t_enq
    EXCEPTIONS
      COMMUNICATION_FAILURE       = 1
      SYSTEM_FAILURE              = 2
      OTHERS                      = 3
        if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        endif.
        if t_enq[] is initial.
          exit.
        endif.
      enddo.
    David

  • Call function module in update task

    Hi
    I am using the follwoing logic in my prog
    CALL FUNCTION 'Z_Update _Task'    In update task
      EXPORTING
        t_vbak        =  t_vbak.
    But the program goes to dump at call function
    Please let me know if the syntax i am using is correct.
    Edited by: kittu reddy on Feb 28, 2008 5:29 AM

    It might be the type conflict . Please check once .
    Here am giving some information abt UPDATE TASK.
    Why do we use this " In Update Task " ??
    The main update technique for bundling database changes in a single  
    database LUW is to use CALL FUNCTION... IN UPDATE TASK.
    How do we Use ??
    A typical R/3 installation contains dialog work processes and at least one update work process. The update work processes are responsible for updating the database. When an ABAP program reaches a COMMIT WORK statement, any function modules from CALL FUNCTION... IN UPDATE TASK statements are released for processing in an update work process. The dialog process does not wait for the update to finish. This kind of update is called asynchronous update.
    What is the Use... ??
    Asynchronous update is useful when response time from the transaction is critical, and the database updates themselves are so complex that they justify the extra system load
    Thanks
    Jagadeesh

  • ABAP Dump when calling Function Module Starting New Task

    Hi all. I have a tricky situation now, I am doing a POC on parallel processing.
    I am getting an ABAP dump on the following Call Function line which is in class lcl_steer_114numc (See below for full program):
    METHOD start.
        CALL FUNCTION 'Z_ZZCLS_STEER_114NUMC'
          STARTING NEW TASK me->id
          CALLING me->finish ON END OF TASK.
      ENDMETHOD.                    "start
    However I get the following ABAP dump:
    Short text
        Statement "CALL FUNCTION .. DESTINATION/STARTING NEW TASK/IN BACKGROUND TASK"
    The function module only contains a wait statement to simulate parallel processing. It is strange that it dumps here, because when I change the FM call to another call that has been triggered successfully from other classes, it still produces the same ABAP dump.
    The background of the Proof Of Concept is to see if I can get an event to trigger the next process that depends on the outcome of the previous process. Parallel processes are run in the start methods by calling RFC.
    <Garbled code removed>
    Moderator Message: Please post relevant portions of the code only.
    Edited by: Suhas Saha on Jul 17, 2011 1:17 PM

    Well, the thing is I did manage to run 3 other Function Modules asynchronously succeesfully prior to that function call, with the same exact function call syntax. Further more, I have tried editing it with your suggestion but I get the exact same dump.
    The complete function group can be downloaded here (slinkee file):
    https://docs.google.com/leaf?id=0B3sua1Bw4XK4ZmFhNzcwMTgtYzQ0Mi00NzQ4LTg5YTMtNDNlNWUxYTM2NTg3&hl=en_US
    The complete program can be downloaded here (slinkee file):
    https://docs.google.com/leaf?id=0B3sua1Bw4XK4YWJmNjU3ODYtODRmMy00Nzg2LThkNTUtZjNkNDRhZGQ3MTUw&hl=en_US
    The complete ST22 dump can be found here:
    https://docs.google.com/leaf?id=0B3sua1Bw4XK4ZDU1YmFkZDAtOTU5MS00ZTgwLWFlZTktNWZhMDUxMzJlZWNl&hl=en_US
    Basically I ST22 gives me the following:
    Runtime Errors         RPERF_ILLEGAL_STATEMENT
    Date and Time          17.07.2011 05:29:54
    |Short text                                                                                |
    |    Statement "CALL FUNCTION .. DESTINATION/STARTING NEW TASK/IN BACKGROUND TASK"                 |
    |What happened?                                                                                |
    |    Error in the ABAP Application Program                                                         |
    |                                                                                |
    |    The current ABAP program "Z_ZZB1_CLOSE_PERIOD_TEST2" had to be terminated                     |
    |     because it has                                                                               |
    |    come across a statement that unfortunately cannot be executed.                                |
    And it explains it here (but is not helpful / relevant at all) as I ran the program from SE38.
    |Error analysis                                                                                |
    |    There is probably an error in the program                                                     |
    |    "Z_ZZB1_CLOSE_PERIOD_TEST2".                                                                  |
    |    The program was probably called in a conversion exit                                          |
    |    or in a field exit. These are implemented by                                                  |
    |    function modules called CONVERSION_EXIT_xxxxx_INPUT/OUTPUT or                                 |
    |    USER_EXIT_xxxxx_INPUT.                                                                        |
    |    Conversion exits are triggered during screen field transports or                              |
    |    WRITE statements, field exits during field transports from the                                |
    |    screen to the ABAP/4 program.                                                                 |
    |    In this connection, the following ABAP/4 statements are not allowed:                          |
    |                                                                                |
    I hope you try to download the slinkee files and you will notice the call function I performed was no different than the other call function RFC calls that really are working.

  • Call function module in new task

    I need to call a function module starting new task but the problem is that it has inporting parameters also. Please help me in doing this. Points will be rewarded.

    Look at the ABAP keywords RECEIVE RESULTS FROM FUNCTION.  This is where you can get the results from the CALL FUNCTION MODULE... NEW TASK...
    It's all in the ABAP help for CALL FUNCTION MODULE.
    matt

  • What is the syntax for calling function from class file by jsp

    does anyone here knows what is the syntax of how to call a function from java class file by javascript code or any way to call it?
    and where should i put the calling function code? because the function is called depend on the user click.
    for example
    <%=pc.functionName(a,b)%>
    for the variable a and b, how can i get the value from html textbox and put it in a and b...
    urgent needed...
    thx

    Jsp's are executed before the Html forms are created and loaded. Dont try to use a java code function calling on a javascript click. You'll have to explicitly redirect it into a servlet where in you can call the function you want.
    Well! another way could be using AJAX. That seems to be powerfull enough and it might also serve your purpose.
    Hope this helps

  • What is the Use of Partner Functions in VM?

    Hi,
    Can someone tell what is the exact use of the Partner Functions (VN, OA, IP,GS etc) maintained in the Partner Function view of Vendor Master? Where exactly are these used?
    PO, GR, Inv, Vend Payment all can be done without maintaining the Partner Functions in VM then why do we need these to be maintained?
    What will happen if we enter different Vendor #'s for differet Partner Functions in VM e.g. 1001, 1002, 1003, 1004 against for VN, OA, IP, GS?
    Thanks.

    if you are doing business with global players, then your vendor is e.g. located in Belgium, but you might order at a sales office in your country, so this sales office need to be created as vendor and you assign this vendor as OA order adress to the venor master of your Belgium vendor.
    The material is then send from a plant in Great Britain, thus this will become the GS partner, that is needed for trade reporting in European Union.
    The invoice is send from the Business Service company of your vendor, this is then partner role PI invocie presenter.
    if you have more than one vendor for the same role, then the buyers will get pop-ups to choose the right one for the PO.

  • 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

Maybe you are looking for

  • Mac Mini - Running Final Cut Express - Output to a 2nd display

    Anyway of using Final cut Express to output to a 2nd display on a Mac Mini. I know out of the box it only supports either vga or dvi (1 monitor). What does final cut express require for this option to work? A 2nd video card? Thanks

  • HT1449 Is there a way to "Organize Library" and *move* the files, rather than *copy* them?

    I was trying to move my iTunes Library from the old iTunes Music folder to a new-style iTunes Media folder. The Organize Library command wants to copy my 219 GB library. Is there any way to do the same thing but move the files instead? There's no way

  • Match edges error message -  can't find current layer

    Hello everybody, If I use filter --> "match edges" an error message appears: can't find current layer. It is no different if  it is a smartobject or a rasterized layer. Are there any suggestions to fix this problem? What layer-order is exactly to be

  • Welcome Screen problem

    Hi guys, first i am complitly new in APEX but i am really interested in it, so please do not be too cruel to me ;) . I want to create a "Welcome Screen" which should show the menu on top and only a big picture below. So i created a "Dummy" table with

  • SharePoint External URL 404 Error

    Hi I am pretty much new with this - so please bear with me, its prob a simple problem! I have an internal (normal) url for a SharePoint site, which works great. However, we want to extend the web application, and use forms and SSL. So I done this, fi