<?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: if-else in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-else/m-p/2211466#M473722</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;this will return 'Condition 2 is fulfilled'.&lt;/P&gt;&lt;P&gt;The CS command stands for contains string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;&lt;/P&gt;&lt;P&gt;CS (Contains String): &lt;/P&gt;&lt;P&gt;c1 contains the character string c2. &lt;/P&gt;&lt;P&gt;Trailing blanks in c1 and c2 are ignored if the respective field is of type C. &lt;/P&gt;&lt;P&gt;An empty string c2 (i.e., only blanks with type C, or empty string with type STRING) is included in any string c1, including the empty string itself. On the other hand, there is no non-empty string c2 included in an empty string c1. &lt;/P&gt;&lt;P&gt;If the result of the comparison is positive, the system field SY-FDPOS contains the offset of the first character of c2 in c1. &lt;/P&gt;&lt;P&gt;If the result of the comparison is negative, the system field SY-FDPOS contains the length of c1. &lt;/P&gt;&lt;P&gt;The comparison is not case-sensitive. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Examples: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'ABCDE' CS 'CD' is true; SY-FDPOS = 2. &lt;/P&gt;&lt;P&gt;'ABCDE' CS 'XY' is false; SY-FDPOS = 5. &lt;/P&gt;&lt;P&gt;'ABAAA' CS 'AB ' is true; SY-FDPOS = 0. &lt;/P&gt;&lt;P&gt;' ABC' CS ' AB' is true; SY-FDPOS = 1. &lt;/P&gt;&lt;P&gt;'ABC DEF' CS ' ' is true; but: SY-FDPOS = 0, &lt;/P&gt;&lt;P&gt;since ' ' is interpreted as a trailing blank and is thus &lt;/P&gt;&lt;P&gt;ignored. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 11 May 2007 06:54:12 GMT</pubDate>
    <dc:creator>kostas_tsioubris</dc:creator>
    <dc:date>2007-05-11T06:54:12Z</dc:date>
    <item>
      <title>if-else</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-else/m-p/2211464#M473720</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;can anyone explain me how this code is working and what is the use of CS.&lt;/P&gt;&lt;P&gt;DATA: text1(30) TYPE c VALUE 'This is the first text',&lt;/P&gt;&lt;P&gt;      text2(30) TYPE c VALUE 'This is the second text',&lt;/P&gt;&lt;P&gt;      text3(30) TYPE c VALUE 'This is the third text',&lt;/P&gt;&lt;P&gt;      string(5) TYPE c VALUE 'eco'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF text1 CS string.&lt;/P&gt;&lt;P&gt;  WRITE / 'Condition 1 is fulfilled'.&lt;/P&gt;&lt;P&gt;ELSEIF text2 CS string.&lt;/P&gt;&lt;P&gt;  WRITE / 'Condition 2 is fulfilled'.&lt;/P&gt;&lt;P&gt;ELSEIF text3 CS string.&lt;/P&gt;&lt;P&gt;  WRITE / 'Condition 3 is fulfilled'.&lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;P&gt;  WRITE / 'No condition is fulfilled'.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;vivek&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 May 2007 06:51:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-else/m-p/2211464#M473720</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-11T06:51:54Z</dc:date>
    </item>
    <item>
      <title>Re: if-else</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-else/m-p/2211465#M473721</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vivek,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CS IS NOTHING BUT CONTAIN STRING.&lt;/P&gt;&lt;P&gt;i text1 value contains string ,it will return true else false.&lt;/P&gt;&lt;P&gt;now output is 'no condition....'.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 May 2007 06:53:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-else/m-p/2211465#M473721</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-11T06:53:55Z</dc:date>
    </item>
    <item>
      <title>Re: if-else</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-else/m-p/2211466#M473722</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;this will return 'Condition 2 is fulfilled'.&lt;/P&gt;&lt;P&gt;The CS command stands for contains string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;&lt;/P&gt;&lt;P&gt;CS (Contains String): &lt;/P&gt;&lt;P&gt;c1 contains the character string c2. &lt;/P&gt;&lt;P&gt;Trailing blanks in c1 and c2 are ignored if the respective field is of type C. &lt;/P&gt;&lt;P&gt;An empty string c2 (i.e., only blanks with type C, or empty string with type STRING) is included in any string c1, including the empty string itself. On the other hand, there is no non-empty string c2 included in an empty string c1. &lt;/P&gt;&lt;P&gt;If the result of the comparison is positive, the system field SY-FDPOS contains the offset of the first character of c2 in c1. &lt;/P&gt;&lt;P&gt;If the result of the comparison is negative, the system field SY-FDPOS contains the length of c1. &lt;/P&gt;&lt;P&gt;The comparison is not case-sensitive. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Examples: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'ABCDE' CS 'CD' is true; SY-FDPOS = 2. &lt;/P&gt;&lt;P&gt;'ABCDE' CS 'XY' is false; SY-FDPOS = 5. &lt;/P&gt;&lt;P&gt;'ABAAA' CS 'AB ' is true; SY-FDPOS = 0. &lt;/P&gt;&lt;P&gt;' ABC' CS ' AB' is true; SY-FDPOS = 1. &lt;/P&gt;&lt;P&gt;'ABC DEF' CS ' ' is true; but: SY-FDPOS = 0, &lt;/P&gt;&lt;P&gt;since ' ' is interpreted as a trailing blank and is thus &lt;/P&gt;&lt;P&gt;ignored. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 May 2007 06:54:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-else/m-p/2211466#M473722</guid>
      <dc:creator>kostas_tsioubris</dc:creator>
      <dc:date>2007-05-11T06:54:12Z</dc:date>
    </item>
    <item>
      <title>Re: if-else</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-else/m-p/2211467#M473723</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;CS means contains string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So the code is checking, if the value of string (eco) is used in text1, 2 and 3.&lt;/P&gt;&lt;P&gt;It will be found in text2 (sECOnd line).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Frank&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 May 2007 06:54:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-else/m-p/2211467#M473723</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-11T06:54:36Z</dc:date>
    </item>
    <item>
      <title>Re: if-else</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-else/m-p/2211468#M473724</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;sorry I didnt saw that string.&lt;/P&gt;&lt;P&gt;string having value 'eco'.that is there in text2,so the output is 'condition2.....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 May 2007 06:55:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-else/m-p/2211468#M473724</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-11T06:55:24Z</dc:date>
    </item>
    <item>
      <title>Re: if-else</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/if-else/m-p/2211469#M473725</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;CS means contain String.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CS Contains String: True if the content of operand2 is contained in operand1. Upper/lower case is not taken into account, trailing blanks of the left operand are taken into account. If operand1 is of type string and initial, or of type c and contains only blank characters, the logical expression is false, unless operand2 is also of type string and initial, or of type c and only contains blank characters. In this case the logical expression is always true. If the result of the comparison is true, sy-fdpos contains the offset of operand2 in operand1. If the result of the comparison is negative, sy-fdpos contains the length of operand1. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ajith V&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 May 2007 06:58:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/if-else/m-p/2211469#M473725</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-11T06:58:29Z</dc:date>
    </item>
  </channel>
</rss>

