<?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: CL SALV aggregation doesn't work in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/cl-salv-aggregation-doesn-t-work/m-p/13900529#M2031515</link>
    <description>&lt;P&gt;I copied your code and it worked on my ECC and S/4HANA systems, can you check that you didn't define a default display variant and/or execute the &lt;A href="https://help.sap.com/docs/search?q=ALV+consistency+check" target="_self"&gt;ALV consistency chec&lt;/A&gt;k on your system?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="raymond_giuseppi_0-1729062067858.png" style="width: 400px;"&gt;&lt;img src="https://community.sap.com/t5/image/serverpage/image-id/179770i6B92565C5DFF7943/image-size/medium?v=v2&amp;amp;px=400" role="button" title="raymond_giuseppi_0-1729062067858.png" alt="raymond_giuseppi_0-1729062067858.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 16 Oct 2024 07:04:12 GMT</pubDate>
    <dc:creator>RaymondGiuseppi</dc:creator>
    <dc:date>2024-10-16T07:04:12Z</dc:date>
    <item>
      <title>CL SALV aggregation doesn't work</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cl-salv-aggregation-doesn-t-work/m-p/13900380#M2031497</link>
      <description>&lt;P&gt;The aggregation was not working on my main program, so I decided to write another dummy program to see if it works there or not. Turns out, it doesn't. I have gone through every discussion and cannot seem to find the solution. The total doesn't appear at the end of the column which technically, it should.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="abap"&gt;REPORT z_test_salv_aggregation.

TYPES: BEGIN OF ty_data,
         menge TYPE i, " Using integer for quantity
       END OF ty_data.

DATA: it_test      TYPE TABLE OF ty_data,
      wa_test      TYPE ty_data,
      lo_alv_table TYPE REF TO cl_salv_table,
      lo_agg       TYPE REF TO cl_salv_aggregations,
      lo_functions TYPE REF TO cl_salv_functions_list.

* Sample data
wa_test-menge = 10. APPEND wa_test TO it_test.
wa_test-menge = 20. APPEND wa_test TO it_test.
wa_test-menge = 30. APPEND wa_test TO it_test.

* Create the ALV Table
TRY.
    cl_salv_table=&amp;gt;factory(
      IMPORTING
        r_salv_table = lo_alv_table
      CHANGING
        t_table      = it_test
    ).
  CATCH cx_salv_msg INTO DATA(lx_msg).
    WRITE: / 'Error creating ALV table:', lx_msg-&amp;gt;get_text( ).
    RETURN.
ENDTRY.

* Get the Functions object and activate all functions
lo_functions = lo_alv_table-&amp;gt;get_functions(  ).
lo_functions-&amp;gt;set_all( 'X' ).

lo_agg = lo_alv_table-&amp;gt;get_aggregations(  ).
  TRY.
      CALL METHOD lo_agg-&amp;gt;add_aggregation
        EXPORTING
          columnname  = 'MENGE'
          aggregation = if_salv_c_aggregation=&amp;gt;total.
    CATCH cx_salv_data_error cx_salv_not_found cx_salv_existing INTO DATA(lx_error).
  ENDTRY.

