Function module In Update Task is called more than once

Hi experts!!
I had a requirement to Create a Customer ( i will call it B) when another Customer (A)  is created (ON SAVE).
I used a Badi to implement the requirement, and inside my Badi i have 2 Function Calls in Update Task.
The first one to create Customer B and the second one to send Customer's B data to another System.
Even though the second function call is inside an IF-ENDIF condition ( so that only Customer's B data are sent) the function is called twice sending the same data. My guess is that since the First Function saves the Customer to the database, that is the reason why the second Function is called twice.
Is there any way i can control how many times a Function In Update Task is called????
Please help!!
Thank you in advance!!

Hi BreakPoint & thank you for your reply!!
I tried your suggestion but even if i fill the flag during the first call the function is called twice. Looks like during the second database commit the function is called with the correct conditions met but twice.
Also while debugging it looks like it is only called once. It s very strange!
Any other ideas???

Similar Messages

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

  • Performance... Why a function column in a view is executed more than once...?

    Why a function column created inside a view is executed more than once when called more than once?
    EXAMPLE:
    create or replace view aux1 as
    date_column,
    any_function(date_column) column1
    from any_table
    create or replace view aux2 as
    column1 c1,
    column1 c2,
    column1 c3
    from aux1
    select * from aux2
    It will execute 3 times the function any_function... logically the value will be the same for all columns...
    I understand why!... are 3 calls... but...
    Why not to create a "small" verification and if the function column was execute replace the second, the third... value? ... instead of execute 3, 4... times...
    tks
    Braga

    Actually, this is more than a performance issue. This is a consistency problem. If the function is NOT deterministic then you may get different values for each call which is clearly not consistent with selecting 3 copies of the same column from a row. Oracle appears to have fixed this in 9i...
    Connected to:
    Oracle8i Enterprise Edition Release 8.1.7.2.0 - Production
    With the Partitioning option
    JServer Release 8.1.7.2.0 - Production
    create view v1 as select dbms_random.value(1,100) r from dual;
    create view v2 as select r r1, r r2 from v1;
    select * from v2;
              R1           R2
              93           74
    Connected to:
    Oracle9i Enterprise Edition Release 9.0.1.3.0 - Production
    With the Partitioning option
    JServer Release 9.0.1.3.0 - Production
    create view v1 as select dbms_random.value(1,100) r from dual;
    create view v2 as select r r1, r r2 from v1;
    select * from v2;
              R1           R2
              78           78Richard

  • Method called more than once - and dies with EXC_BAD_ACCESS error

    Hi,
    In my app, I have 4 views with their respective viewControllers. In the appDelegate.m, I provide methods that allows to switch to any of these views. Following is code for switching to the editView:
    -(void) flipToEditView {
    [self populateTheList]; // populate an array
    EditViewController *anEditVC = [[EditViewController alloc] initWithNibName:@"EditView" bundle:nil];
    [self setEditVC:anEditVC];
    [viewController.view removeFromSuperview];
    [self.window addSubview:[editVC view]];
    [anEditVC release]; }
    The view is not switched - and moreover, this method is called more than once; and the app dies with EXCBADACCESS!
    2009-08-23 14:54:40.648 iNotate[2128:20b] Album (before): x= 0 y=20 width=320 height=460
    2009-08-23 14:54:40.653 iNotate[2128:20b] Album (after): x= 0 y= 0 width=320 height=480
    warning: Couldn't find minimal bounds for "_sigtramp" - backtraces may be unreliable
    (gdb) bt
    #0 -[iNotateAppDelegate flipToEditView] (self=0x523690, _cmd=0x9563) at /Users/sam/MY_FILES/iPhone Apps/app/Classes/iNotateAppDelegate.m:116
    #1 0x00008661 in -[FirstView editAction] (self=0x546a30, _cmd=0xac94) at /Users/sam/MY_FILES/iPhone Apps/app/FirstView.m:25
    #2 0x30a4eee6 in -[UIApplication sendAction:to:from:forEvent:] ()
    #3 0x30ab0d36 in -[UIControl sendAction:to:forEvent:] ()
    #4 0x30ab11fe in -[UIControl(Internal) _sendActionsForEvents:withEvent:] ()
    #5 0x30ab0544 in -[UIControl touchesEnded:withEvent:] ()
    #6 0x30a67917 in -[UIWindow sendEvent:] ()
    #7 0x30a56fff in -[UIApplication sendEvent:] ()
    #8 0x30a561e0 in _UIApplicationHandleEvent ()
    #9 0x31565dea in SendEvent ()
    #10 0x3156840c in PurpleEventTimerCallBack ()
    #11 0x94a713c5 in CFRunLoopRunSpecific ()
    #12 0x94a71aa8 in CFRunLoopRunInMode ()
    #13 0x31566600 in GSEventRunModal ()
    #14 0x315666c5 in GSEventRun ()
    #15 0x30a4eca0 in -[UIApplication _run] ()
    #16 0x30a5a09c in UIApplicationMain ()
    #17 0x000027e8 in main (argc=1, argv=0xbffff068) at /Users/sam/MY_FILES/iPhone Apps/app/main.m:14
    Current language: auto; currently objective-c
    (gdb) continue
    2009-08-23 14:54:55.885 iNotate[2128:20b] >>>>>>>>>>>>>>>>>> populateTheList
    (gdb) bt
    #0 -[iNotateAppDelegate flipToEditView] (self=0x523690, _cmd=0x9563) at /Users/sam/MY_FILES/iPhone Apps/app/Classes/iNotateAppDelegate.m:116
    #1 0x00008661 in -[FirstView editAction] (self=0x5457b0, _cmd=0xac94) at /Users/sam/MY_FILES/iPhone Apps/app/FirstView.m:25
    #2 0x30a4eee6 in -[UIApplication sendAction:to:from:forEvent:] ()
    #3 0x30ab0d36 in -[UIControl sendAction:to:forEvent:] ()
    #4 0x30ab11fe in -[UIControl(Internal) _sendActionsForEvents:withEvent:] ()
    #5 0x30ab0544 in -[UIControl touchesEnded:withEvent:] ()
    #6 0x30a67917 in -[UIWindow sendEvent:] ()
    #7 0x30a56fff in -[UIApplication sendEvent:] ()
    #8 0x30a561e0 in _UIApplicationHandleEvent ()
    #9 0x31565dea in SendEvent ()
    #10 0x3156840c in PurpleEventTimerCallBack ()
    #11 0x94a713c5 in CFRunLoopRunSpecific ()
    #12 0x94a71aa8 in CFRunLoopRunInMode ()
    #13 0x31566600 in GSEventRunModal ()
    #14 0x315666c5 in GSEventRun ()
    #15 0x30a4eca0 in -[UIApplication _run] ()
    #16 0x30a5a09c in UIApplicationMain ()
    #17 0x000027e8 in main (argc=1, argv=0xbffff068) at /Users/sam/MY_FILES/iPhone Apps/app/main.m:14
    (gdb) continue
    2009-08-23 14:55:22.493 iNotate[2128:20b] >>>>>>>>>>>>>>>>>> populateTheList
    Program received signal: “EXCBADACCESS”.
    (gdb) continue
    What's happening here?
    Sam!

    -(void) flipToEditView {
    [self populateTheList]; // populate an array
    EditViewController *anEditVC = [[EditViewController alloc] initWithNibName:@"EditView" bundle:nil];
    [self setEditVC:anEditVC];
    [viewController.view removeFromSuperview];
    [self.window addSubview:[editVC view]];
    [anEditVC release]; }
    }<---- is this } matched elsewhere?

  • -setFence:count: called more than once per transaction

    I am getting following error, any body have any idea what it is?
    -setFence:count: called more than once per transaction
    Debugger stopped.
    Program exited with status value:101.
    Thanks in Advance
    Ravi

    I am getting the same error...
    T'is usly a m'ry error.
    Use the debugging/testing tools in the latest Xcode to track down suspects, etc.

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

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

  • 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

  • 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

  • Regarding Error in Function Module in Update Task

    Hi All,
    If a function module is called in Update Task and there is some error generated from it, it comes as an exit message unlike in a normal function module.
    Is there any possible way to avoid such an exit message?
    Thanks in advance.
    Regards,
    Garima

    Hi,
    The problem is I am updating Z tables in a function and also calling a function in Update task to update a different set of tables.
    Now, if for some reason there is an error in Update Function module, then my requirement is that rather than throwing an Exit message (which it is presently doing) the errors coming from the function should be captured so that the user knows what was wrong with the data he entered.
    Is there any work around to the above requirement? Either all the tables should be updated or none of them should be updated.
    Regards,
    Garima Thapar.

  • QuickTime DOM Events called more than once?

    I am in the process of writing code in JavaScript that will track the interaction on a embedded QuickTime video.
    function ew_addImage(v) {
    trackImg=new Image(1,1);
    trackImg.src=v;
    function ew_pauseTrk() {
    var imgStr='http://www.sldkfjsldfjk.com/200125/EWTRACKNEW_VINT?ewadid=751801&ewbust='ewbust'&eid=1078554&file=$VIDEO$&bw=56&vlen=3:00&vint=PAUSED';
    ew_addImage(imgStr);
    if (document.addEventListener)
    document.getElementById("mov1").addEventListener("qt_pause", ew_pauseTrk, false);
    Everything works correctly. I am able to see the image being called when I am looking at Wireshark. The problem is when I click pause more than once.. It seems like the QuickTime DOM Events can only be called once.. Is that true?
    Thanks

    -(void) flipToEditView {
    [self populateTheList]; // populate an array
    EditViewController *anEditVC = [[EditViewController alloc] initWithNibName:@"EditView" bundle:nil];
    [self setEditVC:anEditVC];
    [viewController.view removeFromSuperview];
    [self.window addSubview:[editVC view]];
    [anEditVC release]; }
    }<---- is this } matched elsewhere?

  • Can the same partner function be entered in the sales order more than once.

    Hi
    I know that as per standard same partner function cannot be entered more than once in Sales order.
    If somebody has tried ways to do this please share.
    THanks
    Alags

    Yes. You can have multiple Ship to Party, Bill to Parrty & Payer in Sales Order. But Sold to Party will have to Unique & single.
    This functionality of having multilpe Partners is widely used & just follow as Deepak suggested above & you too can have multiple Partners of same type in single Sales Order.
    But there has to be a strong Business case in doing so... say different Ship tp Party for different line items in Sales Order or different BIll to Party for some line Items in Sales Order.
    Hope this helps,
    Thanks,
    JIgnesh Mehta

  • WDDOMODIFYVIEW and WDDOPOSTPROCESSING is called more than once!

    Hello everybody,
    maybe someone can help me. Our WDA application consist of 5 Components. One main and 4 components embedded in it. We instantiate the components in the WDDOINIT of the main component and use them between themselves.
    I suppose that's the reason that the events in the views and componentcontrollers of each component is called so often.
    With a break point in a WDDOMODIFYVIEW an the debugger I find out that the  HANDLE_REQUEST methos from the CL_WDR_CLIENT_ABSTRACT_HTTP  class is startet also more than once.
    1.  if m_ucf is not bound -> yes and  m_request_type = suspend
    2.  if m_ucf is not bound -> initial and  m_request_type = suspend
    3.  if m_ucf is not bound -> initial and  m_request_type = suspend
    4.  if m_ucf is not bound -> initial and  m_request_type = refresh
    Maybe someone has expierence with it an can give a hint or explanations for this.
    I hope so
    Thanks for any answer
    Best regards
    Christian Breitenbach

    hi christian.......
         a wddomodifyview view method will be called even if there is a little change in your view. it will b e called more times than your normal pbo in a dynpro application. the wddoinit will be called only before the view is loaded... but the modify willbe called even for popups nad any event.
    ---regards,
       alex b justin

  • 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

