<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: Java :Checking for Not equal to in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/java-checking-for-not-equal-to/qaa-p/1930291#M847482</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi swabap,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dont declare these many variables:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;i&amp;gt;String str1 = new String();&lt;/P&gt;&lt;P&gt;String str2 = new String();&lt;/P&gt;&lt;P&gt;String str3 = new String();&lt;/P&gt;&lt;P&gt;String str4 = new String();&lt;/P&gt;&lt;P&gt;String str5 = new String();&lt;/P&gt;&lt;P&gt;String str6 = new String();&lt;/P&gt;&lt;P&gt;String str7 = new String();&lt;/P&gt;&lt;P&gt;String str8 = new String();&lt;/P&gt;&lt;P&gt;String str9 = new String();&lt;/P&gt;&lt;P&gt;String str10 = new String();&lt;/P&gt;&lt;P&gt;String str11 = new String();&lt;/P&gt;&lt;P&gt;String str12= new String();&amp;lt;/i&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try to reuse str1, str2, str3, str4...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check these:&lt;/P&gt;&lt;P&gt;1) str1=a&amp;lt;i&amp;gt;.substring(0,5);&lt;/P&gt;&lt;P&gt;    should be str1=a&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;&amp;lt;/b&amp;gt;.substring(0,5);&lt;/P&gt;&lt;P&gt;2) for (int j =0; j&amp;gt;&amp;lt;b.length; j++)&lt;/P&gt;&lt;P&gt; here i think you are taking the values from &amp;lt;b&amp;gt;b[]&amp;lt;/b&amp;gt; array and check this &lt;/P&gt;&lt;P&gt;         for (int j =0; j&amp;lt;b&amp;gt;&amp;gt;&amp;lt;&amp;lt;/b&amp;gt;b.length; j++)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try to execute one by one for loop then you will know in which you are getting error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Suraj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 12 Feb 2007 14:04:46 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-02-12T14:04:46Z</dc:date>
    <item>
      <title>Java :Checking for Not equal to</title>
      <link>https://community.sap.com/t5/technology-q-a/java-checking-for-not-equal-to/qaq-p/1930277</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Group,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In Java How to Check the Condition for not equals to &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I am using the following code I am not getting expected result:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

String str1 = new String();
String str2 = new String();
String str3 = new String();
String str4 = new String();

