<?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: Do_sum and Subtotal in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/do-sum-and-subtotal/m-p/2597434#M594968</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 link.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.geocities.com/mpioud/Z_DEMO_ALV_SORT.html" target="test_blank"&gt;http://www.geocities.com/mpioud/Z_DEMO_ALV_SORT.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Reshma&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 24 Jul 2007 07:53:23 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-07-24T07:53:23Z</dc:date>
    <item>
      <title>Do_sum and Subtotal</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/do-sum-and-subtotal/m-p/2597428#M594962</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 VL06 Transaction in Zprogram and i am trying to sum for fields (ANZPOS- Number of total items) and subtotal on the basis of picking date(KODAT).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the fieldcatlog for the field ANZPOS I checked the DO_SUM = 'X' and for subtotal i modified the sortinfo internal table and i checked sub_tot = 'x' for the goods issue date . But result is not coming as expected... What should be done???&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Prince&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jul 2007 07:09:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/do-sum-and-subtotal/m-p/2597428#M594962</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-24T07:09:53Z</dc:date>
    </item>
    <item>
      <title>Re: Do_sum and Subtotal</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/do-sum-and-subtotal/m-p/2597429#M594963</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;wa_fieldcat2-col_pos    = '10'.&lt;/P&gt;&lt;P&gt;  wa_fieldcat2-fieldname  = 'FAKWR'.&lt;/P&gt;&lt;P&gt;  wa_fieldcat2-tabname = 't_output2'.&lt;/P&gt;&lt;P&gt;  wa_fieldcat2-seltext_l  = 'Amount'.&lt;/P&gt;&lt;P&gt; &amp;lt;b&amp;gt; wa_fieldcat2-do_sum        = 'X'.   "SUM UPON DISPLAY&lt;/P&gt;&lt;P&gt;  wa_fieldcat2-datatype = 'CURR'.&amp;lt;/b&amp;gt;*  wa_fieldcat-just       = 'L'.&lt;/P&gt;&lt;P&gt;  wa_fieldcat2-outputlen  = '15'.&lt;/P&gt;&lt;P&gt;  wa_fieldcat2-do_sum = 'X'.&lt;/P&gt;&lt;P&gt;  APPEND wa_fieldcat2 TO t_fieldcat2.&lt;/P&gt;&lt;P&gt;  CLEAR wa_fieldcat2.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jul 2007 07:11:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/do-sum-and-subtotal/m-p/2597429#M594963</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-24T07:11:57Z</dc:date>
    </item>
    <item>
      <title>Re: Do_sum and Subtotal</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/do-sum-and-subtotal/m-p/2597430#M594964</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sumi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; I am checking the DO_SUM = 'X' and this is Hirerchical list display. But nothing is happening......&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Prince&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jul 2007 07:15:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/do-sum-and-subtotal/m-p/2597430#M594964</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-24T07:15:48Z</dc:date>
    </item>
    <item>
      <title>Re: Do_sum and Subtotal</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/do-sum-and-subtotal/m-p/2597431#M594965</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;Can i have your sample code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Pavan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jul 2007 07:20:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/do-sum-and-subtotal/m-p/2597431#M594965</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-24T07:20:39Z</dc:date>
    </item>
    <item>
      <title>Re: Do_sum and Subtotal</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/do-sum-and-subtotal/m-p/2597432#M594966</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Pavan,&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;  This is the copy of standard transaction VL06 for picking and the list is being displayed in Hierarchical format.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="2" type="ul"&gt;&lt;P&gt;sample code&lt;/P&gt;&lt;/LI&gt;&lt;UL&gt;&lt;LI level="3" type="ul"&gt;&lt;P&gt;Building Fieldcatlog&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt; ls_fieldcat-fieldname = 'ANZPOS'.&lt;/P&gt;&lt;P&gt; ls_fieldcat-tabname = 'GT_OUTTAB'.&lt;/P&gt;&lt;P&gt; ls_fieldcat-do_sum  = charx.&lt;/P&gt;&lt;P&gt; ls_fieldcat-no_out  = space.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;modify ct_fieldcat from ls_fieldcat&lt;/P&gt;&lt;P&gt;   transporting do_sum no_out&lt;/P&gt;&lt;P&gt;   where fieldname eq 'ANZPOS'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="10" type="ul"&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;      ls_sort-spos = 1.&lt;/P&gt;&lt;P&gt;      ls_sort-fieldname = 'KODAT'.   " Picking Date&lt;/P&gt;&lt;P&gt;      ls_sort-tabname = 'GT_OUTTAB'.   "IT_D_POSTAB_KODAT&lt;/P&gt;&lt;P&gt;      ls_sort-up = charx.&lt;/P&gt;&lt;P&gt;      ls_sort-subtot = charx.    " Added as per DEV319&lt;/P&gt;&lt;P&gt;      append ls_sort to gt_sort.&lt;/P&gt;&lt;P&gt;      clear ls_sort .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Prince&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jul 2007 07:29:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/do-sum-and-subtotal/m-p/2597432#M594966</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-24T07:29:43Z</dc:date>
    </item>
    <item>
      <title>Re: Do_sum and Subtotal</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/do-sum-and-subtotal/m-p/2597433#M594967</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 to use this &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ls_sort-subtot    = &amp;amp;2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check this sample for your knowledge how to declare the things&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;*&amp;amp;---------------------------------------------------------------------*
