<?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: Case Statement Dynamic in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/case-statement-dynamic/m-p/11870291#M1959764</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sitesh,&lt;/P&gt;&lt;P&gt;In the online documentation for keyword CASE, the use of table operations is expressly ruled out (See bulletpoint 2 below.).&amp;nbsp; Since a RANGE is an internal table, that would seem to rule out using ranges as the WHEN operand in a CASE statement.&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/jiveimages/1007328" width="450" /&gt;&lt;/P&gt;&lt;P&gt;Loyd&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 02 Aug 2016 14:01:09 GMT</pubDate>
    <dc:creator>loyd_enochs3</dc:creator>
    <dc:date>2016-08-02T14:01:09Z</dc:date>
    <item>
      <title>Case Statement Dynamic</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/case-statement-dynamic/m-p/11870287#M1959760</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear All,&lt;/P&gt;&lt;P&gt;My requirement is as below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Case var.&lt;/P&gt;&lt;P&gt; when 'A' or 'B' or 'C'.&lt;/P&gt;&lt;P&gt;&amp;nbsp; "do something with letters".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when '1' or '2'.&lt;/P&gt;&lt;P&gt; " Do something with number.&lt;/P&gt;&lt;P&gt;endcase.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now, I want to add "D" also but everytime new letter has to be added, I need to make changes in Code like &lt;/P&gt;&lt;P&gt;when "A" or "B" or"C" or "D".&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt; "do something with letters".&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;Can we have solution, where we just add D in any field in table and when keyword uses that for usage.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;I tried it by passing all values in table and perform it, but "OR" keyword is not been read as it has to be. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;Please do let me know if we can achieve this.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;Thanks n advance.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;Sitesh&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Aug 2016 12:34:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/case-statement-dynamic/m-p/11870287#M1959760</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-08-02T12:34:17Z</dc:date>
    </item>
    <item>
      <title>Re: Case Statement Dynamic</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/case-statement-dynamic/m-p/11870288#M1959761</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How about switch from CASE to IF and use selection table (operand [NOT] IN seltab) ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Aug 2016 12:51:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/case-statement-dynamic/m-p/11870288#M1959761</guid>
      <dc:creator>former_member259807</dc:creator>
      <dc:date>2016-08-02T12:51:59Z</dc:date>
    </item>
    <item>
      <title>Re: Case Statement Dynamic</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/case-statement-dynamic/m-p/11870289#M1959762</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you considered using IF. ELSE. with ranges?&lt;/P&gt;&lt;P&gt;What I mean is the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF var1 IN lr_range_1.&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;ELSEIF var1 IN lr_range_2,&lt;/P&gt;&lt;P&gt;...&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;You could simply populate range content dynamically. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Aug 2016 12:54:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/case-statement-dynamic/m-p/11870289#M1959762</guid>
      <dc:creator>ziolkowskib</dc:creator>
      <dc:date>2016-08-02T12:54:15Z</dc:date>
    </item>
    <item>
      <title>Re: Case Statement Dynamic</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/case-statement-dynamic/m-p/11870290#M1959763</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear All,&lt;/P&gt;&lt;P&gt;With IF Elseif condition, it is possible.&lt;/P&gt;&lt;P&gt;The code is already implemented and I do not want to make more changes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Plus, there are many when (option) command.&lt;/P&gt;&lt;P&gt;If we use if elseif, it is suitable with only 2 conditions. for more than 2-3 condition, we should not use IF statement but Case statement works faster and better.&lt;/P&gt;&lt;P&gt;Hence, I am trying to find the solution with Case statement only.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks n regards,&lt;/P&gt;&lt;P&gt;Sitesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Aug 2016 13:47:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/case-statement-dynamic/m-p/11870290#M1959763</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-08-02T13:47:49Z</dc:date>
    </item>
    <item>
      <title>Re: Case Statement Dynamic</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/case-statement-dynamic/m-p/11870291#M1959764</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sitesh,&lt;/P&gt;&lt;P&gt;In the online documentation for keyword CASE, the use of table operations is expressly ruled out (See bulletpoint 2 below.).&amp;nbsp; Since a RANGE is an internal table, that would seem to rule out using ranges as the WHEN operand in a CASE statement.&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/jiveimages/1007328" width="450" /&gt;&lt;/P&gt;&lt;P&gt;Loyd&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Aug 2016 14:01:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/case-statement-dynamic/m-p/11870291#M1959764</guid>
      <dc:creator>loyd_enochs3</dc:creator>
      <dc:date>2016-08-02T14:01:09Z</dc:date>
    </item>
    <item>
      <title>Re: Case Statement Dynamic</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/case-statement-dynamic/m-p/11870292#M1959765</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use functional methods and IF... ELSEIF...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;IF is_numeric( var ).&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; " Do numeric stuff&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ELSEIF is_letters( var ).&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; " Do letter stuff.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ELSE.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp; " Do something else.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ENDIF.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or better, instead of var as just a value, make it an object. Then, with polymorphism, you can simply use&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;var-&amp;gt;do_appropriate_stuff( ).&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Aug 2016 14:24:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/case-statement-dynamic/m-p/11870292#M1959765</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2016-08-02T14:24:48Z</dc:date>
    </item>
    <item>
      <title>Re: Case Statement Dynamic</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/case-statement-dynamic/m-p/11870293#M1959766</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;
