<?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>topic Re: Character comparison. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/character-comparison/m-p/1144456#M115726</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 X2 is database field,keep it as such.Just change the comparing variable to type p.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the sample.It gives correct result.Kindly reward points if it helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : x1 type char10, x2 type char10, p1 type p decimals 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;x1 = '133.35'.&lt;/P&gt;&lt;P&gt;p1 = x1.&lt;/P&gt;&lt;P&gt;x2 =  '1000'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if ( x2 &amp;gt; p1 ).&lt;/P&gt;&lt;P&gt;   write ' successful'.&lt;/P&gt;&lt;P&gt;   write x1.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if ( p1 &amp;gt; x2 ).&lt;/P&gt;&lt;P&gt;   write 'unsuccessful'.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 09 Jan 2006 06:04:00 GMT</pubDate>
    <dc:creator>jayanthi_jayaraman</dc:creator>
    <dc:date>2006-01-09T06:04:00Z</dc:date>
    <item>
      <title>Character comparison.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/character-comparison/m-p/1144453#M115723</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Friends,&lt;/P&gt;&lt;P&gt;          We have a scenario in which a database table field is of type CHAR10.&lt;/P&gt;&lt;P&gt;Selection screen parameter is as well defined using the same field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Actually this represents a number but is defined as character.&lt;/P&gt;&lt;P&gt;Now, due to character comparison we get false results when user enters a number on that selection screen.&lt;/P&gt;&lt;P&gt;For ex: 133.33 is evaluated greater then 1000 and the like. This is because of character comparison.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could someone help me how can i get correct result here?&lt;/P&gt;&lt;P&gt;Is there some way that i dont have to change the field type in DDIC to number, and still i can get number comparison instead of character comparison?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Rohit.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Jan 2006 05:33:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/character-comparison/m-p/1144453#M115723</guid>
      <dc:creator>rohit_trivedi</dc:creator>
      <dc:date>2006-01-09T05:33:37Z</dc:date>
    </item>
    <item>
      <title>Re: Character comparison.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/character-comparison/m-p/1144454#M115724</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;I actually tried for what you asked.But even in comparing with character,I am getting the correct answer.If you have problem with character,just convert it into variable of type p as I am doing here.Kindly reward points by clicking the star on the left of reply,if it helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : c1(10),&lt;/P&gt;&lt;P&gt;       p1 type p decimals 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;c1  = '133.33'.&lt;/P&gt;&lt;P&gt;p1 = c1.&lt;/P&gt;&lt;P&gt;if c1 le 1000.&lt;/P&gt;&lt;P&gt;write 'Correct'.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;skip.&lt;/P&gt;&lt;P&gt;if p1 le 1000.&lt;/P&gt;&lt;P&gt;write 'Correct'.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Jan 2006 05:49:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/character-comparison/m-p/1144454#M115724</guid>
      <dc:creator>jayanthi_jayaraman</dc:creator>
      <dc:date>2006-01-09T05:49:52Z</dc:date>
    </item>
    <item>
      <title>Re: Character comparison.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/character-comparison/m-p/1144455#M115725</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;  The character comparison indeed gives the wrong result.&lt;/P&gt;&lt;P&gt;check this code:&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="----------------------------------------" /&gt;&lt;P&gt;data : x1 type char10, x2 type char10.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;x1 = '133.35'.&lt;/P&gt;&lt;P&gt;x2 =  '1000'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if ( x2 &amp;gt; x1 ).&lt;/P&gt;&lt;P&gt;   write ' successful'.&lt;/P&gt;&lt;P&gt;   write x1.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if ( x1 &amp;gt; x2 ).&lt;/P&gt;&lt;P&gt;   write 'unsuccessful'.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="----------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also it wont be possible to assing char to num as you have mentioned, because comparison is done with database table field, which is character and not a number!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Rohit.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Jan 2006 05:58:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/character-comparison/m-p/1144455#M115725</guid>
      <dc:creator>rohit_trivedi</dc:creator>
      <dc:date>2006-01-09T05:58:26Z</dc:date>
    </item>
    <item>
      <title>Re: Character comparison.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/character-comparison/m-p/1144456#M115726</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 X2 is database field,keep it as such.Just change the comparing variable to type p.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the sample.It gives correct result.Kindly reward points if it helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : x1 type char10, x2 type char10, p1 type p decimals 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;x1 = '133.35'.&lt;/P&gt;&lt;P&gt;p1 = x1.&lt;/P&gt;&lt;P&gt;x2 =  '1000'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if ( x2 &amp;gt; p1 ).&lt;/P&gt;&lt;P&gt;   write ' successful'.&lt;/P&gt;&lt;P&gt;   write x1.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if ( p1 &amp;gt; x2 ).&lt;/P&gt;&lt;P&gt;   write 'unsuccessful'.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Jan 2006 06:04:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/character-comparison/m-p/1144456#M115726</guid>
      <dc:creator>jayanthi_jayaraman</dc:creator>
      <dc:date>2006-01-09T06:04:00Z</dc:date>
    </item>
  </channel>
</rss>

