Why findByAltKey(String keyName, Key key, int) returns a RowIterator object

Hi All,
I was thinking that why findByAltKey(String keyName, Key key, int) returns a RowIterator object and not Row object because alternate key is a candidate key and is unique so only one record should be there for a particular alternate key.
Thanks
Puneet

findByKey (which you could also use) returns Row[]. findByAltKey is just a special version of findByKey that returns a RowIterator.
Probably it's not going to change for historical reasons.
Plus, the Key you use doesn't have to be a full key - it can be a partial one, meaning that you can match more than one row.
John

Similar Messages

  • Mapping a key string to the KeyEvent int value

    /** Returns the int value of a key
    * @param the String representing the key. example "SHIFT" for the shift key
    * @return KeyEvent.VK_keyName
    public static int mapKeyCode(String keyName) {
    // we don't have access to an instance of KeyEvent!!!
    Class.forName("java.awt.event.KeyEvent").getDeclaredField("VK_"+keyName).getInt(obj..@#@#@
    //+ exception handling
    }

    public int keyTyped( KeyEvent event ) {
      try {
         return java.lang.Integer( String.valueOf( event.getKeyChar() ) );
      } catch ( NumberFormatException nfe ) {
         System.err.println( "NumberFormatException: " + nfe.getMessage() );
         return( 0 );
    }

  • Primary Key Source returning improper value

    Hi All,
    I have a tabular updateable form.
    My Primary Key field has
    Primary key Source Type : Custom PL/SQL Function
    Primary key Source : RETURN (EB_PACKAGE.GET_COD_NUM (:P4_CTY_TYPE));
    My function is in a package and is executing properly and i have checked it.
    I have an Item on that page as P4_CTY_TYPE whose value i'm passing to obtain the Primary key.
    But my problem is the function does not return a proper value, i feel the value being passed for the function is always same. Why is proper value not being passed.
    Hopefully I have explained my problem, if not let me know so.
    Hoping for the solution.
    Thanks n Regards
    Arif

    Hi Ravi,
    Thanks for the reply and sorry for late reply.
    The session value for P4_CTY_TYPE is ok.
    P4_CTY_TYPE is a Select List with Submit.
    I have a Report and there's a link which changes the value of P4_CTY_TYPE or can be changed by itself as it is a Select List.
    Depending upon the value of P4_CTY_TYPE I'm displaying records in a Tabular form with Insert, Update and Delete facilities.
    Now Suppose the Value for P4_CTY_TYPE is 10 at the start of the session then the function works fine and it always does for this value, when i select other value for P4_CTY_TYPE say 20. The value returned by my function is as if the parameter value being passed to the function EB_PACKAGE.GET_COD_NUM (:P4_CTY_TYPE)) is 10 and not 20. This is what i mean by function does not return a proper value.
    If any more clarification required do let me know.
    Thanks Once again.
    Arif

  • Msg no.FF709 Error in account determination: table T030K key INT VS1 I0

    Dear friends ,
    We are trying to post a MIRO with tax code I0 for Brazil , but tax code I0 has only the AccKey VST activated in the tax  code , but when we hit [Save]  system is issuing the error message FF709-Error in account determination: table T030K key INT VS1 I0.
    My question is: Why do we need to put the tax code I0 in the VS1 once we have only VST  AccKey activated ?
    We noticed that in the  Main Program SAPLTAX1 and into Source code of LTAX1F02 , the system is doing a select single into T030K and issue this message.
    We took a look into OSS notes but no relevant notes were found.
    Best regards,
    Alessandro

    Hi,
    The error message FF709 appears when for the account key and      
    tax code (e.g. V0) no G/L account was entered.                               
    For account keys with the posting indicator = 2 (separate line item)         
    an G/L account HAS TO be maintained in OB40, also if it is a zero tax.       
    Only for account keys with the posting indicator = 3 (Distribute to          
    relevant expense/revenue items) like NVV no G/L account will be entered.     
    Best  regards
    Erika

  • Use special string as key of DES

    I want to use a special string as key of DES.
    I f I want to use a string which length is more than 8 as key,what should I do?
    Thanks

    Although DES has been designed for using keys composed of eight 7-bit ASCII characters with parity (i.e., plain-text passwords), you do not need to use such "weak" keys. Common passwords have almost no "entropy" (i.e., random information); so you must not use passwords directly in any algorithm (DES, AES, RC4 etc.).
    Remember - keys are not passwords; keys can be derived from passwords. Cryptographic algorithms usually use keys, not passwords.
    The PBE algorithm (Password-Based Encryption) use passwords for encrypting, but do not use the passwords directly. It calculates a special function than derives a key from a password.
    Study the PBE algorithm instead of trying to use the password as a key directly.
    I will give an example to make you understand the problem better.
    There is a class of functions called "cryptographic hashes" that works "digesting" the bytes you pass to it.
    They receive any quantity of bytes as input, and return a fixed-size result (160 bits = 20 bytes for SHA-1, 128 bits = 16 bytes for MD5).
    Examples of cryptographic hash are the MD5 and SHA-1 functions.
    I will give several words that are very near in spelling, but their hashes are completely different.
    The SHA-1 of "password" is 5BAA61E4 C9B93F3F 0682250B 6CF8331B 7EE68FD8
    The SHA-1 of "passwords" is A267F7DB A707256B 0B664DEE 86AB9AE8 B4941218
    The SHA-1 of "passwort" is 2E2B6533 A81BC154 30CF65DE 46DC097E EB5BA70C
    The SHA-1 of "Password" is 8BE3C943 B1609FFF BFC51AAD 666D0A04 ADF83C9D
    If you modify a byte in the content, the value is completely altered. You can see that the SHA-1 of "password" and "Password" are completely different.
    The "naive" way of deriving a key from a password is simply to calculate the SHA-1 of the password, throwing out the unneeded bits (for instance, if you use DES, you can use only the first 8 bytes - 64 bits of the SHA-1 value.)
    The PBE algorithm uses a more sofisticated and secure scheme but the inspiration is that you can derive a key from a password, and use the key to encrypt your data.

  • Error in account determination: table T030K key INT MWS O1

    Hi ,
    I created billing document. now when i am posting to accounting. I am getting an error while posting  to accounting .
    " Error in account determination: table T030K key INT MWS O1
    Please guide me.
    Rgds
    AKi

    Hi Akhilesh kumar,
    System is looking for GL account for Tax line item....
    In the error message, INT represents your chart of accounts and MWS shows for your transaction key assigned in your tax procedure. and O1 is tax code...
    Maintain in OB40 or simply go to the T code FTXP and go to the tax code O1 and maintain the tax accoutns by selecting "tax accoutns " Tab button
    Thanks & Regards
    Ravi C

  • "DELETE" key to "RETURN"

    On a new MacBook Air I'm using the Ukelele key layout for Devanagari to map Dvorak. But when I was on the Aluminum 3G I was able to only switch the "DELETE" key with the "RETURN" key through the system somewhere. Ukelele has maybe updated itself and I was able to switch them there. But the end result is that both keys act as a "DELETE" key. That seems to mean that the "RETURN" key was changed properly but the "DELETE" key cannot be changed.
    I found "KeyRemap4MacBook" so I downloaded and Installed it. It did not offer the switch I need. So on the forum I found "DoubleCommand" and still could not make it do what I wanted.
    Then the system crashed for the first time and shut itself down. On restart the keyboard didn't function. I uninstalled "KeyRemap4MacBook" and still it was not working. (try typing your password when the key layout is not functioning) Then I uninstalled  "DoubleCommand" and on restart my keyboard works!
    Anyone have any ideas for remapping the "DELETE" key to "RETURN" ?

    You cannot do that with UKELELE, because this beautiful app does not change system settings. You have two ways to deal with this:
    1. Apple’s settings in System Preferences / Keyboard / Modifer Keys
    2. and / or install a pretty utility called DoubleCommand, free. This one can offer many settings. I use it for changing right Enter key on my MacBook into Option key, just because I use many keybaord layouts, and also need dead keys very frequently.
    Give a try, you will be satisfied.

  • About key word return

    Hi;
    Iam very confused about the use of the key word return. I understand its functionality when it returns some value.But what's the case when we use it in the following way:
    if(some testcase)
    return;
    Also where will return leads to when we use only return in a method that has void return type.

    Hi;
    Iam very confused about the use of the key
    word return. I understand its functionality when it
    returns some value.But what's the case when we use
    it in the following way:
    if(some testcase)
    return;:eek:
    IMO a ``test case'' is not a language construct.
    http://en.wikipedia.org/wiki/Test_case

  • Why does my home key stick?

    Why does my home key keep sticking?

    Hi,
    It has happenned to me one time too.
    Cheers,
    Cad,ls.

  • Error in account determination: table T030R key INT ZAS

    Hello Gurus...
    im facing a error when i tried for invoice verification using Tcode MIRO
    i heard its strong issue of FI
    Error in account determination: table T030R key INT ZAS
    Error is
    <b>Error in account determination: table T030R key INT ZAS
    Message no. FF708
    Diagnosis
    In the chart of accounts you are using, no rule was found for the account key for determining the accounts to be posted to.
    Procedure
    Contact your system administrator.
    Procedure for System Administration
    Define the account determination rules for the specified account key in Customizing for taxes on sales/purchases.
    To do this, choose Maintain entries (F5).
    </b>
    pls help me
    Thanks in advance

    Hi ansuman...
    i did as u said...and i dont know which G/L account number need to give for ZAS??
    i think problem will be solved once i give appropriate G/L account..
    Thanks

  • WHY WON'T STICKY KEYS ACCESSABILITY WORK ON SAFARI/

    WHY WON'T STICKY KEYS ACCESSABILITY FEATURE WORK ON SAFARI? I AM A DOUBLE AMPUTEE AND THIS FEATURE REALLY HELPS ME.
    RANDY

    Do us all a favor, and unlock your Cap keys.  It's considered yelling, and it's a real turn-off for those looking to help posters here.

  • Why don't arrow keys advance slides in LR5 slideshow module

    Why don't arrow keys advance slides in LR5 slideshow module

    While the slideshow's playing, you mean?  It's a bug. I've already reported it.

  • How do I know if I can convert a String value to an int value or not?

    Hi,
    I want to know how to make the judgment that if I can convert a String value to an int value or not? Assume that I don't know the String is number or letters
    Thank you

    Encephalopathic wrote
    Again, why?One of the problems (have been dued) in my codelab asks us to write a class as follow
    Write a class definition of a class named 'Value' with the following:
    a constructor accepting a single integer paramter
    a constructor with no parameters
    a method 'setVal' that accepts a single parameter,
    a boolean method, 'wasModified' that returns true if setVal was ever called for the object.
    a method 'getVal' that returns an integer value as follows: if setVal has ever been called, it getVal returns the last value passed to setVal. Otherwise if the "single int parameter" constructor was used to create the object, getVal returns the value passed to that constructor. Otherwise getVal returns 0.
    The setVal(int y) returns nothing, so how do I know whether it has been called or not?
    Thank you

  • Why does the Java method ServletContext.getResourceAsStream return null with a know good path to an xsl file?

    iPLANET ISSUE
    Why does the Java method ServletContext.getResourceAsStream return null with a know good path to an xsl file?
    CODE
    ServletContext context = mpiCfg.getServletConfig().getServletContext();
    // Debugging
    out.print(context.getServerInfo());     // Get server info
    out.print(&#8220;getRealPath = &#8221; + context.getRealPath("WEB-INF/xsl/RedirectToAcs.xsl"));
    String strXslName = "RedirectToAcs.xsl";
    InputStream is = context.getResourceAsStream("WEB-INF/xsl/"+ strXslName);
    TRACE FROM THE LOG
    [26/Jul/2002:08:23:15] info ( 2868): [0][][ClearCommerceCcpaMpi][]getServerInfo() = iPlanet-WebServer-Enterprise/6.0, getRealPath() = C:\iPlanet\Servers\web-apps\ccpa\WEB-INF\xsl\RedirectToAcs.xsl
    [26/Jul/2002:08:23:15] info ( 2868): [0][][ClearCommerceCcpaMpi][]strXslName = RedirectToAcs.xsl, is = null
    [26/Jul/2002:08:23:15] info ( 2868): [1][][ClearCommerceCcpaMpi][16]ResourceAsStream is null
    [26/Jul/2002:08:23:15] info ( 2868): [1][][ClearCommerceCcpaMpi][30]Problem reading XSL file.
    DIRECTORY DUMP
    C:\iPlanet\Servers\web-apps\ccpa\WEB-INF\xsl>dir
    Volume in drive C has no label.
    Volume Serial Number is 9457-EBF4
    Directory of C:\iPlanet\Servers\web-apps\ccpa\WEB-INF\xsl
    07/22/2002 05:54p <DIR> .
    07/22/2002 05:54p <DIR> ..
    07/22/2002 05:54p 3,086 RedirectToAcs.xsl
    07/22/2002 05:54p 3,088 Response.xsl
    2 File(s) 6,174 bytes
    2 Dir(s) 1,797,405,696 bytes free

    I think there's supposed to be a forward slash before WEB-INF.
    InputStream is = context.getResourceAsStream("/WEB-INF/xsl/"+ strXslName);

  • Replacing String month with type Int - What to do!?!

    import java.util.Scanner;
    public class Date
        private String month;
        private int day;
        private int year; //a four digit number.
        public Date( )
            month = "January";
            day = 1;
            year = 1000;
        public Date(int monthInt, int day, int year)
            setDate(monthInt, day, year);
        public Date(String monthString, int day, int year)
            setDate(monthString, day, year);
        public Date(int year)
            setDate(1, 1, year);
        public Date(Date aDate)
            if (aDate == null)//Not a real date.
                 System.out.println("Fatal Error.");
                 System.exit(0);
            month = aDate.month;
            day = aDate.day;
            year = aDate.year;
        public void setDate(int monthInt, int day, int year)
            if (dateOK(monthInt, day, year))
                this.month = monthString(monthInt);
                this.day = day;
                this.year = year;
            else
                System.out.println("Fatal Error");
                System.exit(0);
        public void setDate(String monthString, int day, int year)
            if (dateOK(monthString, day, year))
                this.month = monthString;
                this.day = day;
                this.year = year;
            else
                System.out.println("Fatal Error");
                System.exit(0);
        public void setDate(int year)
            setDate(1, 1, year);
        public void setYear(int year)
            if ( (year < 1000) || (year > 9999) )
                System.out.println("Fatal Error");
                System.exit(0);
            else
                this.year = year;
        public void setMonth(int monthNumber)
            if ((monthNumber <= 0) || (monthNumber > 12))
                System.out.println("Fatal Error");
                System.exit(0);
            else
                month = monthString(monthNumber);
        public void setDay(int day)
            if ((day <= 0) || (day > 31))
                System.out.println("Fatal Error");
                System.exit(0);
            else
                this.day = day;
        public int getMonth( )
            if (month.equals("January"))
                return 1;
            else if (month.equals("February"))
                return 2;
            else if (month.equalsIgnoreCase("March"))
                return 3;
            else if (month.equalsIgnoreCase("April"))
                return 4;
            else if (month.equalsIgnoreCase("May"))
                return 5;
            else if (month.equals("June"))
                return 6;
            else if (month.equalsIgnoreCase("July"))
                return 7;
            else if (month.equalsIgnoreCase("August"))
                return 8;
            else if (month.equalsIgnoreCase("September"))
                return 9;
            else if (month.equalsIgnoreCase("October"))
                return 10;
            else if (month.equals("November"))
                return 11;
            else if (month.equals("December"))
                return 12;
            else
                System.out.println("Fatal Error");
                System.exit(0);
                return 0; //Needed to keep the compiler happy
        public int getDay( )
            return day;
        public int getYear( )
            return year;
        public String toString( )
            return (month + " " + day + ", " + year);
        public boolean equals(Date otherDate)
            return ( (month.equals(otherDate.month))
                      && (day == otherDate.day) && (year == otherDate.year) );
        public boolean precedes(Date otherDate)
            return ( (year < otherDate.year) ||
               (year == otherDate.year && getMonth( ) < otherDate.getMonth( )) ||
               (year == otherDate.year && month.equals(otherDate.month)
                                             && day < otherDate.day) );
        public void readInput( )
            boolean tryAgain = true;
            Scanner keyboard = new Scanner(System.in);
            while (tryAgain)
                System.out.println("Enter month, day, and year.");
                  System.out.println("Do not use a comma.");
                String monthInput = keyboard.next( );
                int dayInput = keyboard.nextInt( );
                int yearInput = keyboard.nextInt( );
                if (dateOK(monthInput, dayInput, yearInput) )
                    setDate(monthInput, dayInput, yearInput);
                    tryAgain = false;
                else
                    System.out.println("Illegal date. Reenter input.");
        private boolean dateOK(int monthInt, int dayInt, int yearInt)
            return ( (monthInt >= 1) && (monthInt <= 12) &&
                     (dayInt >= 1) && (dayInt <= 31) &&
                     (yearInt >= 1000) && (yearInt <= 9999) );
        private boolean dateOK(String monthString, int dayInt, int yearInt)
            return ( monthOK(monthString) &&
                     (dayInt >= 1) && (dayInt <= 31) &&
                     (yearInt >= 1000) && (yearInt <= 9999) );
        private boolean monthOK(String month)
            return (month.equals("January") || month.equals("February") ||
                    month.equals("March") || month.equals("April") ||
                    month.equals("May") || month.equals("June") ||
                    month.equals("July") || month.equals("August") ||
                    month.equals("September") || month.equals("October") ||
                    month.equals("November") || month.equals("December") );
        private String monthString(int monthNumber)
            switch (monthNumber)
            case 1:
                return "January";
            case 2:
                return "February";
            case 3:
                return "March";
            case 4:
                return "April";
            case 5:
                return "May";
            case 6:
                return "June";
            case 7:
                return "July";
            case 8:
                return "August";
            case 9:
                return "September";
            case 10:
                return "October";
            case 11:
                return "November";
            case 12:
                return "December";
            default:
                System.out.println("Fatal Error");
                System.exit(0);
                return "Error"; //to keep the compiler happy
    }My question is that if I were to change the String month in the instance variables to type int, what changes do I make to the code to make this work WITHOUT changing the method headings and it also says that none of the type String paraenters should change to type int. I need to redefine the methods to make it work. I've been at this for hours and am just stuck so this is the reason for my early morning post.

    import java.util.Scanner;
    public class Date
        private int month;
        private int day;
        private int year; //a four digit number.
        public Date( )
            month = 1;
            day = 1;
            year = 1000;
        public Date(int monthInt, int day, int year)
            setDate(monthInt, day, year);
        public Date(String monthString, int day, int year)
            setDate(monthString, day, year);
        public Date(int year)
            setDate(1, 1, year);
        public Date(Date aDate)
            if (aDate == null)//Not a real date.
                 System.out.println("Fatal Error.");
                 System.exit(0);
            month = aDate.month;
            day = aDate.day;
            year = aDate.year;
        public void setDate(int monthInt, int day, int year)
            if (dateOK(monthInt, day, year))
                this.month = monthInt;
                this.day = day;
                this.year = year;
            else
                System.out.println("Fatal Error");
                System.exit(0);
        public void setDate(String monthString, int day, int year)
            if (dateOK(monthString, day, year))
                this.month = monthStringToInt(monthString);
                this.day = day;
                this.year = year;
            else
                System.out.println("Fatal Error");
                System.exit(0);
        public void setDate(int year)
            setDate(1, 1, year);
        public void setYear(int year)
            if ( (year < 1000) || (year > 9999) )
                System.out.println("Fatal Error");
                System.exit(0);
            else
                this.year = year;
        public void setMonth(int monthNumber)
            if ((monthNumber <= 0) || (monthNumber > 12))
                System.out.println("Fatal Error");
                System.exit(0);
            else
                month = monthNumber;
        public void setDay(int day)
            if ((day <= 0) || (day > 31))
                System.out.println("Fatal Error");
                System.exit(0);
            else
                this.day = day;
        public int getMonth( )
             return month;
        public int getDay( )
            return day;
        public int getYear( )
            return year;
        public String toString( )
            return (month + " " + day + ", " + year);
        public boolean equals(Date otherDate)
            return ( (month == otherDate.month)
                      && (day == otherDate.day) && (year == otherDate.year) );
        public boolean precedes(Date otherDate)
            return ( (year < otherDate.year) ||
               (year == otherDate.year && getMonth( ) < otherDate.getMonth( )) ||
               (year == otherDate.year && month == otherDate.month
                                             && day < otherDate.day) );
        public void readInput( )
            boolean tryAgain = true;
            Scanner keyboard = new Scanner(System.in);
            while (tryAgain)
                System.out.println("Enter month, day, and year.");
                  System.out.println("Do not use a comma.");
                String monthInput = keyboard.next( );
                int dayInput = keyboard.nextInt( );
                int yearInput = keyboard.nextInt( );
                if (dateOK(monthInput, dayInput, yearInput) )
                    setDate(monthInput, dayInput, yearInput);
                    tryAgain = false;
                else
                    System.out.println("Illegal date. Reenter input.");
        private boolean dateOK(int monthInt, int dayInt, int yearInt)
            return ( (monthInt >= 1) && (monthInt <= 12) &&
                     (dayInt >= 1) && (dayInt <= 31) &&
                     (yearInt >= 1000) && (yearInt <= 9999) );
        private boolean dateOK(String monthString, int dayInt, int yearInt)
            return ( monthOK(monthString) &&
                     (dayInt >= 1) && (dayInt <= 31) &&
                     (yearInt >= 1000) && (yearInt <= 9999) );
        private boolean monthOK(String month)
            return (month.equals("January") || month.equals("February") ||
                    month.equals("March") || month.equals("April") ||
                    month.equals("May") || month.equals("June") ||
                    month.equals("July") || month.equals("August") ||
                    month.equals("September") || month.equals("October") ||
                    month.equals("November") || month.equals("December") );
        private String monthString(int monthNumber)
            switch (monthNumber)
            case 1:
                return "January";
            case 2:
                return "February";
            case 3:
                return "March";
            case 4:
                return "April";
            case 5:
                return "May";
            case 6:
                return "June";
            case 7:
                return "July";
            case 8:
                return "August";
            case 9:
                return "September";
            case 10:
                return "October";
            case 11:
                return "November";
            case 12:
                return "December";
            default:
                System.out.println("Fatal Error");
                System.exit(0);
                return "Error"; //to keep the compiler happy
        private int monthStringToInt(String monthString) {
             if (monthString.equals("January")) return 1;
             else if (monthString.equals("February")) return 2;
             else if (monthString.equals("March")) return 3;
             else if (monthString.equals("April")) return 4;
             else if (monthString.equals("May")) return 5;
             else if (monthString.equals("June")) return 6;
             else if (monthString.equals("July")) return 7;
             else if (monthString.equals("August")) return 8;
             else if (monthString.equals("September")) return 9;
             else if (monthString.equals("October")) return 10;
             else if (monthString.equals("November")) return 11;
             else if (monthString.equals("December")) return 12;
             else return -1;
    }I've added one method: monthStringToInt to convert "January", "February" into an integer value. There are probably better ways to do this (Calendar), but this involes no other classes.

Maybe you are looking for