"In Update Task" for ABAP OO

Hi All,
is there a simular function for methods like for function modules to call something "IN UPDATE TASK"?
My problem is that I want to call a method out of the User Interface which is then executed in a separate process (in background), that the user on the UI do not have to wait until the processing is finished.
How do I achieve this. Is it only possible with function modules which I call "IN UPDATE TASK" or does something like this exists also in the abap oo world.
Thx,
Hans.

Hello Hans,
My problem is that I want to call a method out of the User Interface which is then executed in a separate process (in background), that the user on the UI do not have to wait until the processing is finished
Which version of SAP are you on? I can speak of Release 701 & i don't think you've OO methods which can be used for performing the desired functionality.
You can ofcourse create a wrapper method enclosing the update function module!
Cheers,
Suhas

Similar Messages

  • Error in update task for MB02

    Hello all,
    My requirement is as follows.
    In MB02 i should go to tab 'details from item' and on that screen I click on the messages.
    here in the messages i give the output type and medium as special function and language EN.
    This output type is assigned to a zprogram and form routine.This zprogram should call the transaction QAC2 to transfer inspection lot quantity(plant to plant and storage loc to storage loc).
    When I save this material document, I am getting a dump in the zprogram.
    The dump say posting illegal statement and the error analasys is
    This program is triggered in the update task. There, the
    following ABAP/4 statements are not allowed:           
    -  CALL SCREEN                                         
    -  CALL DIALOG                                         
    -  CALL TRANSACTION                                    
    -  SUBMIT                                                                               
    Please help me how to achieve this?
    Thanks
    Sandeep

    Hi I am attaching the short dump code here.
                                                                                    Statement "CALL TRANSACTION" is not allowed in this form.                                                                               
    What happened?                                                                               
    Error in ABAP application program.                                                                               
    The current ABAP program "SAPLZVINOD " had to be terminated because one of the                       
    statements could not be executed.                                                                               
    This is probably due to an error in the ABAP program.                                                                               
    What can you do?                                                                               
    Print out the error message (using the "Print" function)                                             
    and make a note of the actions and input that caused the                                             
    error.                                                                               
    To resolve the problem, contact your SAP system administrator.                                       
    You can use transaction ST22 (ABAP Dump Analysis) to view and administer                             
    termination messages, especially those beyond their normal deletion                                 
    date.                                                                               
    Error analysis                                                                               
    This program is triggered in the update task. There, the                                             
    following ABAP/4 statements are not allowed:                                                                               
    -  CALL SCREEN                                                               
    -  CALL DIALOG                                                               
    -  CALL TRANSACTION                                                          
    -  SUBMIT                                                                               
    How to correct the error                                                                               
    Probably the only way to eliminate the error is to correct the program.      
    You may able to find an interim solution to the problem                      
    in the SAP note system. If you have access to the note system yourself,      
    use the following search criteria:                                                                               
    "POSTING_ILLEGAL_STATEMENT" C                                                
    "SAPLZVINOD " or "LZVINODU01 "                                               
    "BDC_TRANSACTION"                                                                               
    Thanks
    Sandeep

  • Update tasks - Transfer Order creation.

    I have an issue in our production environment where in some situations a Transfer Order (TO) is created with missing storage handling unit information.  This only happens intermittently, and when the TO is cancelled and re-created, it is created with the correct storage unit information.
    I have looked at the TO creation function l_to_create_int and it is called from within an update function module l_communication_to_create.  The l_to_create_int function is not called within an update task.  The function within l_to_create_int which creates the storage handling unit is an update function module (function L_TA_HINZUFUEGEN).
    So my question is, what happens when you have a combination of function modules called as an update and function modules called normally?  Will the updates in the function called normally update outside of the update task commit?  I'm beginning to think that the problem may be caused by inconsistencies in when updates are completed by the program.
    I'd greatly appreciate any help or guidance regarding this issue.
    Kind regards,
    James Mandikos.

    Hi James,
    You are correct, a function module must be explicitly be called in 'UPDATE TASK' for it to be executed in the update task (regardless of the settings flagged in SE37).
    If, however, it is called in UPDATE TASK there are four possible settings you can have in SE37 which each behave differently (as of the release I am looking at at the moment - R/3 4.7).
    Here is my understanding of how the settings behave:
    <b>Start immed.</b>
    Will run in a V1 update process together with all other update functions called in the same LUW with Start immed. flagged.
    <b>Immediate start, no restart</b>
    As above, but cannot be reprocessed via transaction SM13 in the case of error (but can be viewed).
    <b>Start delayed</b>
    Will run in a V2 update process individually.
    <b>Coll.run</b>
    Will run in a V2 update process toegether with all other update functions called in the same LUW with Coll.run flagged.
    So given the data you have provided both your function modules should be running in a collective V1 process, and therefore if one failed then the whole transaction should have been rolled back (and hence this does not explain your problem). 
    <b>BUT</b> what may be happening is that for whatever reason the transaction fails (maybe due to heavy system load) and either your system admin (or an autmated job) is pushing through the error in SM13. As the function L_TA_HINZUFUEGEN is flagged as immediate start, no restart then it will not be processed and the L_TO_CREATE_INIT will be.  This could exactly explain your problem.
    Hope that makes things clearer.
    Cheers,
    Brad

  • Problem while generating Update progam for a Change Document Object

    Hi,
    I'm trying to deal with Change Document concept in a R/3 4.6C environment and to establish new Change Document object for my (Z)-table. I haven't using any namespace and created object with name ZTEST. Following the online documentation I came to the point, where I have to generate include program. I made all the nessesary inputs (using Z prefix) but faced
    "Function module name is reserved for SAP"
    Creating everything similarily using some of our registered namespaces (/somenamespace/) I succeed to generate the Update program and to integrate it in my Z-programs as well.
    My question is: is it possible to use Change Document Object-names without predefined namespace - being a regular customer developer, but not an SAP developer - means, if I am allowed to manage programs in the customer namespace (Z,Y, X) only. If yes, how to do this?
    Further (I decided not to open a new thread) - generated Update program uses
    CALL FUNCTION 'xxxxx' IN UPDATE TASK
    for creation of Change Numbers for generated Change Document Object. This CALL doesn't work when I implemented it in my Z-program, but when changed  (IN UPDATE TASK was commented) - everything goes well and the system creates records in CDHDR/CDPOS tables for my object class and table.
    Why is that? According to the documentation I shoud only fill appropriate variables for the Change Document Object (class, tr.code, etc.) and call generated FM, nothing is pointed out about any possible problems? Am I doing something wrong?
    Well, to be precise, I think I have to give a sample:
    1. I have a sample Z-table with few fields (their data elements are marked as Change-Document relevant).
    2. Using own z-progam I created a new record for this z-table. Also fill all the nessesary variables included in the interface of generated FM for Change Document Object (for example - FM-mane CD_CALL_my_object).
    3. I call the CDO FM.
    4. Check what is happening (directly in both tables CDHDR/CDPOS or using FM CHANGEDOCUMENT_READ).
    Further, I perfom the steps from 1 to 4 updating the created in previous loop record in my Z-table.
    In both cases if the FM 'CD_CALL_my_object' is called IN UPDATE TASK nothing happens, but in case of direct call (without addition IN UPDATE TASK) the system behaves as expected. Well, obliously I can change the generated code for our production needs, but it doesn't seems to be the correct decision - in case of next possible modification of the Change Document Object definition, respectively in need of re-generation of the code.
    Any hints are wellcome.
    Thanks in advance.
    Ivaylo Mutafchiev
    Edited by: Ivaylo Mutafchiev on Jan 24, 2008 10:24 AM

    "IN UPDATE TASK" resolved by myself. The one should explicitly call 'COMMIT WORK' from Z-program after CALL FUNCTION '...' IN UPDATE TASK in order to get changes in the CDHDR/CDPOS commited. The key in this issue for me was to check the documentation of CALL FUNCTION :-).
    Regards,
    Ivo

  • Starting new task inside an Update Task

    Hi guys,
    I need an expert opinion for a problem I'm facing at the moment.
    The requirement is this: I need to trigger a function module during the update task of a material document.
    This function module however should not slow down the posting of the document, so it must not be in the same LUW, but in a separate task.
    My question is: does it work to call a function module with STARTING NEW TASK inside an UPDATE TASK (for example a user exit) and if it does work, what's your opinion on it? Is if safe? Does it come with problems? According to the SAP documentation, STARTING NEW TASK does not trigger a COMMIT when it's called inside an update task.
    The alternative would be to trigger a work flow, but that's much more work.
    Any input is welcome.
    Thanks.

    Hello Janis,
    Just to reiterate this aRFC call triggers an implicit database commit. So the OP is partially correct
    Klaus Kronawetter we have 2 things which we need to consider -
    Asynchronous RFC triggers a database commit in the calling program.
    Any database commits or database rollbacks that occur within the update task cancel the update.
    Simply put, as per SAP documentation, you cannot use aRFC within an update task.
    BR,
    Suhas

  • Error Handling for Background/Update Tasks (Transfer Order creation) - How?

    Hi,
    I have a standard process for creating a Transfer Order and 2 user-exits that I have implemented.
    The user exits are used to transfer information during Transfer Order creation.
    However, the user-exits also check data in table TVARV and other. As such, error handling needs to be implemented, since the T.O. might or might not go through, depending on data validation and related.
    However, the user-exits are implemented during creation, which is an update task that runs in the background. This makes it impossible to output any information or error messages.
    What else can be done in regards to outputting a message, since the user will need to see some sort of message that the process failed, that the T.O. didnu2019t confirm?  Can an SAP inbox message be created and how?
    Please help.
    Thank You,
    John

    Hi,
         Please check the following link for all the function modules and user exits on TOs.
    http://help.sap.com/saphelp_erp2005/helpdata/EN/c6/f83a294afa11d182b90000e829fbfe/content.htm
    Reward points if it was helpful.
    Regards
    Abhishek
    Edited by: Abhishek Raj on May 29, 2008 10:20 AM

  • FM in update task - How do you debug for a user exit (IW32)

    Hi,
    I am working on user exit IWO10009, fm EXIT_SAPLCOIH_009, transaction IW32.
    The user-exit should be called any time an order is saved with parts added to the component tab.
    The import structure of the user exit is CAUFVD, which doesnu2019t contain the items in the component. Instead, I have to go into table RESB and get the components.
    However, when I go into RESB from inside the user-exit, the added components have not yet been added to the table.
    As such, I was thinking of creating a Z function module in update task to process this code after the order is saved & RESB is updated.
    2 questions
    1 u2013 Is this the best way of accomplishing this?
    2 u2013 How do you debug FMu2019s in update task? I have set a breakpoint & have switched system debugging on from inside the debugger, but it doesnu2019t stop inside the fm.
    Please help.
    Thanks,
    John

    Hi,
    to debug update task you need to switch on "update debugging" not the "system debugging" from the menu Settings->update debugging.
    -Ramesh

  • Do CIF BAdIs issue implicit COMMIT WORKS (for FM's called "in update task")

    I am calling the CIF BAdI:
    /SAPAPO/TR_TRANSFER.
    In the PUSH_LANE_DATA method of this BAdI, I want to call a function module "in update task".
    To trigger the actual execution of this function module, do I have to code an explicit COMMIT WORK in the BAdI or will SAP automatically generate a COMMIT WORK when the BAdI ends?

    Hope you have called the FM correctly with the additional importing parameter , also check if your FM is RFC enabled then check the "pass by value" option.

  • Is there any BAPI calling only  ABAP command SET UPDATE TASK LOCAL

    Hi abapers
    we have a requirement to run SET UPDATE TASK LOCAL befor calling BAPI_ENTRYSHEET_CREATE command by JAVA through JCO.
    is there any BAPI that contains SET UPDATE TASK LOCAL command or simillar functionality.
    Thanks & Regards,
    Ramesh

    You could write a wrapper RFC function module which calls your BAPI and also the SET UPDATE TASK LOCAL.
    Regards,
    Rich Heilman

  • In update task & Express document Update was terminated

    Hi all
    Need help!
    Requirement: When i do confirmation through CO11N i have to do GI through a BADI.
    Solution: I have written a wrapper Update module(internally has /AFS/BAPI_GOODSMVT_CREATE) with Start delayed and called that module(in update task) in the method MB_DOCUMENT_BEFORE_UPDATE of the definition MB_DOCUMENT_BADI.
    It works fine when every thing is correct, but if GI fails its still confirms the confimation and "Express document Update was terminated" pops up when i push the back button. I have written a abort statement in the update module if goods movement fails. When i check SM13 it shows the reason for erroring out. But my requirement is to stop the complete transaction if GI fails and put the error message at the bottom of screen(CO11N)
    How can i do this?
    Appreciate any suggestions.

    Hi,
    I don't think that it is possible. It's too late to call rollback. The FM in update task is called after command COMMIT WORK. Here is a quote from ABAP documentation:
    If during the update an error occurs, the update work process executes a database rollback, returns the log record with a note into table VBLOG and informs the user whose program has created the log record by SAPMail. After removing the error cause, the returned log records can be updated again.
    So you should call that module only in case that you are 100% sure that it will be processed correctly.
    Cheers

  • Function in update task goes to dialog process(seen by sm50)

    Hi Forum,
       I wrote a simple test to invoke a function module in update task, and the execution of the module takes several minutes (updating database using opensql) . The test looks simply like described in the following link:
    http://www.****************/Tutorials/ABAP/Debug/Index.htm
       During the run, I used transaction sm50 to view the working processes and expect to find a running "UPD" process. However it is not found, instead  my dialog process is always seen running. Any hints on why?
    Thanks,
    Yang

    got the answer. The reason is that sm50 can not display UPD process so promptly. For a more thorough tracing, transaction "stad" can be used. (where I see the DB access executed in UPD process)

  • 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

  • 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 transaction inside Update task

    <b>Is it possible to use call transaction inside an update function module?</b>
    My requirement is like this.
    When I execute LB10 storage units will be created..then we have to go to lt09 and then create a TO's there for all these Storage units..
    Now, when I try to call a bdc session from an exit, the storage units are not  updated there. so the BDC is getting failed..
    To resolve this, I kept all the BDC code in to a Zfunction module and made it an update funtion module. I am calling this function module form the exit IN UPDATE TASK.
    But the call transaction is not working....
    I have tried with L_TO_CREATE_MOVE_SU inside the Z function module..Still no use..
    is there any other way that I can solve this?

    Hi,
       Calling a FM in Update Task is one of the bundling techniques used in ABAP to avail functionality provided by SAP Update System. Here all database updates are processed at the end of the SAP LUW in contrast to normal FM call where the database updates are done and commited at the time of call (Database LUW). It is necessary to bundle all your database updates in an SAP LUW e.g. all database updates in a transaction (like VA01) should be bundled. Almost all standard SAP transactions use bundling techniques.
    This technique separates the dialog process and update process. The dialog part of the transaction can span more than one screen(one dialog step) and can be processsed by more than one dialog work process. A work process is released when the dialog step changes (screen changes) and the work process sends a database commit (called Implicit Database LUW). So with each screen change there is a database commit and database remains in consistent state.
    Now when using bundling technique, when a COMMIT WORK is encountered, system ends the dialog process with a dialog work porcess and starts the update process using an update work process.
    The dialog step containing the COMMIT WORK is considerd as the last dialog step of the transaction and all the update function modules are processed now in the last dialog step by the update work process though they were called earlier during the earlier dialog steps.
    It is necessary to create update FMs to take advantage of this technique. The update FM is created FM by setting the Update moduleradiobutton in the Attributes tab in SE37.
    In a normal FM call, if there are database updates (UPDATE, INSERT, MODIFY, DELETE) than database is commited after the FM processing is over as the FM starts its own Database LUW and ends it too.
    <b>Reward Points</b>
    Regards

  • Problem when using Call FM IN UPDATE TASK.

    we plan to update ztable using Call FM in update task, and write the success/error message into log.
    Does below is right??  I found the commit work can not be used here. Thanks..
    CALL FUNCTION 'ENQUEUE_ETABLE'.
    IF sy-subrc = 0.
    CALL FUNCTION 'update_ztable'' IN UPDATE TASK.
    Endif.
    COMMIT WORK and wait.
    IF sy-subrc <> 0.   
         ROLLBACK WORK.
         write error log.
    Else.
        Write successful log.
    Endif.
    CALL FUNCTION 'DNQUEUE_ALL'.

    Hi ,
    Please see the refernce of UPDATE FUNCTION MODULES:
    UPDATE FUNCTION MODULE
    -In the attributes tab, under processing type, choose Update Module, 
    Start Immediately. Define your import parameters, enter the source
    code, All validations should have been done prior to the call to this
    function module, so all you need in the source, is the updating of the
    database, INSERT, MODIFY, UPDATE, whatever.
    -When you call you function module, use IN UPDATE TASK, after the call, 
    COMMIT WORK. The commit work will trigger the db update.
    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.
    Q:We are calling Sales Order Change in update task inside the user Exit MV50FZ1. We can see that the FM is called in update task after the commit work and the return of the FM shows the success message. But still the changes are not saved to the DB.
    A: check sm21 or sm13 to see if the update was successful  .. In SM21 I checked. It is giving me the error Transaction Failed
    Reward if useful
    Thanks
    Jagadeesh.G

Maybe you are looking for