Deleting Locked Transactions from SM12 programmatically

HI,
If a user is editing a particular transaction(Service ticket ST) and in this process if the particular transactions hangs or if the user is not following the correct process, this particular transaction gets locked for that particular user.
Please suggest me which are the methods and function modules i can use to delete the entries in SM 12 programmatically.
Thanks in advance.
Warm Regards,
Mathew.

Hi Faisal,
Sry i am new to CRM. Will this code work in deleting the SM12 entries programmatically.
I need to delete the session lock for that particular user.
  DATA: W_GARG  TYPE EQEGRAARG.
  CLEAR: W_GARG, ENQ, ENQ[].
  CALL FUNCTION 'ENQUEUE_READ'
    EXPORTING
      GNAME                 = P_GNAME
      GUNAME                = P_GUNAME
    IMPORTING
      NUMBER                = P_NUMBER
      SUBRC                 = P_SUBRC
    TABLES
      ENQ                   = ENQ
    EXCEPTIONS
      COMMUNICATION_FAILURE = 1
      SYSTEM_FAILURE        = 2
      OTHERS                = 3.
  IF ENQ[] IS NOT INITIAL.
    CONCATENATE SY-MANDT P_WI_ID INTO W_GARG.
    DELETE ENQ WHERE GARG  W_GARG.
    CALL FUNCTION 'ENQUE_DELETE'
      EXPORTING
        CHECK_UPD_REQUESTS = '1'
      IMPORTING
        SUBRC              = P_SUBRC
      TABLES
        ENQ                = ENQ.
  ENDIF.
ENDFUNCTION.

