<?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: SUBTOTAL SCRIPTS in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/subtotal-scripts/m-p/2291656#M500040</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI HEMANT &lt;/P&gt;&lt;P&gt;can u pleasse mention me where to use the code that you gave...please send me the code ellaborattedly or explained....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 14 May 2007 10:13:07 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-05-14T10:13:07Z</dc:date>
    <item>
      <title>SUBTOTAL SCRIPTS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/subtotal-scripts/m-p/2291654#M500038</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all&lt;/P&gt;&lt;P&gt;i need to calculate the subtotal of &amp;amp;BSEG-WRBTR&amp;amp;...please give me the code in the driver program and the sap script...please dont mention the code that am mentioning below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/: DEFINE &amp;amp;TOT_PRICE&amp;amp; &lt;/P&gt;&lt;P&gt;/: PERFORM F_GET_PRICE IN PROGRAM &amp;lt;subroutine prog name&amp;gt; /:USING &amp;amp;KOMVD-KBERT&amp;amp; /:CHANGING &amp;amp;TOT_PRICE&amp;amp; /:ENDPERFORM &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then write the variable where ever you want it to be printed (mostly it will be in footer window) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then create subroutine pool program and you have to write the code. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM F_GET_PRICE tables int_cond structure itcsy &lt;/P&gt;&lt;P&gt;outt_cond structure itcsy. data : value type kbert. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;statics value1 type kbert. &lt;/P&gt;&lt;P&gt;Read int_cond table index 1. &lt;/P&gt;&lt;P&gt;value = int_cond-value. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;value1 = value1 + value. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Read outt_cond table index 1. &lt;/P&gt;&lt;P&gt;outt_cond-value = value1. &lt;/P&gt;&lt;P&gt;Modify outt_cond index 1. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thank you&lt;/P&gt;&lt;P&gt;with regards &lt;/P&gt;&lt;P&gt;vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 May 2007 10:03:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/subtotal-scripts/m-p/2291654#M500038</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-14T10:03:25Z</dc:date>
    </item>
    <item>
      <title>Re: SUBTOTAL SCRIPTS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/subtotal-scripts/m-p/2291655#M500039</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vijay,  &lt;/P&gt;&lt;P&gt;             Use &amp;lt;b&amp;gt;SUM&amp;lt;/b&amp;gt; command to for subtotal.&lt;/P&gt;&lt;P&gt;use thsi command using control breaks:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At field, at end of ....................&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;at end of BSEG-WRBTR.&lt;/P&gt;&lt;P&gt;sum.&lt;/P&gt;&lt;P&gt;write:/ BSEG-WRBTR.&lt;/P&gt;&lt;P&gt;endat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Hemant&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 May 2007 10:11:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/subtotal-scripts/m-p/2291655#M500039</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-14T10:11:12Z</dc:date>
    </item>
    <item>
      <title>Re: SUBTOTAL SCRIPTS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/subtotal-scripts/m-p/2291656#M500040</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI HEMANT &lt;/P&gt;&lt;P&gt;can u pleasse mention me where to use the code that you gave...please send me the code ellaborattedly or explained....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 May 2007 10:13:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/subtotal-scripts/m-p/2291656#M500040</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-14T10:13:07Z</dc:date>
    </item>
    <item>
      <title>Re: SUBTOTAL SCRIPTS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/subtotal-scripts/m-p/2291657#M500041</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;use the USING paramter as the Document Number for which you have to calculate the Sum of the costs instead of &amp;amp;KOMVD-KBERT&amp;amp;. like Billing document number (VBELN) etc.&lt;/P&gt;&lt;P&gt;so take the VBRK-KNUMV and pas that to KONV and take the KWERT fields and sum up and pass it back to the script.&lt;/P&gt;&lt;P&gt;See the sample code for the routine.&lt;/P&gt;&lt;P&gt;REPORT ZMPO1 .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form get_freight tables in_par structure itcsy out_par structure itcsy.&lt;/P&gt;&lt;P&gt; tables: ekko,konv,t685t.&lt;/P&gt;&lt;P&gt; data: begin of itab occurs 0,&lt;/P&gt;&lt;P&gt;         ebeln like ekko-ebeln,&lt;/P&gt;&lt;P&gt;         knumv like ekko-knumv,&lt;/P&gt;&lt;P&gt;       end of itab.&lt;/P&gt;&lt;P&gt; data: begin of itab1 occurs 0,&lt;/P&gt;&lt;P&gt;         knumv like konv-knumv,&lt;/P&gt;&lt;P&gt;         kposn like konv-kposn,&lt;/P&gt;&lt;P&gt;         kschl like konv-kschl,&lt;/P&gt;&lt;P&gt;         kbetr like konv-kbetr,&lt;/P&gt;&lt;P&gt;         waers like konv-waers,&lt;/P&gt;&lt;P&gt;         kwert like konv-kwert,&lt;/P&gt;&lt;P&gt;       end of itab1.&lt;/P&gt;&lt;P&gt; data: begin of iout occurs 0,&lt;/P&gt;&lt;P&gt;         kschl like konv-kschl,&lt;/P&gt;&lt;P&gt;         vtext like t685t-vtext,&lt;/P&gt;&lt;P&gt;         kbetr like konv-kbetr,&lt;/P&gt;&lt;P&gt;         kwert like konv-kwert,&lt;/P&gt;&lt;P&gt;       end of iout.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; data v_po like ekko-ebeln.&lt;/P&gt;&lt;P&gt; read table in_par with key 'EKKO-EBELN'.&lt;/P&gt;&lt;P&gt; if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;   v_po = in_par-value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   select&lt;/P&gt;&lt;P&gt;     ebeln&lt;/P&gt;&lt;P&gt;     knumv&lt;/P&gt;&lt;P&gt;  from ekko &lt;/P&gt;&lt;P&gt;  into table itab&lt;/P&gt;&lt;P&gt;  where ebeln = v_po.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;    loop at itab.&lt;/P&gt;&lt;P&gt;      select&lt;/P&gt;&lt;P&gt;        knumv&lt;/P&gt;&lt;P&gt;        kposn&lt;/P&gt;&lt;P&gt;        kschl&lt;/P&gt;&lt;P&gt;        kbetr&lt;/P&gt;&lt;P&gt;        waers&lt;/P&gt;&lt;P&gt;        kwert&lt;/P&gt;&lt;P&gt;      into table itab1&lt;/P&gt;&lt;P&gt;      from konv&lt;/P&gt;&lt;P&gt;      where knumv = itab-knumv and&lt;/P&gt;&lt;P&gt;            kappl = 'M'.&lt;/P&gt;&lt;P&gt;    endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    loop at itab1.&lt;/P&gt;&lt;P&gt;      if itab1-kposn &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;        select single * from t685t&lt;/P&gt;&lt;P&gt;                          where kschl = itab1-kschl&lt;/P&gt;&lt;P&gt;                            and kappl = 'M'&lt;/P&gt;&lt;P&gt;                            and spras = 'EN'.&lt;/P&gt;&lt;P&gt;        iout-vtext = t685t-vtext.&lt;/P&gt;&lt;P&gt;        iout-kschl = itab1-kschl.&lt;/P&gt;&lt;P&gt;        iout-kbetr = itab1-kbetr.&lt;/P&gt;&lt;P&gt;        iout-kwert = itab1-kwert.&lt;/P&gt;&lt;P&gt;        append iout.&lt;/P&gt;&lt;P&gt;        clear iout.&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;    endloop.&lt;/P&gt;&lt;P&gt;    sort itab1 by kposn.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    loop at iout.&lt;/P&gt;&lt;P&gt;      sort iout by kschl.&lt;/P&gt;&lt;P&gt;      if ( iout-kschl eq 'GSDC' OR&lt;/P&gt;&lt;P&gt;           iout-kschl eq 'GSFR' OR&lt;/P&gt;&lt;P&gt;           iout-kschl eq 'GSIR' ).&lt;/P&gt;&lt;P&gt;        at end of kschl.&lt;/P&gt;&lt;P&gt;          read table iout index sy-tabix.&lt;/P&gt;&lt;P&gt;          sum.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;         write:/ iout-kschl,iout-vtext,iout-kwert.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      out_par-name = 'A1'.&lt;/P&gt;&lt;P&gt;      out_par-value = iout-vtext.&lt;/P&gt;&lt;P&gt;      append out_par.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      out_par-name = 'A2'.&lt;/P&gt;&lt;P&gt;      out_par-value = iout-kwert.&lt;/P&gt;&lt;P&gt;      append out_par.&lt;/P&gt;&lt;P&gt;          endat.&lt;/P&gt;&lt;P&gt;        endif.&lt;/P&gt;&lt;P&gt;      endloop.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;endform.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;IN THE FORM I AM WRITING THIS CODE.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/:DEFINE &amp;amp;A1&amp;amp; = ' '&lt;/P&gt;&lt;P&gt;/:DEFINE &amp;amp;A2&amp;amp; = ' '&lt;/P&gt;&lt;P&gt;/:PERFORM GET_FREIGHT IN PROGRAM ZMFORM_PO1&lt;/P&gt;&lt;P&gt;/:USING &amp;amp;EKKO-EBELN&amp;amp;&lt;/P&gt;&lt;P&gt;/:CHANGING &amp;amp;A1&amp;amp;&lt;/P&gt;&lt;P&gt;/:CHANGING &amp;amp;A2&amp;amp;&lt;/P&gt;&lt;P&gt;/:ENDPERFORM&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;&amp;amp;A1&amp;amp;&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;&amp;amp;A2&amp;amp;&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This Code is to be written in the PO form under ADDRESS window.&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="-------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/:DEFINE &amp;amp;A1&amp;amp; = ' '&lt;/P&gt;&lt;P&gt;/:DEFINE &amp;amp;A2&amp;amp; = ' '&lt;/P&gt;&lt;P&gt;/:DEFINE &amp;amp;A3&amp;amp; = ' '&lt;/P&gt;&lt;P&gt;/:DEFINE &amp;amp;A4&amp;amp; = ' '&lt;/P&gt;&lt;P&gt;/:DEFINE &amp;amp;A5&amp;amp; = ' '&lt;/P&gt;&lt;P&gt;/:DEFINE &amp;amp;A6&amp;amp; = ' '&lt;/P&gt;&lt;P&gt;/:PERFORM GET_VENDOR IN PROGRAM ZMFORM_PO&lt;/P&gt;&lt;P&gt;/:USING &amp;amp;EKKO-EBELN&amp;amp;&lt;/P&gt;&lt;P&gt;/:CHANGING &amp;amp;A1&amp;amp;&lt;/P&gt;&lt;P&gt;/:CHANGING &amp;amp;A2&amp;amp;&lt;/P&gt;&lt;P&gt;/:CHANGING &amp;amp;A3&amp;amp;&lt;/P&gt;&lt;P&gt;/:CHANGING &amp;amp;A4&amp;amp;&lt;/P&gt;&lt;P&gt;/:CHANGING &amp;amp;A5&amp;amp;&lt;/P&gt;&lt;P&gt;/:CHANGING &amp;amp;A6&amp;amp;&lt;/P&gt;&lt;P&gt;/:ENDPERFORM&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;&amp;amp;A1&amp;amp;&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;&amp;amp;A2&amp;amp;&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;&amp;amp;A3&amp;amp;&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;&amp;amp;A4&amp;amp;&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;&amp;amp;A5&amp;amp;&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;&amp;amp;A6&amp;amp;&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward points if useful&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Anji&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 May 2007 10:13:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/subtotal-scripts/m-p/2291657#M500041</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-14T10:13:09Z</dc:date>
    </item>
  </channel>
</rss>

