<?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: sum function in inner join in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/sum-function-in-inner-join/m-p/5151568#M1193715</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;Please Have a Look at the following Thread Please Have a look at my Reply&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[Inner Join VBRK VBRP SUM FKIMG|&lt;A class="jive_macro jive_macro_thread" href="https://community.sap.com/" __jive_macro_name="thread" modifiedtitle="true" __default_attr="1221850"&gt;&lt;/A&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind Regards,&lt;/P&gt;&lt;P&gt;Faisal&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Faisal Altaf on Feb 4, 2009 2:52 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 04 Feb 2009 09:42:52 GMT</pubDate>
    <dc:creator>faisalatsap</dc:creator>
    <dc:date>2009-02-04T09:42:52Z</dc:date>
    <item>
      <title>sum function in inner join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sum-function-in-inner-join/m-p/5151560#M1193707</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Gurus&lt;/P&gt;&lt;P&gt;I am using the following select statement with inner join. I have used sum function for quantity field but i couldn find where the data is going as in body part quantity is coming individually and header line is empty.&lt;/P&gt;&lt;P&gt;the code is given below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  select a&lt;SUB&gt;knumv b&lt;/SUB&gt;posnr sum( b~fkimg ) as fkimg&lt;/P&gt;&lt;P&gt;  from vbrk as a inner join vbrp as b&lt;/P&gt;&lt;P&gt;  on ( a&lt;SUB&gt;vbeln = b&lt;/SUB&gt;vbeln )&lt;/P&gt;&lt;P&gt;  into corresponding fields of table itab1&lt;/P&gt;&lt;P&gt;  where&lt;/P&gt;&lt;P&gt;               b~erdat in fkdat&lt;/P&gt;&lt;P&gt;             and   posnr &amp;gt; 0&lt;/P&gt;&lt;P&gt;             and   fkimg &amp;gt; 0&lt;/P&gt;&lt;P&gt;             group by a&lt;SUB&gt;knumv b&lt;/SUB&gt;posnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With regards&lt;/P&gt;&lt;P&gt;PARDEEP SHARMA&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Feb 2009 09:12:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sum-function-in-inner-join/m-p/5151560#M1193707</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-04T09:12:09Z</dc:date>
    </item>
    <item>
      <title>Re: sum function in inner join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sum-function-in-inner-join/m-p/5151561#M1193708</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;As you are doing the inner join it is not recomonded to use sum function due to performance issue.So fetch all the values in the internal table them collect internal table and you will gat all the consolidated values compairing all non numeric value. Else you can loop at the internal table and add the  Invoiced Quantity into a local variable say l_ fking.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;l_ fking = l_ fking + in_tab-fking.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;finally after loop you will get the total Invoiced Quantity.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Feb 2009 09:21:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sum-function-in-inner-join/m-p/5151561#M1193708</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-04T09:21:42Z</dc:date>
    </item>
    <item>
      <title>Re: sum function in inner join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sum-function-in-inner-join/m-p/5151562#M1193709</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Pradeep,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your select querry just populates your internal table. To get the data row by row into you rwork area either use a loop on your internal table or use READ statement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Feb 2009 09:22:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sum-function-in-inner-join/m-p/5151562#M1193709</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-04T09:22:45Z</dc:date>
    </item>
    <item>
      <title>Re: sum function in inner join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sum-function-in-inner-join/m-p/5151563#M1193710</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;u can also select the data first and then use AT new or at  AT END OF field_name.&lt;/P&gt;&lt;P&gt;          SUM.&lt;/P&gt;&lt;P&gt;          .......&lt;/P&gt;&lt;P&gt;        ENDAT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sap-img.com/abap/inner-joins.htm" target="test_blank"&gt;http://www.sap-img.com/abap/inner-joins.htm&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Feb 2009 09:22:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sum-function-in-inner-join/m-p/5151563#M1193710</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-04T09:22:50Z</dc:date>
    </item>
    <item>
      <title>Re: sum function in inner join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sum-function-in-inner-join/m-p/5151564#M1193711</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks for your reply but i dont want to use loop statement. &lt;/P&gt;&lt;P&gt;I want to get the dataas well as sum in a single select command.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but the question is where the value of sum( b~fkimg ) is going?&lt;/P&gt;&lt;P&gt;Is it possible to use aggregate function using inner join and for all entries??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;with regards&lt;/P&gt;&lt;P&gt;pardeep sharma&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Pardeep Sharma on Feb 4, 2009 2:54 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Feb 2009 09:24:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sum-function-in-inner-join/m-p/5151564#M1193711</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-04T09:24:28Z</dc:date>
    </item>
    <item>
      <title>Re: sum function in inner join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sum-function-in-inner-join/m-p/5151565#M1193712</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Pradeep,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I didn't understand your question clearly,&lt;/P&gt;&lt;P&gt;Here i'm all the values of itab including fkimg&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data: begin of itab1 occurs 0,
        knumv like vbrk-knumv,
        posnr like vbrp-posnr,
        fkimg like vbrp-fkimg,
      end of itab1.

