UDF problem with value comparison

Dear Experts,
as I am not a Java-expert I need your help. I created a UDF (type ""QUEUE", also tried "CONTEXT" but did not work), which accepts 3 parameters from my input-XML file. For some reason, from the UDF I always get the value "O" back, even if for instance the Billingstatus1 = C.
In message-mapping, I mapped the node "BillingStatus1" directly to the input parameter of the UDF. The same goes for the other parameters.
Code of UDF:
if(BillingStatus1.equals("C") | BillingStatus2.equals("C"))
result.addValue("I");
else if(DeliveryStatus.equals("C"))
result.addValue("S");
else {
result.addValue("O");
Can anybody please tell me what I am doing wrong here?
Thanks in advance!
William
Edited by: JWD on Dec 2, 2009 5:22 PM

Hi,
UDF looks like mixture of the contexts....
if it is QUEUE then arrays will be passed to the UDF you need to access the values using index...
i.e BillingStatus1[0]...also logical or is two pipes || not single pipe |
for ( int i=0 ; i<BillingStatus1.length;i++)
   if(BillingStatus1<i>.equals("C") || BillingStatus2<i>.equals("C"))
    result.addValue("I");
else if(DeliveryStatus<i>.equals("C"))
  result.addValue("S");
else {
result.addValue("O");
try above code
HTH
Rajesh

Similar Messages

  • Problem with value in object element declared as NUMBER(26,3)

    We have an object OBJ_NAME_1 created like below and total element in the object are around 100 with in which only one element is of data type VARCHAR2(4000). Other are with small size as below
    create or replace TYPE OBJ_NAME_1 AS OBJECT
    ( v_col1 VARCHAR2(4),
    v_col2 VARCHAR2(4),
    d_date DATE,
    amount_1 NUMBER(26,3) . . . . . . . . . . .)
    And we are creating an VARRY of above object as below:
    create or replace TYPE ARRAY_NAME_1 AS VARRAY(1000) OF OBJ_NAME_1
    Now we have one procedure with IN parameter of type ARRAY_NAME_1 as below and we are calling this procedure from java.
    create or replace PROCEDURE SP_PROC_1 (
    P_ARR_1 IN ARRAY_NAME_1,
    P_FILE IN VARCHAR2,
    E_MESS OUT VARCHAR2,
    E_CODE OUT NUMBER) . . . . . . . .
    My problem is with value of element amount_1 of array ARRAY_NAME_1 in the procedure. Actually data type of this element is NUMBER(26,3) in object. But from java we are able to pass value like 1234.12345 (with 5 decimal).
    The declare section of the procedure are like below :
    l_OBJ_NAME_1 OBJ_NAME_1;
    m_amount_1     table_1.amount_1%type; /* amount_1 in table_1 declared as NUMBER(26,3)*/
    n_amount_1     NUMBER(26,3);
    In the begin section we are assigning variable like below:
    IF (P_ARR_1 .COUNT>0) THEN
    FOR i IN P_ARR_1.FIRST .. P_ARR_1.LAST LOOP
    l_OBJ_NAME_1 := P_ARR_1(i);
    m_amount_1 := P_ARR_1(i).amount_1;
    n_amount_1 := P_ARR_1(i).amount_1;
    END LOOP;
    The value of variables are below after above assignment:
    l_OBJ_NAME_1 . Amount_1 → 234.12345 (without round off)
    m_amount_1 → 234.12345 (without round off)
    n_amount_1 → 234.123 (with round off)
    Actually all the above 3 variable/element has been declared as NUMBER(26,3), then the value in these variables should be with rounded up to 3 decimal place. Then why it is not happening with variable
    l_OBJ_NAME_1 . Amount_1 and m_amount_1?
    Please help.
    Edited by: SANT007 on Aug 12, 2011 9:45 AM

    Okay, thanks Patrick. I commented that out so now I can see the full error message. Actually, now the page just returns an "OK" (nothing else), and I click on that to return back to the page where I see:
    Checksum error for Hidden and Protected item ID (26968176992578859), value ([object]), posted checksum (326873D5A54A4AF425EC4D500B9B4D02), expected checksum (********************************), index_i (10), index_j (2), index_m (2);
    Okay, so that's evidently a new option in 3.1, it should have just been a 'Hidden' item, not 'Hidden and Protected'. So, I change this back to just 'Hidden', refressh the page, the re-execute it and try to select from the popup again. This time, instead of the more-or-less blank page with only "OK" on it, I also get "ORA-01722: invalid number" above the "OK". When I click the "OK", then I am returned back to the last good 'runnable' page I executed (since the search page is no longer 'runnable' (the javascript evidently is still returning an object instead of a number).
    On a previous run of trying to track the problem down, I made the :P3_SEQ as a regular text field so I could try to see what was going on, and it briefly displayed "[object]" before the search executed and returned the error.
    So thanks for helping me get past the first stage so I could see a better version of what the error is. Now I just need to figure out why an object is being returned instead of number. This worked fine in 3.0, and the only thing I can think of is that something, somewhere in 3.1's javascript is slightly different now, but I really don't know.
    Bill Ferguson

  • Problems with value retorned by   FM: 'SPELL_AMOUNT' with language 'ES'

    Hi,
    I'm having problems with the FM 'SPELL_AMOUNT' with language 'ES'.
    When amount it's over 1 billion, the output is something like this:
    <b>Amount (NUM)</b>--<b>Actual output</b>--
    <b>wanted output</b>
    1.000.000.000, 00  -
    Un Millardo Millones -
    Un Millardo or                                                                                Mil Millones
    25.000.000.000,00 -
    Veinticinco millardos millones -
    Veinticinco millardos or veinticincomil millones
    Please, if somebody could help me, god bless you!!!
    <b>Alexis Sanchez
    ABAP Trainee
    Valencia, Venezuela</b>

    Hi,
    I tested it in SE37, i am getting the correct output, Please make sure that you are passing all the values correctly i mean the CURRENCY .
    Regards
    Sudheer

  • Facing problem with Value Help

    Hi Friends,
    I am trying to use Value helps for 4 different variables.
    When I click on any Value help for a range of that variable, it gives list of 1st variable only.
    Please help..
    Jatin

    Hi,
    What is "We need all the variables with value help in a single form".
    For this creat all variables with single form and then add value helps there.
    You are getting same list means you are creating (using same design parameters) for both fields:
    comp_code and Emp_code .
    I think u did mistake in fields mapping while creating value help i.e step no 2
    Can u check this once and if this is not correct just send ur gml file i will check and let u know the problem
    Regards,
    Govindu

  • Problems with string comparison using

    I have a problem using the > and < comparison operators.
    When the xsl:if test uses numeric values the comparison works OK. If the
    test uses string values it always returns a false result.
    The style sheet below shows an example (which should run against any
    XML doc with a root element)
    Note - the spurious
    tags are just for debugging- I write the
    output to an HTML page and IE happens to recognise them
    even though the rest of the HTML tags are missing !!
    <?xml version="1.0" ?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
    <xsl:template match="/">
    <xsl:for-each select="*">
    Starting numeric test :
    <xsl:if test="(1 < 2)">
    In Test, ID= <xsl:value-of select="generate-id()"/>
    </xsl:if>
    Finished numeric test :
    Starting alpha test :
    <xsl:if test="('a' < 'b')">
    In Test, ID= <xsl:value-of select="generate-id()"/>
    </xsl:if>
    Finished alpha test :
    </xsl:for-each>
    </xsl:template>
    </xsl:stylesheet>
    null

    Having looked at the XPath spec I believe what I am trying to do (compare strings with gt and lt type tests) is not supported. The spec indicates that they can only be used for node sets or numerics. Presumably the processor is attempting to convert the values to numbers but evaluating them both as NaN (not a number). Can someone confirm this.
    I find this restriction quite strange, is this a situation where an extension function is required ? If so can someone point me to some (Java) examples.
    null

  • Problems with value-based hierarchies in Oracle 11gR2

    Hello,
    I have the following problem:
    I want to cereate a dimension with 2 hierarchies.
    These hierarchies have to be value-based.
    It's no problem to fill and display one of them, but when I fill both and try to display them, at the lowest level, the parent-child relevancy is now incorrect.
    Let's display this in OLAP Worksheet for Cube Type OLAP 11g :
    lcolwidth=20
    rpr down nim_2 w 25 NIM_2_PARENTREL
                              ------------------NIM_2_PARENTREL------------------
                              ------------------NIM_2_HIERLIST-------------------
    NIM_2                                KON                       AGT
    L1_Total_AGT_A            NA                        NA
    L1_Total_KONZ_K           NA                        NA
    L2_AGT_A_A                NA                        L1_Total_AGT_A
    L2_AGT_B_A                NA                        L1_Total_AGT_A
    L2_AGT_C_A                NA                        L1_Total_AGT_A
    L2_KONZ_1_K               L1_Total_KONZ_K           NA
    L2_KONZ_2_K               L1_Total_KONZ_K           NA
    L3_100_A                  NA                        L2_AGT_A_A
    L3_100_K                  L2_KONZ_1_K               NA
    L3_200_A                  NA                        L2_AGT_B_A
    L3_200_K                  L2_KONZ_1_K               NA
    L3_300_A                  NA                        L2_AGT_C_A
    L3_300_K                  L2_KONZ_2_K               NA
    L4_101_A                  NA                        L3_100_A
    L4_101_K                  L3_100_K                  NA
    L4_301_A                  NA                        L3_300_A
    L4_301_K                  L3_300_K                  NA
    L5_302_A                  NA                        L4_301_A
    L5_302_K                  L4_301_K                  NA
    100                       NA                        L3_100_A
    101                       L4_101_K                  NA
    102                       NA                        L4_101_A
    200                       NA                        L3_200_A
    201                       L3_200_K                  NA
    300                       L3_300_K                  NA
    301                       NA                        L4_301_A
    302                       NA                        L5_302_A
    303                       NA                        L5_302_A
    304                       NA                        L5_302_AAs you see, the lowest level items are only connectet with one of the hierachies, instead connected with both. (100, 101, e.g)
    If I build the same dimension in a 10g Cube, the result is now correct.
    Let's display this in OLAP Worksheet for Cube Type OLAP 10g :
    lcolwidth=20
    rpr down nim w 25 NIM_PARENTREL
                         -------------------NIM_PARENTREL-------------------
                         -------------------NIM_HIERLIST--------------------
    NIM                             AGT                       KON
    L1_Total_AGT_A       NA                        NA
    L1_Total_KONZ_K      NA                        NA
    L2_AGT_A_A           L1_Total_AGT_A            NA
    L2_AGT_B_A           L1_Total_AGT_A            NA
    L2_AGT_C_A           L1_Total_AGT_A            NA
    L2_KONZ_1_K          NA                        L1_Total_KONZ_K
    L2_KONZ_2_K          NA                        L1_Total_KONZ_K
    L3_100_A             L2_AGT_A_A                NA
    L3_100_K             NA                        L2_KONZ_1_K
    L3_200_A             L2_AGT_B_A                NA
    L3_200_K             NA                        L2_KONZ_1_K
    L3_300_A             L2_AGT_C_A                NA
    L3_300_K             NA                        L2_KONZ_2_K
    L4_101_A             L3_100_A                  NA
    L4_101_K             NA                        L3_100_K
    L4_301_A             L3_300_A                  NA
    L4_301_K             NA                        L3_300_K
    L5_302_A             L4_301_A                  NA
    L5_302_K             NA                        L4_301_K
    100                  L3_100_A                  L3_100_K
    101                  L4_101_A                  L4_101_K
    102                  L4_101_A                  L4_101_K
    200                  L3_200_A                  L3_200_K
    201                  L3_200_A                  L3_200_K
    300                  L3_300_A                  L3_300_K
    301                  L4_301_A                  L4_301_K
    303                  L5_302_A                  L5_302_K
    304                  L5_302_A                  L5_302_K
    302                  L5_302_A                  L5_302_K-----
    We are using the latest Version of AWM: Version 11.2.0.1.0A
    Database:
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    PL/SQL Release 11.2.0.1.0 - Production
    "CORE     11.2.0.1.0     Production"
    TNS for IBM/AIX RISC System/6000: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production
    Thank you verry much for any help.

    11.2.0.2 for AIX was announced in October 2010. See DOC ID 1249584.1
    What is being announced?
    We are pleased announce the October 19, 2010 release of Oracle Database 11g Release 2 Patchset 1 (11.2.0.2) on HP-UX > Itanium and IBM AIX on POWER Systems.Patchset 10098816
    Description 11.2.0.2.0 PATCH SET FOR ORACLE DATABASE SERVER
    Product Oracle Database Family
    I have looked, but I cannot find a formal bug for this problem. My hunch is that it was fixed as a side effect of other changes, and I know there were several in this area. My simple test case did work in 11.2.0.2, so I hope it is all fixed. But feel free to enter an SR if you want. (If you mention my name in the SR then support should contact me.) You should certainly do this if moving on to 11.2.0.2 does not resolve the issue.

  • Problems with values changed from timeout to event

    Hi all
    i've this question.
    I'm talking with an instrument (oscilloscope) asking it some values and i can see them into my labview panel (refreshing them every timeout loop).
    I can set different values into labview panel and the scope changes its settings so in the next loop my panel reads the new value from the scope.
    I obtain this with some events and all is working perfectly.
    My problem is this: when i click on an element (click generates an event) labview must finish timeout loop and only then executes the event, so the new value set by the user will be ignored.
    What can i do to execute the event "instantly" with new user values?
    tnx to all
    http://www.sd-studio.it - web design agency

    As per your description, the user input should be delayed, not ignored, because LV will execute the event at last.
    Anyway, to shorten the delay, you may simply set a 0 ms (or a very short, e.g. 10 ms) timeout for the event structure and manage a timeout "by hand". For example, you store in a shift register the last time you executed the refreshing code; when the timeout event executes, you subtract the last time value from the current time; if the difference is more than a given threshold, you actually execute the refreshing code.
    Paolo
    LV 7.0, 7.1, 8.0.1, 2011

  • Problems with Value Labels in Stacked Bar Chart

    Post Author: RGR
    CA Forum: Charts and Graphs
    When choosing a stacked bar chart to display the contribution of 2 values to the overall total, the graph plots correctly, but the value labels are incorrect.  Instead of labeling the values for A & B, the graph is appropriately labeled for A ,but the label for B is the total for A+B.  It should be just "B".
    Has anyone else experienced this problem or has a solution.  I am using CR 2008
    TX

    Post Author: Joy Hampson
    CA Forum: Charts and Graphs
    I have this issue a lot with CR XI.  As I have never used CR 2008, I am not sure of the commands.  But in CR XI, right click on the graph and select Chart Options.  On the Data Labels tab, at the bottom there are two options: Cumulative and Absolute.  It defaults to Cumulative, so change to Absolute.  That always works for me.

  • CLFN problem with values

    Hi everybody,
    I am calling an external DLL via CLFN and have a weird problem. I'm using a function to connect to a USB device and when I manually enter the values for VID, PID and SerialNumber (these three values identify the USB device) in the SubVI, where the DLL is called, it works 100% of the time.
    But whenever I call the SubVI in another VI and simply pass the values, it won't work at times. I used the lamp for debugging, but it did pass the values (as far as I can see) correctly.
    Info: The DLL I'm calling is a wrapper for a C++ DLL, I pass VID and PID as unsigned words and SerialNo as const string*. The CLFN configuration looks like this:
    int8_t ConnectToHidDevice(uint16_t VID, uint16_t PID, const CStr SerialNo);
    Anyone ever had a similar problem? I'd be pleased with any input, this problem is driving me nuts.
    Regards,
    Pedro

    Pedro89 wrote:
    Hi rolfk,
    THat's a nice analogy, you got there
    The C-function-descriptor, as taken from the header file of the dll:
     * Summary: Establishes a connection to a USB/HID device. The device is specified by its
     *          vendor id, product id, and serial number.
     * Params:  usVendorId - Vendor id of the USB/HID device to connect to
     *            usProductId - Product id of the USB/HID device to connect to
     *            szSerialNumber - Serial number of the USB/HID device to connect to (UNICODE)
     * Returns: Nonzero, if a connection to the device has been successfully established; otherwise zero.
    extern "C" SEN_USB_LABVIEW_API unsigned int ConnectToHidDevice(unsigned short usVendorId, unsigned short usProductId, const char* szSerialNumber);
    Regards,
    Pedro
    The red marked word is your problem.
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Pricing problem with value based free goods!

    Hi All,
    I've got a pricing problem.....
    Can anyone can come out with a solution.
    Here is the Business Scenario....
    In a super market pricing...should be implemented in such a way that....if the customer purchases any material(all materials) for $1000 he should be given  a materisl XXX one unit free (free goods)
    How to implement this in SD R/3 Scenario...
    i have tried out with Free goods...n pricing...but was not able to implement it..can any one of you suggest me a solution for this plz..
    Regards,
    Pavan.

    Hi Pavan,
    I would suggest that you post this message in the mySAP ERP business suite solution application forum. Here is the navigation info:
    Welcome to the SAP Forums » SAP Solutions » Enterprise Resource Planning (ERP) . It is more likely that someone from the SD slide will be reading that forum than this "SAP NetWeaver integration with my SAP ERP" forum. 
    I hope this helps,
    Mike.

  • Problem with values between 0 and +-0.49 URGENT

    I have a strange problem. I have an internal table:
    DATA : BEGIN OF xxx OCCURS 0,
           value(15),
           END OF xxx.
    If the xxx-value is between 0.01 and 0.49 the
    if xxx-value GE 0
    returns TRUE and the
    if xxx-value >  0
    returns FALSE.
    If the xxx-value is between -0.01 and -0.49 the
    if xxx-value GE 0
    returns TRUE and the
    if xxx-value >  0
    returns FALSE.
      Our SAP version is 4.0b. Does anyone know any solution to this very urgent and serious problem?
      Thanks in advance<b></b>

    hi,
    DATA : BEGIN OF xxx OCCURS 0,
           value type f,
           END OF xxx.
    also
    2nd condition
    below is not valid condition since it will be always
    less than 0.
    If the xxx-value is between -0.01 and -0.49 the
    if xxx-value GE 0
    returns TRUE and the
    if xxx-value >  0
    returns FALSE.

  • Facing problem with Value Attributes

    Hi,
    I have created a value attribute under the context node. This attribute is editable field. User can enter value for this attribute on WEBUI.
    Now, my problem is in GET_METHOD.
    In get method, normally we get the value using "COLLECTION_WRAPPER" or "ITERATOR". If the attribute is BOL attribute , then we can get the value from these . However my attribute is value attribute, and I am unable to get the value using COLLECTION_WRAPPER or ITERATOR. So, when the user enters any value it is coming into GET_METHOD, and displaying blank value on the screen.
    Now my bottom line question is: if the attribute is value attribute, how can we get the value in GET method.
    Note: I can't add it as BOL attribute, for my case it is not possible.
    Thanks,
    Sandeep

    Hi,
    if it is a pure value note then you could access this using this class instead of bol class:
    lr_value_node TYPE REF TO cl_bsp_wd_value_node.
    Kind regards
    Manfred

  • DropdownByKey inside ALV Table - Problem with Value set

    Hi,
    I have Component A which has a custom controller that uses the interface controller of the ALV Component.
    Custom controller has node ITAB.. that has certain attributes...
    I want DropdownByKey inside the ALV Table column. I am populating the corresponding attribute of ITAB node with the value set that I want the drop down to have.
    However when I execute the application..I get error
    " Key XXX not present in Value Set and is not initial"
    XXX is present in the Value Set table of the attribute.
    <b>Following is my code in the methods of CUSTOM CONTROLLER</b>
    <u>Generate Value Set</u>
    nodeinfo_context = wd_context->get_node_info( ).
    nodeinfo_ITAB= nodeinfo_context->get_child_node( wd_this->wdctx_ITAB ).
    <u> Populate the Value Set</u>
    data ls_valueset type wdy_key_value.
    data it_valueset type wdy_key_value_table.
    ls_valueset-key = 'FRA'.
    ls_valueset-value = 'FRANCE'.
    Append ls_valueset to it_valueset.
    ls_valueset-key = 'SFO'.
    ls_valueset-value = 'SAN FRANCISCO'.
    Append ls_valueset to it_valueset.
    <u>Set the Value Set for the Attribute</u>
    call method nodeinfo_ITAB->SET_ATTRIBUTE_VALUE_SET
                  EXPORTING
                     NAME = <b>'ATTR1'</b>
                     VALUE_SET = it_valueset.
    <u>Changing ALV Column</u>
    Get the ALV Configuration Model
      ifc_alv2 = wd_this->wd_cpifc_alv2( ).
      itab_alv2_config = ifc_alv2->get_model( ).
      itab_alv2_config->IF_SALV_WD_TABLE_SETTINGS~SET_READ_ONLY( abap_false ).
    <u>Get the Column reference for ATTR1</u> 
    ref_alv2_colset = itab_alv2_config->if_salv_wd_column_settings~get_column( <b>'ATTR1'</b> ).
    <u>Create the DropDownByKey Object</u>
    CREATE OBJECT ref_dropdownkey
              exporting SELECTED_KEY_FIELDNAME = ref_alv2_colset->id.
      ref_dropdownkey->SET_SELECTED_KEY_FIELDNAME( <b>ref_alv2_colset->id</b> ).
      ref_alv2_colset->SET_CELL_EDITOR( <b>ref_dropdownkey</b> ).
    <u>Check the value set</u>
      ref_attr_info = nodeinfo_flight_details2->get_attribute( ref_alv2_colset->id ).
    I do get back the value set if I see ref_attr_info->value_set.
    SO the Value Set is getting set for attribute ATTR1, but still I get Error
    <b>"The value selectedKey = "SFO" in DropDownByKey "_8C" does not exist in the value list and is not initial either "</b><u></u>
    SAP  User

    You have forgotten to set a cell variant. I had the same with setting a ProgressIndicator cell-editor to a table column as default editor. This causes the column to be hidden on the table while it did show up in the settings dialog. I removed the set_editor( lr_progressindicator) and created a cell variant instead with this lr_progressindicator. You then need to add this cell variant to your column. By default it will select the standard viewtext-cell-editor (which can only be textview and inputfield, like when you create a table yourself in a view), but if you use a cell variant, it will display the required cell editor if you set it (last line of the code).
    <b>In your case, replace lr_progressindicator by your ref_dropdownkey.</b>
      DATA: lr_column_settings    TYPE REF TO if_salv_wd_column_settings,
            lr_column             TYPE REF TO cl_salv_wd_column,
            lr_column_header      TYPE REF TO cl_salv_wd_column_header,
            lr_cellvar            TYPE REF TO cl_salv_wd_cv_standard,
            l_cellvar             TYPE string,
            lr_progress_indicator TYPE REF TO cl_salv_wd_uie_progr_indicator.
      lr_column_settings ?= wd_this->mr_table.
      lr_column = lr_column_settings->get_column( 'STATUSBAR' ).
      lr_column_header = lr_column->get_header( ).
      lr_column_header->set_text( 'Completed' ).
    CREATE OBJECT lr_cellvar.
      l_cellvar = 'CV_SB'.
      lr_cellvar->set_key( l_cellvar ).
      CREATE OBJECT lr_progress_indicator.
      lr_progress_indicator->set_percent_value_fieldname( 'STATUSBAR' ).
      lr_progress_indicator->set_tooltip( 'completed' ).
      lr_cellvar->set_editor( lr_progress_indicator ).
      lr_column->add_cell_variant( lr_cellvar ).
      lr_column->set_selected_cell_variant( l_cellvar ).
    I hope this will solve your issues.

  • Problems with string comparison and\or If statement

    Right now I'm trying to make a program that will look into all of my music folders, and rename the .mp3 files to a format i want, based on the id3 tags. The program so far looks in all of the folders I want it to, but I get stuck when I need to check if the files are .mp3 files or not. Here is my code so far:
    package fileRenamer;
    import java.io.File;
    public class FileRenamer {
    public static void main(String[] argv) {
         File artistsFolders = new File("F:/Music (MP3)");
         File[] artists = artistsFolders.listFiles();
         for(int i = 0; i < artists.length; i++){
              if(artists.isFile()) {
                   System.out.println(artists[i].getName());
         } else if (artists[i].isDirectory()) {
              System.out.println(artists[i].getName());
              File albumsFolders = new File("F:/Music (MP3)/"+artists[i].getName());
              File[] albums = albumsFolders.listFiles();
              for(int a = 0; a < albums.length; a++){
                   if(albums[a].isFile()) {
                        System.out.println("-" + albums[a].getName());
                   } else if (albums[a].isDirectory()) {
                        System.out.println("-" + albums[a].getName());
                   File songsFolders = new File("F:/Music (MP3)/"+artists[i].getName()+"/"+albums[a].getName());
                   File[] songs = songsFolders.listFiles();
                   for(int s = 0; s < songs.length; s++){
                        if(songs[s].isFile()) {
                             int dotPos = songs[s].getName().toString().lastIndexOf(".");
                             String extension = songs[s].getName().toString().substring(dotPos);
                             System.out.println(extension);
                             if(extension == ".mp3"){
                                  System.out.println("--" + songs[s].getName());
                   } else if (songs[s].isDirectory()) {
                             System.out.println("--" + songs[s].getName());
    When I test the code, the line System.out.println(extension); prints .mp3 into the console for all of the .mp3 files. Whatever I try, the if(extension == ".mp3") never seems to declare the two equal. If anyone knows what my problem is, I greatly appreciate the advice and help.
    Thanks in Advance,
    James

    Pojo226 wrote:
    I just tried that and it worked perfectly. Thanks.You're welcome.

  • Problem with values of some components per card in CardLayout

    in card 1 i ask the user to enter the numbers (say the user entered, 55.3,62.5,73.2,86.7)
    parsed it, count the observations..
    now in card 2, i have a JComboBox of sample sizes from the numbers the user entered. (in the example, the JComboBox should show 1,2,3,4 since the sample size should be from 1 to "n" numbers of observations the user entered)
    the problem now is, how can i set the "n" for card 2 where the "n" will come from card 1?
    hope i made it clear... please help me...

    i think i figure it out already...
    i put the initiation of card 2 in a different method..
    whew!

Maybe you are looking for

  • K7T Turbo limited edition can't support Windows XP!!!!

    i'm user of K7T Turbo Limited Edition mainboard, i treid to upgrade my OS to Windows XP currently and i found that the installation aborted abnormaly when it reach windows is restarting phase, and my PC will just hang without giving any response, i'm

  • Not able to open XML file in the application server..........

    Hi, I have downloaded a XML file to the application server..... File is created but i am not able to open the file there.... Plz advice ....how to open it..... Regards.

  • Rmi load balancer

    hey, i've started writing a basic rmi dispatcher to distribute the work of a search engine and i was wondering what the best way to balance load among available machines on the network would be. does rmi have any built in methods to calculate the wor

  • Function module Prob with kostl

    hi,good day guys. Iam using K_ORDER_SRULE_ADD for settelment rules. In this other function module  for read the fields one whic is K_DEFAULT_RULE_READ.. This is k_order_srule_add f.m source code as below as. .default rule table TKB2C is maintained as

  • How to create multi instance monitoring using VSAE

    i have a class and it has multiple instances which inturn has data about each and every instance as performance logs etc i need to get the data about each every instance and add some property bag data appropraitely. how can i achieve this, how can i