&lt;P&gt;Sitesh Kumar said:&lt;/P&gt;
&lt;P&gt;for more than 2-3 condition, we should not use IF statement but Case statement &lt;STRONG&gt;works faster&lt;/STRONG&gt; and better.&lt;/P&gt;
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Faster ? I'd like to see the benchmark ! (probably, in a loop of 1 trillion elements, no doubt that there will be a gain of 1 microsecond)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Better ? I guess you mean that CASE is a more human-readable format, and it's a faster input and avoids wrong inputs (while retyping the same variable in IF). Agreed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Aug 2016 19:47:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/case-statement-dynamic/m-p/11870293#M1959766</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2016-08-02T19:47:32Z</dc:date>
    </item>
    <item>
      <title>Re: Case Statement Dynamic</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/case-statement-dynamic/m-p/11870294#M1959767</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Case abap_true.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; When is_letter( var ).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Do someting for letters.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; When is_numeric( var ).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 23.7566px;"&gt;Do someting for numbers.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Endcase.&lt;/P&gt;&lt;P&gt;Regards Clemens&lt;/P&gt;&lt;P&gt;Looks strange but works so nice&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Aug 2016 22:21:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/case-statement-dynamic/m-p/11870294#M1959767</guid>
      <dc:creator>Clemenss</dc:creator>
      <dc:date>2016-08-02T22:21:48Z</dc:date>
    </item>
    <item>
      <title>Re: Case Statement Dynamic</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/case-statement-dynamic/m-p/11870295#M1959768</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Satish,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use Scalability table. A &lt;SPAN style="font-size: 13.3333px;"&gt;Scalability&lt;/SPAN&gt; table is a Z - Table where values are maintained for additional cases like your scenario to avoid code changes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example let the structure of the &lt;SPAN style="font-size: 13.3333px;"&gt;Scalability&lt;/SPAN&gt; table(Z_SCAL) be -&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Variable | count | value | Type&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maintain data where for all numeric values use type as Numeric and for all alphabets use type as Alpha.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Read the data into two internal Tables i_num i_alpha.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from Z_SCAL where into table i_num where type EQ 'NUMERIC'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;select * from Z_SCAL where into table i_alpha where type EQ 'ALPHA'.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Up on checking Read the internal table for data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Read table i_alpha where value EQ v_var.&lt;/P&gt;&lt;P&gt;if sy-subrc EQ 0.&lt;/P&gt;&lt;P&gt;******* do some thing for alpha.&lt;/P&gt;&lt;P&gt;else if sy-subrc NE 0.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Read table i_num where value EQ v_var.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;****** do some thing for Numbers.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;else&lt;/P&gt;&lt;P&gt;********* do something else.&lt;/P&gt;&lt;P&gt;end if.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By this upon maintaining data in Z_SCAL entries your case can be solved avoiding code changes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This can also be used for not only alpha and numeric. Even 1 2 A b as one Group and A B 5 6 as another group based on how you are grouping the variables in the type column.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Aug 2016 16:31:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/case-statement-dynamic/m-p/11870295#M1959768</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-08-03T16:31:20Z</dc:date>
    </item>
    <item>
      <title>Re: Case Statement Dynamic</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/case-statement-dynamic/m-p/11870296#M1959769</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I guess there is some misunderstanding here. I gave an example.&lt;/P&gt;&lt;P&gt;The requirement is like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Case VAR.&lt;/P&gt;&lt;P&gt; when 'AC' or 'HP' or 'FC'.&lt;/P&gt;&lt;P&gt;&amp;nbsp; Do something.&lt;/P&gt;&lt;P&gt;when 'QC' or 'TC'.&lt;/P&gt;&lt;P&gt; Do something.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endcase.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have to add 'PC' along with 'FC' in above when condition.&lt;/P&gt;&lt;P&gt;There is no number or alphabet concept.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wanted if I can use as below:&lt;/P&gt;&lt;P&gt;Select field from ztable where (condition).&lt;/P&gt;&lt;P&gt;pass value in VAR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Case VAR.&lt;/P&gt;&lt;P&gt; When "1st condition" (This would include all like AC or HP or FC, I just need to add value in table)&lt;/P&gt;&lt;P&gt;&amp;nbsp; do something&lt;/P&gt;&lt;P&gt;when "2nd condition"&lt;/P&gt;&lt;P&gt; Do.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endcase.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mr. Loyd has hinted me well with his answer. Thank you Mr. Loyd. Even I found that we can not use table operation with Case statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks n Regards,&lt;/P&gt;&lt;P&gt;Sitesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Aug 2016 08:19:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/case-statement-dynamic/m-p/11870296#M1959769</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-08-04T08:19:16Z</dc:date>
    </item>
    <item>
      <title>Re: Case Statement Dynamic</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/case-statement-dynamic/m-p/11870297#M1959770</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sitesh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; You can maintain these entries in a Z table and then fetch them during runtime, concatenate them into a string also using a separator. Then use the CASE statement as below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Case VAR&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; When VAR &lt;EM&gt;CS&lt;/EM&gt; lv_string1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ..............&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ..............&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; When VAR &lt;EM style="font-size: 13.3333px;"&gt;CS&lt;/EM&gt; lv_string2.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ..............&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ..............&lt;/P&gt;&lt;P&gt;Endcase.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;I used Contains String operator to check complete existence of VAR in string 1.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;-Yaswanth Datta&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Aug 2016 16:59:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/case-statement-dynamic/m-p/11870297#M1959770</guid>
      <dc:creator>YaswanthDatta</dc:creator>
      <dc:date>2016-08-05T16:59:04Z</dc:date>
    </item>
    <item>
      <title>Re: Case Statement Dynamic</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/case-statement-dynamic/m-p/11870298#M1959771</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Yaswanth,&lt;/P&gt;&lt;P&gt;this is not possible. Can we use Bit operator in When statement. I dont think so.&lt;/P&gt;&lt;P&gt;Please send me working code if it is possible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks n Regards,&lt;/P&gt;&lt;P&gt;Sitesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Aug 2016 09:21:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/case-statement-dynamic/m-p/11870298#M1959771</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-08-08T09:21:56Z</dc:date>
    </item>
    <item>
      <title>Re: Case Statement Dynamic</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/case-statement-dynamic/m-p/11870299#M1959772</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;