data: itab_wa like itab1.

select a~knumv b~posnr sum( b~fkimg ) as fkimg
from vbrk as a inner join vbrp as b
on ( a~vbeln = b~vbeln )
into corresponding fields of table itab1
where
*b~erdat in fkdat
posnr &amp;gt; 0
and fkimg &amp;gt; 0
group by a~knumv b~posnr.


loop at itab1 into itab_wa.
  write:/ itab_wa-knumv, itab_wa-posnr, itab_wa-fkimg.
endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pl. clarify&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, 04 Feb 2009 09:32:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sum-function-in-inner-join/m-p/5151565#M1193712</guid>
      <dc:creator>former_member222860</dc:creator>
      <dc:date>2009-02-04T09:32:12Z</dc:date>
    </item>
    <item>
      <title>Re: sum function in inner join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sum-function-in-inner-join/m-p/5151566#M1193713</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;yes it is possible....see this for help ....&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.webdeveloper.com/forum/showthread.php?t=176144" target="test_blank"&gt;http://www.webdeveloper.com/forum/showthread.php?t=176144&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Feb 2009 09:38:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sum-function-in-inner-join/m-p/5151566#M1193713</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-04T09:38:18Z</dc:date>
    </item>
    <item>
      <title>Re: sum function in inner join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sum-function-in-inner-join/m-p/5151567#M1193714</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks for your reply Reddy.&lt;/P&gt;&lt;P&gt;My question is i want to do the calculations using the total quantity only.&lt;/P&gt;&lt;P&gt;So I am trying to get the total quantity with one select. But from where the total quantity to be taken after the select statement.&lt;/P&gt;&lt;P&gt;I dont want to use loop.............endloop statements!!!!!!!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With regards&lt;/P&gt;&lt;P&gt;Pardeep sharma&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Feb 2009 09:38:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sum-function-in-inner-join/m-p/5151567#M1193714</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-04T09:38:30Z</dc:date>
    </item>
    <item>
      <title>Re: sum function in inner join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sum-function-in-inner-join/m-p/5151568#M1193715</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;Please Have a Look at the following Thread Please Have a look at my Reply&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[Inner Join VBRK VBRP SUM FKIMG|&lt;A class="jive_macro jive_macro_thread" href="https://community.sap.com/" __jive_macro_name="thread" modifiedtitle="true" __default_attr="1221850"&gt;&lt;/A&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind Regards,&lt;/P&gt;&lt;P&gt;Faisal&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Faisal Altaf on Feb 4, 2009 2:52 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Feb 2009 09:42:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sum-function-in-inner-join/m-p/5151568#M1193715</guid>
      <dc:creator>faisalatsap</dc:creator>
      <dc:date>2009-02-04T09:42:52Z</dc:date>
    </item>
    <item>
      <title>Re: sum function in inner join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sum-function-in-inner-join/m-p/5151569#M1193716</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks Faisal&lt;/P&gt;&lt;P&gt;I did the same but from where to sum of fkimg after the select statement.&lt;/P&gt;&lt;P&gt;please help me after select statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With regards&lt;/P&gt;&lt;P&gt;Pardeep Sharma&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Feb 2009 10:04:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sum-function-in-inner-join/m-p/5151569#M1193716</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-04T10:04:53Z</dc:date>
    </item>
    <item>
      <title>Re: sum function in inner join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sum-function-in-inner-join/m-p/5151570#M1193717</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Pradeep&lt;/P&gt;&lt;P&gt;   I think ,its better to fetch the whole data into your internal table and do the SUM.&lt;/P&gt;&lt;P&gt;If you need the sum of individual key fields you can go for COLLECT ,which adds all the &lt;/P&gt;&lt;P&gt;numeric field.If you want the total of a particular field ,you can use SUM in the control &lt;/P&gt;&lt;P&gt;break statement AT LAST .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;AT LAST.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;SUM.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ENDAT.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt; I think this will be more usefull for your situation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Menon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Feb 2009 10:26:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sum-function-in-inner-join/m-p/5151570#M1193717</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-04T10:26:27Z</dc:date>
    </item>
    <item>
      <title>Re: sum function in inner join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sum-function-in-inner-join/m-p/5151571#M1193718</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; Dear Gurus&lt;/P&gt;&lt;P&gt;&amp;gt; I am using the following select statement with inner join. I have used sum function for quantity field but i couldn find where the data is going as in body part quantity is coming individually and header line is empty.&lt;/P&gt;&lt;P&gt;&amp;gt; the code is given below.&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt;   select a&lt;SUB&gt;knumv b&lt;/SUB&gt;posnr sum( b~fkimg ) as fkimg&lt;/P&gt;&lt;P&gt;&amp;gt;   from vbrk as a inner join vbrp as b&lt;/P&gt;&lt;P&gt;&amp;gt;   on ( a&lt;SUB&gt;vbeln = b&lt;/SUB&gt;vbeln )&lt;/P&gt;&lt;P&gt;&amp;gt;   into corresponding fields of table itab1&lt;/P&gt;&lt;P&gt;&amp;gt;   where&lt;/P&gt;&lt;P&gt;&amp;gt;                b~erdat in fkdat&lt;/P&gt;&lt;P&gt;&amp;gt;              and   posnr &amp;gt; 0&lt;/P&gt;&lt;P&gt;&amp;gt;              and   fkimg &amp;gt; 0&lt;/P&gt;&lt;P&gt;&amp;gt;              group by a&lt;SUB&gt;knumv b&lt;/SUB&gt;posnr.&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; With regards&lt;/P&gt;&lt;P&gt;&amp;gt; PARDEEP SHARMA&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;If you don't use INTO CORRESPONDING FIELDS and just give your receiving itab fields the same order as your select string and discard the as FKIMG I think it should work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Feb 2009 10:40:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sum-function-in-inner-join/m-p/5151571#M1193718</guid>
      <dc:creator>christine_evans</dc:creator>
      <dc:date>2009-02-04T10:40:24Z</dc:date>
    </item>
    <item>
      <title>Re: sum function in inner join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sum-function-in-inner-join/m-p/5151572#M1193719</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; thanks Faisal&lt;/P&gt;&lt;P&gt;&amp;gt; I did the same but from where to sum of fkimg after the select statement.&lt;/P&gt;&lt;P&gt;&amp;gt; please help me after select statement.&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; With regards&lt;/P&gt;&lt;P&gt;&amp;gt; Pardeep Sharma&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Test the following Code it is already giving you the SUM of "FKIMG" Group By "KNUMV and POSNR".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;TABLES: vbrk, vbrp.