for (int i =0; i&amp;lt;a.length; i++)
{
str1=a&amp;lt;i&amp;gt;.substring(0,6);
str2=a&amp;lt;i&amp;gt;.substring(7,14); 
str3=a&amp;lt;i&amp;gt;.substring(18,23); 
str4=a&amp;lt;i&amp;gt;.substring(24,31); 
if ( (!str1.equals("000000")) || (!str2.equals("00000000")) || (!str3.equals("000000")) ||
    (!str4.equals("00000000")))
 
result.addValue("");

}
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Feb 2007 12:03:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/java-checking-for-not-equal-to/qaq-p/1930277</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-12T12:03:27Z</dc:date>
    </item>
    <item>
      <title>Re: Java :Checking for Not equal to</title>
      <link>https://community.sap.com/t5/technology-q-a/java-checking-for-not-equal-to/qaa-p/1930278#M847469</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you will never get a result for your coding.&lt;/P&gt;&lt;P&gt;If you use NOT you can't use ||. You have to use &amp;amp;&amp;amp;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(This is boolean algebra!)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards Mario&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Feb 2007 12:15:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/java-checking-for-not-equal-to/qaa-p/1930278#M847469</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-12T12:15:20Z</dc:date>
    </item>
    <item>
      <title>Re: Java :Checking for Not equal to</title>
      <link>https://community.sap.com/t5/technology-q-a/java-checking-for-not-equal-to/qaa-p/1930279#M847470</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if non of the strings to be not equal to zero then replace || (or) with &amp;amp;&amp;amp; (And). Is this ur req?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Feb 2007 12:20:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/java-checking-for-not-equal-to/qaa-p/1930279#M847470</guid>
      <dc:creator>prabhu_s2</dc:creator>
      <dc:date>2007-02-12T12:20:18Z</dc:date>
    </item>
    <item>
      <title>Re: Java :Checking for Not equal to</title>
      <link>https://community.sap.com/t5/technology-q-a/java-checking-for-not-equal-to/qaa-p/1930280#M847471</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if your req is that any of str1 to str4 is not equal to 0, then add in resultlist, then the below code may help you:&lt;/P&gt;&lt;P&gt;if (!( (str1.equals("000000")) &amp;amp;&amp;amp; (str2.equals("00000000")) &amp;amp;&amp;amp; (str3.equals("000000")) &amp;amp;&amp;amp;   (str4.equals("00000000"))))&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;result.addValue("");&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Rajeev Gupta&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Feb 2007 12:40:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/java-checking-for-not-equal-to/qaa-p/1930280#M847471</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-12T12:40:36Z</dc:date>
    </item>
    <item>
      <title>Re: Java :Checking for Not equal to</title>
      <link>https://community.sap.com/t5/technology-q-a/java-checking-for-not-equal-to/qaa-p/1930281#M847472</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The substring method in String class works as follows&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;substring(int beginIndex,int endIndex)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;beginIndex - the beginning index, inclusive.&lt;/P&gt;&lt;P&gt;endIndex - the ending index, exclusive.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here, str2 will have only 7 chars ( str2=a.substring(7,14); )&lt;/P&gt;&lt;P&gt;But u r comparing with 8 chars. &lt;/P&gt;&lt;P&gt;So always this condition will fail and not of this will return true.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Same for str3 and str4&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So always the "if" will return "true".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This code will work properly&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if ( (!str1.equals("000000")) || (!str2.equals("0000000")) || (!str3.equals("00000")) ||&lt;/P&gt;&lt;P&gt;    (!str4.equals("0000000")))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This "if" will return "false" when str1, str2, str3 and str4 has all zeros&lt;/P&gt;&lt;P&gt;and return "true" if any one str has different value&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Uma&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Feb 2007 12:46:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/java-checking-for-not-equal-to/qaa-p/1930281#M847472</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-12T12:46:00Z</dc:date>
    </item>
    <item>
      <title>Re: Java :Checking for Not equal to</title>
      <link>https://community.sap.com/t5/technology-q-a/java-checking-for-not-equal-to/qaa-p/1930282#M847473</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;or you can use this...this will also work&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if ( !( (str1.equals("000000")) || (str2.equals("00000000")) || (str3.equals("000000")) ||&lt;/P&gt;&lt;P&gt;       (str4.equals("00000000")) )&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;result.addValue("");&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note: I applied De Morgans law to what others said....[ !A &amp;amp;&amp;amp; !B = !(A || B) ]&lt;/P&gt;&lt;P&gt;         i am using something i learned during my bachelor's degree....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Feb 2007 13:01:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/java-checking-for-not-equal-to/qaa-p/1930282#M847473</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-12T13:01:45Z</dc:date>
    </item>
    <item>
      <title>Re: Java :Checking for Not equal to</title>
      <link>https://community.sap.com/t5/technology-q-a/java-checking-for-not-equal-to/qaa-p/1930283#M847474</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let us know the results.&lt;/P&gt;&lt;P&gt;kindly close the thread if ur problem is solved!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Uma&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Feb 2007 13:25:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/java-checking-for-not-equal-to/qaa-p/1930283#M847474</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-12T13:25:08Z</dc:date>
    </item>
    <item>
      <title>Re: Java :Checking for Not equal to</title>
      <link>https://community.sap.com/t5/technology-q-a/java-checking-for-not-equal-to/qaa-p/1930284#M847475</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Uma,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to check that If the Str1..str5 (all) each one not quals to '0000' then only proceed otherwise not&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Feb 2007 13:42:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/java-checking-for-not-equal-to/qaa-p/1930284#M847475</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-12T13:42:55Z</dc:date>
    </item>
    <item>
      <title>Re: Java :Checking for Not equal to</title>
      <link>https://community.sap.com/t5/technology-q-a/java-checking-for-not-equal-to/qaa-p/1930285#M847476</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;instead of having a number of if condition convert Str1..str5  to integer and sumup. check if greater than 0. else do ur operation.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Feb 2007 13:45:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/java-checking-for-not-equal-to/qaa-p/1930285#M847476</guid>
      <dc:creator>prabhu_s2</dc:creator>
      <dc:date>2007-02-12T13:45:24Z</dc:date>
    </item>
    <item>
      <title>Re: Java :Checking for Not equal to</title>
      <link>https://community.sap.com/t5/technology-q-a/java-checking-for-not-equal-to/qaa-p/1930286#M847477</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then use the below code:&lt;/P&gt;&lt;P&gt;if (( !(str1.equals("000000")) &amp;amp;&amp;amp; !(str2.equals("0000000")) &amp;amp;&amp;amp; !(str3.equals("000000")) &amp;amp;&amp;amp; !(str4.equals("00000000"))))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;result.addValue("");&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This may help you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Rajeev Gupta&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Feb 2007 13:45:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/java-checking-for-not-equal-to/qaa-p/1930286#M847477</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-12T13:45:44Z</dc:date>
    </item>
    <item>
      <title>Re: Java :Checking for Not equal to</title>
      <link>https://community.sap.com/t5/technology-q-a/java-checking-for-not-equal-to/qaa-p/1930287#M847478</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;change all OR (||) by AND (&amp;amp;&amp;amp;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Uma&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Feb 2007 13:48:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/java-checking-for-not-equal-to/qaa-p/1930287#M847478</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-12T13:48:26Z</dc:date>
    </item>
    <item>
      <title>Re: Java :Checking for Not equal to</title>
      <link>https://community.sap.com/t5/technology-q-a/java-checking-for-not-equal-to/qaa-p/1930288#M847479</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;After adding this  below code I am getting the Error that &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
