How to error check string for LONG list of strings

Hi All,
Let's say I want to compare a string variable with a long list of strings to see if it matches anything in that list. Is there some built-in function that will make this easy. Or should I do it the old fashioned way and load a string array with the list and then for loop through the array comparing each element?
Cheers,
ScKaSx

ScKaSx wrote:
I'm alittle weak at using interfaces. If the string I am trying to compare is (String grade), then how do I define my List to be ("A+", "A", "A-", "B+", "B", "B-", "C+", "C", .....). This is as far as I've got:
String grade = 'some letter to be compared'
String [] GradeList = new String [] {"A+", "A", "A-", "B+", "B", "B-", "C+", "C", .....};Maybe I could summarize what I meant using your example:
Set<String> PossibleGrades = new HashSet();
PossibleGrades.add("A+");
PossibleGrades.add("C");
String grade = "some letter to be compared";
if(PossibleGrades.contains(grade) )
   // do something...
}

Similar Messages

  • How to determine pricing procedure for invoice list

    Hi ,
    Could you pl let me know "How to determine pricing procedure for invoice list"
    All other things are available i.e.
    Create Condition Tables
    Maintain access sequences
    Maintain pricing procedures
    Define condition types
    Basically how the pricing procedure will be assigned for the Invoice list.
    br
    pinky

    Hi Pinky,
    Create a billing doc type by coping std.(ZF1)
    Assign invoice list to billing type Zf1
    Now maintain a document pricing procedure (for Eg: Z )
    Assign this to billing type in pricing control - document pricing procedure.
    Now maintain the pricing procedure determination as per the sales area /doc pp/cust pp.
    Also in copy control in VTFL maintain pricing type as " B".
    REgards,
    Krishna O

  • How to Filter a DVWP for other list items with same name?

    I have 2 lists, Clients & Engagements.
    The Engagements list has a lookup field to the Clients list (to the Title).
    The Engagements list often has more than on listing (job) for the same client at one time. I am trying to create a DisplayForm on the Engagements list that will also include a DVWP that will list all other items in the Engagements list that have
    the same Client Name ([Title]).
    I tried to use a parameter but not sure which one or if that is correct way? I have looked at the Query String but don't see anything in there to relate the other items together.
    The other option is I could use a Workflow to copy the [ID] column from the Clients list into a [ClientsID] column in the Engagement list but I figure there is an easier way since I already have a lookup column linking the two lists.
    Any help or direction would be appreciated.
    Stunpals - Disclaimer: This posting is provided "AS IS" with no warranties.

    Sudip, this is probably me not understanding the correct terminology for each type of webpart it seems in my reading I have either not understood the reference or the writer had them mixed up.
    Just to clarify I am using SharePoint Foundation 2010.
    I have attached a few screenshots so you can see what I am referring to, so we can avoid any confusion or misused terminology. I created a new test site and 2 new lists so I don't have to block out client data.I have created 2 lists Clients & Jobs. The
    jobs has a lookup to the Clients list. I have been trying to create 1 new display form on each list.
    ***Jobs**
    I want to open the DispForm for the job but also at the bottom of the display list all other jobs with the same client name. (seems straight forward)
    I have inserted a DVWP for the Jobs list and when I try to use a connection the filter list has blank columns for both lists.
    While focused on the upper display form section, I use the "Add Connection"  button and select
    "Send Row of Data To",
    Webpart on this page
    Target webpart=Jobs(1), Target Action=Get Filter Values From
    And the columns are blank and can not be changed or selected
    If I start over, still focused on the top Display webpart and select but select Get Filter Value from the columns are then active but obviously this is backwards from what I am trying to do.
    If I try to follow the Get Filter values from while selecting the bottom DVWP that was inserted, again the columns come up blank.
    I have used connections successfully on different pages and even on this page but not in the fashion I am attempting now.
    This is why I thought I could/should be using/passing a value in the query string then use filtering. I have used the ID in the query string previously but that will not work in this scenario.
    I also considering a similar DispForm from the Clients list showing all Jobs for the open client but have the same issue. This would likely be a more appropriate view but I am interested in seeing if both can be done.
    Honestly my gut is saying filtering and query strings is how I should be doing this but again I am no expert. That's where I started a few weeks ago but despite the numerous guides I have found to do this I still can't get it to work. There is either
    missing instructions or skipped steps or it was done in a different version of SPD and I can not find the tab, feature, etc anywhere even after googling and reading.
    Stunpals - Disclaimer: This posting is provided "AS IS" with no warranties.

  • How to supplier backlog/advance for a list of materials ?

    Hello,
    in ME38, we manage the purchasing schedule lines and inbound deliveries : user can see backlogs/advance in ME38 for a material.
    How to see supplier backlogs/advance in mass for a list of materials ? is there a transaction for such a thing ?
    Thanks a lot.
    Best regards,
    Romeo.

    There is no T code as you requied.
    please check me2n or me2m.
    if not satisfied go for ABAP development

  • Is it possible to make the log pop up of errors/warnings appear for longer?

    Dear all
    The answer to this question may have already been posted but I could not locate it when searching.
    I am running SQL Developer 1.5.1 and I have set up the display so that the log is minimised. When I debug or compile any packages the log of error messages/warnings pops up. However this does not stay on screen long enough for me to be able to read it and only 1 in 4 times do I get to the log window quick enough, in order to click on it to keep it open. Is there away of making the log pop up until I minimise it or at least stay on screen for longer, so that I can reach it in time? I estimate it is currently staying on screen for less than 1 second.
    I don't want the log to be displayed all the time because it takes up valuable space, which I find useful when writing my code. It gets in the way even more when I am using the SQL statement window/script output window.
    Kind regards
    Tim

    Thank you K. for your reply.
    After all these months of using SQL developer. it never registered with me that hovering over the tab brings it up. I must have brought it up before now but I don't remember doing so if I did.
    Problem resolved.
    Kind regards
    Tim

  • How to extend the timeout for long running queries

    I unfortunately have a query that needs to run for 2 hours (long story) to load a year's worth of data into PowerPivot (RTM).  PowerPivot stops with an error after running for 1 hour.  I tried changing the "General Timeout" setting from 0 to 28800
    (8 hours) in the SQL conneciton settings (native client 10.0) and I also managed to get the server owner to increase the "Query Timeout" setting in the SQL Server's Connections dialog but PowerPivot still errors out after 1 hr.  
    A workaround will be to use SSIS to run the query and store the result in another database but I'd rather not do that if I don't have to.
    Error Message
    The refresh operation failed because the source data base or the table does not exist, or because you do not have access to the source
    More Details:
    OLE DB or ODBC error: Query timeout expired; HYT00.
    An error occurred while processing the 'XXXX' table.
    The operation has been cancelled.
    Is there any other place where the timeout can be set or controlled that I've missed?

    Try 
    1) Setting "ExternalCommandTimeout" in the server configuration file (msmdsrv.ini) to a multiple of seconds you want (in this case >7200, by default it is 3600(1hr)).
    2) Restart the server.
    3) Refresh the data.
    Please let me know, if this doesn't work.

  • How to make a tooltip for incoming list items

    Hi,
    I am trying to make a tooltip with JQuery for incoming list items. People will enter some text in a textfield en those values will be added to a list. I want to make a tooltip for every list item that will be added to the list. I want the text that people fill in in the textfield to be added in the tooltip, is this possible? And how can I do this? Thanks! This is what I have so far..
    <input type="text" id="input" placeholder="Voer item in" /> <button id="button">Toevoegen</button>
    <div id="tooltip"></div>
    $(document).ready(function(e) {
      $('#button').on('click', function (){
      var toevoegen = $('#input').val();
      var verwijderen = '<a href = "#" class = "verwijderen">Verwijderen</a>'
      <!--add list item-->
      $('#boodschappenlijst').prepend('<li>' + toevoegen + '' + '\t' + verwijderen + '</li>');
    <!--remove list item-->
    $('#boodschappenlijst').on('click', '.verwijderen', function(){
      $(this).parent('li').remove();
    <!-textfield empty-->
    $('#input').on('click', function (){
      $(this).val('')
    $('#boodschappenlijst').hover(
    function (){
      $('#tooltip').css('display', 'block')
    function (){
      $('#tooltip').css('display', 'none')
    #tooltip {
      position: absolute;
      top: 100px;
      right: 300px;
      border: 1px solid #000000;
      border-radius: 5px;
      color: black;
      width: 100px;
      display: none;
    The tooltip appears, but I want the text that people fill in in the textfield to be added in the tooltip

    Hi,
    I am trying to make a tooltip with JQuery for incoming list items. People will enter some text in a textfield en those values will be added to a list. I want to make a tooltip for every list item that will be added to the list. I want the text that people fill in in the textfield to be added in the tooltip, is this possible? And how can I do this? Thanks! This is what I have so far..
    <input type="text" id="input" placeholder="Voer item in" /> <button id="button">Toevoegen</button>
    <div id="tooltip"></div>
    $(document).ready(function(e) {
      $('#button').on('click', function (){
      var toevoegen = $('#input').val();
      var verwijderen = '<a href = "#" class = "verwijderen">Verwijderen</a>'
      <!--add list item-->
      $('#boodschappenlijst').prepend('<li>' + toevoegen + '' + '\t' + verwijderen + '</li>');
    <!--remove list item-->
    $('#boodschappenlijst').on('click', '.verwijderen', function(){
      $(this).parent('li').remove();
    <!-textfield empty-->
    $('#input').on('click', function (){
      $(this).val('')
    $('#boodschappenlijst').hover(
    function (){
      $('#tooltip').css('display', 'block')
    function (){
      $('#tooltip').css('display', 'none')
    #tooltip {
      position: absolute;
      top: 100px;
      right: 300px;
      border: 1px solid #000000;
      border-radius: 5px;
      color: black;
      width: 100px;
      display: none;
    The tooltip appears, but I want the text that people fill in in the textfield to be added in the tooltip

  • How to pull Net pay for a list of employee numbers

    Hi all,
    Can i know how to pull data for a list of employees with their net pay .
    Can i know which table /FM i should trigger to do this .
    regards,
    Evani

    Hi,
    Using the FM CU_READ_RGDIR read RGDIR, get the sequence number for the given period and read the BT (Payresult table returing from below function module )using the FM PYXX_READ_PAYROLL_RESULT. In BT table (Bank Tranfer) u can get the Bank transfer amount.

  • How to get check number for the employee's paycheck

    Hello
    Anyone can advise on how to get the check number for an employee's pacheck
    I got employee first name,last name,GROSS salary,Tax Info,and NET salary.I need the CHECK NUMBER.
    please advise
    thanks
    kp
    Edited by: user8612301 on Dec 16, 2010 1:26 PM

    Hi,
    Or are you looking for this:
    SELECT serial_number, paaf.assignment_number
    FROM pay_assignment_actions paa, per_all_assignments_f paaf
    WHERE action_status = 'C'
    AND paaf.assignment_id = paa.assignment_id
    AND serial_number IS NOT NULL
    AND SYSDATE BETWEEN paaf.effective_start_date AND paaf.effective_end_date;
    - Viky
    Edited by: Viky on Dec 17, 2010 11:42 AM

  • How can I use script change long list format?

    Hi everyone
    If I have this kind of long list
    0101
    Long white radish
    Chinese Celery
    Tah tsai
    Round cucumber
    Cherry radish
    fennel
    Small-leaf arugula
    Small wax gourd
    0102
    Green-leaf Lettuce
    Broad-leaf arugula
    UFO squash
    Crystal radish
    Red wave lettuce
    Green endive
    Sponge gourd
    Rose-heart radish
    Butter head lettuce
    Radicchio
    0103
    Chinese mustard
    New Zealand spinach
    Yellow summer squash
    Turnip
    Malabar spinach
    Chinese kale
    Green bean
    Edible rape
    Begonia fimbristipulata hance
    Purple bean
    Cabbage
    Water Spinach
    Okra
    Snow peas
    How can I change the format into this:
    0101
    0101/Long white radish
    0101/Chinese Celery
    0101/Tah tsai
    0101/Round cucumber
    0101/Cherry radish
    0101/fennel
    0101/Small-leaf arugula
    0101/Small wax gourd
    0102
    0102/Green-leaf Lettuce
    0102/Broad-leaf arugula
    0102/UFO squash
    0102/Crystal radish
    0102/Red wave lettuce
    0102/Green endive
    0102/Sponge gourd
    0102/Rose-heart radish
    0102/Butter head lettuce
    0102/Radicchio
    0103
    0103/Chinese mustard
    0103/New Zealand spinach
    0103/Yellow summer squash
    0103/Turnip
    0103/Malabar spinach
    0103/Chinese kale
    0103/Green bean
    0103/Edible rape
    0103/Begonia fimbristipulata hance
    0103/Purple bean
    0103/Cabbage
    0103/Water Spinach
    0103/Okra
    0103/Snow peas
    by useing script?
    thanks
    Teetan

    Hi,
    Perhaps not a problem, try this code ...
    var myFolder=Folder("~/Documents");
    var sourceFile = new File(myFolder + "/"+"sourceFile.txt");
    var logFile = new File(myFolder + "/"+"logFile.txt");
    //var elementList = Array('0101','Long white radish','Chinese Celery','Tah tsai','Round cucumber','Cherry radish','fennel','Small-leaf arugula','Small wax gourd','0102','Green-leaf Lettuce','Broad-leaf arugula','UFO squash','Crystal radish','Red wave lettuce','Green endive','Sponge gourd','Rose-heart radish','Butter head lettuce','Radicchio','0103','Chinese mustard','New Zealand spinach','Yellow summer squash','Turnip','Malabar spinach','Chinese kale','Green bean','Edible rape','Begonia fimbristipulata hance','Purple bean','Cabbage','Water Spinach','Okra','Snow peas')
    //var newElementList = new Array;
    var myPattern = new RegExp("^\\d{4,4}$");
    var myPrefix="";
    if (sourceFile.exists){sourceFile.open( 'r' );
    while( !sourceFile.eof ) {
              var aElement  = sourceFile.readln();
              if (myPattern.test(aElement)){
                  //newElementList.push(aElement);
                  myPrefix = aElement + "/";
                  writeLogFile(aElement)
              } else {
                   //newElementList.push(myPrefix+ aElement);
                   writeLogFile(myPrefix+ aElement)
        //$.write(newElementList);
    function writeLogFile(theString) {
        logFile.open( "a" );
        logFile.writeln(theString);
        logFile.close();   

  • I think my email was hacked from my iPad how can I check it for viruses

    I think my e mail was hacked from my iPad. How can I check the iPad for viruses?

    Well there are apps for that, but iPads and others are not suseptable to viruses, if they are its very very very small number. So I would suspect that you are fine, but check the app store for an app that would scan for viruses, i use Virusbarrier to scan downloads i get in emails, or links.

  • How to create Check table for Field Maktx

    Hi Experts,
    I am create one ztable with fields Mandt, Matnr, Maktx, Type1 and Type2 etc.
    I need a create a check table for field MAKTX.
    If i give material number the its the material description also.
    Thanks in Advance,
    Purnaneelu.

    Hi,
    Actually i am create one ZTable with fields Mandt ,matnr, maktx, type1,type2 and type3
    Now i am entry the data for matnr,type1,type2 and type3 .
    Now i am going to TCode SE16n material is not appears, but the requirement is shows the description also
    STOP USING I AM in each and every sentence...and try to correct your english...so that people can understand your problem easily.
    Hope this suggestion will help you going forward at the time of posting your question at SDN.
    Wram regards,
    Abhishek

  • How to create a matchcode for the list of Customers "Group key" KNA1-KONZS

    Hi All,
    with reference to the creation of "Group key" KNA1-KONZS for Customers,
    I'd like to know if is possible to create a matchcode for the list of Customers "Group key" created.
    Thanks
    Gandalf

    Hi
    MAINTAIN THE GROUP KEY IN GENERAL DATA ---CONTROL DATA SCREEN
    If the customer or the vendor belongs to a group, you can enter a group
    key here. The group key is freely assignable.
    If you create a matchcode using this group key, group evaluations are
    possible.
    KNA1-KONZS
    Cya
    udayakumar

  • How to give column heading for detailed list

    hi,
    we can get column-heading of basic list by text-element provided.
    but what are ways of giving column heading in detailed list ?

    HI,
    Based on the SY-LSIND value, you can have a different heading.
    top-of-page at line-selection.
    case sy-lsind.
    when 1.
    write:/ 'Heading for first list'.
    when 2.
    write:/ 'Heading for second list'.
    when 3.
    write:/ 'Heading for third list'.
    endcase.
    please see the link below it might help you
    http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/dba2eb35c111d1829f0000e829fbfe/content.htm
    *******please reward points if the information is helpful to you*************

  • How automatic dirty checking works for persistance layer?

    Hi,
    I recently started learning about Java Persistance API and also about Hibernate and I came across this example
    private void addPersonToEvent(Long personId, Long eventId) {
        Session session = HibernateUtil.getSessionFactory().getCurrentSession();
        session.beginTransaction();
        Person aPerson = (Person) session.load(Person.class, personId);
        Event anEvent = (Event) session.load(Event.class, eventId);
        aPerson.getEvents().add(anEvent);
        session.getTransaction().commit();
    }and in the explanation they have given like
    After loading a Person and an Event, simply modify the collection using the normal collection methods. As you can see, there is no explicit call to update() or save(), Hibernate automatically detects that the collection has been modified and needs to be updated. This is called automatic dirty checking, and you can also try it by modifying the name or the date property of any of your objects.
    How does it work? I know that something called dynamic proxy that exist in java, is it by that?
    Let us say I want something to do like an interceptor, whenever I call a particular method on an object, that call will first be address by me and then it will be delegated to the actual object.
    Say
    public void handleEvent(SyncCompletedEvent event)
            // We have to handle this one, this is the only one that will trigger the start up sync
            // however, this request doesn't need response!
            if (event.isSenderDeviceCommunicator())
                // set the request to null, so that no intermediate response will be sent out.
                handleRequest((UpmSyncRequest) null);
            if(event.getSubType().equals(SyncCompletedEvent.SUBTYPE.LEGACY_SERVER_STARTUP_COMPLETED))
                ((UpmService) getService()).scheduleAuditBackup(false);
        }

    What kind of problems do you have with the Firefox 28 release?
    Did you check your security software (firewall, anti-virus) to make sure that the new version in allowed?
    It is possible that your security software (firewall, anti-virus) blocks or restricts Firefox or the plugin-container process without informing you, possibly after detecting changes (update) to the Firefox program.
    Remove all rules for Firefox and the plugin-container from the permissions list in the firewall and let your firewall ask again for permission to get full, unrestricted, access to internet for Firefox and the plugin-container process and the updater process.
    See:
    *https://support.mozilla.org/kb/Server+not+found
    *https://support.mozilla.org/kb/Firewalls
    *https://support.mozilla.org/kb/fix-problems-connecting-websites-after-updating
    You can create a new profile as a test to check if your current profile is causing the problem.
    See "Creating a profile":
    *https://support.mozilla.org/kb/profile-manager-create-and-remove-firefox-profiles
    *http://kb.mozillazine.org/Standard_diagnostic_-_Firefox#Profile_issues
    If the new profile works then you can transfer files from a previously used profile to the new profile, but be cautious not to copy corrupted files to avoid carrying over the problem
    *http://kb.mozillazine.org/Transferring_data_to_a_new_profile_-_Firefox

Maybe you are looking for

  • Fields missing in Shipment Document VT01N

    Hi Experts, Can you help to have field's in Shipment Document Like Shipping condition & Shipping type.When i am creating shipment i don't see these fields in shipment header. Thanks.

  • Please help me make the sound of my PC normal?

    I need to know how to check the sound configuration on my pc, adjust it so that it is normal again and not sounding like I am in a tunnel or concert hall, and that's all.  Is this so difficult for the Robohelp or powers that be?

  • Ftp username and password when downloading ?

    Hi, I'm asked an username and password when trying to download JEE edition 5 (name for ftp://ftp.sap.com). What does it mean ? Thanks for Help. Etienne PS : server seems to be busy with more than 150 simultaneous connection....

  • Match beginning of line with Regular Expression

    I'm confused about dreamweaver's treatment of the characters ^ and $ (beginning of line, end of line) in regex searches. It seems that these characters match the beginning of the file, not the beginning of the various lines in the file. I would expec

  • Setting up wireless first time on my laptop

    Am having terrible problems it says it lilited or no connectivity and something about the ip address can anyone help am not particularly computer savvy