*&amp;amp; Report  ZALVTOTAL                                                   *
*&amp;amp;                                                                     *
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;                                                                     *
*&amp;amp;                                                                     *
*&amp;amp;---------------------------------------------------------------------*

REPORT  ZALVTOTAL                               .

TYPES :
  BEGIN OF ty_vbak,
    vkorg TYPE vbak-vkorg,             " Sales organization
    kunnr TYPE vbak-kunnr,             " Sold-to party
    vbeln TYPE vbak-vbeln,             " Sales document
    netwr TYPE vbak-netwr,             " Net Value of the Sales Order
    waerk TYPE vbak-waerk,             " Document currency
  END OF ty_vbak.

DATA:
  vbak    TYPE vbak,
  gt_vbak TYPE TABLE OF ty_vbak.

SELECT-OPTIONS :
  s_vkorg FOR vbak-vkorg,              " Sales organization
  s_kunnr FOR vbak-kunnr,              " Sold-to party
  s_vbeln FOR vbak-vbeln.              " Sales document

SELECTION-SCREEN :
  SKIP, BEGIN OF LINE,COMMENT 5(27) v_1 FOR FIELD p_max.
PARAMETERS p_max(2) TYPE n DEFAULT '20' OBLIGATORY.
SELECTION-SCREEN END OF LINE.

*---------------------------------------------------------------------*
INITIALIZATION.

  v_1 = 'Maximum of records to read'.

*---------------------------------------------------------------------*
START-OF-SELECTION.

  PERFORM f_read_data.

  PERFORM f_display_data.

*---------------------------------------------------------------------*
*      Form  f_read_data
*---------------------------------------------------------------------*
FORM f_read_data.

  SELECT vkorg kunnr vbeln netwr waerk
      UP TO p_max ROWS
    INTO TABLE gt_vbak
    FROM vbak
   WHERE kunnr IN s_kunnr
     AND vbeln IN s_vbeln
     AND vkorg IN s_vkorg.

ENDFORM.                               " F_READ_DATA
*---------------------------------------------------------------------*
*      Form  f_display_data
*---------------------------------------------------------------------*
FORM f_display_data.

  TYPE-POOLS: slis.                    " ALV Global types

  DEFINE m_fieldcat.
    add 1 to ls_fieldcat-col_pos.
    ls_fieldcat-fieldname   = &amp;amp;1.
    ls_fieldcat-ref_tabname = 'VBAK'.
    ls_fieldcat-do_sum      = &amp;amp;2.
    ls_fieldcat-cfieldname  = &amp;amp;3.
    append ls_fieldcat to lt_fieldcat.
  END-OF-DEFINITION.

  DEFINE m_sort.
    add 1 to ls_sort-spos.
    ls_sort-fieldname = &amp;amp;1.
    ls_sort-up        = 'X'.
    ls_sort-subtot    = &amp;amp;2.
    append ls_sort to lt_sort.
  END-OF-DEFINITION.

  DATA:
    ls_fieldcat TYPE slis_fieldcat_alv,
    lt_fieldcat TYPE slis_t_fieldcat_alv,
    lt_sort     TYPE slis_t_sortinfo_alv,
    ls_sort     TYPE slis_sortinfo_alv,
    ls_layout   TYPE slis_layout_alv.

  m_fieldcat 'VKORG' ''  ''.
  m_fieldcat 'KUNNR' ''  ''.
  m_fieldcat 'VBELN' ''  ''.
  m_fieldcat 'NETWR' 'X' 'WAERK'.
  m_fieldcat 'WAERK' ''  ''.

  m_sort 'VKORG' 'X'.                  " Sort by vkorg and subtotal
  m_sort 'KUNNR' 'X'.                  " Sort by kunnr and subtotal
  m_sort 'VBELN' ''.                   " Sort by vbeln

  ls_layout-cell_merge = 'X'.

  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
            is_layout   = ls_layout
            it_fieldcat = lt_fieldcat
            it_sort     = lt_sort
       TABLES
            t_outtab    = gt_vbak.

ENDFORM.                               " F_DISPLAY_DATA&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward all helpfull answers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Pavan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jul 2007 07:47:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/do-sum-and-subtotal/m-p/2597433#M594967</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-24T07:47:17Z</dc:date>
    </item>
    <item>
      <title>Re: Do_sum and Subtotal</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/do-sum-and-subtotal/m-p/2597434#M594968</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 link.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.geocities.com/mpioud/Z_DEMO_ALV_SORT.html" target="test_blank"&gt;http://www.geocities.com/mpioud/Z_DEMO_ALV_SORT.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Reshma&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jul 2007 07:53:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/do-sum-and-subtotal/m-p/2597434#M594968</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-24T07:53:23Z</dc:date>
    </item>
    <item>
      <title>Re: Do_sum and Subtotal</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/do-sum-and-subtotal/m-p/2597435#M594969</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;My Problem is solved only the thing which I was not getting that in the copied zprogram Standard variant was coming bydefault and in the function module "Reuse_ALV_HIERSEC_DISPLAY"  I put my custom varaint then my program is working fine.&lt;/P&gt;&lt;P&gt;Thanks for your support!!!!!! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;PR&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Jul 2007 12:15:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/do-sum-and-subtotal/m-p/2597435#M594969</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-25T12:15:18Z</dc:date>
    </item>
  </channel>
</rss>