SELECT-OPTIONS: fkdat for vbrp-erdat.

TYPES: BEGIN OF t_vbrk_vbrp,
  knumv LIKE vbrk-knumv,
  posnr LIKE vbrp-posnr,
  fkimg LIKE vbrp-fkimg,
END OF t_vbrk_vbrp.

DATA: it_vbrk_vbrp TYPE STANDARD TABLE OF t_vbrk_vbrp WITH HEADER LINE.

SELECT vbrk~knumv vbrp~posnr SUM( vbrp~fkimg ) AS fkimg
  INTO CORRESPONDING FIELDS OF TABLE it_vbrk_vbrp
  FROM vbrk INNER JOIN vbrp ON ( vbrk~vbeln = vbrp~vbeln )
  WHERE vbrp~erdat IN fkdat
    AND posnr &amp;gt; 0
    AND fkimg &amp;gt; 0
GROUP BY vbrk~knumv vbrp~posnr.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What you mean by After Select what you want to do after Select Please reply,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind Regards,&lt;/P&gt;&lt;P&gt;Faisal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Feb 2009 05:10:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sum-function-in-inner-join/m-p/5151572#M1193719</guid>
      <dc:creator>faisalatsap</dc:creator>
      <dc:date>2009-02-05T05:10:55Z</dc:date>
    </item>
    <item>
      <title>Re: sum function in inner join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sum-function-in-inner-join/m-p/5151573#M1193720</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;Check this Select query,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Eg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      select sum( menge ) as menge sum( effwr ) as effwr&lt;/P&gt;&lt;P&gt;      from ekko as k inner join&lt;/P&gt;&lt;P&gt;      ekpo as p on k&lt;SUB&gt;ebeln = p&lt;/SUB&gt;ebeln&lt;/P&gt;&lt;P&gt;      into corresponding fields of itab&lt;/P&gt;&lt;P&gt;      where bednr = itemp-bednr and p~loekz &amp;lt;&amp;gt; 'L'&lt;/P&gt;&lt;P&gt;      and k&lt;SUB&gt;ebeln &amp;lt;&amp;gt; itemp-ebeln and k&lt;/SUB&gt;bstyp = 'F'&lt;/P&gt;&lt;P&gt;      and k~bsart in bsart&lt;/P&gt;&lt;P&gt;      and p~aedat between first_day and last_day.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Make ur select query like this, U'll get the data in header line.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Feb 2009 05:25:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sum-function-in-inner-join/m-p/5151573#M1193720</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-05T05:25:48Z</dc:date>
    </item>
    <item>
      <title>Re: sum function in inner join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sum-function-in-inner-join/m-p/5151574#M1193721</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Pradeep,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If i get u correct, ur exepecting SUM of all the records of the column like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data: val type i.
