Variables with fixed value

Is there in Java an operator that allow to a variable only a fixed set of values. For example the variable char color have only these value: "red","yellow",.. "etc".

[Enums.|http://java.sun.com/docs/books/tutorial/java/javaOO/enum.html]

Similar Messages

  • Can I compare bind variable with fixed value in where cause

    I found the problem buffer hit ratio < 70%. From monitoring, this below query is full table scan(8.5G)
    I think full table scan is a problem from scanning 720MB buffer cache.
    SELECT CT.LENS_ID,
    TO_NUMBER (TO_CHAR (CT.EXPIRED_DATE, 'YYYYMMDD')) AS EXP_DATE,
    CT.WAREHOUSE_ID,
    COUNT (*) AS QTY
    FROM TB_STK_BARCODE_CTRL CT
    WHERE CT.EXPIRED_DATE IS NOT NULL
    AND (:B7 = -1 OR CT.WAREHOUSE_ID = :B7)
    AND (:B1 = -1 OR CT.LENS_ID = :B1)
    AND CT.L_STATUS_ID = 'I'
    GROUP BY CT.LENS_ID, TO_CHAR (CT.EXPIRED_DATE, 'YYYYMMDD'), CT.WAREHOUSE_ID;
    I try to remove ":B7 = -1" from the query, and performance is OK. Index(WAREHOUSE_ID, LENS_ID, VERTICAL_TEXT, HORIZONTAL_TEXT) is used.
    SELECT CT.LENS_ID,
    TO_NUMBER (TO_CHAR (CT.EXPIRED_DATE, 'YYYYMMDD')) AS EXP_DATE,
    CT.WAREHOUSE_ID,
    COUNT (*) AS QTY
    FROM TB_STK_BARCODE_CTRL CT
    WHERE CT.EXPIRED_DATE IS NOT NULL
    AND CT.WAREHOUSE_ID = :B7
    AND CT.LENS_ID = :B1
    AND CT.L_STATUS_ID = 'I'
    GROUP BY CT.LENS_ID, TO_CHAR (CT.EXPIRED_DATE, 'YYYYMMDD'), CT.WAREHOUSE_ID;
    any suggest please
    Edited by: M.Suradech on Apr 8, 2012 8:11 PM

    M.Suradech wrote:
    AND (:B7 = -1 OR CT.WAREHOUSE_ID = :B7)
    AND (:B1 = -1 OR CT.LENS_ID = :B1)Looks like you are attempting to make some "generic" type of query.
    I'd recommend implementing something like this instead of what you currently have.
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:1669972300346534908

  • Creation of Variable with single values in BPS

    Dear All,
    I have a very basic requirement in creating variables that would accept single values from the user in BPS.
    Could anyone pls provide me the steps in doing so?
    I am able to create and use varibles with value ranges but could not find the option to create variables with  single values.
    Regards,
    Srini.

    Hi Raj,
    I have already been  thru SAP help file but,  though it says we can create variables with single values, it does not  provide any steps in creating it.
    Any suggestions?
    Regards,
    Srinivas Kamireddy.
    Edited by: Srinivas Kamireddy on Apr 25, 2008 7:59 PM

  • Report script - using substitution variable with multiple values

    Hi All,
    Substitution variable with multiple values is not working correctly with Report scripts. Can you please let me know what is the syntax to assign multiple values to a sub variable using maxl:
    alter database samp.samp set variable 'ExtractQuarter' 'Q1,Q2,Q3,Q4';
    alter database Samp.Samp set variable 'ExtractQuarter' 'Q1:Q4';
    I tried both of the above but they are errored out with the below error:
    Error: 1001005 - Unknown Member [Q1:Q4] in Report.
    my requirement is different for both Actual and forecast data extract so i would like to make use of this variable to extract whole year data for Forecast and current quarter data for Actual with out duplicating the report scripts for both processes.
    Thanks,
    PRaveen

    Hi,
    Please refer following thread,
    range of months in report script?
    Hope it helps.
    Regards

  • How can I get the variable with the value from Thread Run method?

    We want to access a variable from the run method of a Thread externally in a class or in a method. Even though I make the variable as public /public static, I could get the value till the end of the run method only. After that scope of the variable gets lost resulting to null value in the called method/class..
    How can I get the variable with the value?
    This is sample code:
    public class SampleSynchronisation
         public static void main(String df[])
    sampleThread sathr= new sampleThread();
    sathr.start();
    System.out.println("This is the value from the run method "+sathr.x);
    // I should get Inside the run method::: But I get only Inside
    class sampleThread extends Thread
         public String x="Inside";
         public void run()
              x+="the run method";
    NB: if i write the variable in to a file I am able to read it from external method. This I dont want to do

    We want to access a variable from the run method of a
    Thread externally in a class or in a method. I presume you mean a member variable of the thread class and not a local variable inside the run() method.
    Even
    though I make the variable as public /public static, I
    could get the value till the end of the run method
    only. After that scope of the variable gets lost
    resulting to null value in the called method/class..
    I find it easier to implement the Runnable interface rather than extending a thread. This allows your class to extend another class (ie if you extend thread you can't extend something else, but if you implement Runnable you have the ability to inherit from something). Here's how I would write it:
    public class SampleSynchronisation
      public static void main(String[] args)
        SampleSynchronisation app = new SampleSynchronisation();
      public SampleSynchronisation()
        MyRunnable runner = new MyRunnable();
        new Thread(runner).start();
        // yield this thread so other thread gets a chance to start
        Thread.yield();
        System.out.println("runner's X = " + runner.getX());
      class MyRunnable implements Runnable
        String X = null;
        // this method called from the controlling thread
        public synchronized String getX()
          return X;
        public void run()
          System.out.println("Inside MyRunnable");
          X = "MyRunnable's data";
      } // end class MyRunnable
    } // end class SampleSynchronisation>
    public class SampleSynchronisation
    public static void main(String df[])
    sampleThread sathr= new sampleThread();
    sathr.start();
    System.out.println("This is the value from the run
    method "+sathr.x);
    // I should get Inside the run method::: But I get
    only Inside
    class sampleThread extends Thread
    public String x="Inside";
    public void run()
    x+="the run method";
    NB: if i write the variable in to a file I am able to
    read it from external method. This I dont want to do

  • How can I get the variable with the value from Thread's run method

    We want to access a variable from the run method of a Thread externally in a class or in a method. Even though I make the variable as public /public static, I could get the value till the end of the run method only. After that scope of the variable gets lost resulting to null value in the called method/class..
    How can I get the variable with the value?
    This is sample code:
    public class SampleSynchronisation
         public static void main(String df[])
    sampleThread sathr= new sampleThread();
    sathr.start();
    System.out.println("This is the value from the run method "+sathr.x);
    /* I should get:
    Inside the run method
    But I get only:
    Inside*/
    class sampleThread extends Thread
         public String x="Inside";
         public void run()
              x+="the run method";
    NB: if i write the variable in to a file I am able to read it from external method. This I dont want to do

    Your main thread continues to run after the sathr thread is completed, consequently the output is done before the sathr thread has modified the string. You need to make the main thread pause, this will allow sathr time to run to the point where it will modify the string and then you can print it out. Another way would be to lock the object using a synchronized block to stop the main thread accessing the string until the sathr has finished with it.

  • Variable with multiple values.

    Hi All,
    Can anyone help me  to create a  variable with multiple values like it should accept two Buisness Area AU10,PH10 in Query.As well as how to use this variable in fox using VARV, VARI,and VARC.
    Thanx&Rgds,
    Indu

    Hi,
      You can write an exit for variable to retrieve two values.
    Usage of this variable in FOX..
    TOTALCOUNT= VARC(variable).
    COUNT = 1.
    DO .
    IF COUNT < TOTALCOUNT.
    varval = VARI( variable, COUNT ).
    COUNT = COUNT + 1.
    ENDIF.
    Hope this helps.
    Regards,
    Bindu

  • How to read the 'Input help with fixed values' of domain .

    How to read the 'Input help with fixed values' of domain .
    The domain has a Value range i want to read those values .
    Are these values stored in any table ?
    Plz help me i need it ver badly...
    Thanks in Advance...

    Hi Chandra Shekhar,
    To read the 'Input help with fixed values' of domain , you can use the function module : HR_P_GET_FIXED_VALUE_TEXT.
    iIf you enter the domain name, you will find the fixed values entered in the domain.
    These values are stored in a table DD07L(DD zero 7 L). Here the values are stored based on domain name.
    See if it works for you.
    Award points if its helpful.
    Regards,
    Bhanu

  • A variable with multiple values. Is it possible?

    Normally, when we need a variable with multiple values we just write them while creating the variable or, if they depend on some other variable selected by the user a variable of type exit is used.
    However, this time we would like my user to select <b>a few</b> variable values <b>at a time</b>, i.e years 2005,2006 and 2007. He can change his mind and then select 2007 and 2008. I don't want the user to be forced to select ONLY ONE value. They need to select several values at the same time.
    Ideally, I don't want to use a range with values from 2 variables to do that.
    Thanks,
    Alberto Sabate
    Message was edited by: Alberto Sabate

    Hello Alberto,
    When restricting variables to multiple values you need to use a range. The variable restriction in BPS supports two operators EQ - equals and BT - between.
    In your example below however you could use a user exit to support this. The years you have typed in below are sequential and therefore would fit into a range.
    Cheers,
    Scott

  • I want to set a variable with default value and can be changed by the user

    hi,
    i want to set a variable with default value and can be changed by the user, so i new a variable with setting : customer exit, single value, optional, ready for input.
    in my customer exit code, i set a default value, eg. 20070530
    when the variable screen popup, it display the default value 20070530, i changed it to 20070529, but it doesn't work , it still display the data in 20070530, how can i solve this problem? 
    your help is appreciated.

    Liu,
       As mentioned by Anil, you need to restrict your customerr Exit code to I_STEP = 1.
    or.
       <u>Open your Variable in change mode, in the Last Page os the Variable Maintenance you can provide default value. Note: you are doing same thing in Customer Exit. In your case no need of Customer Exit.</u>
    Nagesh Ganisetti.
    Assign points if it helps.

  • Aggregate with fixed value for 0SOLD_TO__0REGION wonu00B4t work

    Hi,
    We want to have a aggregate for a specific region. I have problem getting the aggregate to work. When testing it for aggregates in tc rsrt, it states that it will not use the aggregate because of Characteristic/Attribute 0SOLD_TO__0REGION does not have aggregation level */%.
    This in spite of the fact that 0SOLD_TO__0REGION is filtred to only include the same region and country in the aggregate and in the query.
    Maybe the message with the * in the end of it means that the aggregate needs to have all regions (value * in aggregate instead of F), but if that is the case, why?
    BR,
    Niclas
    Edited by: Niclas Erlandsson on Jul 22, 2009 10:30 PM

    Hi
    1.Create separate aggragates for each Attribute, using fixed values and create a multiprovider over this cube and take the report.
    Multiprovider perform parallel search on aggregates hence you query retrival time will be quick.
    2.Create Hierarchy variable and hierarchy node variable in the properties of IO
    in this case also you won't see entirer hierarchy. if you won't provide data for other nodes... it won't display.
    set authorization on hierarchy node also helps
    Hope this helps
    Regards
    CSM Reddy

  • SELECT with fixed value

    Hi,
    I want to use SELECT....INTO TABLE statement but using a fixed value in one column, is that possible???
    I'm trying to do something like this:
    SELECT matnr "sy-datum" quantity FROM ztable INTO TABLE it_table.
    The it_table has got 3 columns: matnr, date and quantity but in the ztable there isn't a date and I want to insert into the table with a variable or something...
    Thanks

    Hi,
    you can do like this.
    Suppose your internal table structure is like that,
    data:begin of itab occurs 0,
           matnr type mara-matnr,
          datum type sy-datum,
          quant  type  menge,
          end of itab.
    SELECT matnr  quant FROM ztable INTO corresponding fields of  TABLE it_table.
    loop at itab .
    itab-datum = sy-datum.
    modify itab index sy-tabix.
    endloop.
    If you do like this then your column of itab-datum will have sy-datum .
    I hope this will help you.
    Help children of U.N World Food Program by rewarding them and encourage others to answer your queries

  • User entry variable with exclude values

    Hello All,
    I created a  user entry/ default value variable, which allows multiple single values and is optional entry. And I also got to exclude few values from this infoobject as well as have a variable.  When I select and exclude my value from selsction and run the report, I get a system error and the varibale is converted to mandatory entry. The detail error message is displayed below.  Any useful input will be awarded
    Diagnosis
    Variable &V1& is used in the query in such a way, that an optional entry is not possible.
    For example, you might be using an "Exclude", or the variable might be connected using OR to additional selections for &V2& in the global filter, but is still displayed in the columns selections.
    It is also not possible to use an optional parameter variable to fill an interval selection in either the from-field or the to-field.
    System response
    Procedure
    If you are able to accept the mandatory entry, you need not do anything. Otherwise you must work with several variables in the query. You can use an optional interval variable to do this.
    Procedure for System Administration

    Hello ,
    I did try creating a variable with the foll details:
    Variable Type : User Entry / Default Value
    Variable Represents : Multiple Single values
    Variable entry optional
    When I run the query it converts my variable to mandotary entry.  but I want to have optional user entry variable.
    Any help will be awarded

  • User defined Variable with multiple value

    Hi Experts,
    customer requirement is the following:
    Build a layout in which to have in Lead Column the cost center characteristics, but not all cost center in master data but only those chosen by user with manual input. To achieve this goal i have created a variable of type characteristics (associatd to cost center CH) with replacement type "user defined values", then i have put this var in planning level. I have created a layout with Cost Center in Lead Column and set "all possible ch combination" in additional setting.
    Thanks to the varable created, the user can enter Cost Center value, but the problem is that he cannot select more than one single cost center value, for example:
    User want to see in layout CosCen1 and CosCen4, by now he can set variable in order to see the entire range from CosCen1 to CosCen4 (included all intermediate Cost Center) or to see only one between those 2 Cost Center, but it's not possible (or better i don't know how to..) to select both cost center and display the layout with ONLY those 2 Cost Center in Lead Column (CosCen1 and CosCen4).
    In other word, is it possible to set a variable with more than one single value without using range from-to?
    If not, does exist an alternative?
    Thanks in advance.
    Fabio

    Hi Fabio,
    It works as follows.
    let's say you have 3 multiple single lines for your cost center variable.
    once you are in the folder, select any single value & the layout is ready for planning with the corresponding cost center.
    now, select the "Cost center variable row" in the header of the folder within section "Name of Variable" & click on "Trash Can" icon to "Delete Selection" of variable.
    this basically deletes all the entered selections (3 entries) & displays for all.
    It works this way, because we don't have "resriction of values required by user".
    if am not wrong & correct me if am wrong,
    overall, this is nothing but equal to "planning level not restricted with any variable".
    I just tested this & the flaw in this is that, it is not only displaying for all the initially entered 3 lines but it displays for each & every cost center irrespective of the variable selections.
    hope it is clear.

  • Web Forms using substitution variables with multiple values

    Hi,
    I am trying to select a substitution variable in a webform (Hyperion Planning 11.1.1.3) with multiple values in EAS, but is not working does somebody knows if this an expected behaviour.
    I allready try ex.
    &Months = "Jan","Feb", "Mar"
    &Months = Jan, Feb, Mar
    &Months = Jan:Mar
    Please let me know something, since as far as I recall in previous versions of Hyperion Planning this was possible.
    Kind Regards

    We experienced the same issue, our requirement was that for the first half of the year the substitution variable was = Oct and for the second part of the year Jan:Dec. We were lucky that for the second scenario we had a Total Year member as well (that at the bottom level is Jan:Dec). So on web form we picked Level0 descendants of the substitution variable. That worked fine but not the range.

