Lock the plant so that other user cannot use the same plant.

Hi Gurus!
I ahve this small report which shows the pro-rate factor . In this report I need to block the plant or lock it(a soft) lock witha  message that some other user is using the plant so that other cannot use the same plant to post.Following is the report and if soemone can help me out would be very kind enough.I ahve added teh code where validation of plant is doen , so it must be somewhere here the locking should be done as per my thinking . Kindly suggest please.
*&      Form  get_pro_factor
*       get pro rate factor from the given
*       combination of plant/sloc/mat#/period
form get_pro_factor .
  select single zpr_factor zpr_disp_factor zpr_pipe_net zpr_pipe_gross
  from zprfactor
  into (zprfactor-zpr_factor, zprfactor-zpr_disp_factor,
        zprfactor-zpr_pipe_net, zprfactor-zpr_pipe_gross)
  where zpr_werks = p_werks    and
        zpr_lgort = p_lgort    and
        zpr_matnr = p_matnr    and
        zpr_mjahr = p_mjahr    and
        zpr_monat = p_monat.
  v_subrc = sy-subrc.
  if zprfactor-zpr_factor = 0.
    if c_wp = p_lgort+0(2).
      zprfactor-zpr_factor = 1. " Don C added this routine
    endif.
  endif.
  if zprfactor-zpr_disp_factor is initial.
    if not zprfactor-zpr_pipe_gross is initial.
      zprfactor-zpr_disp_factor = zprfactor-zpr_pipe_net / zprfactor-zpr_pipe_gross.
    endif.
    if zprfactor-zpr_disp_factor is initial.
      zprfactor-zpr_disp_factor = 1.
    endif.
  endif.
endform.                    " get_pro_factor
*&      Form  valid_plant
*       validate whether plant entered in selection screen
*       exists in database or not
form valid_plant .
  if not ( p_werks is initial and
             p_lgort is initial and
             p_matnr is initial and
             p_mjahr is initial and
             p_monat is initial ).
    select single werks from t001w into t001w-werks
           where werks = p_werks.
    if sy-subrc ne 0.
      message e048(zmm) with p_werks.
    endif.
  endif.
endform.                    " valid_plant
*&      Form  FIND_MATKL
form find_matkl .
  select single matkl into v_matkl from mara where matnr = p_matnr.
endform.                    " FIND_MATKL
*&      Form  UPDATE_ZPRFACTOR
form update_zprfactor using p_flag.                         "DEVK903224
  call function 'ENQUEUE_E_TABLEE'
    exporting
      mode_rstable   = c_e
      tabname        = 'ZPRFACTOR'
    exceptions
      foreign_lock   = 1
      system_failure = 2
      others         = 3.
  if sy-subrc <> 0.
    message id sy-msgid type sy-msgty number sy-msgno
            with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  else.
    select single * from zprfactor where zpr_werks = p_werks
                                   and   zpr_lgort = p_lgort
                                   and   zpr_matnr = p_matnr
                                   and   zpr_monat = p_monat
                                   and   zpr_mjahr = p_mjahr.
    if sy-subrc = 0.
      zprfactor-zpr_rate_flag = p_flag.                     "DEVK903224
      update zprfactor.
    endif.
  endif.
  call function 'DEQUEUE_E_TABLEE'
    exporting
      mode_rstable = c_e
      tabname      = 'ZPRFACTOR'.
Thanks
Aarav

call function 'ENQUEUE_E_TABLEE'
    exporting
      mode_rstable   = c_e
      tabname        = 'ZPRFACTOR'
    exceptions
      foreign_lock   = 1
      system_failure = 2
      others         = 3.
ENQUEUE_E_TABLEE   } E_TABLEE is the name of the lock object, it starts with character "E".