Similar Messages

  • Copied role but want to delete a transaction from S_tcode

    Copied one of our roles to a new role.
    When I go to the new role and want to change authorization for s_tcode.
    I want to remove a transaction from s_tcode. I only have a display icon
    It will not let me delete transaction.
    How can I change display icon to change
    Any suggestions on what I'm doing wrong
    Thanks
    Joe

    you should ask your question in the SECURITY forum to get a better answer.
    please check Security

  • Deleting unused transactions from roles

    I am planning for unused transaction cleanup activity for SAP roles as mentioned below.
    There are lot of roles which are copied from SAP menu due to which they consist of around 1000 transactions. Now I know there will be around 50 transactions which might be used and rest of them not used at all.  I have made the strategy to find all the transactions which are not used during the last 3 months(using ST03N) and than consult the list with the role owners and delete the unused transactions.
    I would like to know whether this is the correct strategy to follow, will the ST03N data-> transactional profile provides the relevant data to sort out the transactions not used in last 3 months.  Please suggest or any alternative strategy can be followed. I know about sm19 audit log, but the problem is that it cannot be activated for all the users due to file space and performance issues.
    Regards,
    Sanjay

    There are lot of roles which are copied from SAP menu due to which they consist of around 1000 transactions.
    I am tempted to move this to the Test&Playground forum, because that is what building authorization roles from SAP Menü navigation nodes is.
    If course if you do not care and it is better than manual profiles then it is not all bad, so I will leave it here in the security forum fir now.
    From my side, if you have no clue... then go for the SAP standard roles and copy them into your own namepsace and work from there to start with. Check the objects included against audit check lists as step two. Take a closer look when you have a chance as step three (there are many manual auths in there...). You will be better off this ways than inventing roles of your own without any tcode or blue-print infos.
    I would however still not call it "best practice" and it will backfire over time, but it can be done in a few days (so that you can get your bones out of the project and onto the next one without learning about the pain-points).
    Eventually you become a professional bull-*******...
    Cheers,
    Julius

  • Locking transaction from modifying table

    Hi All,
    We have a transaction. This transaction is used to modify the data in certain tables. Currently multiple users can open the transaction in 'Change Mode'. We have to put a lock if one 'Change Mode' is open for transaction, it should say other new users that they can't modify it and open in display mode.
    We thought of following strategy:
    1. Create lock object for each corresponding to each table.
    2. Call Enqueue Function Modules in PBO of different screens used in transaction.
    Now problem is that once user is leaving the transaction he/she should dequeue it. We can do it by calling Dequeue FMs corresponding to 'BACK/EXIT/CANCEL' buttons. But can't think how to handle the scenario if user presses '/n'.
    You can also suggest any other way of handling the issue as well.
    Regards,
    Ashwini

    Hi,
    The locks releases are dependent on the scope parmeter which you are passing ot the ENQUEUE_FUNCTION module.
    There are this parameter can have 3 values 1,2,3.
    We need to pass correct value depending on your requirement.
    If you are updating all the tables in the same program which you are using to displaying the transaction go for scope parameter 1. So the lock will get released automatically when you end the transaction.
    If you use some function module at update task then use the scope parameter 2. In such case you need to end it after updation using DEQUQE_<lock object> FM.
    Generally locks will get released once the transaction got ended by /n. You can check that in T code SM12. after coming out of transaction. No need of Dequeue FM in such case.
    Thanks
    Kiran.
    Edited by: kiran Pasala on Jun 26, 2009 3:36 PM
    Edited by: kiran Pasala on Jun 26, 2009 3:38 PM

  • Delete locked file from /Applications folder

    Hi there
    I used Clean My Mac to remove a file install - something I have done many times without any problems.
    This time though the application file was left behind in the /Applications folder and I am unable to move it to the Trash because it is locked.
    I have tried the following
    sudo chflags nouchg /Applications/CrashPlan.app
    This however does not resolve the issue and I am still unable to move the file to Trash - it does not remove the locked flag
    Does anyone have any other ideas or suggestions how to remove the file?

    Hi WIlliam
    I tried what you said but I get an unexpected result...
    Johns-Mac-Pro:~ John$ sudo rm -r /Applications/CrashPlan.app
    Password:
    rm: /Applications/CrashPlan.app/Contents: Operation not permitted
    override rwxrwxr-x  root/admin schg for /Applications/CrashPlan.app?
    I'm not sure how to respond to the question it is asking. I tried keying in Y but the response was
    override rwxrwxr-x  root/admin schg for /Applications/CrashPlan.app? y
    rm: /Applications/CrashPlan.app: Operation not permitted
    Johns-Mac-Pro:~ John$

  • I Need To Delete All Transactions and Balances From all Modules

    I Need To delete All Transactions From All Financial Modules (AP,Ar,Gl,Cm and FA)
    payables ( Delete All Invoices and Payment that validated and create accounting )
    Receivables ( Delete All Transactions and Receipts that completed and create accounting )
    Assets ( Delete All Asset Depreciation Amount )
    General Ledger ( Delete All Journals That Posted In General Ledger )
    I Need To Make This To Delete Any transaction Or Balances And Uploading Anew Balances and Journals
    Can I Make This By Purge and How Can I Do it ? Or any another Way ?
    Thanks,
    Mohamed Gamal
    Edited by: Mohamed Gamal on Sep 5, 2011 2:27 PM
    Edited by: Mohamed Gamal on Sep 5, 2011 2:28 PM

    Hello Mohamed.
    Each Application User's Guide (for AP, AR, GL, CM and FA) has a section dedicated to Archive and Purge process.
    Depending on the quantity of records you need to process perhaps you should consider other options like creating new organization(s), books, etc. and create only the desired open items in there.
    Octavio

  • Problem in deleting a request from Dso

    Hi Experts,
    I have loaded the request into DSO, after activation, i have changed the QM status to red and try to delete it from the manage screen. But it is not getting deleted from DSO.
    I have used following tables :
    RSREQDONE
    RSICCONNT
    RSODSACTREQ
    For deletion purpose, but i'm not provided with authorization ..
    And also i have used FM to delete the request from DSO , but it also failed ..
    Can you please help me out in this regard..
    Thanks
    PT

    Hi,
          Please check if your DSO is locked by any other process.  You can check the lock status from SM12. If your DSO is locked by some other process, you will have to wait till that process finishes or kill the process if it is not required so that your DSO will be unlocked. Once your DSO is unlocked you can retry activation. If this doesn't work, please check if you have the authorization to delete data. after trying to delete the DSO you can run the transaction SU53 to see if there is any authorization failure.
    Hope this helps you.
    Thanks,
    Nithin Reddy.

  • Deleting Failed Transactions in SAP B1if

    How can I delete transactions which have "failed" in processing through B1if?
    I attempted to delete one of the groups in the Unit of Measurement Groups which was already assigned to items in the B1 application.  This "error" then attempts to replicate to the other databases participating in the Intercompany Integration Solution (IIS).  Every time a new attempt is made ("error retry"), the transaction fails and generates a failure alert message. 
    I know that I can set the B1if to "never attempt to retry errors", but I would like to delete the message from the queue so that I can leave the retry setting at "retry errors every two hours". 
    I have tried to delete this failed transaction from the B1if queue without any luck thus far.  Does anybody know how to delete failed messages from the queue so that they will not attempt a "retry" and thus generate new failed alert message?

    Hi Jerry,
    You may delete transactions using Intercompany Integration Solution Message Log. The Message Log is a Web application that enables you to view log of Interbranch transactions. You can filter transaction logs by date and time ranges, sender system, or receiver system.
    You can access the message log Web application from the machine on which the Intercompany solution is installed, and by using Microsoft Internet Explorer.
    To delete the transaction from message queue you may follow the steps below on machine on which the Intercompany solution is installed:
    1. Open Start menu and choose Intercompany Administration Console icon.
        Logon Window appears.
    2. Enter your login credentials and Logon.
        Intercompany Administration Console appears.
    3. Navigate to Monitoring → Message Log, open the Message Log web application.
        On Message page, the upper frame of the window allows you to define a filter for the messages.
    4. Enter From date and To date in the respective filters, in Status dropdown menu select Failure and choose Display log.
        In Failure matrix, failed message that confine within above defined filters appears.
    5. Choose Delete Log.
        This deletes the log entries.
    For further details, you may also refer to Message Log section in Intercompany Solution User Guide.
    Regards,
    Agneesh Jain
    SAP Intercompany Team

  • HT2674 I have an iMac purchased in May 2011.  OSX Lion 10.7.3.  I deleted backup file from the external hard drive. Now, the trash can will not empty some of the files deleted.  File folder: "Core Services" contains a locked file: "boot.efi".  It will not

    I have an iMac purchased in May 2011.  OSX Lion 10.7.3.  I deleted backup file from the external hard drive which operates from Time Machine.
    Now, the trash can will not empty some of the files deleted from the backup harddrive.
    The trash contains-- File folder: "Core Services" which contains a locked file: "boot.efi". 
    It will not delete.
    How do I get the trash can empty of these files?

    Yes, the Old Master file has a folder for each year where I find all photos from that specific year. I am attaching a screen shot of the file.
    In the meantime i have managed to download all photos (it did not download any video files though in mpg, avi, 3gp, m4v,mp4 and mov format) to a new iphoto library. Unfortunately the photos are quite mixed and often doubled up. I ma considering to purchase iphoto library which checks all duplicates in iphoto. this will save me a lot of time. What do you think?

  • I want to delete the transactional record from database table

    Hai,
    I want to delete the transactional data from database table with out using the dialog programming is it there any trancation for this.
    for master data we have the transaction code for delete the records. The t.code is 'OBR2'.
    Plz help in that cse.
    Thanks and regards,
    P.Naganjana Reddy

    Hai,
    Plz help me urgent.
    I am asking i want to delete transactional data from database table without using the dialog programming.
    Thanks and Regards,
    P.Naganjana

  • I successfully deleted a user from my MacBook through the Users and Groups window in System Preferences.  But now I cannot close the lock in the bottom left corner of the box.  When I click on it, I briefly see a word that I think says "reauthorizing" but

    I successfully deleted a user from my MacBook through the Users and Groups window in System Preferences.  But now I cannot close the lock in the bottom left corner of the box.  When I click on it, I briefly see a word that I think says "reauthorizing" but the word flashes too quickly to tell for sure.

    If you are admin.
    Try restarting your Mac.

  • MM17 Delete a Field from this Transaction

    Hi,
      Could someone tell me how to delete a field from the MM17 transaction code.
       Please let me know if this is feasible.
    Thanks & Regards,
    YJR.
    Message was edited by:
            YJR

    Hello,
    I think it is not possible to delete fields or add tables in MM17.
    Vasanth

  • Why can't I delete mp3 files from my Trash?  They are not locked.

    Why can't I delete mp3 files from my Trash? They are not locked.  I compressed them into a zip file and then couldn't delete that file either.  I've restored them and tried deleting again but no luck.  Can anybody please help?  iOS 10.8.5

    You can't empty the Trash or move a file to the Trash
    Visit The XLab FAQs and read the FAQ on solving Trash issues. You can also try using Trash It! 5.1 to fix the problem. Or you can try this:
    Open the Terminal in the Utilities folder and paste the following at the prompt:
         sudo rm -Rf ~/.Trash/*
    Press RETURN. Enter your admin password when prompted. It will not echo to the screen. Press RETURN again.

  • Deleting user from OF programmatically

    Hi,
    We have written code to add/remove users in the OID.
    Deleting in OID works fine but the user remains in OF.
    Is there configuration setting to cascade the deletion request to Oracle Files?
    Is there away to programmatically delete the user from Oracle files?
    Thanks in Advance

    The agent is configured to 1 minute. Appears to work fine for adding users.
    The user deletes successfully in OID. We can see the user has been deleted in OID via the OF user page (icon) .
    If you now recreate the same username (day later) and try to log in, you will get "An Unexpected Error has occurred. Please report it with as much detail as possible. Please include a description of the operation you were performing and the steps to recreate it." screen.
    Currently it appears that deleting a user is a two step process delete the user in the OiD and then we must manually delete them from the list in OF as well.
    Is this a simple configuration setting that needs to be changed.
    We have scripted the add/delete of users. So we need to be able to do this programmatically.

  • Programmatically adding/deleting users to/from portal groups

    I am using the following PDK api, to delete an user from a portal group (otp_sales).
    I get the following error which doestn make sense. I tested the following api from a
    script shown below. In my application, this gets called from a trigger, and fails
    because it sees a ROLLBACK getting used in the API.
    <<<<<<<<<<<<< delete_from_group.sql >>>>>>>>>>>>>>>>>>>>>>
    DECLARE
    BEGIN
    moc.wwsec_api.delete_user_from_list (p_group_id
    =>MOC.wwsec_API.GROUP_ID('OTP_SALES')
    ,p_member_person_id =>73);
    END;
    <<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    SQL> @delete_from_group.sql
    Input truncated to 1 characters
    DECLARE
    ERROR at line 1:
    ORA-01086: savepoint 'DELETEUSERFROMLIST_SAVEPOINT' never established
    ORA-06512: at "MOC.WWSEC_API", line 2467
    ORA-06510: PL/SQL: unhandled user-defined exception
    ORA-06512: at "MOC.WWCTX_SSO", line 849
    ORA-06510: PL/SQL: unhandled user-defined exception
    ORA-06512: at "MOC.WWCTX_SSO", line 669
    ORA-06502: PL/SQL: numeric or value error
    ORA-06512: at line 3
    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    Thanks
    regards
    -Ananth

    We had the same problem and it turned out that deleting a portal user(delete_portal_user), removing a portal user from a list (delete_user_from_list) or updating a portal user, the "savepoint xxxx never established message" came up when there was no context set. If the procedure is called from within a portal page (or as user portal30) ,and the context is set and it works. The solution is to check to see if the context was set, and then set it if not.
    if not portal30.wwctx_api_private.is_context_set then
    portal30.wwctx_api_private.set_context(p_user_name => 'portal30');
    end if;
    Hope this helps
    Tania

Maybe you are looking for

  • HT1725 How do I re activate my security questions

    How do I re activate my security questions

  • Crop Tool Confusion When Used to Change the Dimensions (but not the resolution) of an Image

    Picture this.  You have a real photograph in front of you.  Its dimensions are 7x5 inches, and you want to cut out of that photograph, a 4x4” square.  You’re not bothered by the rest of the photograph, you’ll discard that, so you mark your 4” square

  • Converting a date

    Hi, My process text using select ........ from....... into........ where I am able to use an NVL on a string in my select clause however I'm not too sure as to what i can use for a date to return 'None' if nothing is found in the tables. To char will

  • Programming an MS Excel button to execute a Refresh/Retrieve or Submit Data

    Hello, I wanted to find out if I can program an MS Excel macro button to perform a refresh/retrieve and or a SubmitData function in SmartView? I did it before in an earlier version of Essbase but, SmartView is unique. Please advise if anyone can assi

  • Adobe director 12 bug

    hi i have adobe director 12 i want to play webcam Through swf flash file i create flash file to open my webcam and import it to director in the flash sprite property i checked DTS play the movie to test a popup settingsPanel window display but cannot