<?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-Endcase in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/case-endcase/m-p/2664722#M614907</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Endloop statement is not there.&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,&lt;/P&gt;&lt;P&gt;Sen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Aug 2007 19:33:15 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-08-15T19:33:15Z</dc:date>
    <item>
      <title>Case-Endcase</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/case-endcase/m-p/2664720#M614905</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gurus, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have written the following code using Case and End case.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at it_header.&lt;/P&gt;&lt;P&gt;    case it_header-custty.&lt;/P&gt;&lt;P&gt;      when 'ST'.&lt;/P&gt;&lt;P&gt;        continue.&lt;/P&gt;&lt;P&gt;      when 'BG'.&lt;/P&gt;&lt;P&gt;        select kunn2 into it_knvp from knvp&lt;/P&gt;&lt;P&gt;        where parvw = 'ZB'&lt;/P&gt;&lt;P&gt;        and kunnr = it_header-custid.&lt;/P&gt;&lt;P&gt;      when 'PG'.&lt;/P&gt;&lt;P&gt;        select kunnr into it_knvh from knvh&lt;/P&gt;&lt;P&gt;        where hityp = 'A'&lt;/P&gt;&lt;P&gt;        and hkunnr = it_header-custid.&lt;/P&gt;&lt;P&gt;      when 'HQ'.&lt;/P&gt;&lt;P&gt;         select kunnr into it_knvh1 from knvh&lt;/P&gt;&lt;P&gt;         where hityp = 'A'&lt;/P&gt;&lt;P&gt;         and hkunnr = it_header-custid.&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;and I am getting the error message " when is allowed only after case".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you please try to help me out of this.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Rajeev Gupta&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Aug 2007 19:27:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/case-endcase/m-p/2664720#M614905</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-15T19:27:30Z</dc:date>
    </item>
    <item>
      <title>Re: Case-Endcase</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/case-endcase/m-p/2664721#M614906</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rajeev,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Expecting that you may be you forget to put ENDLOOP for LOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Vinay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Aug 2007 19:32:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/case-endcase/m-p/2664721#M614906</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-15T19:32:42Z</dc:date>
    </item>
    <item>
      <title>Re: Case-Endcase</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/case-endcase/m-p/2664722#M614907</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Endloop statement is not there.&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,&lt;/P&gt;&lt;P&gt;Sen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Aug 2007 19:33:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/case-endcase/m-p/2664722#M614907</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-15T19:33:15Z</dc:date>
    </item>
    <item>
      <title>Re: Case-Endcase</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/case-endcase/m-p/2664723#M614908</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Looks like you select statement are screwing it up.  If you wish to get data into an internal table, use the word TABLE in your select statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

case it_header-custty.
  when 'ST'.
    continue.
  when 'BG'.
    select kunn2 into TABLE it_knvp from knvp
    where parvw = 'ZB'
    and kunnr = it_header-custid.
  when 'PG'.
    select kunnr into TABLE it_knvh from knvh
    where hityp = 'A'
    and hkunnr = it_header-custid.
  when 'HQ'.
    select kunnr into TABLE it_knvh1 from knvh
    where hityp = 'A'
    and hkunnr = it_header-custid.

endcase.


&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Of if you need a single record us the SINGLE word in your select statements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

case it_header-custty.
  when 'ST'.
    continue.
  when 'BG'.
    select SINGLE kunn2 into  it_knvp from knvp
    where parvw = 'ZB'
    and kunnr = it_header-custid.
  when 'PG'.
    select SINGLE kunnr into  it_knvh from knvh
    where hityp = 'A'
    and hkunnr = it_header-custid.
  when 'HQ'.
    select SINGLE kunnr into  it_knvh1 from knvh
    where hityp = 'A'
    and hkunnr = it_header-custid.

endcase.




&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>Wed, 15 Aug 2007 19:34:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/case-endcase/m-p/2664723#M614908</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2007-08-15T19:34:16Z</dc:date>
    </item>
    <item>
      <title>Re: Case-Endcase</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/case-endcase/m-p/2664724#M614909</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;&lt;/P&gt;&lt;P&gt;  Check this corrected code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at it_header.&lt;/P&gt;&lt;P&gt;case it_header-custty.&lt;/P&gt;&lt;P&gt;when 'ST'.&lt;/P&gt;&lt;P&gt;continue.&lt;/P&gt;&lt;P&gt;when 'BG'.&lt;/P&gt;&lt;P&gt;select single kunn2 into it_knvp from knvp&lt;/P&gt;&lt;P&gt;where parvw = 'ZB'&lt;/P&gt;&lt;P&gt;and kunnr = it_header-custid.&lt;/P&gt;&lt;P&gt;when 'PG'.&lt;/P&gt;&lt;P&gt;select single kunnr into it_knvh from knvh&lt;/P&gt;&lt;P&gt;where hityp = 'A'&lt;/P&gt;&lt;P&gt;and hkunnr = it_header-custid.&lt;/P&gt;&lt;P&gt;when 'HQ'.&lt;/P&gt;&lt;P&gt;select single kunnr into it_knvh1 from knvh&lt;/P&gt;&lt;P&gt;where hityp = 'A'&lt;/P&gt;&lt;P&gt;and hkunnr = it_header-custid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endcase.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;mahesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Aug 2007 19:34:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/case-endcase/m-p/2664724#M614909</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-15T19:34:19Z</dc:date>
    </item>
    <item>
      <title>Re: Case-Endcase</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/case-endcase/m-p/2664725#M614910</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i don't think you can write logic statements like where parvw = 'ZB'  while using when statement..it should always be when 'Value' like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when '1'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when '2'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when var1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rajeev&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Aug 2007 19:34:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/case-endcase/m-p/2664725#M614910</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-15T19:34:23Z</dc:date>
    </item>
  </channel>
</rss>

