Locking in update task

Hi,
I have a weird issue with locking during update task.
I have a report, which enqueue a specific lock object in exclusive cumulative mode (mode E) with scope 2.
Afterwards, I call FM in update task, which also enqueue exactly the same object in exclusive cumulative mode with scope 2. The FM is triggered after commit work has been executed.
For some reason, the enqueue during the update task process fails (because object is locked by other owner).
As I know, there shouldn't be any locking problem because the update task inherits the lock owner (as described in http://help.sap.com/saphelp_erp60_sp/helpdata/EN/7b/f9813712f7434be10000009b38f8cf/frameset.htm).
Does anyone why does it occur? How can I solve this issue?
Thanks in advance,
Shai

Hi,
Thanks for the answer.
Why is that?
The lock is defined in exclusive cumulative mode, what means that the same lock can be requested by the same owner several times.
This scenario works just fine in normal dialog process (with two sequent locks), but fails in update task.
For your knowledge,
Shai

Similar Messages

  • Cannot cumulate lock within update task

    Hi,
    I am writing a BAPI to update several materials asynchronously.
    1. The BAPI will lock those materials for update by ENQUEUE_EMMARAE with scope 2
    2. Calls another function module IN UPDATE TASK, which calls BAPI_MATERIAL_SAVEDATA several times to update those materials.
    However, the BAPI_MATERIAL_SAVEDATA fails to accumulate the lock on EMMARAE and rejects the changes.
    The BAPI is to return without waiting for the material changes, but block other change attempts in the mean time.
    As a work around, I tried to release the lock in the FM before locking again, but it could not be done by DEQUEUE_ALL nor DEQUEUE_EMMARAE.
    Please help.
    Many thanks,
    MF

    Hi again,
    1. Lets take this sequence
       a) program logic
       b) enqueue
          update FM
          Commit Work and Wait
          dequeu
    2. In above,
       all the 4 statements in B
       are executed immediately in sequence.
    3. When update FM is called,
       it does not execute immediate.
       However,since the immediate next
       statment is commit work and WAIT,
       the update FM will execute (immediate now)
       and after completion,
       dequeu will be exectued.
    4. I think this is the most shortest span
       of time, in which u won't have any problem.
    regards,
    amit m.

  • Call on update module without addition "in update task"

    Hi, folks!
    Could anyone please explain the behaviour of an update module that is called without addition "in update task" with regards to transactionality and locking? Where is the processing carried out - in the dialog step, I guess? Does a COMMIT WORK AND WAIT make any sense in this context? Will any locks be removed in this way?
    Thank you very much in advance!
    Cheers,
    Thomas

    Hi Thomas,
    Please find the below mentioned piece of code :
      call function 'Z_ZE0EDISTAT_UPDATE' in update task
           EXPORTING
                w_ZE0EDISTAT          =  struct_ZE0EDISTAT
           EXCEPTIONS
                NO_UPDATE            = 01.
    *&   Update Database with changes.
      COMMIT WORK AND WAIT.
    In this case whatever changes which will be done to the table 'ZE0EDISTAT' inside the FM 'Z_ZE0EDISTAT_UPDATE'  will ONLY be reflected in the database table  ZE0EDISTAT' when COMMIT WORK and WAIT statement is encountered. Else updates won't be visible. Hope it will clear some doubt of yours.
    Cheers
    VJ

  • Update task FM

    Hi Guys,
    Im dealing with a customize dialog transaction where it does have quite a number of Update task FMs to be executed(base on the process). And all those Update Task FMs will be bundled in 1 single LUW to ensure the data consistancy.
    But i have a case happened in prod server where part of the tables(inside Update task FM) weren't updated where those FMs are belong to 1 single LUW.
    And there is not Update termination or Short dump shown. It leads to update carried out successfull. By right it is wrong where part of tables not being updated. And for my every single FM, i put message type A to perform rollback and abend for all the updating process if the current updating having prob in DB.
    eg code in Update task FM:
    UPDATE mara FROM i_mara.
    IF SY-SUBRC <> 0.
      MESSAGE A000(zz.
    ENDIF.
    Other than that, it wasn't due to locking problem where locks are placed nicely from the begining of the transaction.
    Besides that the most shity part is, it can not be simulated in Prod server. There is no log in SM21, SM13. Plus if i simulate the same set of data in QA server, the problem never come out. And the case in Prod server from April till now, it happens twice only. While for the rest of the same transaction type carried out in Prod server without any prob.
    Pls comment for the above.
    Thanks in advance.

    Hi,
    I couldn't help but noticing the fact that you have a update statement on the standard MARA table in your FM. This will cause inconsistencies in the databases. What I am talking about might not be related to your existing issue, but you should never ever update the standard tables directly.
    You should always try and use the BAPI's to do the required functionality and I am sure your problem also will be solved by doing that.
    Regards,
    Ravi
    Note : Please mark the helpful answers

  • Usage of IN UPDATE TASK in Update process

    Hi
    I want to synchronize the Lock and Rollback process with respect to
    addon table and FI document posting.Need to consider that many  addon programs are accessing the table at same time and may be bulk records need to be udpated sometimes.So may be more time to execute. I am trying to execute below in 1LUW process. pls correct me if i am doing wrong here. below is my issue.
    Pls correct me whether can i go with below process.
    1)Check and prepare record for Update
    2)If (No) record exists
      Display Error.
      Else
    3)call Function Enqueue_XXXXX " (Lock the Updating doc record for table.)
    4)Call Function 'UPDATE_ZMMT44' IN UPDATE TASK(Inside FM Update stmt is written)
    FI document standard Commit Work (hope this will release both table lock and BKPF lock)
    FI standard Rollback Work
    Issue
    1)Lock Release timing of Enqueue process?
      Lock Release happens only at the end of FI document Posting. if batch update happens it will lead to long time freeze and no error can be displayed unfortunately. how to handle this?
    2)How to handle SQL error(Update <table> stmt error)
    I am not able to catch this error inside program. seems it goes to ST22 ...how to catch this inside program?
    My earlier query is not clear and i did not get answer so i am post it again
    regards
    prince
    Edited by: princeck on Nov 18, 2011 2:28 AM

    Hello Prince,
    Regarding issue2, this is not solved, How to handle the SQL error when update record?
    Now its going to SAP office and gives error. not showing error at same place.
    This is the standard behavior when an "update"(processed via an Update WP) fails.
    If you don't want this to happen you can opt for local updates(SET UPDATE TASK LOCAL). You would like to read the [behavior of messages in local updates|http://help.sap.com/abapdocu_702/en/abenabap_message_update.htm].
    BR,
    Suhas

  • 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

  • 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

  • Update Tasks remain in status = init / started forever. Doest not process

    Hello Everyone,
    We have the FM ME_DB_UPDATE_INFORECORDS called in update task from one of our program
       CALL FUNCTION 'ME_DB_UPDATE_INFORECORDS' IN UPDATE TASK
          EXPORTING
            i_changedocument = c_upd
          TABLES
            db_eina_u        = li_eina
            db_eine_u        = li_eine.
        COMMIT WORK.
    But all these calls does not process. it queues up in SM13 and uses up all update WP and affects the whole system.
    The update records in SM 13 stays with status init or started with the enqueue locks. This results in unresolved table locks on the EINA table.
    The concerned program generates multiple of these update requests with results in piling up of unprocessed such update requests.

    Hello,
    I only suggested SM12 because you said "I feel there is an enqueue problem".
    I would just look for any locks, if you can reproduce the problem. It depends on the ones your method uses.
    Can you tell if the method has been run successfully for those In Process steps? If so, you could try a Complete Manually.
    regards
    Rick Bakker
    hanabi technology

  • What is Update Task Capability of a Function Module

    Hi Folks,
    My client wants me to create a function module with Update Task Capability.
    Can you please know what is this and how to use this? I am completely new to this Update Task part. So please guide me accordingly.
    Thanks in advance,
    Siddarth

    Hi Sir,
    Please have a look below to understand update task capability of FM.
    Plz do reward if useful
    Thankx.
    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.
    The system logs your request and executes the function module when the next COMMIT WORK statement is reached. The parameter values used to execute the function module are those current at the time of the call.
    a = 1.
    CALL FUNCTION 'UPD_FM' IN UPDATE TASK EXPORTING PAR = A...
    a = 2.
    CALL FUNCTION 'UPD_FM' IN UPDATE TASK EXPORTING PAR = A...
    a = 3.
    COMMIT WORK.
    Here, the function module UPD_FM is performed twice in the update task: the first time, with value 1 in PAR, the second time with value 2 in PAR.
    Check the SAP Help :
    http://help.sap.com/saphelp_nw04s/helpdata/en/41/7af4bfa79e11d1950f0000e82de14a/frameset.htm

  • Run Time of update task function module

    Hi
    Any body please tell me how to find out the execution time for a update task function module with in a user exit.
    thanks in advance
    saravanan

    Vimal,
    if the INSERT tries to insert an existing key, check for sy-subrc = 4 in the function module, raise an error (duplicate key) and the iupdate process is aborted - you will get express message.
    It might be better to
    first lock the table
    then check the existence of key
    then call update function (update process will unlock).
    Regards,
    Clémens

  • Locking workstation during task sequence.

    Hello I have had trouble getting the workstation to acually lock during the task sequence. I have tried many different ways including putting the command in the task sequence or even running it form a command file. It appears to run but just doesn't lock the
    machine.
    Any ideas. Sorry about the code dump. Its a bit messy. BTW Z: drive is mapped
    Expand a string: WinPEandFullOS
    TSManager
    24/04/2014 10:05:09 AM
    2628 (0x0A44)
    Executing command line: smsswd.exe /run: Z:\Lock_Workstation.cmd
    TSManager
    24/04/2014 10:05:09 AM
    2628 (0x0A44)
    [ smsswd.exe ]
    InstallSoftware
    24/04/2014 10:05:10 AM
    2964 (0x0B94)
    PackageID = ''
    InstallSoftware
    24/04/2014 10:05:10 AM
    2964 (0x0B94)
    BaseVar = '', ContinueOnError=''
    InstallSoftware
    24/04/2014 10:05:10 AM
    2964 (0x0B94)
    ProgramName = 'Z:\Lock_Workstation.cmd'
    InstallSoftware
    24/04/2014 10:05:10 AM
    2964 (0x0B94)
    SwdAction = '0001'
    InstallSoftware
    24/04/2014 10:05:10 AM
    2964 (0x0B94)
    Working dir 'not set'
    InstallSoftware
    24/04/2014 10:05:10 AM
    2964 (0x0B94)
    Executing command line: Run command line
    InstallSoftware
    24/04/2014 10:05:10 AM
    2964 (0x0B94)
    InstallSoftware
    24/04/2014 10:05:10 AM
    2964 (0x0B94)
    C:\Windows\system32>C:\Windows\system32\rundll32.exe
    user32.dll,LockWorkStationInstallSoftware
    24/04/2014 10:05:10 AM
    2964 (0x0B94)
    Process completed with exit code 0
    InstallSoftware
    24/04/2014 10:05:10 AM
    2964 (0x0B94)
    Command line returned 0
    InstallSoftware
    24/04/2014 10:05:10 AM
    2964 (0x0B94)
    Process completed with exit code 0
    TSManager
    24/04/2014 10:05:10 AM
    2628 (0x0A44)
    TSManager
    24/04/2014 10:05:10 AM
    2628 (0x0A44)
    Successfully completed the action (Lock Workstation) with the exit win32 code 0
    TSManager
    24/04/2014 10:05:10 AM
    2628 (0x0A44)
    Set authenticator in transport
    TSManager
    24/04/2014 10:05:10 AM
    2628 (0x0A44)
    Set a global environment variable _SMSTSLastActionRetCode=0
    TSManager
    24/04/2014 10:05:11 AM
    2628 (0x0A44)
    Set a global environment variable _SMSTSLastActionSucceeded=true
    TSManager
    24/04/2014 10:05:11 AM
    2628 (0x0A44)
    Clear local default environment
    TSManager
    24/04/2014 10:05:11 AM
    2628 (0x0A44)
    Updated security on object C:\_SMSTaskSequence.
     TSManager
    24/04/2014 10:05:11 AM
    2628 (0x0A44)
    Set a global environment variable _SMSTSNextInstructionPointer=3
    TSManager
    24/04/2014 10:05:11 AM
    2628 (0x0A44)
    Set a TS execution environment variable _SMSTSNextInstructionPointer=3
    TSManager
    24/04/2014 10:05:11 AM
    2628 (0x0A44)
    Set a global environment variable _SMSTSInstructionStackString=
    TSManager
    24/04/2014 10:05:11 AM
    2628 (0x0A44)
    Set a TS execution environment variable _SMSTSInstructionStackString=
    TSManager
    24/04/2014 10:05:11 AM
    2628 (0x0A44)
    Save the current environment block
    TSManager
    24/04/2014 10:05:11 AM
    2628 (0x0A44)
    ssfully completed the action (Lock Workstation) with the exit win32 code 0
    SCCM Deployment Technician

    Actually it didn't work see below
    Expand a string: WinPEandFullOS TSManager
    30/04/2014 11:33:35 AM 2472 (0x09A8)
    Executing command line: smsswd.exe /run: Z:\Lock_Workstation.cmd
    TSManager 30/04/2014 11:33:35 AM
    2472 (0x09A8)
    [ smsswd.exe ] InstallSoftware
    30/04/2014 11:33:35 AM 4580 (0x11E4)
    PackageID = '' InstallSoftware
    30/04/2014 11:33:35 AM 4580 (0x11E4)
    BaseVar = '', ContinueOnError='' InstallSoftware
    30/04/2014 11:33:35 AM 4580 (0x11E4)
    ProgramName = 'Z:\Lock_Workstation.cmd' InstallSoftware
    30/04/2014 11:33:35 AM 4580 (0x11E4)
    SwdAction = '0001' InstallSoftware
    30/04/2014 11:33:35 AM 4580 (0x11E4)
    Getting linked token InstallSoftware
    30/04/2014 11:33:35 AM 4580 (0x11E4)
    failed to get the linked token information. It may not be available. Error 1312
    InstallSoftware 30/04/2014 11:33:35 AM
    4580 (0x11E4)
    Working dir 'not set' InstallSoftware
    30/04/2014 11:33:36 AM 4580 (0x11E4)
    Executing command line: Run command line InstallSoftware
    30/04/2014 11:33:36 AM 4580 (0x11E4)
    InstallSoftware 30/04/2014 11:33:38 AM
    4580 (0x11E4)
    C:\Windows\system32>rundll32.exe user32.dll,LockWorkStation
    InstallSoftware 30/04/2014 11:33:38 AM
    4580 (0x11E4)
    Process completed with exit code 0 InstallSoftware
    30/04/2014 11:33:38 AM 4580 (0x11E4)
    Command line returned 0 InstallSoftware
    30/04/2014 11:33:38 AM 4580 (0x11E4)
    Process completed with exit code 0 TSManager
    30/04/2014 11:33:38 AM 2472 (0x09A8)
    SCCM Deployment Technician

  • How do I SUBMIT from a user exit which is called in an update task?

    I want to send an idoc each time there is a goods movement. So, in the user exit of MB_POST_DOCUMENT I am calling IDOC_OUTBOUND_WRITE_TO_DB. This creates an idoc of status 30. However, in order to send the idoc I want to SUBMIT RSEOUT00. I get an ABAP dump on the SUBMIT because MB_POST_DOCUMENT is called in the update task, where SUBMIT is not allowed. Do you know any other way I can execute RSEOUT00 at this moment without having to call it later in batch?
    Thanks!!
    Joy

    Hi Naren,
    Your reply is VERY helpful!! Thank you so much.
    I added  CALL FUNCTION 'RSAP_IDOC_EINBUCHEN_VOM_BIW_4' IN BACKGROUND TASK. I am no longer getting the dump, but my idoc is still a status 03 and not a status 30. Should I expect to see it turn to a status 30? I ran this function directly in SE37 -> Test with the same parameters and it ran perfectly and turned the idoc to a status 03. Is there anything else I need to do in the code?
    Thanks again,
    Joy

  • Running Function Module in Background with Update Task is not working

    Hello Friends,
    I have a "Z" Report Program where I am running this Report in Background using JOB_OPEN, JOB_SUBMIT, JOB_CLOSE. I am calling this in BADI.
    In this Report I am calling another Function Module PRICES_POST which is a standard Function Module and in this FM there is another FM 'CKML_UPDATE_MATERIAL_PRICE IN UPDATE TASK'. Now when I am running the BADI these values are not being updated.
    Friends I would like to know whether can we run Function Modules which are  included with UPDATE TASK as Background Job program?
    Kindly help me in providing your valuable suggestions in proceeding further.
    Thanks and Regards
    Pradeep Goli

    Usually the sequence of CALLs in your report should look like
      CALL FUNCTION 'CM_F_INITIALIZE'
        EXPORTING
          msg_on_screen = c_x.
      CALL FUNCTION 'CKMS_BUFFER_REFRESH_COMPLETE'.
      CALL FUNCTION 'PRICES_CHANGE'
        EXPORTING
          actual_bdatj = f_matpr-pp-bdatj
          actual_poper = f_matpr-pp-poper
          bukrs        = p_bukrs
          budat        = p_date
          xblnr        = p_xblnr
        TABLES
          t_matpr      = t_matpr.
      READ TABLE t_matpr WITH KEY pp-xerror = ' '
                                TRANSPORTING NO FIELDS.
      IF sy-subrc <> 0.
        MESSAGE i046(ckprch).
      ELSE.
        CALL FUNCTION 'PRICES_POST'
          EXPORTING
            i_bktxt    = p_bktxt
            bukrs      = p_bukrs
            lis_update = 'X'
          TABLES
            t_matpr    = t_matpr.
      ENDIF.
      COMMIT WORK.
    If you forget the COMMIT-WORK each and every FM called in UPDATE TASK will not be triggered.
    Regards,
    Raymond

  • 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

Maybe you are looking for

  • "Can't read or write to disk" error message

    hi... got my husband a 16g nano and i'm trying to sync his songs. i have the newest version of itunes installed. it put almost half of the songs on the nano and all of a sudden itunes has an error that says something about "can't write to nano. disk

  • My computer has a virus , is it safe to use iTunes?

    hello I want to do backup for my iPhone , but my computer has a virus ,is it safe to use iTunes or not ?

  • Should I invest in Toast for burning video?

    I have FCP Studio 7 and am wondering if I should invest in Toast Titanium Pro for better quality video. I currently burn DVD's in SD quality -using DVD Studio and they are shown on non-blu-ray DVD equipment. Since I shoot the footage in AVCHD I an al

  • System Discovery

    I'm seeing the following warning in the component "SMS_AD_SYSTEM_DISCOVERY_AGENT": Active Directory System Discovery Agent reported errors for 267 objects. DDRs were generated for 0 objects that had errors while reading non-critical properties. DDRs

  • Os x running very slow. Spinning beach ball happens often

    I dont know what happened latley here the last few days i cant do much of anything for long before i get the spinning beach ball. It drives me crazy because i am typing or doing something and i have to stop wait for it to go away then i can do someth