<?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 in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/case-statement/m-p/1752279#M326248</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;a case statement is an abap syntax, which wil help you to brach to one of the multiple paths available based on a value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;eg:&lt;/P&gt;&lt;P&gt;case value.&lt;/P&gt;&lt;P&gt;when 1.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;do something.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;when 2.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;do something else.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;when 3.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;do something else..&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;when others.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;do some other thing.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;endcase.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 06 Dec 2006 09:59:59 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-12-06T09:59:59Z</dc:date>
    <item>
      <title>case statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/case-statement/m-p/1752276#M326245</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;what is case statement&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Dec 2006 04:44:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/case-statement/m-p/1752276#M326245</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-06T04:44:06Z</dc:date>
    </item>
    <item>
      <title>Re: case statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/case-statement/m-p/1752277#M326246</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you must first go and read some documentation on ABAP and other basic things instead of just hosting a Quiz contest over here .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1st go and read ur self.. then If u have doubts come to SDN. &lt;/P&gt;&lt;P&gt;All the questions that you have asked are very basic questions that can be understood just by reading some material.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Dec 2006 04:57:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/case-statement/m-p/1752277#M326246</guid>
      <dc:creator>former_member69765</dc:creator>
      <dc:date>2006-12-06T04:57:05Z</dc:date>
    </item>
    <item>
      <title>Re: case statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/case-statement/m-p/1752278#M326247</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     Just check these links.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_erp2005vp/helpdata/en/0a/191ca01377384dbf872d5391adf3cf/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_erp2005vp/helpdata/en/0a/191ca01377384dbf872d5391adf3cf/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_erp2005vp/helpdata/en/0a/191ca01377384dbf872d5391adf3cf/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_erp2005vp/helpdata/en/0a/191ca01377384dbf872d5391adf3cf/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Priyanka.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Dec 2006 09:57:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/case-statement/m-p/1752278#M326247</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-06T09:57:39Z</dc:date>
    </item>
    <item>
      <title>Re: case statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/case-statement/m-p/1752279#M326248</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;a case statement is an abap syntax, which wil help you to brach to one of the multiple paths available based on a value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;eg:&lt;/P&gt;&lt;P&gt;case value.&lt;/P&gt;&lt;P&gt;when 1.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;do something.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;when 2.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;do something else.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;when 3.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;do something else..&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;when others.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;do some other thing.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;endcase.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Dec 2006 09:59:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/case-statement/m-p/1752279#M326248</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-06T09:59:59Z</dc:date>
    </item>
    <item>
      <title>Re: case statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/case-statement/m-p/1752280#M326249</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Case is an ABAP Syntax which will allow u to execute the part depending on the field value in when condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;E.g&lt;/P&gt;&lt;P&gt;CASE sy-ucomm. &lt;/P&gt;&lt;P&gt;  WHEN 'BACK'. &lt;/P&gt;&lt;P&gt;    LEAVE TO SCREEN 100. &lt;/P&gt;&lt;P&gt;  WHEN 'CANCEL'. &lt;/P&gt;&lt;P&gt;    LEAVE SCREEN. &lt;/P&gt;&lt;P&gt;  WHEN 'EXIT'. &lt;/P&gt;&lt;P&gt;    LEAVE PROGRAM. &lt;/P&gt;&lt;P&gt;  WHEN OTHERS. &lt;/P&gt;&lt;P&gt;    MESSAGE '...' TYPE 'E'. &lt;/P&gt;&lt;P&gt;ENDCASE.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Dec 2006 12:11:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/case-statement/m-p/1752280#M326249</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-06T12:11:35Z</dc:date>
    </item>
    <item>
      <title>Re: case statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/case-statement/m-p/1752281#M326250</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Case statement in ABAP is same as C language for exam:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;case value.&lt;/P&gt;&lt;P&gt;when 1.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;do something.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;when 2.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;do something else.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;when 3.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;do something else..&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;when others.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;do some other thing.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;endcase.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Its always preferred  to use case statement rather than if else ladder. The case statement internaly generates the binary search to satisfy the "Value". If-else ladder is like linear search.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps u to understand case statement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Dec 2006 13:34:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/case-statement/m-p/1752281#M326250</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-06T13:34:04Z</dc:date>
    </item>
    <item>
      <title>Re: case statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/case-statement/m-p/1752282#M326251</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;FYA&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think you must first go and read some documentation on ABAP and other basic things instead of just hosting a Quiz contest over here .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1st go and read ur self.. then If u have doubts come to SDN. &lt;/P&gt;&lt;P&gt;All the questions that you have asked are very basic questions that can be understood just by reading some material.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Dec 2006 13:36:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/case-statement/m-p/1752282#M326251</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-06T13:36:29Z</dc:date>
    </item>
    <item>
      <title>Re: case statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/case-statement/m-p/1752283#M326252</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Abhay Singh&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Syntax &lt;/P&gt;&lt;P&gt;CASE operand. &lt;/P&gt;&lt;P&gt;  [WHEN operand1 [OR operand2 [OR operand3] ...]. &lt;/P&gt;&lt;P&gt;    [statement_block1] ] &lt;/P&gt;&lt;P&gt;  ... &lt;/P&gt;&lt;P&gt;  [WHEN OTHERS. &lt;/P&gt;&lt;P&gt;    [statement_blockn] ] &lt;/P&gt;&lt;P&gt;ENDCASE. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;These statements define a control structure that can contain multiple statement blocks statement_block1 ... statement_blockn, of which no more than one is executed depending on the value in the operand operand. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Starting with the first WHEN-statement, the content of the operand operand is compared with the content of the operand operand1 operand2 ... in a descending order. The statement block is executed after the first identical instance is found. If no matches are found, the statement block is executed after the statement WHEN OTHERS. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For operand, operand1, operand2 , ...you can use the data object built-in functions and functional methods. With the latter, you receive the return value as an operand. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the end of the executed statement block is reached or no statement block is executed, then the processing continues after ENDCASE. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the comparison of the contents, the following logical expression can be used: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;operand = operand1 [OR operand = operand2 [OR operand = operand3] ... ] &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the execution of the comparison with dependency on the data types of the involved operands, the same rules apply as described in the section Relational Operators for all Data Types. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note &lt;/P&gt;&lt;P&gt;You cannot use a statement between the statement CASE and the first statement WHEN &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example &lt;/P&gt;&lt;P&gt;Linking the program flow according to the function code in the system field sy-ucomm. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CASE sy-ucomm. &lt;/P&gt;&lt;P&gt;  WHEN 'BACK'. &lt;/P&gt;&lt;P&gt;    LEAVE TO SCREEN 100. &lt;/P&gt;&lt;P&gt;  WHEN 'CANCEL'. &lt;/P&gt;&lt;P&gt;    LEAVE SCREEN. &lt;/P&gt;&lt;P&gt;  WHEN 'EXIT'. &lt;/P&gt;&lt;P&gt;    LEAVE PROGRAM. &lt;/P&gt;&lt;P&gt;  WHEN OTHERS. &lt;/P&gt;&lt;P&gt;    MESSAGE '...' TYPE 'E'. &lt;/P&gt;&lt;P&gt;ENDCASE.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Dec 2006 09:18:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/case-statement/m-p/1752283#M326252</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-07T09:18:47Z</dc:date>
    </item>
  </channel>
</rss>

