<?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: ALVsorting and subtotal. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/alvsorting-and-subtotal/m-p/4278081#M1020638</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1. have an extra field to store the month when you are defining  the internal table, &lt;/P&gt;&lt;P&gt;2. After internal table population populate the month value from the date.&lt;/P&gt;&lt;P&gt;3. populate the fieldcatalog for Month also , but make it invisible&lt;/P&gt;&lt;P&gt; using no_out = 'X'.&lt;/P&gt;&lt;P&gt;4. For field which you want totals/subtota value use DO_SUM = 'X'. in fieldcatalog.&lt;/P&gt;&lt;P&gt;5. Populate the sort table based on the month number which you populated in step2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;sort-fieldname = 'MONTH'.
sort-up = 'X'.
sort-subtot = 'X'.
append sort to it_sort.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;6. pass the sort information to ALV function.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 05 Aug 2008 06:26:14 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-08-05T06:26:14Z</dc:date>
    <item>
      <title>ALVsorting and subtotal.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alvsorting-and-subtotal/m-p/4278078#M1020635</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;&lt;/P&gt;&lt;P&gt;In ALV.. i have to sort the grid according to date field, this date field is of format mmddyyyy.&lt;/P&gt;&lt;P&gt;Here i need to sort it month wise.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also in this case, after sorting i need to do the sub total of other numeric field monthwise...ie at the end of all &lt;/P&gt;&lt;P&gt;JAN month entries. i want sub total of the numeric field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help me with the same.&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;Amruta.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Aug 2008 06:19:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alvsorting-and-subtotal/m-p/4278078#M1020635</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-05T06:19:06Z</dc:date>
    </item>
    <item>
      <title>Re: ALVsorting and subtotal.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alvsorting-and-subtotal/m-p/4278079#M1020636</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 the link for sorting wrt a field in ALV&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_thread" href="https://community.sap.com/" __jive_macro_name="thread" modifiedtitle="true" __default_attr="921147"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and for SUBTOTAL check&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_thread" href="https://community.sap.com/" __jive_macro_name="thread" modifiedtitle="true" __default_attr="940766"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You will get many example to solve your prob.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, &lt;/P&gt;&lt;P&gt;anirban&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Aug 2008 06:22:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alvsorting-and-subtotal/m-p/4278079#M1020636</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-05T06:22:38Z</dc:date>
    </item>
    <item>
      <title>Re: ALVsorting and subtotal.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alvsorting-and-subtotal/m-p/4278080#M1020637</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;  In data declaration...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt;data:  w_sortinfo TYPE slis_sortinfo_alv,&lt;/P&gt;&lt;P&gt;&amp;gt;         t_sortinfo TYPE slis_t_sortinfo_alv.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In field cat appending....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt;  w_fieldcat-seltext_m = 'NET VALUE'.&lt;/P&gt;&lt;P&gt;&amp;gt;  W_FIELDCAT-DO_SUM = 'X'.&lt;/P&gt;&lt;P&gt;&amp;gt;  APPEND w_fieldcat TO t_fieldcat.&lt;/P&gt;&lt;P&gt;&amp;gt;  CLEAR w_fieldcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and after appending the field cat.....now sort table appending...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt;  W_SORTINFO-FIELDNAME = &amp;lt;field for sorting&amp;gt;.&lt;/P&gt;&lt;P&gt;&amp;gt;  w_sortinfo-subtot   = 'X'.&lt;/P&gt;&lt;P&gt;&amp;gt;  APPEND w_sortinfo TO t_sortinfo.&lt;/P&gt;&lt;P&gt;&amp;gt;  CLEAR w_sortinfo.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in grid FM...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt;    it_sort                           = t_sortinfo&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Naveen Inuganti.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Aug 2008 06:25:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alvsorting-and-subtotal/m-p/4278080#M1020637</guid>
      <dc:creator>naveen_inuganti2</dc:creator>
      <dc:date>2008-08-05T06:25:37Z</dc:date>
    </item>
    <item>
      <title>Re: ALVsorting and subtotal.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alvsorting-and-subtotal/m-p/4278081#M1020638</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1. have an extra field to store the month when you are defining  the internal table, &lt;/P&gt;&lt;P&gt;2. After internal table population populate the month value from the date.&lt;/P&gt;&lt;P&gt;3. populate the fieldcatalog for Month also , but make it invisible&lt;/P&gt;&lt;P&gt; using no_out = 'X'.&lt;/P&gt;&lt;P&gt;4. For field which you want totals/subtota value use DO_SUM = 'X'. in fieldcatalog.&lt;/P&gt;&lt;P&gt;5. Populate the sort table based on the month number which you populated in step2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;sort-fieldname = 'MONTH'.
sort-up = 'X'.
sort-subtot = 'X'.
append sort to it_sort.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;6. pass the sort information to ALV function.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Aug 2008 06:26:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alvsorting-and-subtotal/m-p/4278081#M1020638</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-05T06:26:14Z</dc:date>
    </item>
    <item>
      <title>Re: ALVsorting and subtotal.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alvsorting-and-subtotal/m-p/4278082#M1020639</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;Refer to the link.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapdev.co.uk/reporting/alv/alvgrid_sort.htm" target="test_blank"&gt;http://www.sapdev.co.uk/reporting/alv/alvgrid_sort.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Sumit Agarwal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Aug 2008 06:26:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alvsorting-and-subtotal/m-p/4278082#M1020639</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-05T06:26:25Z</dc:date>
    </item>
    <item>
      <title>Re: ALVsorting and subtotal.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alvsorting-and-subtotal/m-p/4278083#M1020640</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Follow tis code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: gt_sort TYPE slis_t_sortinfo_alv.

CLEAR gs_sort.
gs_sort-fieldname = 'LDDAT'.
gs_sort-spos = 1.
gs_sort-up = 'X'.
gs_sort-subtot = 'X'.
APPEND gs_sort TO gt_sort.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = v_repid
i_callback_user_command = 'PROCESS_USER_COMMANDS'
is_layout = w_layout
it_fieldcat = i_fieldcat[]
it_sort = gt_sort[]
i_default = 'X'
i_save = 'A'
it_events = v_events
is_print = w_print
TABLES
t_outtab = i_final1&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Aug 2008 06:26:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alvsorting-and-subtotal/m-p/4278083#M1020640</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-05T06:26:25Z</dc:date>
    </item>
    <item>
      <title>Re: ALVsorting and subtotal.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alvsorting-and-subtotal/m-p/4278084#M1020641</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Amrutha,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check out this link:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="5794635"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Chandra Sekhar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Aug 2008 06:29:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alvsorting-and-subtotal/m-p/4278084#M1020641</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-05T06:29:26Z</dc:date>
    </item>
  </channel>
</rss>