Maybe you are looking for

  • Office 2008 in Lion

    Hello,      I'm thinking about getting Lion for my mac, but I want to know how it will effect my Office for Mac 2008 Home and Student Edition. Also If I can use it or if I need to download an update. Thanks!

  • HT201335 Apple TV AirPlay mirroring

    Why couldn't we use mirroring on the new iPod as it is the main gaming device for apple and it would be great to go round to mates houses and show them the game u just bought on the tv

  • No video for Adobe TV Tutorials

    Instead of the videos, I just get a white screen. I have tried all the solutions in the following thread but no dice. I'm on Windows 7 64-bit. I've tried disabling virus protection, and uninstalled and reinstalled Flash. I don't get it in IE 9, Chrom

  • SQL Loader Error using regexp_replace

    Hi Guys, i am trying to using sql loader to load data and one column in control file is x1 POSITION(718:725) DATE "YYYYMMDD" NULLIF FI_CLM_RCPT_DT = BLANKS, XYZ POSITION(736:745) CHAR "regexp_replace(substr(:XYZ,1,9),\'[^1|Y|N|U|W]\',\' \')||regexp_r

  • Win_Api_Environment.Read_Ini_File throws error in 11g OAS

    Dear All, We are in the process of upgrading our forms application from 10g to 11g. During this process we are facing an issue in Win_Api_Environment.Read_Ini_File. h1.Issue :- When we access this function we are getting "Undefined Error" error at ru