Locking Ztransaction

Hi Experts,
   i want to lock the ztransaction in change mode.i searched in sdn i came to know by using lock object i can lock it.i understood how to create lock object.which is generating two function modules.my question is how to use this function modules in my program..
i want to set lock object for creation and change mode both.because while creation the number will generate automatically.so i want to lock this also..please provide me the sample coding of any program
please do needful as soon as possible.
Thx.

Hi,
Incase you want to lock the table during update then before the update step call the enqueue FM and after the update step call the dequeue FM.
As an example you can see this.
  call function 'ENQUEUE_E_TABLE'
       exporting
            tabname        = ld_tabname
            varkey         = ld_varkey
       exceptions
            foreign_lock   = 1
            system_failure = 2
            others         = 3.
Do the update operation on the table and then dequeue.
  call function 'DEQUEUE_E_TABLE'
       exporting
            tabname = ld_tabname
            varkey  = ld_varkey
       exceptions
            others  = 1.
  if sy-subrc ne 0.
    message id     sy-msgid
            type   'I'
            number sy-msgno
            with   sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  endif.
The varkey contains the value of the key fields concatenate together so as to lock the particular record.
If you specify an incomplete key then several records will be locked.
Regards,
Ankur Parab
Edited by: Ankur Parab on Aug 20, 2009 3:44 PM

