<?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: Short Dump on Aggregate Function Count in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/short-dump-on-aggregate-function-count/m-p/8173900#M1623531</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Many thanks folks, It was data type which caused error. Instead of keep gv_posnr as type i I'd it type posnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 07 Sep 2011 19:08:38 GMT</pubDate>
    <dc:creator>former_member295881</dc:creator>
    <dc:date>2011-09-07T19:08:38Z</dc:date>
    <item>
      <title>Short Dump on Aggregate Function Count</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/short-dump-on-aggregate-function-count/m-p/8173896#M1623527</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to write a simple Aggregate Select statement to count POSNR from VBAP but having a short dump saying 'Error in module RSQL of the database interface'. Can anybody see what's wrong with the following statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          select vbeln posnr kdmat cuobj&lt;/P&gt;&lt;P&gt;                  into table t_sales_order&lt;/P&gt;&lt;P&gt;                    from vbap&lt;/P&gt;&lt;P&gt;                          where vbeln = pv_pin_number (user input parameter)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                describe table t_sales_order lines lv_lin.&lt;/P&gt;&lt;P&gt;                read table t_sales_order into lwa_sales_order index lv_lin.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="---" /&gt;&lt;P&gt;&amp;gt; Error               select count( distinct posnr ) from vbap&lt;/P&gt;&lt;P&gt;                                    into gv_posnr&lt;/P&gt;&lt;P&gt;                                         where vbeln = lwa_sales_order-vbeln.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Sep 2011 18:41:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/short-dump-on-aggregate-function-count/m-p/8173896#M1623527</guid>
      <dc:creator>former_member295881</dc:creator>
      <dc:date>2011-09-07T18:41:36Z</dc:date>
    </item>
    <item>
      <title>Re: Short Dump on Aggregate Function Count</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/short-dump-on-aggregate-function-count/m-p/8173897#M1623528</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There should be further information about the error. Please share it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Sep 2011 18:48:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/short-dump-on-aggregate-function-count/m-p/8173897#M1623528</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-09-07T18:48:21Z</dc:date>
    </item>
    <item>
      <title>Re: Short Dump on Aggregate Function Count</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/short-dump-on-aggregate-function-count/m-p/8173898#M1623529</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;gv_posnr has to be an integer, so TYPE I&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Sep 2011 18:51:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/short-dump-on-aggregate-function-count/m-p/8173898#M1623529</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-09-07T18:51:48Z</dc:date>
    </item>
    <item>
      <title>Re: Short Dump on Aggregate Function Count</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/short-dump-on-aggregate-function-count/m-p/8173899#M1623530</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;I copied the same code and did some small modificatio.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have replaced the GV_POSNR with V_COUNT and declared it as INT4. The COUNT holds only upto INT4 values. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is working for me. Please change the data type of VG_POSNR to INT4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please a break on select count statement and check the index of LV_LIN value and also the VBELN.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check how many entries are there for the same VBELN.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
types : begin of ty_vbap,
        vbeln type vbak-vbeln,
        posnr type vbap-posnr,
        kdmat type vbap-kdmat,
        cuobj type vbap-cuobj,
        end of ty_vbap.

        Data : t_vbap  type table of ty_vbap,
               wa_vbap type ty_vbap,
               lv_lin  type i,
               v_count type int4.


select vbeln posnr kdmat cuobj
into table t_vbap
from vbap
up to 2000 rows.

describe table t_vbap lines lv_lin.
read table t_vbap into wa_vbap index lv_lin.

*----&amp;gt; Error
select count( distinct posnr ) from vbap
into v_count
where vbeln = wa_vbap-vbeln.

write : v_count.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;SHIVA&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Sep 2011 19:02:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/short-dump-on-aggregate-function-count/m-p/8173899#M1623530</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-09-07T19:02:12Z</dc:date>
    </item>
    <item>
      <title>Re: Short Dump on Aggregate Function Count</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/short-dump-on-aggregate-function-count/m-p/8173900#M1623531</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Many thanks folks, It was data type which caused error. Instead of keep gv_posnr as type i I'd it type posnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Sep 2011 19:08:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/short-dump-on-aggregate-function-count/m-p/8173900#M1623531</guid>
      <dc:creator>former_member295881</dc:creator>
      <dc:date>2011-09-07T19:08:38Z</dc:date>
    </item>
  </channel>
</rss>

