Disallow opening of two screens with same plant.

Hi Gurus!
I need to block the plant entered in a particular screen so that others cant use the same plant to run the report. For example if I use a plant say 200 in a screen for example 1000 with other entries like division , year , month and material, and run the report it will allow me , but at the same time another user wants to execute the same same screen  or program with same plant 200 , I want the report o block that plant or the screen itself so that other user wont be able to enter the report and make the changes corresponding to the same plant at the same time, to avoid confusiioon qmong themselves.
Is it possible to do so , if so how do I go about doing it.
Regards
Aarav

your logic is incorrect. You need to execute the code within enque / dequeue only if sy-subrc = 0.
Right now it is gettign executed for all cases
*&      Form  valid_plant
*       validate whether plant entered in selection screen
*       exists in database or not
FORM valid_plant .
DATA : lv_key TYPE rstable-varkey  .
  CONCATENATE sy-mandt p_werks INTO lv_key .
  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 ).
CALL FUNCTION 'ENQUEUE_E_TABLEE'
EXPORTING
   MODE_RSTABLE         = 'E'
   TABNAME              = 'ZPRFACTOR'
   VARKEY               = lv_key
IF SY-SUBRC  0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  message i000 with text-000.
                        <<<--------- Move this ENDIF to down
    SELECT SINGLE werks FROM t001w INTO t001w-werks
           WHERE werks = p_werks.
    IF sy-subrc NE 0.
      MESSAGE e048(zmm) WITH p_werks.
    ENDIF.
CALL FUNCTION 'DEQUEUE_E_TABLEE'
EXPORTING
   MODE_RSTABLE       = 'E'
   TABNAME            = 'ZPRFACTOR'
   VARKEY             = lv_key       .
ENDIF.  --- Move ENDIF here from above
  ENDIF.
ENDFORM.