Maybe you are looking for

  • Show LabVIEW VI Front Panel When Sequence Step Called

    Hello, By clicking on the "Show VI Front Panel When Called" checkbox in the Step Settings pane displays the LabVIEW VI Front Panel for approximately 100 milliseconds. Is there a configuration way to display the VI front panel for a longer period of t

  • Solution to only TWO USB ports, please

    I should have paid more attention when I bought my Mac. I didn't realize there were only TWO USB ports on board. My job requires me to be mobile, and on any given day, I could be using up to 10 USB ports. I know they make hubs, one of which I've trie

  • Materialized view with synonym

    HI, I created a materialized view that is based on a synonym, depending on the table you want to modify using the synonym to point to another table, but to cool it still uses the original referenced table synonym. Is there a way, without deleting the

  • JDeveloper and OC4J runtime exception

    Hi, I am running trying to launch a simple jsp file but it fails everytime and spits out the following: Error: cannot read: java.lang.Enum 05/12/27 10:30:54 Error initializing server: Error initializing ejb-modules: Error loading module file:/C:/jdev

  • Programmatic access to multiple backend systems using adaptive RFC

    Hello, The following  link http://help.sap.com/saphelp_nw04/helpdata/en/af/84a34098022a54e10000000a1550b0/content.htm talks about the support to map multiple backend systems by specifying the backend system as URL parameters in a webdynpro applicatio