select SUM( fkimg ) into val from vbrp.
write:/ val.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I feel that is not possible with joins.&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>Thu, 05 Feb 2009 05:56:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sum-function-in-inner-join/m-p/5151574#M1193721</guid>
      <dc:creator>former_member222860</dc:creator>
      <dc:date>2009-02-05T05:56:18Z</dc:date>
    </item>
    <item>
      <title>Re: sum function in inner join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sum-function-in-inner-join/m-p/5151575#M1193722</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Pradeep,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    Take The hole data to an internal Table and then do the sum.&lt;/P&gt;&lt;P&gt;     So if u want to sum the perticular Filed then use the control break statments&lt;/P&gt;&lt;P&gt; for this as ATLAST.&lt;/P&gt;&lt;P&gt;                SUM&lt;/P&gt;&lt;P&gt;                ENDAT.&lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;N.Neelima.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Feb 2009 07:00:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sum-function-in-inner-join/m-p/5151575#M1193722</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-05T07:00:04Z</dc:date>
    </item>
    <item>
      <title>Re: sum function in inner join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sum-function-in-inner-join/m-p/5151576#M1193723</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; Hi Pradeep,&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; If i get u correct, ur exepecting SUM of all the records of the column like this:&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;/CODE&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;CODE&gt;data: val type i.
&amp;gt; select SUM( fkimg ) into val from vbrp.
&amp;gt; write:/ val.&lt;/CODE&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; I feel that is not possible with joins.&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; thanks\&lt;/P&gt;&lt;P&gt;&amp;gt; Mahesh&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;It is perfectly possible to do a SUM with a JOIN. In response to an earlier question, I don't think that using aggregate functions with FOR ALL ENTRIES is allowed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Feb 2009 10:12:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sum-function-in-inner-join/m-p/5151576#M1193723</guid>
      <dc:creator>christine_evans</dc:creator>
      <dc:date>2009-02-05T10:12:15Z</dc:date>
    </item>
    <item>
      <title>Re: sum function in inner join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sum-function-in-inner-join/m-p/5151577#M1193724</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;try the like the given code below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

types: begin of t_vbrk_vbrp,
  kunrg like vbrk-kunrg,
  sortl like kna1-sortl,
  regio like vbrk-regio,
  mvgr1 like vbrp-mvgr1,
  matkl like vbrp-matkl,
  mvgr5 like vbrp-mvgr5,
  vrkme like vbrp-vrkme,
  fkimg like vbrp-fkimg,
end of t_vbrk_vbrp.
 
data: it_vbrk_vbrp type standard table of t_vbrk_vbrp with header line,
      wa_it_vbrk_vbrp type t_vbrk_vbrp.
 
select vbrk~kunrg vbrk~regio vbrp~mvgr1 vbrp~matkl vbrp~mvgr5 vbrp~vrkme sum( vbrp~fkimg ) as fkimg "vbrp~lgort
      into corresponding fields of table it_vbrk_vbrp
      from vbrp
      inner join vbrk on ( vbrp~vbeln = vbrk~vbeln and vbrk~fksto = '' )
      where vbrk~fkart = 'ZCLA'
        and vbrk~regio = 'RM3'
        and vbrk~fkdat = '20091231'
        and vbrp~matkl = '001'
        and vbrp~pstyv in ('ZFUL','TAN')
        and vbrp~mvgr1 = 'P01'
        and vbrp~mvgr5 in ('B09','B10','B11','B12')
      group by vbrk~kunrg vbrk~regio vbrp~mvgr1 vbrp~matkl vbrp~mvgr5 vbrp~vrkme .



&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ritesh J&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Feb 2009 10:17:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sum-function-in-inner-join/m-p/5151577#M1193724</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-05T10:17:26Z</dc:date>
    </item>
    <item>
      <title>Re: sum function in inner join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sum-function-in-inner-join/m-p/5151578#M1193725</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks all of you.....&lt;/P&gt;&lt;P&gt;points to all..............&lt;/P&gt;&lt;P&gt;i got the clue n i m closing this thread......&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With regards&lt;/P&gt;&lt;P&gt;pardeep sharma&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Feb 2009 10:49:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sum-function-in-inner-join/m-p/5151578#M1193725</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-05T10:49:29Z</dc:date>
    </item>
  </channel>
</rss>

