<?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: checking for the condition types using case statement in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/checking-for-the-condition-types-using-case-statement/m-p/963404#M67962</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Santhosh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think that your CASE statement has a flaw. The line length of one of the lines is too large. You need to insert a carriage-return to shorten it (or press the button 'Pretty Printer').&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code would look nicer like this:[code]  CASE wac-kschl.&lt;/P&gt;&lt;P&gt;    WHEN 'ZRAT' OR 'ZAGR' OR 'ZRCR' OR 'Y098' OR 'Y007' OR 'ZREW'&lt;/P&gt;&lt;P&gt;      OR 'Y106' OR 'ZTSR' OR 'Y127' OR 'Y125' OR 'Y126' OR 'Y124'&lt;/P&gt;&lt;P&gt;      OR 'Y157' OR 'Y092' OR 'Y085' OR 'Y090' OR 'ZMZD' OR 'Y215'&lt;/P&gt;&lt;P&gt;      OR 'Y214' OR 'Y111' OR 'ZC$D' OR 'ZAUD' OR 'Z001' OR 'Z002'&lt;/P&gt;&lt;P&gt;      OR 'Z003' OR 'Z004' OR 'Z005' OR 'Z006' OR 'Z007' OR 'Z008'&lt;/P&gt;&lt;P&gt;      OR 'Z009' OR 'Z010' OR 'Z011' OR 'Z012' OR 'Z013' OR 'Z014'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    Do your thing here&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    ...&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      WRITE: / 'OK'.&lt;/P&gt;&lt;P&gt;    WHEN OTHERS.&lt;/P&gt;&lt;P&gt;      WRITE: / 'NOT OK'.&lt;/P&gt;&lt;P&gt;  ENDCASE.[/code]If this will not work for you, you could try a different approach:[code]* Local definition&lt;/P&gt;&lt;P&gt;  DATA:&lt;/P&gt;&lt;P&gt;    var_list(1024).&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Build variable string for checking&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CONCATENATE 'ZRAT ZAGR ZRCR Y098'&lt;/P&gt;&lt;P&gt;              'Y007 ZREW Y106 ZTSR'&lt;/P&gt;&lt;P&gt;              'Y127 Y125 Y126 Y124'&lt;/P&gt;&lt;P&gt;              'Y157 Y092 Y085 Y090'&lt;/P&gt;&lt;P&gt;              'ZMZD Y215 Y214 Y111'&lt;/P&gt;&lt;P&gt;              'ZC$D ZAUD'&lt;/P&gt;&lt;P&gt;         INTO var_list&lt;/P&gt;&lt;P&gt;    SEPARATED BY space.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Check if the correct value is supplied&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  IF var_list CS wac-kschl.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Do your thing here&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  ...&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    WRITE: / 'OK'.&lt;/P&gt;&lt;P&gt;  ENDIF.[/code]Hope this helps you a bit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rob.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 22 Jul 2005 00:40:34 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2005-07-22T00:40:34Z</dc:date>
    <item>
      <title>checking for the condition types using case statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/checking-for-the-condition-types-using-case-statement/m-p/963402#M67960</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi folks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a lot of condition types that I have to check for and I am using case statement to do that. The code goes like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; case wac-kschl.&lt;/P&gt;&lt;P&gt;        when 'ZRAT' OR 'ZAGR' OR 'ZRCR' OR &lt;/P&gt;&lt;P&gt;              'Y098' OR 'Y007' OR 'ZREW' OR 'Y106'        OR 'ZTSR' OR 'Y127' OR 'Y125' OR 'Y126' OR 'Y124' OR 'Y157' OR 'Y092' OR 'Y085' OR 'Y090' OR 'ZMZD'&lt;/P&gt;&lt;P&gt; OR 'Y215' OR 'Y214' OR 'Y111' OR 'ZC$D' OR 'ZAUD'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;up till here it is working on errors and when I add few more condition types to the case statement it is throwing the error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have to check for all the condition types out here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I correct it? Is there a better way to do it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Santhosh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jul 2005 22:51:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/checking-for-the-condition-types-using-case-statement/m-p/963402#M67960</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-07-21T22:51:52Z</dc:date>
    </item>
    <item>
      <title>Re: checking for the condition types using case statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/checking-for-the-condition-types-using-case-statement/m-p/963403#M67961</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;what exactly is the error that its throwing.  You can do this with a case statement, but there are other ways.  I really depends on your logic and what you need to happen in your program.&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>Thu, 21 Jul 2005 23:40:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/checking-for-the-condition-types-using-case-statement/m-p/963403#M67961</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2005-07-21T23:40:11Z</dc:date>
    </item>
    <item>
      <title>Re: checking for the condition types using case statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/checking-for-the-condition-types-using-case-statement/m-p/963404#M67962</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Santhosh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think that your CASE statement has a flaw. The line length of one of the lines is too large. You need to insert a carriage-return to shorten it (or press the button 'Pretty Printer').&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code would look nicer like this:[code]  CASE wac-kschl.&lt;/P&gt;&lt;P&gt;    WHEN 'ZRAT' OR 'ZAGR' OR 'ZRCR' OR 'Y098' OR 'Y007' OR 'ZREW'&lt;/P&gt;&lt;P&gt;      OR 'Y106' OR 'ZTSR' OR 'Y127' OR 'Y125' OR 'Y126' OR 'Y124'&lt;/P&gt;&lt;P&gt;      OR 'Y157' OR 'Y092' OR 'Y085' OR 'Y090' OR 'ZMZD' OR 'Y215'&lt;/P&gt;&lt;P&gt;      OR 'Y214' OR 'Y111' OR 'ZC$D' OR 'ZAUD' OR 'Z001' OR 'Z002'&lt;/P&gt;&lt;P&gt;      OR 'Z003' OR 'Z004' OR 'Z005' OR 'Z006' OR 'Z007' OR 'Z008'&lt;/P&gt;&lt;P&gt;      OR 'Z009' OR 'Z010' OR 'Z011' OR 'Z012' OR 'Z013' OR 'Z014'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    Do your thing here&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    ...&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      WRITE: / 'OK'.&lt;/P&gt;&lt;P&gt;    WHEN OTHERS.&lt;/P&gt;&lt;P&gt;      WRITE: / 'NOT OK'.&lt;/P&gt;&lt;P&gt;  ENDCASE.[/code]If this will not work for you, you could try a different approach:[code]* Local definition&lt;/P&gt;&lt;P&gt;  DATA:&lt;/P&gt;&lt;P&gt;    var_list(1024).&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Build variable string for checking&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CONCATENATE 'ZRAT ZAGR ZRCR Y098'&lt;/P&gt;&lt;P&gt;              'Y007 ZREW Y106 ZTSR'&lt;/P&gt;&lt;P&gt;              'Y127 Y125 Y126 Y124'&lt;/P&gt;&lt;P&gt;              'Y157 Y092 Y085 Y090'&lt;/P&gt;&lt;P&gt;              'ZMZD Y215 Y214 Y111'&lt;/P&gt;&lt;P&gt;              'ZC$D ZAUD'&lt;/P&gt;&lt;P&gt;         INTO var_list&lt;/P&gt;&lt;P&gt;    SEPARATED BY space.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Check if the correct value is supplied&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  IF var_list CS wac-kschl.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Do your thing here&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  ...&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    WRITE: / 'OK'.&lt;/P&gt;&lt;P&gt;  ENDIF.[/code]Hope this helps you a bit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rob.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jul 2005 00:40:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/checking-for-the-condition-types-using-case-statement/m-p/963404#M67962</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-07-22T00:40:34Z</dc:date>
    </item>
    <item>
      <title>Re: checking for the condition types using case statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/checking-for-the-condition-types-using-case-statement/m-p/963405#M67963</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi folks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the error  is  'the text literal is longer than 255 and see that it ends correctly'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the other error is ' after 'OR' there must be a space or equivalent character. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have several of these condition types and I need to check for every one of them hence forth I have been using the case statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Even after using the 'Pretty Printer' it is throwing the same error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Santhosh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jul 2005 12:54:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/checking-for-the-condition-types-using-case-statement/m-p/963405#M67963</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-07-22T12:54:50Z</dc:date>
    </item>
    <item>
      <title>Re: checking for the condition types using case statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/checking-for-the-condition-types-using-case-statement/m-p/963406#M67964</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;insert your condition types in an internal table zcond&lt;/P&gt;&lt;P&gt;( or better create a customizing table for it )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and your code is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;read table zcond with key kschl = wac-kschl.

if sy-subrc = 0.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;-&amp;gt; your process&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;&lt;/P&gt;&lt;P&gt;regards Andreas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jul 2005 13:02:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/checking-for-the-condition-types-using-case-statement/m-p/963406#M67964</guid>
      <dc:creator>andreas_mann3</dc:creator>
      <dc:date>2005-07-22T13:02:15Z</dc:date>
    </item>
    <item>
      <title>Re: checking for the condition types using case statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/checking-for-the-condition-types-using-case-statement/m-p/963407#M67965</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;This error usually occurs when&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) Din't close the literals properly with single quotes.&lt;/P&gt;&lt;P&gt;2) Missing full stop.&lt;/P&gt;&lt;P&gt;3) Too many words in a single line (try to shorten thro pretty printer)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check the above...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Sam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jul 2005 13:02:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/checking-for-the-condition-types-using-case-statement/m-p/963407#M67965</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-07-22T13:02:24Z</dc:date>
    </item>
  </channel>
</rss>

