<?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 Char variable value check? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/char-variable-value-check/m-p/2512724#M568303</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 have two variables of CHAR 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ie&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var1 = 19&lt;/P&gt;&lt;P&gt;var2 = 3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to check &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if var1 gt var2.&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The above condition is failing ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Sa_r&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 17 Jul 2007 19:07:13 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-07-17T19:07:13Z</dc:date>
    <item>
      <title>Char variable value check?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/char-variable-value-check/m-p/2512724#M568303</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 have two variables of CHAR 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ie&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var1 = 19&lt;/P&gt;&lt;P&gt;var2 = 3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to check &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if var1 gt var2.&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The above condition is failing ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Sa_r&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jul 2007 19:07:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/char-variable-value-check/m-p/2512724#M568303</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-17T19:07:13Z</dc:date>
    </item>
    <item>
      <title>Re: Char variable value check?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/char-variable-value-check/m-p/2512725#M568304</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If they must be character fields, then you must have leading zeros.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;RIch Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jul 2007 19:09:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/char-variable-value-check/m-p/2512725#M568304</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2007-07-17T19:09:04Z</dc:date>
    </item>
    <item>
      <title>Re: Char variable value check?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/char-variable-value-check/m-p/2512726#M568305</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Again, if these fields must be character, then you will need to have leading zeros in the fields in order to do the conditional statement, otherwise you can make them numeric fields or integar fields and do the condition.  Here is an example of what you can do if these fields must remain as character.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

report zrich_0001 .

data: var1(2) type c value '19'.
data: var2(2) type c value '3'.
data: n(2) type n.

* Convert the character fields to numeric and back
n = var1.
var1 = n.
n = var2.
var2 = n.

* Now do condition statement.
if var1 &amp;gt; var2.
  write:/ 'Var1 is &amp;gt; var2'.
else.
  write:/ 'Var1 is not &amp;gt; var2'.
endif.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jul 2007 19:12:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/char-variable-value-check/m-p/2512726#M568305</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2007-07-17T19:12:08Z</dc:date>
    </item>
    <item>
      <title>Re: Char variable value check?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/char-variable-value-check/m-p/2512727#M568306</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rich,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You answer works well....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need not to be changed the char to numeric , Instead of i used UNPACK to fill character 0 before the value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Sa_R&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jul 2007 19:15:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/char-variable-value-check/m-p/2512727#M568306</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-17T19:15:25Z</dc:date>
    </item>
  </channel>
</rss>