Similar Messages

  • How to separate two contact with same name

    Hi, anyone knows how to separate two contacts with same name in Contacts?  Actually they are two persons from two gmail contacts with same name but different contact numbers, different emails....etc, but Contacts assume they are same person and merge them as one!

    FG,
    In Lion, you have the File > Duplicate option. You will then have two copies of your document open, and the one on top will have the temporary filename "OriginalFileName copy", and your next responsibility is to File > Save (or Command-S) and rename the duplicate. At this point, you edit the copy's name, to perhaps ...copy 1, or whatever you wish. The document you had open when you initiated the File > Duplicate will still be there on your screen, waiting for you to Close it or continue editing.
    Jerry

  • When I click to open a photo it opens a black screen with a grey triangle, exclamation mark in the middle. How do I fix this problem?

    When I click to open a photo it opens a black screen with a grey triangle, exclamation mark in the middle. How do I fix this problem?

    Make a temporary, backup copy of your library if you don't already have one (Control-click on the library and select Duplicate from the contextual menu) and  apply the two fixes below in order as needed:
    Fix #1
    Launch iPhoto with the Command+Option keys held down and rebuild the library.
    Select the options identified in the screenshot. 
    Fix #2
    Using iPhoto Library Manager  to Rebuild Your iPhoto Library
    Download iPhoto Library Manager and launch.
    Click on the Add Library button, navigate to your Home/Pictures folder and select your iPhoto Library folder.
    Now that the library is listed in the left hand pane of iPLM, click on your library and go to the File ➙ Rebuild Library menu option
    In the next  window name the new library and select the location you want it to be placed.
    Click on the Create button.
    Note: This creates a new library based on the LIbraryData.xml file in the library and will recover Events, Albums, keywords, titles and comments but not books, calendars or slideshows. The original library will be left untouched for further attempts at fixing the problem or in case the rebuilt library is not satisfactory.
    OT

  • Two methods with same name but different return type?

    Can I have two methods with same name but different return type in Java? I used to do this in C++ (method overloading or function overloading)
    Here is my code:
    import java.io.*;
    public class Test{
    public static void main(String ar[]){
    try{          
    //I give an invalid file name to throw IO error.
    File file = new File("c:/invalid file name becasue of spaces");
    FileWriter writer = new FileWriter(file ,true);
    writer.write("Test");
    writer.close();     
    } catch (IOException IOe){
         System.out.println("Failure");
    //call first method - displays stack trace on screen
         showerr(NPe);
    //call second method - returns stack trace as string
            String msg = showerr(NPe);
            System.out.println(msg);
    } // end of main
    public static void showerr(Exception e){
         StringWriter sw = new StringWriter();
         PrintWriter pw = new PrintWriter(sw);
         e.printStackTrace(pw);
         try{
         pw.close();
         sw.close();
         catch (IOException IOe){
         IOe.printStackTrace();     
         String stackTrace = sw.toString();
         System.out.println("Null Ptr\n" +  stackTrace );
    }//end of first showerr
    public static String showerr(Exception e){
         StringWriter sw = new StringWriter();
         PrintWriter pw = new PrintWriter(sw);
         e.printStackTrace(pw);
         try{
         pw.close();
         sw.close();
         catch (IOException IOe){
         IOe.printStackTrace();     
         return sw.toString();
    }//end of second showerr
    } // end of class
    [\code]

    Overloading is when you have multiple methods that have the same name and the same return type but take different parameters. See example
    public class Overloader {
         public String buildError(Exception e){
              java.util.Date now = new java.util.Date() ;
              java.text.DateFormat format = java.text.DateFormat.getInstance() ;
              StringBuffer buffer = new StringBuffer() ;
              buffer.append(format.format(now))
                   .append( " : " )
                   .append( e.getClass().getName() )
                   .append( " : " )
                   .append( e.getMessage() ) ;
              return buffer.toString() ;
         public String buildError(String msg){
              java.util.Date now = new java.util.Date() ;
              java.text.DateFormat format = java.text.DateFormat.getInstance() ;
              StringBuffer buffer = new StringBuffer() ;
              buffer.append(format.format(now))
                   .append( " : " )
                   .append( msg ) ;
              return buffer.toString() ;
         public String buildErrors(int errCount){
              java.util.Date now = new java.util.Date() ;
              java.text.DateFormat format = java.text.DateFormat.getInstance() ;
              StringBuffer buffer = new StringBuffer() ;
              buffer.append(format.format(now))
                   .append( " : " )
                   .append( "There have been " )
                   .append( errCount )
                   .append( " errors encountered.")  ;
              return buffer.toString() ;
    }Make sense ???
    Regards,

  • Gallery Images: How to make clear PNG's open in full screen with a white background?

    Hi,
    So in the Life on Earth textbook, there is an image of an ant that has no background, so when you pick it up, you can see the text below without the standard "white box" around it.
    I've scorwed the internet looking for answers but couldn't find any.
    Please see the photos snapped from my phone of this:
    Unfortunately... When I try to achive this, my images open on a black background.
    I can achive the pick up.
    Would really appreicate the help. Thanks...
    Grant

    Well, if I put a white background in my image, it opens in full screen with a white background. But has a white square when I pick it up:
    This is with a 2028 x 1496 image same as above, just no background - came out of Illustrator - and this has the effect I want, as the first post but still opens to full screen with a black background.
    Thanks for the help... Hope to get this one figured out!

  • Two Switches with same MAC+Priority running STP

    Hi
    what will happen if two switch with same MAC-ADDRESS and same STP priority will run STP , how will elect to the root bridge ???? how the STP process will handle this situation?
    thanx

    Well, first off, no two switches (or switchports) will have the same MAC (if they do, you're buying switches from the wrong, very bad place).
    Every port of the switch will have (at least) one MAC of it's own.
    Given the same priority for all switches/bridges on the LAN, the lowest switch/bridge MAC on the LAN will win as the root.
    VLANS take on the MAC of the administrative interface ("CPU"): i.e., xxxx.xxxx.5000, the first port (i.e., fa0/1) is xxxx.xxxx.5001, the second (fa0/2) is xxx.xxxx.5002, and so on
    If you do a "show interface", the MAC / bia is displayed in the second line.
    Good Luck
    Scott

  • Two idocs with same idoc number in idx5

    We are using an idoc to file scenario where idocs are bundled using bpm and posted to ftp. here the issue is we are getting two idocs with same idoc number in idx5. due to which the file in ftp is getting overwritten.
    Could anyone suggest me what to do in this regard.

    Hi,
    >>>check your sender system is sending same IDoc twice ?
    if you send the same IDOC twice they both get different numbers as IDOC number is taken from the IDOC num range
    unless you're able to send the same IDOC twice with the same IDOC num somehow
    Regards,
    Michal Krawczyk

  • How do I reboot my iMac in Lion? Right now it opens a black screen with dos and asks me to insert the boot disk.

    How do I reboot my iMac in Lion? Right now it opens a black screen with Dos and asks me to insert the boot disk.I recently installed Parallels & Windows 7. Now if I have to turn the system off, it starts up as per above in Dos. know I need to start up and press a couple of keys, but which ones? I forgot....

    A simple search around here, identified this thread https://discussions.apple.com/message/15762361#15762361
    The More Like This box on the right has more.

  • Two account with same UPN in Active Directory

    Is it possible to have two accounts with same UPN in AD? 
    I'm using Windows Server 2012 R2

    To expand on what Mr X said. Active Directory allows you to assign just about anything to the userPrincipalName attribute, as long as the value is unique. The value of this attribute is generally referred to as the UPN. But you could assign values with no
    "@" symbol, for example, or more than one "@" symbol. Also, Active Directory does not require that any value be assigned. It is an optional attribute.
    If no value is assigned to the userPrincipalName attribute, then the user can use a "default" UPN, which is <sAMAccountName>@<DNS domain name>, where <sAMAccountName> is the "pre-Windows 2000 logon" name of the user
    (the value of the sAMAccountName attribute), and <DNS domain name> is the DNS name of the domain.
    If a user has a value assigned to userPrincipalName that does not match this "default" form, then they can logon with either UPN, as long as no one else has either value assigned to their userPrincipalName attribute. You will note that Active
    Directory enforces uniqueness in the domain on sAMAccountName values.
    If in domain "domain.com" a user has a sAMAccountName of "jsmith" but userPrincipalName "[email protected]", then another user can have userPrincipalName of "[email protected]" (as long as no one else
    has that value assigned to userPrincipalName). They can each logon with their assigned values for userPrincipalName. But the first user can no longer also logon with their "default" value, based on their sAMAccountName, because it is now
    used by someone else. But if you attempt to assign a value to userPrincipalName that is also assigned to another user, you get an error.
    Bottom line, only one person can logon with any given UPN.
    Richard Mueller - MVP Directory Services

  • Two records with same  key (Infocube)

    Hi,
    I was trying to do, in a update rule, an "IF" condition with two key figures.
    IF Kf1 > Kf2. result = Kf1 else result = Kf2.
    But the data in the source (datamart Infocube to infocube) have tow records with the same characteristics combination (the same keys)and different amount in the keyfigures, then the result of my "if" condition is not the expected because I understood in the infocube only exists one characteristics combination. :S
    I was seeing those records in the manage transaction of the infocube.
    Some reason for this?
    Thanks and regards
    Victoria Leó

    This can happen with parallel loads.  Two rows with same set of Char values but in different packets of the same Request, being loaded at the same time.
    It really shouldn't be an issue - your update rule will make the KF change as desired.  Your queries aggregate KFs based characteristic values, not Dim IDs, so you'll get the totals you expect.
    Here's some more info:
    There is an RSRV Test that lets you check a dimension for a cube to see if multiple DIM IDs exist for the same combination of Chars - <b>Multiple Entries in Dimensions of a (Basis) InfoCube</b>
    Output looks like:
    12:02:24 o'clock on 08/25/2006: Start test run for user PIZZAMAN:)
    Dimension ZFM_C521: DIMID 61,215 and 61,214 have same characteristic values
    Dimension ZFM_C521: DIMID 61,880 and 61,879 have same characteristic values
    Dimension ZFM_C521: DIMID 61,366 and 61,365 have same characteristic values
    Dimension ZFM_C521: DIMID 61,368 and 61,367 have same characteristic values
    12:02:24 on 08/25/2006: Test run for user PIZZAMAN:) completed
    You can run the Correct Error option to have it update fact rows to use one of the DimIDs if you want, but unless you have lots of them, I even wouldn't bother.
    Here's the description of the test:
    <u>Description</u>
    This elementary test recognizes whether there are several lines that have different DIMIDs(dimension table key), but have the same SIDs for the selected dimension table for the InfoCube specified. (This can occur by using parallel loading jobs). This has nothing to do with an inconsistency. However, unnecessary storage space is occupied in the database.
    <u>Repairs</u>
    Since the different DIMIDs with the same SIDs are normally used in the fact tables, they cannot simply be deleted. Therefore, all of the different DIMIDS in the fact tables are replaced by one DIMID that is randomly selected from the equivalent ones. Before a change can be made to the database, the consent of the user is requested.
    DIMIDs that have become unnecessary are deleted in the connection. In doing so, not only are the DIMDs deleted that were released in the first part of the repair, but so are all of those that are no longer used in the fact tables (including aggregates). The consent of the user is again requested before this change is made.

  • Struts- two actions with same path in struts config

    hai
    I am having html:select tag with two options (View And Download) in a form.My form signature is like <html:form action="select">.I mapped two options(View,Download) with same action path.When i click view it doesn't forwards(remains idle) and no error is shown.But i click download it forwards to the appropriate page.If iam having two tags with same action path the second is only working.This problem doesn't comes when iam having one tag alone.
    My code is here:
    -----------Select.jsp----------------
    <html:form action="Select">
    <html:select property="id">
    <html:option value="view">View</html:option>
    <html:option value="download">Download</html:option>
    </html:select>
    </html:form>
    ----------------Struts-config.xml------------
    <form-beans>
    <form-bean name="viewForm" type="ViewForm"/>
    <form-bean name="download" type="DownloadForm"/>
    </form-beans>
    <action-mappings>
    <action path="/Select"
    name="viewForm"
    type="ViewAction"
    input="/Select.jsp">
    <forward name="success" path="/Success.jsp"/>
    </action>
    <action path="/Select"
    name="downloadForm"
    type="DownloadAction"
    input="/Select.jsp">
    <forward name="success" path="/Welcome.jsp"/>
    </action>
    </action-mappings>
    Can i have action tag with same paths like this.If not please provide me a solution

    I have created two success pages.
    I have created two findForward in my ActionClasspublic ActionForward execute(ActionMapping mapping,...............)
    if(a==view)
    return mapping.findForward("success");
    else
    return mapping.findForward("success1");
    ----------------Struts-config.xml------------
    <form-beans>
    <form-bean name="viewdownloadForm" type="ViewdownloadForm"/>
    </form-beans>
    <action-mappings>
    <action path="/Select"
    name="viewdownloadForm"
    type="ViewdownloadAction"
    input="/Select.jsp">
    <forward name="success" path="/Success.jsp"/>
    <forward name="success1" path="/Success1.jsp"/>
    </action>

  • Unable to monitor two databases with same name on two different hosts

    I have got two databases with same name on two different hosts. I added one database to the list of monitored databases. Now If I try to add the other one , I get the message that the database is already being managed.
    Can't we monitor two databases with same name on two different hosts?

    you can... while saving the target,give a different name.. for eg target-2

  • My wife changed start up somehow. Now 7 or 8 files open when restart. Have to  close all to do anything. How do adjust setting so that it open do normal screen with icons etc?

    my wife changed start up somehow. Now 7 or 8 files open when restart. Have to  close all to do anything. files, applications, internet, folders etc. How do adjust setting so that it open do normal screen with icons etc?  before this, it started up and went to main screen with dock, save folders ICOns etc

  • HT5622 Good day!! I was having two Iphones with same icloud id, later i deleted 1 id from one device, and made 2nd id for this device but same time my old id is stored on other device and i can not change it with another id, can any1 guide me on this issu

    Good day!! I was having two Iphones with same icloud id, later i deleted 1 id from one device, and made 2nd id for this device but same time my old id is stored on other device and i can not change it with another id, can any1 guide me on this issue.

    Log in to icloud.com on a web browser and remove the device from "Find My iPhone"

  • Cant open firefox on second screen on computer with two screens with two graphics cards.

    I have a computer with two screens and two diffrent graphics card. One of them is onboard GC and another one is USB GC. I am running two instances of FF and it works fine with 3.6.20 version. But when I update to the latest version of FF either 5 or 6 this does not work. Even if i try to open one instance of FF on second screen on USB GC , I cant see anything> i have to move it to the main screen to see the FF window and will not work on the extended screen. I am using windows 7 pro 32 bit and the screen resolution is set to 1280x1024 on both the screens.
    Can you please help.
    Thanks.
    Regards
    PJ

    Try to disable hardware acceleration.
    *Tools > Options > Advanced > General > Browsing: "Use hardware acceleration when available"
    If disabling hardware acceleration works then check if there is an update available for your graphics display driver.
    *https://support.mozilla.org/kb/how-do-i-upgrade-my-graphics-drivers

Maybe you are looking for

  • File.length issues

    I've been trying to make a terminal like program, but I've had issues detecting the file size. When I use file.length(), I get wildly different answers than use of the "du" unix command. Is this a bug in java? Mac OS X? Just me being an idiot? Thank

  • HT4528 IPHONE 5 gets the message "invalid sim" and "sim failure" - how do I fix this?

    I keep getting the message: "sim failure" or "invalid sim". I have a not changed anything on the phone other that adding the recent update. How do I fix this?

  • BEFW11S4 as a range extender?

    Hi, I have recently purchased a Linksys WAG200 wireless modem/accesspoint. This is working out fine, but not all places in the house have good enough wireless coverage. I still have an older BEFW11S4 wireless router. I was wondering if it is possible

  • Sh ip cache flow command in Nexus

    is there a similar command to the  sh ip cache flow in Nexus? Thanks.. _Greg...

  • System Update v3.14 error: "an error occurred while downloadin​g packages"

    I installed the new version of System Update v3.14 from the Leonvo web site on my ThinkCentre A30 (8199-B2U) running Windows XP SP2, however I get the error message "an error occurred while downloading packages" when the percentage hits 15% or 17%. I