<?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 Problem in ALV Sub total in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-alv-sub-total/m-p/5945488#M1335365</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 have two field which is custome number and i want they sum in same line for this i write below code .&lt;/P&gt;&lt;P&gt;and after this i want differece between this two total. so how can i get this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; DEFINE m_sort.&lt;/P&gt;&lt;P&gt;    clear lt_sort.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   add 1 to ls_sort-spos.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    ls_sort-fieldname = 'kunrg'.&lt;/P&gt;&lt;P&gt;    ls_sort-up        = 'X'.&lt;/P&gt;&lt;P&gt;    ls_sort-subtot    = 'X'.&lt;/P&gt;&lt;P&gt;    ls_sort-group     = 'X'.&lt;/P&gt;&lt;P&gt;    append ls_sort to lt_sort.&lt;/P&gt;&lt;P&gt;    clear lt_sort.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    it_sort-fieldname = 'kunrg'.&lt;/P&gt;&lt;P&gt;    it_sort-up = 'X'.&lt;/P&gt;&lt;P&gt;    append ls_sort to lt_sort.&lt;/P&gt;&lt;P&gt;    CLEAR lt_sort.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  END-OF-DEFINITION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but i didn't get this field in group and not get sub total so please help me out as soon as  possible.. please.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 28 Jul 2009 12:46:39 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-07-28T12:46:39Z</dc:date>
    <item>
      <title>Problem in ALV Sub total</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-alv-sub-total/m-p/5945488#M1335365</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 have two field which is custome number and i want they sum in same line for this i write below code .&lt;/P&gt;&lt;P&gt;and after this i want differece between this two total. so how can i get this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; DEFINE m_sort.&lt;/P&gt;&lt;P&gt;    clear lt_sort.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   add 1 to ls_sort-spos.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    ls_sort-fieldname = 'kunrg'.&lt;/P&gt;&lt;P&gt;    ls_sort-up        = 'X'.&lt;/P&gt;&lt;P&gt;    ls_sort-subtot    = 'X'.&lt;/P&gt;&lt;P&gt;    ls_sort-group     = 'X'.&lt;/P&gt;&lt;P&gt;    append ls_sort to lt_sort.&lt;/P&gt;&lt;P&gt;    clear lt_sort.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    it_sort-fieldname = 'kunrg'.&lt;/P&gt;&lt;P&gt;    it_sort-up = 'X'.&lt;/P&gt;&lt;P&gt;    append ls_sort to lt_sort.&lt;/P&gt;&lt;P&gt;    CLEAR lt_sort.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  END-OF-DEFINITION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but i didn't get this field in group and not get sub total so please help me out as soon as  possible.. please.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jul 2009 12:46:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-alv-sub-total/m-p/5945488#M1335365</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-28T12:46:39Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in ALV Sub total</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-alv-sub-total/m-p/5945489#M1335366</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;in your field catalog for that field which you want to do the sum. specify do_sum = 'X'&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jul 2009 12:52:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-alv-sub-total/m-p/5945489#M1335366</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-28T12:52:07Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in ALV Sub total</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-alv-sub-total/m-p/5945490#M1335367</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 refer the below code for Totals and subtotals.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;type-pools : slis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of t_itab occurs 0,&lt;/P&gt;&lt;P&gt;       kunnr type kunnr,&lt;/P&gt;&lt;P&gt;       waers type waers,&lt;/P&gt;&lt;P&gt;       dmbtr type dmbtr,&lt;/P&gt;&lt;P&gt;      end of t_itab.&lt;/P&gt;&lt;P&gt;data: w_fieldcat type slis_fieldcat_alv,&lt;/P&gt;&lt;P&gt;      it_fieldcat type slis_t_fieldcat_alv,&lt;/P&gt;&lt;P&gt;      t_sort type slis_t_sortinfo_alv,&lt;/P&gt;&lt;P&gt;      w_sort type slis_sortinfo_alv,&lt;/P&gt;&lt;P&gt;      w_layout type slis_layout_alv.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;t_itab-kunnr = '0001'.&lt;/P&gt;&lt;P&gt;t_itab-waers = 'USD'.&lt;/P&gt;&lt;P&gt;t_itab-dmbtr = '100.00'.&lt;/P&gt;&lt;P&gt;append t_itab.&lt;/P&gt;&lt;P&gt;t_itab-kunnr = '0001'.&lt;/P&gt;&lt;P&gt;t_itab-waers = 'USD'.&lt;/P&gt;&lt;P&gt;t_itab-dmbtr = '200.00'.&lt;/P&gt;&lt;P&gt;append t_itab.&lt;/P&gt;&lt;P&gt;t_itab-kunnr = '0002'.&lt;/P&gt;&lt;P&gt;t_itab-waers = 'USD'.&lt;/P&gt;&lt;P&gt;t_itab-dmbtr = '100.00'.&lt;/P&gt;&lt;P&gt;append t_itab.&lt;/P&gt;&lt;P&gt;t_itab-kunnr = '0002'.&lt;/P&gt;&lt;P&gt;t_itab-waers = 'USD'.&lt;/P&gt;&lt;P&gt;t_itab-dmbtr = '400.00'.&lt;/P&gt;&lt;P&gt;append t_itab.&lt;/P&gt;&lt;P&gt;t_itab-kunnr = '0002'.&lt;/P&gt;&lt;P&gt;t_itab-waers = 'USD'.&lt;/P&gt;&lt;P&gt;t_itab-dmbtr = '300.00'.&lt;/P&gt;&lt;P&gt;append t_itab.&lt;/P&gt;&lt;P&gt;t_itab-kunnr = '0002'.&lt;/P&gt;&lt;P&gt;t_itab-waers = 'USD'.&lt;/P&gt;&lt;P&gt;t_itab-dmbtr = '100.00'.&lt;/P&gt;&lt;P&gt;append t_itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;w_fieldcat-fieldname = 'KUNNR'.&lt;/P&gt;&lt;P&gt; append w_fieldcat to it_fieldcat.&lt;/P&gt;&lt;P&gt; clear w_fieldcat.&lt;/P&gt;&lt;P&gt;w_fieldcat-fieldname = 'WAERS'.&lt;/P&gt;&lt;P&gt; append w_fieldcat to it_fieldcat.&lt;/P&gt;&lt;P&gt; clear w_fieldcat.&lt;/P&gt;&lt;P&gt; w_fieldcat-fieldname = 'DMBTR'.&lt;/P&gt;&lt;P&gt; w_fieldcat-do_sum  = 'X'.&lt;/P&gt;&lt;P&gt; append w_fieldcat to it_fieldcat.&lt;/P&gt;&lt;P&gt; clear w_fieldcat.&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt; w_sort-fieldname = 'KUNNR'.&lt;/P&gt;&lt;P&gt; w_sort-up = 'X'.&lt;/P&gt;&lt;P&gt; w_sort-group = '*'.&lt;/P&gt;&lt;P&gt; w_sort-subtot = 'X'.&lt;/P&gt;&lt;P&gt; append w_sort to t_sort.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;w_layout-totals_text = 'Grand Total'.&lt;/P&gt;&lt;P&gt;w_layout-subtotals_text = 'Sub total'.&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;  i_callback_program = sy-repid&lt;/P&gt;&lt;P&gt;  it_fieldcat        = it_fieldcat&lt;/P&gt;&lt;P&gt;  it_sort            = t_sort&lt;/P&gt;&lt;P&gt;  is_layout =  w_layout&lt;/P&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;  t_outtab = t_itab&lt;/P&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;P&gt;  program_error = 1&lt;/P&gt;&lt;P&gt;  OTHERS = 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Bhavana&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jul 2009 13:01:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-alv-sub-total/m-p/5945490#M1335367</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-28T13:01:47Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in ALV Sub total</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-alv-sub-total/m-p/5945491#M1335368</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;FOR TOTAL:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;there is a property of fieldcatalog, that is do_sum.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;USE COED LIKE:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PERFORM fieldcat USING:&lt;/P&gt;&lt;P&gt;'1' 'MATNR' 'I_MARD' 'MATERIAL NO' 'MARD' 'MATNR ' ' ',&lt;/P&gt;&lt;P&gt;'2' 'NETWR' 'I_MARD' 'PLANT' 'MARD' 'WERKS' ' ',&lt;/P&gt;&lt;P&gt;..............................&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM fieldcat USING value(p_0029)&lt;/P&gt;&lt;P&gt;value(p_0030)&lt;/P&gt;&lt;P&gt;value(p_0031)&lt;/P&gt;&lt;P&gt;value(p_0032)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;wa_fieldcat-col_pos = p_0029.&lt;/P&gt;&lt;P&gt;wa_fieldcat-fieldname = p_0030.&lt;/P&gt;&lt;P&gt;wa_fieldcat-tabname = p_0031.&lt;/P&gt;&lt;P&gt;wa_fieldcat-reptext = p_0032.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;wa_fieldcat-do_sum = 'X'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;APPEND wa_fieldcat TO i_fieldcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM. " FIELDCAT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in final output you will get the total of currency field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FOR SUB TOTAL:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;decleare: i_sort type standard table of slis_sortinfo_alv,&lt;/P&gt;&lt;P&gt;          wa_sort type slis_t_sortinfo_alv.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;wa_sort-spos = '1'.&lt;/P&gt;&lt;P&gt;wa_sort-fieldname = 'field1'.&lt;/P&gt;&lt;P&gt;wa_sort-subtot = 'X'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;append wa_tab to i_sort.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;i_callback_program = sy-repid&lt;/P&gt;&lt;P&gt;it_fieldcat = it_fieldcat&lt;/P&gt;&lt;P&gt;it_sort = i_sort&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this can solve your pbs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Tutun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jul 2009 04:35:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-alv-sub-total/m-p/5945491#M1335368</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-29T04:35:47Z</dc:date>
    </item>
  </channel>
</rss>