Similar Messages

  • Is it possible to hide a page in a Numbers spreadsheet so that other users cannot see it?

    I have a five page spreadsheet in Numbers that I share with key employees so that they can enter daily data; I would like to hide Sheet 3 of the spreadsheet as it has payroll information that ties in with the other sheets but that I do not want anyone to see or alter but me.  Is there any way to do this?

    Hi Emergin,
    You can make it difficult to snoop. Nothing will prevent a Numbers-savvy user from undoing these tricks.. However:
    Adding to SG's reply, create some dummy sheets (tabs) and drag the payroll info sheet tab to the right.
    Drag the payroll table a fair way down that sheet.
    Set the text colour to match the cell fill colour. The cells will appear to be blank.
    Set the Column width to a very small value.
    After you lock the table, cover it with a Rectangle Shape with a white fill and lock that. It will be invisible until someone clicks on it.
    Scroll up to the top of the sheet and insert a 'dummy' table.
    Go to the input sheet and save.
    Copy this reply and save it in your 'panic' drawer for when you forget what you did .
    Regards,
    Ian.

  • Problems installing update 11.1.4 please help I have tried all the fixes that other users have suggested with no joy

    Hi I am having problems with the latest update (11.1.4), I have unistalled and reinstalled that many times now I have lost count, I have also tried all the fixes that other users have suggested with no joy.
    What is this msvcr80.dll file that is missing, also after unistalling and rebooting computer I get another message that states icudt49.dll is missing. 
    Please help

    Oh, and I checked here http://support.apple.com/kb/HT3939 and you are correct!
    I do have an iPhone 3G not a 3GS.
    So does that mean that I cannot get any later software than iOS 4.2?

  • I'm having the same buffering issues that other users are having when I try to send a short video from my Iphone 4S to my Apple TV.  Has anyone heard back from Apple on this bug ?

    I'm having the same buffering issues that other users are having when I try to stream a short video from my Iphone 4S to my Apple TV
    Has anyone heard back from Apple on this bug ?

    Try the following steps, check whether things are working after each step where appropriate, before trying the next.
    Check AirPlay is turned on on the Apple TV (turn it off and on if it already is)
    Check that both devices are on the same network (Settings > Wifi, on the mobile device and Settings > General > Network, on the Apple TV).
    Restart the Apple TV (Settings > General > Restart).
    Restart the Apple TV by removing ALL the cables for 30 seconds.
    Restart your router. (Also try removing it’s power cord for at least 30 seconds)
    Restart your mobile device.

  • Hello. I don't live in the U.S. and I'd like to buy a new mini IPad retina. But I see it is offered with four mobile operators. Does that mean I cannot use another operator, in my country, with it?

    Hello. I don't live in the U.S. and I'd like to buy a new mini IPad retina. But I see it is offered with four mobile operators. Does that mean I cannot use another operator, in my country, with it?

    Hello. I don't live in the U.S. and I'd like to buy a new mini IPad retina. But I see it is offered with four mobile operators. Does that mean I cannot use another operator, in my country, with it?

  • Will apex_application.stop_apex_engine affect other users to use that APEX?

    Hi, guys:
    I wonder if I call apex_application.stop_apex_engine to execute wpg_docload.download_file in order to download RTF file, would it affect other users to use that APEX application at the same time? I checked the article and did experiment, I think it won't, but I still want to get your comments about it.
    http://www.talkapex.com/2011/12/apexapplicationstopapexengine.html
    APEX 4.1
    Oracle 11G R2
    appreciate your advice!
    Sam
    Edited by: lxiscas on May 17, 2013 9:34 AM
    Edited by: lxiscas on May 17, 2013 9:35 AM

    lxiscas wrote:
    Could you give me more detail about the affects on current session? as I found I have no problem to get to other pages through navigation, and I can still use the current page. The apex_application.stop_apex_engine is called at last in the procedure. and the procedure is called when user click one of two links.I think the API documentation and Martin's post fully cover the effects on the current "session" ("request" would be a more accurate term). Is there something specific that's bothering you?
    <tt>apex_application.stop_apex_engine</tt> does not exert any global control over APEX or the current session (see +{thread:id=2401000}+ for previous discussion on this). It simply stops further APEX page processing of the current request. This is necessary because you want to send the contents of a downloaded file, or redirect it to a new resource, not display an APEX page.

  • Can't connect to my itunes because the message states that another user is using my itunes when thi is not true.

    I can not connect to my itunes account because the message states that another user in using the account and this is not true.

    After a visit to the apple store, they were able to get through my pass code but unfortunately I found out that is was a problem with the logic board. Since Apple only wants to sell and not fix, I was able to locate an iphone repair near me that deals with logic boards and they are currently working on it right now. i should be getting it back soon. Im not sure if the problem you are experiencing is the same as i went through but it does sound like it may be also a hardware issue and would suggest searching online for an iphone repair place that can diagnose what exactly is wrong. Hope this helps.

  • TS1363 When I sync my ipod all goes well until I try to eject then it says that other systems are using files on the ipod. Nothing else is running and when I physically eject the ipod hasnt synched....ideas anyone?!

    When I sync my ipod all goes well until I try to eject then it says that other systems are using files on the ipod.
    Nothing else is running.
    The only way I can eject is to do so manually, when I do I then find the ipod hasnt synched.
    Any ideas?

    Here is what worked for me:
      My usb hub, being usb2, was too fast. I moved the wire to a usb port directory on my pc. That is a usb1 port which is slow enough to run your snyc.

  • How to find out, who locked the same row

    Dears,
    I have a problem,
    sometimes our user complain that, when he tyring to make a transaction to a specific customer's Account
    its says 'Some other user access the same account, keep trying...' (like this).
    and in this response I just kill that user's session. then he can make the transaction by reconnecting.
    sometimes my solution(killing the session) can not slove this problem.it stayed even 5/6 hours long.
    in this time,i cannot find any bloking session or such a long waiting session.
    In this Scenario..
    I need to find out who(SID,SERIAL#,USERNAME) locked the same ROW (not table).
    There are many users who are locking different rows of the same table at the
    same time. I need to find the one who locked my row.
    is it possible to find out, who locked the specific customer's Account ?
    I am trying to find out by the following query but failed.
    SELECT s.SID, serial#, machine, osuser, terminal, b.object_name,
    row_wait_obj#, row_wait_file#, row_wait_block#, row_wait_row#,
    DBMS_ROWID.rowid_create (1,
    row_wait_obj#,
    row_wait_file#,
    row_wait_block#,
    row_wait_row#
    ) rowidd
    FROM v$session s, dba_objects b
    WHERE s.row_wait_obj# = b.object_id
    SELECT *
    FROM (SELECT s.SID, serial#, machine, osuser, terminal, b.object_name,
    row_wait_obj#, row_wait_file#, row_wait_block#, row_wait_row#,
    DBMS_ROWID.rowid_create (1,
    row_wait_obj#,
    row_wait_file#,
    row_wait_block#,
    row_wait_row#
    ) rowidd
    FROM v$session s, dba_objects b
    WHERE s.row_wait_obj# = b.object_id)
    WHERE rowidd IN (SELECT ROWID
    FROM account_mas
    WHERE branch = '999' AND accout_no = '009990215454')
    please help me...
    My Database version- 10.2.0.4, windows
    Regards
    Halim
    Edited by: Abdul Halim on Oct 26, 2009 2:43 AM

    Just check with this query, find the lock and kill the session.
    select b.session_id ,a.SERIAL#, a.username "Blocker Details"
    from v$session a,dba_lock b
    where b.session_id = a.sid
    and b.blocking_others = 'Blocking';
    Regards
    Asif kabir

  • Windows AD user cannot use Promotion management, Why?

    A Procedure is distributed by SAP  how to Use ”Promotion Management”  in a OTAP/ DTAP street.
    See Chapter/Secton 05 of this document: https://archivesaptechedhandson.hana.ondemand.com/contentArchive/AP263_Exercises_VHO_FINAL.pdf
    This is a very good/useful   procedure. This procedure works  with an “Enterprise”  Account. 
    In our environment we ONLY work with  “Windows AD”  accounts. (to keep users management very straight forward.)
    We do not get the procedure working with “Windows AD” account.
    Our procedures stops at Section:  “07.3 Add to VM”:
    The selected webi document, within the promotion Job, is not getting "checked in" in  Version Management.
    After that all other steps are useless.
    Windows AD user cannot use Promotion management, but Why?
    (If we use version managment on the individual webi report, with a windows AD user everyting works fine)

    Sebastian,
    you showed us the right direction.
    We run SAP BusinessObjects BI Platform 4.1 Support Pack 2 Patch 3.
    In SAPBO4.1 we had to extend the properties of 2 services:
    AdaptiveJobServer and the AdaptiveProcessingServer.
    Now we can use windows active directory for promotion management,
    thanx.

  • HT1212 My iPod is locked for 22 Million minutes and i cannot use recovery mode! Please Help!

    My iPod is locked for 22 Million minutes and i cannot use recovery mode because my home button is broken and the screen doesn't respond to any touches or swipes. What should i do?

    Place the iPod in recovery mode using one of these programs and then restore via iTunes:
    For PC
    RecBoot: Easy Way to Put iPhone into Recovery Mode
    If necessary:
    Download QTMLClient.dll & iTunesMobileDevice.dll for RecBoot
    and                                           
    RecBoot tip
    RecBoot may have problems on 64X windows, then try:
    Tenorshare ReiBoot – Enter & Exit iPhone, iPad, iPod Recovery Mode with a Single Click
    For MAC or PC       
    The Firmware Umbrella - TinyUmbrella
    Installs blootware on PC too

  • When i connect my Ipad with My pc Itune is giving msg that " This IPad Cannot  use because Apple Mobile Devise is not started"

    when i connect my Ipad with My pc Itune is giving msg that " This IPad Cannot  use because Apple Mobile Devise is not started"

    You might want to take a look at this kb
    http://support.apple.com/kb/TS1538

  • Thanks for the upgrade to Firefox 4! Unfortunately, you don't say anywhere that it's not compatible with OSX 10.4. Might want to fix that so that other users don't run into this issue.

    After the latest upgrade to 3.whatever, Firefox asked if I'd like to upgrade to 4.0. I said yes, assuming (since Firefox has always been compatible before) that it'd install and work. It didn't. Why? Because Firefox is no longer supporting OSX 10.4, apparently. This should probably be noted SOMEWHERE so that trusting people like me don't screw up our existing Firefox.

    I looked for a link to the system requirements page before I downloaded to my PowerPC Mac, but I couldn't see it anywhere.
    However, I saw that Mozilla was bragging about supporting Windows XP whereas the new IE 9 did not. One would assume that if Mozilla was bragging about supporting that old Windows platform, they would also support a Mac platform of the same vintage.
    I did not assume wisely. I am very disappointed in the Mozilla team.
    For the record, I am running the latest version update of Leopard (10.5.?) on my PowerBook G4.

  • I have a application installed in my apps folder but others users cannot see them

    I installed an app on my imac using OSX Lion. The app is in the application folder of the admin account. The other standard users cannot see the app. Is there a way that they can use the app and see it in the application folder when they log in?

    Then move it into their application folders as well.

  • New HP Pavilion, shared printer, other user cannot print

    Have just purchased HP Pavilion G6 with OS windows 7.
    have set up to network sharing a printer, I am administrator.
    Printer is Brother MFC-240C
    other user on network has a desk top built by local company - non specificbrand - and is running windows XP.
    we have successfully shared printers in past when I was using a desktop with windows XP
    question is:   is the fact that we now use different OS causing the problem with printing?  

    Hi @78Senior,
    Welcome to the HP Forums!
    I noticed that you cannot print from Windows 8.1 to your HP Deskjet f4180. I am happy to help!
    I would recommend to go through this printer is offline guide, 'Printer is offline' Message Displays on the Computer and the Printer Will Not Print: Windows 8. When you get to solution four make sure to select USB and follow the steps there as well.
    Hope this works!   
    RnRMusicMan
    I work on behalf of HP
    Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos Thumbs Up" to say “Thanks” for helping!

Maybe you are looking for

  • Ipod seen in profiler, not in itunes

    I recently used my ipod as a backup harddisk, this involved erasing the whole ipod hd. The backup worked ok; then I restored the ipod software and loaded my music on it. It froze, after some erratic behaviour (split screens, and quickly jumping from

  • Increase in monthly line rental charges without no...

    I have been with BT for a year now on the Unlimited Evening and Weekend plan.  When we signed up a year ago, we just wanted basic line rental, but for some reason were given the Evening and Weekend plan at the same cost.  Knowing that our year's cont

  • Sql query to_date function

    hi all, I am working on a project where some sql scripts are already been developed by someone else. In the code i found Select col_name from table_name where txn_dt between to_date(to_date('05-dec-2007') - 6) and to_date('05-dec-2007'); I am wonderi

  • Shale1.0.3+myfaces1.0.9+tilestiles-core-2.0-SNAPSHOT erros!

    who can give me some help to use tiles in JSF(myfaces) with shale? there's a error when i do this, see following: pplicationDispatcher[jsftest] Servlet.service() for servlet Faces Servlet threw exception java.lang.IllegalStateException: Cannot forwar

  • Problems with Macbook Pro shutting down

    My macbook pro won't shut down completely.  It stops at the blue screen-when left to continue shutting down, it drains the battery.  I have to power down by holding the power button during this process.  Any suggestions?