* Display the ALV Table
lo_alv_table-&amp;gt;display( ).&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Oct 2024 04:44:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cl-salv-aggregation-doesn-t-work/m-p/13900380#M2031497</guid>
      <dc:creator>Anandkarna123</dc:creator>
      <dc:date>2024-10-16T04:44:48Z</dc:date>
    </item>
    <item>
      <title>Re: CL SALV aggregation doesn't work</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cl-salv-aggregation-doesn-t-work/m-p/13900399#M2031498</link>
      <description>&lt;P&gt;It does work.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Sandra_Rossi_0-1729055795861.png" style="width: 400px;"&gt;&lt;img src="https://community.sap.com/t5/image/serverpage/image-id/179746i248772B0D6596604/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Sandra_Rossi_0-1729055795861.png" alt="Sandra_Rossi_0-1729055795861.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Oct 2024 05:16:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cl-salv-aggregation-doesn-t-work/m-p/13900399#M2031498</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2024-10-16T05:16:44Z</dc:date>
    </item>
    <item>
      <title>Re: CL SALV aggregation doesn't work</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cl-salv-aggregation-doesn-t-work/m-p/13900403#M2031499</link>
      <description>&lt;P&gt;Hey, thanks for your reply. As you can see in the image below, the sum is not shown. Could this be a version problem or something like that?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Anandkarna123_0-1729056015351.png" style="width: 400px;"&gt;&lt;img src="https://community.sap.com/t5/image/serverpage/image-id/179747iF0378214B8716AB4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Anandkarna123_0-1729056015351.png" alt="Anandkarna123_0-1729056015351.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Oct 2024 05:20:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cl-salv-aggregation-doesn-t-work/m-p/13900403#M2031499</guid>
      <dc:creator>Anandkarna123</dc:creator>
      <dc:date>2024-10-16T05:20:49Z</dc:date>
    </item>
    <item>
      <title>Re: CL SALV aggregation doesn't work</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cl-salv-aggregation-doesn-t-work/m-p/13900406#M2031500</link>
      <description>&lt;P&gt;Of course. Optionally use "ALV SOS" to identify the cause (search the Web).&lt;/P&gt;</description>
      <pubDate>Wed, 16 Oct 2024 05:23:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cl-salv-aggregation-doesn-t-work/m-p/13900406#M2031500</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2024-10-16T05:23:13Z</dc:date>
    </item>
    <item>
      <title>Re: CL SALV aggregation doesn't work</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cl-salv-aggregation-doesn-t-work/m-p/13900426#M2031501</link>
      <description>&lt;P&gt;yeah, I did the consistency check. It shows this&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Anandkarna123_0-1729057272562.png" style="width: 400px;"&gt;&lt;img src="https://community.sap.com/t5/image/serverpage/image-id/179750iAA4BF57BD4A0D839/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Anandkarna123_0-1729057272562.png" alt="Anandkarna123_0-1729057272562.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Anandkarna123_1-1729057288676.png" style="width: 400px;"&gt;&lt;img src="https://community.sap.com/t5/image/serverpage/image-id/179751iA329B72616F8D1C6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Anandkarna123_1-1729057288676.png" alt="Anandkarna123_1-1729057288676.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;What does this mean?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Oct 2024 05:44:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cl-salv-aggregation-doesn-t-work/m-p/13900426#M2031501</guid>
      <dc:creator>Anandkarna123</dc:creator>
      <dc:date>2024-10-16T05:44:18Z</dc:date>
    </item>
    <item>
      <title>Re: CL SALV aggregation doesn't work</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cl-salv-aggregation-doesn-t-work/m-p/13900474#M2031502</link>
      <description>&lt;P&gt;It doesn't concern your total issue.&lt;/P&gt;&lt;P&gt;What it means:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Sandra_Rossi_0-1729060048134.png" style="width: 400px;"&gt;&lt;img src="https://community.sap.com/t5/image/serverpage/image-id/179765i083A460DB254967F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Sandra_Rossi_0-1729060048134.png" alt="Sandra_Rossi_0-1729060048134.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Sandra_Rossi_1-1729060119843.png" style="width: 400px;"&gt;&lt;img src="https://community.sap.com/t5/image/serverpage/image-id/179767i039DFEFE4C39AA10/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Sandra_Rossi_1-1729060119843.png" alt="Sandra_Rossi_1-1729060119843.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Oct 2024 06:29:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cl-salv-aggregation-doesn-t-work/m-p/13900474#M2031502</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2024-10-16T06:29:01Z</dc:date>
    </item>
    <item>
      <title>Re: CL SALV aggregation doesn't work</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cl-salv-aggregation-doesn-t-work/m-p/13900506#M2031510</link>
      <description>&lt;P&gt;You didn't indicate your ABAP version.&lt;/P&gt;&lt;P&gt;Try with type P instead of I.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Oct 2024 06:49:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cl-salv-aggregation-doesn-t-work/m-p/13900506#M2031510</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2024-10-16T06:49:02Z</dc:date>
    </item>
    <item>
      <title>Re: CL SALV aggregation doesn't work</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cl-salv-aggregation-doesn-t-work/m-p/13900529#M2031515</link>
      <description>&lt;P&gt;I copied your code and it worked on my ECC and S/4HANA systems, can you check that you didn't define a default display variant and/or execute the &lt;A href="https://help.sap.com/docs/search?q=ALV+consistency+check" target="_self"&gt;ALV consistency chec&lt;/A&gt;k on your system?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="raymond_giuseppi_0-1729062067858.png" style="width: 400px;"&gt;&lt;img src="https://community.sap.com/t5/image/serverpage/image-id/179770i6B92565C5DFF7943/image-size/medium?v=v2&amp;amp;px=400" role="button" title="raymond_giuseppi_0-1729062067858.png" alt="raymond_giuseppi_0-1729062067858.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Oct 2024 07:04:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cl-salv-aggregation-doesn-t-work/m-p/13900529#M2031515</guid>
      <dc:creator>RaymondGiuseppi</dc:creator>
      <dc:date>2024-10-16T07:04:12Z</dc:date>
    </item>
    <item>
      <title>Re: CL SALV aggregation doesn't work</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cl-salv-aggregation-doesn-t-work/m-p/13900624#M2031517</link>
      <description>&lt;P&gt;Also MENGE is usually a quantity field, so associated to a unit of measure field, add this uom field to the displayed structure (or define as a constant in field catalog) and insure the link is correct, so ALV will not sum add meters and litters.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;CL_SALV_COLUMN-&amp;gt;SET_QUANTITY or SET_QUANTITY_COLUMN&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Wed, 16 Oct 2024 08:13:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cl-salv-aggregation-doesn-t-work/m-p/13900624#M2031517</guid>
      <dc:creator>RaymondGiuseppi</dc:creator>
      <dc:date>2024-10-16T08:13:00Z</dc:date>
    </item>
  </channel>
</rss>