Similar Messages

  • How to set lock to ztransaction?

    Hi,
    I have one ztransaction how we can set lock at transaction level?
    is it possible ?
    please show me the way for this ..
    Thanks in advance.

    Hi,
    Try
      data: srtfd(22).
      srtfd = sy-repid.
      CALL FUNCTION 'ENQUEUE_ESINDX'
        EXPORTING
          RELID = 'ZZ'
          SRTFD = srtfd
          SRTF2 = 0
        EXCEPTIONS
          FOREIGN_LOCK = 1
          SYSTEM_FAILURE = 2.
      IF SY-SUBRC NE 0.
        message e398(00) with 'ERROR:' sy-repid 'is already running by user' sy-uname.
        EXIT.
      ENDIF.
    Regards,
    Pole

  • Lock change of  ztransaction while using in migo

    hi all,
    in general how do we stop change of a document while it is edited in other transaction .
    Ex : if  PO number is in use while doing MIGO it will stop us editing in ME22n.
    i have a similar requirement , we have a modulepool program ZMRN_CREATE, ZMRN_CHANGE jst like ME21n ME22n .
    the number generated here  is used in MIGO , how can i stop editing or change of MRN number while it is in use in MIGO screen.
    Thanks in advance...Pl help in this regard...
    Deepak.

    Hi Deepak ,
    Use this report in your program to lock and unlock your tcode in the background.
    use SUBMIT statement in your current module pool.
    REPORT Z_LOCK_UNLOCK_TRANSACTIONS
    LINE-SIZE 80
    MESSAGE-ID 00.
    * Program to lock and unlock transactions
    * Suvendu Swain
    TABLES: TSTC.
    DATA: LOCK_TEXT(30).
    *SELECTION-SCREEN begin.
    SELECT-OPTIONS: S_TCODE FOR TSTC-TCODE OBLIGATORY NO INTERVALS.
    PARAMETERS: P_LOCK RADIOBUTTON GROUP A,
    P_UNLOCK RADIOBUTTON GROUP A DEFAULT 'X'.
    AUTHORITY-CHECK OBJECT 'S_TCODE'
    ID 'TCD' FIELD 'SM01'.
    IF SY-SUBRC NE 0.
    MESSAGE E172 WITH TEXT-010.
    STOP.
    ENDIF.
    IF P_LOCK &H3D 'X'.
    LOCK_TEXT &H3D TEXT-008.
    ELSE.
    LOCK_TEXT &H3D TEXT-009.
    ENDIF.
    LOOP AT S_TCODE.
    CALL FUNCTION 'Z_LOCK_UNLOCK_TRANSACTIONS'
    EXPORTING
    TCODE &H3D S_TCODE-LOW
    LOCK &H3D P_LOCK
    UNLOCK &H3D P_UNLOCK
    EXCEPTIONS
    FAIL_TO_LOCK &H3D 1
    FAIL_TO_UNLOCK &H3D 2
    INVALID_TCODE &H3D 3
    INVALID_OPTIONS &H3D 4
    TRANSACTION_ALREADY_LOCKED &H3D 5
    TRANSACTION_ALREADY_UNLOCKED &H3D 6
    OTHERS &H3D 7.
    CASE SY-SUBRC.
    WHEN 0.
    WRITE:/ TEXT-001, S_TCODE-LOW, LOCK_TEXT.
    WHEN 1.
    WRITE:/ TEXT-002, S_TCODE-LOW.
    WHEN 2.
    WRITE:/ TEXT-003, S_TCODE-LOW.
    WHEN 3.
    WRITE:/ TEXT-004, S_TCODE-LOW.
    WHEN 4.
    WRITE:/ TEXT-005, S_TCODE-LOW.
    WHEN 5.
    WRITE:/ TEXT-006, S_TCODE-LOW.
    WHEN 6.
    WRITE:/ TEXT-007, S_TCODE-LOW.
    ENDCASE.
    ENDLOOP.
    hope this will solve your problem.
    cheers,
    Suvendu
    Edited by: Suvendu Swain on May 10, 2009 10:27 AM

  • MSI Forum Lock Ups

    Hey guys wondering where i have been the last couple of days??...no, you guessed wrong i was not with my girlfriend (well at least no during daytime :D )
    I was trying to LOGIN IN THE F*****G FORUM :O  ?(
    Markoul
    p.s. At least it seems now we are going to have Avatars and also we have got the old forum back  :P

    Hi,
    First of all thanks to all for the help, and CJLittle...LMAO !  My car is a Scooby and a nice blue paint job !  Believe it or not they assured me all this would work.. I bought it in one package and even questioned it.  Also to be fair up until then they had always been very good... shows they have no zero about 3200XP 200 fsbetc...  When I went back with the power supply and told them they changed it out and let me off on the extra money it should have been.
    The crashes are as follows :-
    [list=1]
    Locks up after random amounts of time in games, sometimes dont even get to load it up at all, other times I can play 2 hours.  When the games lock up usually there is a high pitch squeal and can only get out of it by reset or power off.
    I cannot install Zone Alarm Pro or Agnitum Outpost are 2 anyway (there are others) these just come up with the installer screen and hangs there, I have to go to Task Manager to close them down, unlike the lock up in games.
    The cooler is the Coolermaster Jet... and the temperature is more than acceptable (right now is 44 C) so I cannot see that at all being a factor.
    leds are on on the d bracket when it locks, I did not know of this function and will check it out. Thanks for that tip.[/list=1]
    Question from me: would the 2700 RAM cause these lockups ?  I would have thought it would just not work at all ?  If this is possible then I will go and change out the RAM as tuning it down to 166 (if it is possible) does not appeal to me !  But yes it may show what the problem is.
    Thanks again, will see what happens...

  • Bit locker Mutliple Drives Mutliple OS's

    I have a laptop with two hard drive in it.  The primary has Windows 7 Enterprise and is a member of the corporate domain.  The secondary has Server 2008 R2 and is a member of the lab domain.  There is no trust or association between domain. 
    The laptop does the Windows multi-boot off the primary drive.  I want to enable bit locker to secure the drives.
    If the two windows environments were exclusively separate, setting up bit locker on each drive independently would be pretty straight forward, but when I'm in one OS, I will frequently need to get files and data from the other drive (and no, making each
    drive big enough to hold all it's own data is not an option, plus the synchronization headache).  Both drives will need to be bit locked to their respective OS, but the other drive will need to be accessible.
    And not to make things too easy, the secondary drive, which i put in an optical drive bay carrier, routinely gets pulled (not while the system is running, of course) out and popped into a USB case to be used as a library transfer drive. 
    So....
    the Windows 7 drive needs to be natively bit locked.  and be accessible when running Windows 2008 from the second drive.
    the Windows 2008 R2 drive needs to be natively bit locked, and be accessible when running Windows 7 from the first drive, and be accessible when run as a stand-alone USB drive on another system.
    I would appreciate any wisdom you can share to make this all work.  And please presume that i know next to nothing about installing and running bit locker, because that's pretty much true.
    Let me know if you need more information about my configuration.
    Thanks

    Hi,
    "and be accessible when run as a stand-alone USB drive on another system."
    Firstly, if you enable bitlocker for one drive, it will be encrypted always until you decrypt it. Thus after you insert it to any system, it need to enter the credential to access it.
    And then, if you want to access one drive in another computer, you need to get the shared permission. After you' re granted the sufficient permission, you could access it no matter if it's encrypted. Of course, another computer must be started.
    Karen Hu
    TechNet Community Support

  • FORMAT WINDOWS 7(64) BY MISTAKEN NOW HOW I RECOVER ERASED DATA WHICH I HAD LOCKED DRIVE BY BIT LOCKER

    i'm using windows 7 (64 bit) but experiment to install mac on my PC (i 5-4 GB ddr 3-500sata sea gate).by mistaken its format my whole hard drive which is 500 GB sea gate sata.after this i'm confused and install windows 8.1 and then again i had install windows
    7 (64 bit) now after 2 time partition erased i'm trying to recover my data 50 percent data but which drive i had locked with windows 7 bit locker it cant recover any thing I've remember its password.
    any one help me to get back my data from this locked drive ?
      

    RB
    If the drive was both formatted and bit locked you cannot recover your data.
    Wanikiya and Dyami--Team Zigzag

  • USB 6009 lock-ups?

    Hello,
    I'm having a strange problem with my newly aquired USB 6009. I've written an app to read the temperature from a temperature controller using the 6009 and that all works fine. However, the problem comes when I port this code into another application. The code is intended to run in a parallel loop to the main execution loop, to continuously read the temperature whilst other data is captured and process (all done in the main loop). Both applications run quite happily when separate. When I bring them together the applications sometimes, but not all the time, refuse to quit and just lock up. I have no idea what is happening as it is not a case of one loop remaining running (I've tried separate stop buttons) and they will run together quite happily. The problem only comes when I hit the button that terminates the main loop (this also triggers the other loop to stop - I'm sure this bit works as I've used the same method in another vi).
    The main loop should, in theory, just close. The loop with the USB reads (using DAQmx Base) will stop and then clear the task (DAQmx Base Clear I think). Sometimes the DAQmx Base Clear runs and the program stops fine, other times it runs and the program locks, other times it locks as soon as I hit the quit button.
    Any thoughts as I'm completely stumped on this one? Like I say, apart from the one button triggering both loops to terminate there is no link between the two loops.
    My only thought is it could be a USB issue as the PC also has a USB keyboard and mouse. I know from my home experience, when for instance plugging in my camera, it can cause the USB to lock if, say, my USB modem is running.

    See the thread
    http://forums.ni.com/ni/board/message?board.id=250&message.id=13722
    John Weeks
    WaveMetrics, Inc.
    Phone (503) 620-3001
    Fax (503) 620-6754
    www.wavemetrics.com

  • Hot Synch Lock-Ups

    I have a Palm Z22, when I hotsynch with outlook, all goes just fine untill I reach expenses, then it locks up on CitiesDb.  It used to lock up on a different Db.   Why is this, can I skip it, how can I make it stop.  I have to end the task on the PC and reset the handheld everytime (Lucklily it is after it is giving me what I need with Synching calendar, tasks, and contacts
    Post relates to: Palm Z22

    scooter_95126, please don't double-post the same message.  I've combined both posts into one here.
    Thanks!
    WyreNut
    Post relates to: Centro (AT&T)
    I am a Volunteer here, not employed by HP.
    You too can become an HP Expert! Details HERE!
    If my post has helped you, click the Kudos Thumbs up!
    If it solved your issue, Click the "Accept as Solution" button so others can benefit from the question you asked!

  • K9N Platinum lock ups

    Hi Guys, I am building a new pc and I am having lots of problems.  The main one being the pc will lock up after a few mins of being on.  I have read it could be a memory problem, but I am not sure. 
    The System is....
    CPU: AMD X2 Dual Core AM2 Athlon 64 3800
    Ram: OCZ 1GB Kit (2x512MB) 240Pin PC2-6400 800MHz Dual Channel GX XTC Gold
    Power supply: Enermax 535Watt Power Supply ATX12V & EPS12V for EEB, CEB 
    Video Card: XFX 7900GT PCI-E 256MB DDR3 DUAL DVI
    and the K9N motherboard. 
    Is the Ram an issue?  Would I be better off exchanging the ram for something else?  Could anyone reccomend ram that will work with this board?
    Thanks a lot for your help guys.
     

    Thanks for the suggestion, unfortunately I have just tried that but its still locking up.
    I have had a look in the bios to set all the memory settings manually, though I am not sure what I set to what.  Apparently the corsair ram has 5-5-5-15 timings but I do not know what these relate to in the bios. 
    I guess the CAS#Latency(TCL) should be set to 5 then I'm not sure what to do.  The options I have are
    Min RAS# Active Time(TRAS)    With the option of 5CLK to 18 CLK (This is set to 15 as mentioned above by Kakarocht)
    RAS# Percharge Time(TRP)      With the option of 3CLK to 6CLK (I guess this is one I should set to 5, currently at Auto)
    RAS#to CAS#Delay(TRCD)       With the option of 3CLK to 6CLK (I guess this is one I should set to 5, currently at Auto)
    ROW to ROW Delay(TRRD)       With the option of 2T to 5T (I guess this is one I should set to 5, currently at Auto)
    ROW Cycle Time(TRC)             With the option of 11T to 24T (Currently set at Auto)
    There is also
    Bank interleaving  which is enabled
    CMD-ADDR Timing Mode which is set to 2T
    Software Memory Hole which is Enabled
    Sorry to be a pain and keep asking all these questions, but this is really confusing me.
    Thanks yet again

  • USB CAUSING LOCK-UPS

    Hi,
      30-40% of the time when I use my front usb it will cause Win XP to lock up and I have to hit the reset button.  Has anyone else experienced this and also any remedies?  It happens with my scanner, gamepad and ipaq.  Setup=Win XP prof w/ service pack 1, KT3ultra2, AMD 1600xp, power supply is 400 watts.  
    Thanx

    Hi Maesus,
      I have AMI bios version 3.31a.  I can't find the usb version on XP (I only know how to get to it on Win 98SE).  It's the one that came with Win XP.  If it matters, the VIA driver I'm using is v4.42.  Lastly the USB connectors are the ones built into the front panel of my case.  I wired it up according to the manual.  
      Again, the unusual thing is when it doesn't lock-up everything works fine.
    Thanx again for your help

  • Pages '08 lock ups

    A couple months ago, I started having issues with Pages '08. It would lock up while I was typing, or even something as simple as scrolling the page down. All I would get was the little rainbow wheel and a locked up document. At first I thought it was just the one file I was working on, but now it happens all the time. It locks up so bad sometimes that it forces a restart of the computer. No other programs are having this issue. Should i just reinstall Pages '08 from the disc or what. Cause this has made my main wordprocessing program completely useless. I'm on Mac OSX 10.5.8

    Update:
    Well I think I got it figured out. For some reason, the spell checker was causing the problem. I've always had it set to "Check spelling as you type", but for some reason that is now causing Pages to lock up. So my work around is to simply turn off the "Check Spelling as you type" option, and now there are no more lock ups.

  • WAP321 intermittent lock-ups

    Have been trying to work through an ongoing lock-up issue on a pair fo WAP321's.  Have read many of the prior threads and have tried to get some feedback from data from either the switch or the AP's to help figure out where the problem may be, but am at a loss.
    Set-up:
    - 2 x WAP321 running v1.0.2.3 connected to a Cisco 2960S-24PS-L (PoE)
    - 2 SSID's each on a different VLAN, both VLANs are tagged.
    - WAP's are no longer clustered.
    Problem:
    Everyday, anywhere from 4-12hrs, the AP's crash.   They either reboot successfully or lock-up 50% of the time.  In a lock-up, the ethernet ports on the 2960 show a device phsyically connected and powered-up there is no layer 2 nor 3 activity (i.e. the AP's are completely unresponsive).  And there are no PoE events at the time of the crash/reboot.
    The AP's are remote to me and the location is not in use everyday so I have not been able to determine if both AP lock-up everytime at exactly the same time but from the past 24hrs of continuous monitoring (pings) they tend to crash within 30min of each other, but not at the exact same time.   They are no longer clustered as I initally thought that might have been the issue.
    AP use is quite light and they lock-up at anytime of the day (i.e. not just during business hours)
    The problem is resolved by rebooting the AP's by shut/no shutting their respective PoE ports.  They are ceiling mounted and there is no way for staff onsite to have a look at them to see what lights are on or off.
    I have not reset the units to factory defaults and re-loaded the firmware.  This is something I would prefer to do onsite as just getting the two VLAN's into the units was a painful 2hr operation (VLAN settings wouldn't stick, couldn't make changes to the VLAN admin page no matter what browser or pc I used, had to reboot each time I made a change, sometimes it would save, sometimes it wouldn't, AP wouldn't accept a new VLAN, then it would etc etc...what should have taken 10 minutes took 2+ hrs.   Based on that experience alone I will never sell these again and will stick to the higher end Cisco WAPs that I'm used to).
    Beyond rebuilding these units and hoping that somehow magically fixes things has anyone encountered any issues with the WAP321's locking-up due to some kind of incompatibility at the network layer?   Or having them locking-up in general operation?  Any thoughts?  I wish I had error messages or log messages of some type to go on but there's ntohing unfortunately.
    Message was edited by: MICHAEL CORDIEZ

    Hi Michael, thank you for using our forum, my name is Johnnatan I am part of the Small business Support community. Thank you for all your specific detail about your issue, that was really clear to me, I will advise you install the last firmware 1.0.3.4, you can download it at link bellow:
    http://software.cisco.com/download/release.html?mdfid=284152656&softwareid=282463166&release=1.0.1.10
    Try to create a backup of your configuration and then upgrade the firmware, after that perform a factory reset and upload your configuration.Let me know if that worked for you.
    Greetings,
    Johnnatan Rodriguez Miranda.
    Cisco Network Support Engineer.
    “Please rate useful posts so other users can benefit from it”
    Greetings, 
    Johnnatan Rodriguez Miranda.
    Cisco Network Support Engineer.

  • K7N2 Delta lock ups

    Hi there,
    I've got a MSI k7N2 Delta sitting in my PC atm. But with a nasty problem. I have to keep the cpu sitting in it (AMD Barton 3000) underclocked for me to use my PC for more then 40 mins at a time. After that time, it just freezes, and the sound card (not system speaker) emits a nasty high pitched sound. Using a more intensive game, i.e. planetside speeds up the process, somethimes running for a mere 5 mins. To use the pc atm, the cpu is clocked at 1.4Ghz, instead of the over 2ghz it should be at.
    Any suggestions anyone?
    Specs:
    K7N2 Delta
    AMD Barton 3000+
    512Mb Kingston DDR (on compatibilty list)
    ATI Radeon 7500
    SB! 128
    Antec 400Watt PSU

    ok, after some more testing (man i love CS  ) it still locks up, but it took longer initially. It now just freezes, with no beeeep from the sound card. It may be temperature related though, as after the intial freeze, it will now only take a few minutes before it does it again. Straight after it freezes I'm getting temperature of around 50 on all monitors.
    Ill whip out that TV card and give it a whirl now
    p.s. case fans, i think one is in the wrong way, is the spinny side supposed to facing in the case, or out the case? cheers

  • Terca 9100 lock ups

    Hi!
    I recently got my hands on a second hand tecra 9100. I got it free since the previous owner complained about random lock ups or freezes. As i've testaed the laptop myself i experienced this aswell. It can freeze just about anytime but i've never had it running flawlessly for more than 20 minutes i recon. Sometimes it also refuses to start up. I do not know if this is a lock up in the initial startup sequence.
    Anyway it will lock up even in bios and i have dissassembled it and put it back together, replaced the RTC battery (with a non rechargable) and removed any hardware not crucial for useage (i.e WiFi card, extra RAm modules, modem card).
    I'm clueless, anyone got any idea of what to try next?
    Regards Simon

    I think you cant fix it by yourself
    In your case the ASP should check the notebook and if necessary replace the faulty part/device.

  • R835 P56X lock ups

    From day 1 (purchased a month ago) I'm still having lock ups with this laptop!  After few hours of use the screen goes black (sometimes blue), if I try to revive it the fan kicks in at full speed sounding like a leaf blower!
    I've reinstalled Win7 with the latest drivers, installed a new SSD instead of the HD and this problem keeps re-occuring randomly (daily)!
    I certainly would appreciate any ideas!

    I replaced my HDD with a OCZ Vertex 3 SSD for my R835-P56x.  It boot in seconds and runs nice and fast, but I get lock-ups and BSOD after several hours (as described above).  Not sure if it had the problem with the HDD, because I didnt use the PC very long before upgrading.  I am also running a 800MB Dataram RAM Disk (Version 3.5.130) for browser cache, which I suspect could be the culprit.   My bios is 3.90 (7/31/2012).
    Portege R835-P56x, i5 2410M, 16GB RAM, Vertex 3 SSD 240GB.

Maybe you are looking for

  • Standard input help in zreport selection screen

    Hi All,    I am having a selection sceen like S_PERNR FOR PA0001-PERNR.    when I put f4 help then it is comming right and showing the value   of personnel number which is correct.    But when you execute the transaction PA30 and select f4 help in pe

  • 7.0 Create forms based on Access data -David O'Hanlon are you there?

    Hi - Using a pdf created using LiveCycle 7.0<br /><br />I'm trying to create xFDFs using data from an Access database.  The xFDF should then be e-mailed to users who fill out the forms and return xml files by e-mail.  I then parse out the xml in to S

  • How can I set pdfs to open in a new tab instead of prompting firefox to open them in Adobe itself?

    I use a website with many links to pdfs. In Windows XP (probably an older version of firefox) I could right click on the link to open a new tab, and the pdf would open in the new tab. In Windows 7 (and updated firefox) when I right click to open a ne

  • How to open .msg attachments

    I upgraded recently Leopard 10.5.1. Previously I was working 10.4.10 so I do not have experience with Mail from 10.5.0. In Leopard Mail 3.1 (914/915) I am receiving some mails with files xyz.msg and abc.msg (example names) attached. Those files do no

  • 404 error when accessing json resources

    I have a node.js Web App in Azure, the site loads the index.html, the css, images, etc. but the JS search functionality doesn't initialize, I did an F12 inspection in Chrome and saw this error [domain].azurewebsites.net/data/policies.json Failed to l