&lt;P&gt;Yaswanth Datta Vathumilli wrote:&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Hi Sitesh,&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; You can maintain these entries in a Z table and then fetch them during runtime, concatenate them into a string also using a separator. Then use the CASE statement as below:&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Case VAR&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; When VAR &lt;EM&gt;CS&lt;/EM&gt; lv_string1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ..............&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ..............&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; When VAR &lt;EM style="font-size: 13.3333px;"&gt;CS&lt;/EM&gt; lv_string2.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ..............&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ..............&lt;/P&gt;
&lt;P&gt;Endcase.&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;I used Contains String operator to check complete existence of VAR in string 1.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;-Yaswanth Datta&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;When &lt;EM&gt;var&lt;/EM&gt; CS &lt;EM&gt;string&lt;/EM&gt; is not valid ABAP.&lt;/STRONG&gt; Why are you posting this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Aug 2016 09:38:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/case-statement-dynamic/m-p/11870299#M1959772</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2016-08-08T09:38:03Z</dc:date>
    </item>
    <item>
      <title>Re: Case Statement Dynamic</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/case-statement-dynamic/m-p/11870300#M1959773</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What Yaswanth posted is not valid ABAP. I think perhaps he's guessing at a solution.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Aug 2016 09:38:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/case-statement-dynamic/m-p/11870300#M1959773</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2016-08-08T09:38:33Z</dc:date>
    </item>
    <item>
      <title>Re: Case Statement Dynamic</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/case-statement-dynamic/m-p/11870301#M1959774</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Sitesh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CS is string operator, but yes it doesn't work with Case statement. But the same logic works with If - Elseif logic. PFB the logic I tried. You can store your variables in any table, fetch them in runtime&amp;nbsp; and place them in in different internal tables and then use them as below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;LOOP &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;AT &lt;/SPAN&gt;li_variables1 &lt;SPAN class="L0S52"&gt;INTO &lt;/SPAN&gt;wa_variable&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;IF &lt;/SPAN&gt;lw_string1 &lt;SPAN class="L0S52"&gt;IS &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;INITIAL&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lw_string1 &lt;SPAN class="L0S55"&gt;= &lt;/SPAN&gt;wa_variable&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;ELSE&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;CONCATENATE &lt;/SPAN&gt;lw_string1 wa_variable &lt;SPAN class="L0S52"&gt;INTO &lt;/SPAN&gt;lw_string1&lt;SPAN class="L0S55"&gt;. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;ENDIF&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN class="L0S52"&gt;ENDLOOP&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN class="L0S52"&gt;LOOP &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;AT &lt;/SPAN&gt;li_variables2 &lt;SPAN class="L0S52"&gt;INTO &lt;/SPAN&gt;wa_variable&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;IF &lt;/SPAN&gt;lw_string2 &lt;SPAN class="L0S52"&gt;IS &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;INITIAL&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lw_string2 &lt;SPAN class="L0S55"&gt;= &lt;/SPAN&gt;wa_variable&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;ELSE&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;CONCATENATE &lt;/SPAN&gt;lw_string2 wa_variable &lt;SPAN class="L0S52"&gt;INTO &lt;/SPAN&gt;lw_string2&lt;SPAN class="L0S55"&gt;. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;ENDIF&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN class="L0S52"&gt;ENDLOOP&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN class="L0S52"&gt;IF &lt;/SPAN&gt;var &lt;SPAN class="L0S52"&gt;CS &lt;/SPAN&gt;lw_string1&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S31"&gt;"Do something&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN class="L0S52"&gt;ELSEIF &lt;/SPAN&gt;var &lt;SPAN class="L0S52"&gt;CS &lt;/SPAN&gt;lw_string2&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S31"&gt;"Do something else&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN class="L0S52"&gt;ENDIF&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Yaswanth Datta&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Aug 2016 09:38:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/case-statement-dynamic/m-p/11870301#M1959774</guid>
      <dc:creator>YaswanthDatta</dc:creator>
      <dc:date>2016-08-08T09:38:58Z</dc:date>
    </item>
    <item>
      <title>Re: Case Statement Dynamic</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/case-statement-dynamic/m-p/11870302#M1959775</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Using IF ELSEIF has already been suggested. I think as we're unlikely to get any new answers, I'm locking this thread.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Aug 2016 09:43:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/case-statement-dynamic/m-p/11870302#M1959775</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2016-08-08T09:43:54Z</dc:date>
    </item>
  </channel>
</rss>