String str1 = new String();
String str2 = new String();
String str3 = new String();
String str4 = new String();
String str5 = new String();
String str6 = new String();
String str7 = new String();
String str8 = new String();
String str9 = new String();
String str10 = new String();
String str11 = new String();
String str12= new String();

for (int i =0; i&amp;lt;a.length; i++)
{
str1=a&amp;lt;i&amp;gt;.substring(0,5);
str2=a&amp;lt;i&amp;gt;.substring(6,13); 
str3=a&amp;lt;i&amp;gt;.substring(17,22); 
str4=a&amp;lt;i&amp;gt;.substring(23,30); 
if ( (!str1.equals("000000")) &amp;amp;&amp;amp;  (!str2.equals("00000000")) &amp;amp;&amp;amp; (!str3.equals("000000")) &amp;amp;&amp;amp;
    (!str4.equals("00000000")))
//if ( (str1 != "000000")  || (str2 != "00000000") || (str3 != "000000") || (str4 != "00000000"))
result.addValue("");

}

for (int j =0; j&amp;lt;b.length; j++)
{
str5 =a[j].substring(0,5);
str6 =a[j].substring(6,13); 
str7=a[j].substring(17,22); 
str8 =a[j].substring(23,30); 
if ( (!str5.equals("000000")) &amp;amp;&amp;amp;  (!str6.equals("00000000")) &amp;amp;&amp;amp;  (!str7.equals("000000")) &amp;amp;&amp;amp;
    (!str8.equals("00000000")))
//if ( (str5 != "000000")  || (str6 != "00000000") || (str7 != "000000") || (str8 != "00000000"))
 result.addValue("");

// result.addValue("");
}
for (int k =0; k&amp;lt;c.length; k++)
{
str9 =a[k].substring(0,5);
str10=a[k].substring(6,13); 
str11=a[k].substring(17,22); 
str12=a[k].substring(23,30); 
if ( (!str9.equals("000000")) &amp;amp;&amp;amp; (!str10.equals("00000000")) &amp;amp;&amp;amp; (!str11.equals("000000")) &amp;amp;&amp;amp;
    (!str12.equals("00000000")))
//if ( (str9 != "000000")  || (str10 != "00000000") || (str11 != "000000") || (str12 != "00000000"))

 result.addValue("");

}
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Sfter adding above Code I am getting this error&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;&lt;/P&gt;&lt;P&gt;Exception:[java.lang.StringIndexOutOfBoundsException: String index out of range: 5] in class com.sap.xi.tf._MM_SR3_BACS_02_ method createTC$[, , ]&lt;/P&gt;&lt;P&gt;&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Feb 2007 13:53:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/java-checking-for-not-equal-to/qaa-p/1930288#M847479</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-12T13:53:20Z</dc:date>
    </item>
    <item>
      <title>Re: Java :Checking for Not equal to</title>
      <link>https://community.sap.com/t5/technology-q-a/java-checking-for-not-equal-to/qaa-p/1930289#M847480</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;replace &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for (int k =0; k&amp;lt;c.length; k++)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Feb 2007 13:56:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/java-checking-for-not-equal-to/qaa-p/1930289#M847480</guid>
      <dc:creator>prabhu_s2</dc:creator>
      <dc:date>2007-02-12T13:56:57Z</dc:date>
    </item>
    <item>
      <title>Re: Java :Checking for Not equal to</title>
      <link>https://community.sap.com/t5/technology-q-a/java-checking-for-not-equal-to/qaa-p/1930290#M847481</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;&amp;lt;i&amp;gt;if ( (!str1.equals("000000")) || (!str2.equals("00000000")) || (!str3.equals("000000")) ||&lt;/P&gt;&lt;P&gt;    (!str4.equals("00000000")))&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;result.addValue("");&amp;lt;/i&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since u need&lt;/P&gt;&lt;P&gt;&amp;lt;i&amp;gt; I need to check that If the Str1..str5 (all) each one not quals to '0000' then only proceed otherwise not&amp;lt;/i&amp;gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Either choose:&lt;/P&gt;&lt;P&gt;1) if ( (!str1.equals("0000")) &amp;amp;&amp;amp; (!str2.equals("0000")) &amp;amp;&amp;amp; (!str3.equals("0000")) &amp;amp;&amp;amp;&lt;/P&gt;&lt;P&gt;    (!str4.equals("0000")))&lt;/P&gt;&lt;P&gt;     result.addValue("");&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2)&lt;/P&gt;&lt;P&gt; if ( (!str1.equals("000000")) &lt;/P&gt;&lt;P&gt;     { &lt;/P&gt;&lt;P&gt;       if (!str2.equals("00000000")) &lt;/P&gt;&lt;P&gt;         {&lt;/P&gt;&lt;P&gt;          if (!str3.equals("000000")) &lt;/P&gt;&lt;P&gt;            { &lt;/P&gt;&lt;P&gt;              if (!str4.equals("00000000")))&lt;/P&gt;&lt;P&gt;                     result.addValue("");&lt;/P&gt;&lt;P&gt;           }&lt;/P&gt;&lt;P&gt;         }&lt;/P&gt;&lt;P&gt;      }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;as you can see both servers the same method, But i would prefer to achieve the same functionality with the available node functions (like &amp;lt;b&amp;gt;if then else and substring&amp;lt;/b&amp;gt;) in Message Mapping&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Suraj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Feb 2007 13:58:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/java-checking-for-not-equal-to/qaa-p/1930290#M847481</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-12T13:58:17Z</dc:date>
    </item>
    <item>
      <title>Re: Java :Checking for Not equal to</title>
      <link>https://community.sap.com/t5/technology-q-a/java-checking-for-not-equal-to/qaa-p/1930291#M847482</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi swabap,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dont declare these many variables:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;i&amp;gt;String str1 = new String();&lt;/P&gt;&lt;P&gt;String str2 = new String();&lt;/P&gt;&lt;P&gt;String str3 = new String();&lt;/P&gt;&lt;P&gt;String str4 = new String();&lt;/P&gt;&lt;P&gt;String str5 = new String();&lt;/P&gt;&lt;P&gt;String str6 = new String();&lt;/P&gt;&lt;P&gt;String str7 = new String();&lt;/P&gt;&lt;P&gt;String str8 = new String();&lt;/P&gt;&lt;P&gt;String str9 = new String();&lt;/P&gt;&lt;P&gt;String str10 = new String();&lt;/P&gt;&lt;P&gt;String str11 = new String();&lt;/P&gt;&lt;P&gt;String str12= new String();&amp;lt;/i&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try to reuse str1, str2, str3, str4...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check these:&lt;/P&gt;&lt;P&gt;1) str1=a&amp;lt;i&amp;gt;.substring(0,5);&lt;/P&gt;&lt;P&gt;    should be str1=a&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;&amp;lt;/b&amp;gt;.substring(0,5);&lt;/P&gt;&lt;P&gt;2) for (int j =0; j&amp;gt;&amp;lt;b.length; j++)&lt;/P&gt;&lt;P&gt; here i think you are taking the values from &amp;lt;b&amp;gt;b[]&amp;lt;/b&amp;gt; array and check this &lt;/P&gt;&lt;P&gt;         for (int j =0; j&amp;lt;b&amp;gt;&amp;gt;&amp;lt;&amp;lt;/b&amp;gt;b.length; j++)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try to execute one by one for loop then you will know in which you are getting error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Suraj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Feb 2007 14:04:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/java-checking-for-not-equal-to/qaa-p/1930291#M847482</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-12T14:04:46Z</dc:date>
    </item>
    <item>
      <title>Re: Java :Checking for Not equal to</title>
      <link>https://community.sap.com/t5/technology-q-a/java-checking-for-not-equal-to/qaa-p/1930292#M847483</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First check the length of a(i) that is it feasible to get its substring. Then do a substring of it like:&lt;/P&gt;&lt;P&gt;if (a(i).length() == 5)&lt;/P&gt;&lt;P&gt;str1= a(i).substring(0,5);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do this thing for every str field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You have an extra zero in all fields - this is wrong. While checking the condition in IF statement - put that many zeros according to length of str field. Like length of str1 is 5 so compare str1 with "00000".  Do this thing for all str fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then your UDF will run.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Rajeev Gupta&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        RAJEEV GUPTA&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Feb 2007 14:16:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/java-checking-for-not-equal-to/qaa-p/1930292#M847483</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-12T14:16:16Z</dc:date>
    </item>
  </channel>
</rss>

