CALL FUNCTION update_function IN UPDATE TASK

hi
please give me an <b>example  for implementation</b> of  CALL FUNCTION update_function IN UPDATE TASK
plz help.. its urgent
useful solutions will be rewarded
<b>note</b>: dont give me link. i need simple straight forward example
thanks
ravish

Hi,
   When u want to call function which has to be executed in the Update work process.
1. You have to set the "Processing Type"  to  "Update Module" and select "Immediate Start" which makes the function to be processed using V1 update process(for critical updates)
function module parameters must be passed by using Pass by Value only.
Export parameters are not supported.
In the source code of the function
to perform a ROLLBACK in case of any error
Generate a message using type A(Abend)
2. Call the function from the program using
   CALL FUNCTION 'Z_FM' in update task
   EXPORTING
  TABLES
  COMMIT WORK .  
hope this will help.
Reward if so.
Regards,
Varma

Similar Messages

  • RE:CALL FUNCTION update_function IN UPDATE TASK

    Hi,
    Can anyone give a sample code or a simple scenario for CALL FUNCTION update_function IN UPDATE TASK .
    Thanks in advance,
    Alex.

    Hello George
    In a project dealing with material master data I had the problem that I needed to update standard as well as customer tables at the same time when the user pushed the SAVE button.
    For the standard tables I used BAPI_MATERIAL_MAINTAINDATA_RT (retail material) and for the customer tables I created my own SAVE function modules.
    How to ensure that either both (standard and custom) tables are updated or not simultaneously?
    I created a special SAVE function module which called both the standard BAPI and my custom SAVE function modules.
    This "wrapper" SAVE function module was then called IN UPDATE TASK.
    This way I created a LUW (logic unit of work) which comprised both standard and custom tables. If everything was ok both types of tables were updated, otherwise the entire transaction was rolled back.
    Further reading: [Special LUW Considerations|http://help.sap.com/saphelp_nw04/helpdata/en/9f/dbae3435c111d1829f0000e829fbfe/content.htm]
    Regards
      Uwe

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

  • Function modules in Update task

    Hi Folks,
    What is the difference between
    1.If a function module contains in attributes 'Update mode ' and run( without 'update task - keyword).
    2.call function ' fun2' in update task.
    In this case, do we need to set the attributes must be 'Update task'?
    Please help me.
    Thanks in advance
    Bhavani

    From F1 Help...
    <i>
    This statement registers the update function module specified in update_function. update_function must be a character-type field, which during execution of the statement contains the name of an update function module in uppercase letters.
    <b>An update function module is a function module, for which in the Function Builder the property update module is marked. The registration of an update function module is an essential part of the update task.</b>
    The function module is not executed immediately, but is scheduled for execution in a special work process (update work process). For this purpose, the name of the function module including the passed actual parameters is stored as a log record in the database table VBLOG. If the statement is executed during the update task, the addition IN UPDATE TASK is ignored.
    </i>
    Regards,
    Rich Heilman

  • Function module with UPDATE TASK

    All,
    Have a look at the below code. While debugging the control is not going inside the function module called using <b>call function ...... in update task</b> statement.
    I believe the function module is not executed immediately, but is scheduled for execution in a special work process (update work process). For this purpose, the name of the function module including the passed actual parameters is stored as a log record in the database table VBLOG. If the statement is executed during the update task, the addition IN UPDATE TASK is ignored.
    The actual execution is triggered by the statement COMMIT WORK which is not happening in this case. The formal parameters of the function module receive the values of the actual parameters from table VBLOG. How can I read the entries in VBLOG? Why the function module is not executed? Please suggest.
    PERFORM bte_publish ON COMMIT LEVEL 9.
    * syncron update
        COMMIT WORK AND WAIT.
    *       Publish business transaction events. The function module have
    *       to call as last update module!
    FORM bte_publish.
      IF NOT gvt_nodes IS INITIAL.
        CALL FUNCTION 'CUSTOMER_HIERARCHY_THROW_BTE' IN UPDATE TASK
             EXPORTING
                  ffi_valid_on    = knvh-datab
                  fti_event_list  = gvt_nodes
                  fti_event_listx = gvt_nodesx.
      ENDIF.
    ENDFORM.                               " BTE_PUBLISH
    Thanks,

    Right Naren. But I need to check inside the update function module, whether it is calling the BTE function module I had configured and the code which I had put in it. Any ideas?
    The COMMIT WORK is returning 4 and hence I believe it is not popping up another debuggin session in which the update FM runs.
    Thanks,
    Message was edited by: Somen

  • How  to debug function module in update task ?

    Hi ,
              i have following code :
    CALL FUNCTION 'ZSD_t_UPDATE' IN UPDATE TASK
                 TABLES
                                  it_xvbkd = xvbkd.
    Inside this function module i have some code  to debug . How can i debug it ?
    I put the breakpoint in it but its not working .
    It is triggered on save of  a tcode .
    Thanks and Regards .

    My home-grown method:
    Set your breakpoint in the FM.
    In your transaction, just before you press save, enter hobble mode in your command box with '/h'.
    press save.
    In your first debug screen, toggle settings>system debugging ON (NetWeaver Drop-down menu) or see previous notes for earlier WebAS versions.
    Select continue (F8).
    The program should then stop at your break-point in the FM.

  • Regarding function module in update task

    Hi,
    I have a function module(Zxxx) which is update type. i have called the fun.module in my program (Zyyy) using the syntax CALL FUNCTION ZXXX IN UPDATE TASK. As I suppose to debug the function module, I activated the update debugging in the debugging screen. But the controll still not goen into the function module. Please let me know solution.
    Thanks & regards,
    Suresh

    >
    sureshkumar vaniyasekar wrote:
    > I activated the update debugging in the debugging screen. But the controll still not goen into the function module.
    Hello Suresh,
    What do you mean by not going?
    If you are trying to do an F5 at the function call, the debugger is not "enter" into the FM. This is because at this point the function call is registered but the FM is not executed.
    Update FM calls registered in a particular LUW are executed(in a special "UPD" workprocess) when there is a COMMIT encountered(may be explicit or implicit).
    Did you read the online help on [Update Debugging|http://help.sap.com/saphelp_NW70EHP1core/helpdata/en/c6/617d0ce68c11d2b2ab080009b43351/content.htm] & [Breakpoint behaviour during Update Debugging|http://help.sap.com/saphelp_NW70EHP1core/helpdata/en/c6/617cbee68c11d2b2ab080009b43351/content.htm]?
    BR,
    Suhas

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

  • 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

  • Difference between Function module in Update task

    Hi folks,
    What is the difference between
    1. A function module calling in 'update task'( if attributes not set for update mode).
    2.A function module's attributes set to update mode, but while calling not specified 'Update task'.
    Please clarify this doubt.
    Thanks in advance.
    Bhavani

    CALL FUNCTION func IN UPDATE TASK.
    Additions:
    1. ... EXPORTING  p1 = f1     ... pn = fn
    2. ... TABLES     p1 = itab1  ... pn = itabn
    Effect
    Flags the function module func for execution in the update task. It is not executed at once, but the data passed with EXPORTING or TABLES is placed in a database table and a subsequent COMMIT WORK then causes the function module to be executed by the update task. Update function modules must be flagged as such in the Function Builder
    The return value is not set.
    Addition 1
    ... EXPORTING p1 = f1 ... pn = fn
    Effect
    Values of fields and field strings specified under EXPORTING are passed from the calling program to the function module. In the function module, the formal parameters are defined as import parameters. In the interface definition, default values must be assigned to all import parameters of the update function module.
    Addition 2
    ... TABLES p1 = itab1 ... pn = itabn
    Effect
    TABLES passes references to internal tables. All table parameters of the function module must have values.
    Note
    With update function modules, both import parameters and exceptions are ignored when the call is made.
    Administration transaction
    Related
    COMMIT WORK, SET UPDATE TASK LOCAL
    regards,
    kartikey.

  • 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

  • Call transaction inside of call function in back ground task

    Hi,
        Is it possible to use call transaction statemement inside of call function in back ground task. I am getting error if i use the same. Any help will be highly appreciated.

    Hi,
    I don't think this is possible. The call goes into error in SM58, what you can try to do is after the function is called, you can submit the program RSARFCEX by setting the user name as sy-uname and other parameters as * and set all the checkboxes.
    regards,
    Advait

  • Problem in Call function .. starting new task

    Hi,
    I want to execute a dialog program in background. I am trying to use call function starting new task.
    I am facing some syntax issue. Can any one guide me how to use call function starting new task. The function module is RFC FM. Do we need to define task some where before use please guide.
    Thanks in advance. A sample program will be gr8.

    Hi,
    Incase you want to call a RFC FM in background you can call ity like this.
         call function 'Y_L_TO_CREATE_HUPAST' in background task
                 exporting
              venum   = y_v_venum
              backg   = 'X'
               buser   = y_lv_uname
              langu   = sy-langu
              objky   = y_lv_objky
              printer = y_lv_printer.
    Here Y_L_TO_CREATE_HUPAST is a RFC FM.
    Regards,
    Ankur Parab

  • Call Function'BAPI_USER_CHANGE' starting new task 'TEST'

    Hi All,
    I have problem with starting new task statement, I am using one FM after that am using starting new task 'TEST'
    statement but its not working in one system its working fine in other systems, Please help me who this works.
    Thanks in Advance.
    Eg: Call Function'BAPI_USER_CHANGE' starting new task 'TEST'
    Regar

    Thanks Lqueiroz  ,
    Now again i am getting a DUMP by saying ,
    "An error occurred when executing a REMOTE FUNCTION CALL.
    It was logged under the name "At least one entry could not be "
    on the called page."
    so what can be the reason for this
    call function 'ZRFC_PER_DIEM' starting new task lc_taskid performing subr on end of task
            exporting
              h_guid      = it_header_guid_n
              request_obj = lt_requested_objects_n.
          wait up to '1' seconds.
          read table gt_scl into ls_scl index 1.
          p_transaction_per_diem =  ls_scl-value.
          read table gt_scl into ls_scl index 2.
          transaction_currency_code = ls_scl-value.
      form subr   using task_id type clike.
      data: p_transaction_per_diem  type  char13,
            transaction_currency_code type  char3.
      receive results from function 'ZRFC_PER_DIEM'
                               tables
                                value = gt_scl.
    So basically i am getting dumo when receive statenment is running , by giving above dump.
    Regards
    PG

Maybe you are looking for

  • Error in Data transfer ECC to APO

    Hello Guys, I'm getting an error in my system when I try to transfer data from ECC to APO system. When I CIF (after generating IM, when I activate it)  older data (master data created previously in system), I'm getting a short dump with mesage class

  • Tuning when bind variables is used

    I have the following query.. which has some bind variables.. When i run in TOAD by hardsocing these bind variables, the query comes out in 2-3 mins. But when i run after replacing bind variables during run time , the query hangs. These bind variables

  • Change UI layout based on panel size

    I am looking for a way to adjust the layout of my UI based on the panel's size. For example, two buttons that are above each other until the window height gets small enough that they need to be next to each other instead. Another example would be a s

  • How can I change colour of blend without realeasing it?

    If I have a simple blend of two lines and want to change the colour I go to >Objec>Blend>Release Blend and then change the colour by selecting and changing the swatch of the stroke.  Then I have to redo the blend and end up reapplying the blend param

  • Authenticating on two different "official" iPhone networks

    hi i dont own an iPhone (yet). question is this: if you have an iPhone account on two networks, such as AT&T and a network in Hong Kong, can you simply just insert the other network's SIM and it works? or do you need to keep on using iTunes to authen