<?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: alv oops in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-oops/m-p/3846734#M924855</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Joshi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Award points if useful..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Summing up Percentages in an ALV Grid&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;ALV Grid lets you get subtotals and totals of columns, but you might often need to get averages and percentages among other not so frequent requirements.&lt;/P&gt;&lt;P&gt;              It&amp;#146;s possible to get averages (or sub-averages) instead of subtotals.You can use the method get_subtotals, since this method returns a reference you can use it to change the values displayed as subtotals to what ever you want, not just percentages - ratios, powers, logarithms, anything you want. &lt;/P&gt;&lt;P&gt;This is the code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CREATE OBJECT gr_alvcon&lt;/P&gt;&lt;P&gt;  EXPORTING container_name = &amp;#145;ABC&amp;#146;. &amp;#147;Name of the custom container&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;CREATE OBJECT gr_alvgrid&lt;/P&gt;&lt;P&gt;  EXPORTING i_parent = gr_alvcon.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL METHOD gr_alvgrid-&amp;gt;set_table_for_first_display&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      is_layout = ps_layout&lt;/P&gt;&lt;P&gt;    CHANGING&lt;/P&gt;&lt;P&gt;      it_fieldcatalog = fieldcat&lt;/P&gt;&lt;P&gt;      it_sort = it_sort&lt;/P&gt;&lt;P&gt;      it_outtab = it_delsm[].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : total TYPE REF TO data,&lt;/P&gt;&lt;P&gt;       subto TYPE REF TO data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FIELD-SYMBOLS &amp;lt;ftotal&amp;gt; TYPE STANDARD TABLE.&lt;/P&gt;&lt;P&gt;FIELD-SYMBOLS &amp;lt;fsubto&amp;gt; TYPE STANDARD TABLE.&lt;/P&gt;&lt;P&gt;DATA wa_tot TYPE t_delsm.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL METHOD gr_alvgrid-&amp;gt;get_subtotals&lt;/P&gt;&lt;P&gt;    IMPORTING ep_collect00 = total&lt;/P&gt;&lt;P&gt;              ep_collect01 = subto.&lt;/P&gt;&lt;P&gt;ASSIGN total-&amp;gt;* TO &amp;lt;ftotal&amp;gt;.&lt;/P&gt;&lt;P&gt;ASSIGN subto-&amp;gt;* TO &amp;lt;fsubto&amp;gt;.&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;LOOP AT &amp;lt;ftotal&amp;gt; INTO wa_tot.&lt;/P&gt;&lt;P&gt;  wa_tot-delpc = wa_tot-delpr * 100 / wa_tot-totpr. " Set any value for this&lt;/P&gt;&lt;P&gt;  MODIFY &amp;lt;ftotal&amp;gt; FROM wa_tot INDEX sy-tabix.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL METHOD gr_alvgrid-&amp;gt;set_ready_for_input&lt;/P&gt;&lt;P&gt;    EXPORTING i_ready_for_input = 1.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 13 May 2008 17:28:27 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-05-13T17:28:27Z</dc:date>
    <item>
      <title>alv oops</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-oops/m-p/3846732#M924853</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is ALV oops?&lt;/P&gt;&lt;P&gt;what is  the use of reuse_alv_grid_display_lvc ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 May 2008 14:17:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-oops/m-p/3846732#M924853</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-13T14:17:27Z</dc:date>
    </item>
    <item>
      <title>Re: alv oops</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-oops/m-p/3846733#M924854</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please read this: [https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e8a1d690-0201-0010-b7ad-d9719a415907].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 May 2008 14:28:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-oops/m-p/3846733#M924854</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-13T14:28:25Z</dc:date>
    </item>
    <item>
      <title>Re: alv oops</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-oops/m-p/3846734#M924855</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Joshi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Award points if useful..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Summing up Percentages in an ALV Grid&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;ALV Grid lets you get subtotals and totals of columns, but you might often need to get averages and percentages among other not so frequent requirements.&lt;/P&gt;&lt;P&gt;              It&amp;#146;s possible to get averages (or sub-averages) instead of subtotals.You can use the method get_subtotals, since this method returns a reference you can use it to change the values displayed as subtotals to what ever you want, not just percentages - ratios, powers, logarithms, anything you want. &lt;/P&gt;&lt;P&gt;This is the code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CREATE OBJECT gr_alvcon&lt;/P&gt;&lt;P&gt;  EXPORTING container_name = &amp;#145;ABC&amp;#146;. &amp;#147;Name of the custom container&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;CREATE OBJECT gr_alvgrid&lt;/P&gt;&lt;P&gt;  EXPORTING i_parent = gr_alvcon.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL METHOD gr_alvgrid-&amp;gt;set_table_for_first_display&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      is_layout = ps_layout&lt;/P&gt;&lt;P&gt;    CHANGING&lt;/P&gt;&lt;P&gt;      it_fieldcatalog = fieldcat&lt;/P&gt;&lt;P&gt;      it_sort = it_sort&lt;/P&gt;&lt;P&gt;      it_outtab = it_delsm[].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : total TYPE REF TO data,&lt;/P&gt;&lt;P&gt;       subto TYPE REF TO data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FIELD-SYMBOLS &amp;lt;ftotal&amp;gt; TYPE STANDARD TABLE.&lt;/P&gt;&lt;P&gt;FIELD-SYMBOLS &amp;lt;fsubto&amp;gt; TYPE STANDARD TABLE.&lt;/P&gt;&lt;P&gt;DATA wa_tot TYPE t_delsm.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL METHOD gr_alvgrid-&amp;gt;get_subtotals&lt;/P&gt;&lt;P&gt;    IMPORTING ep_collect00 = total&lt;/P&gt;&lt;P&gt;              ep_collect01 = subto.&lt;/P&gt;&lt;P&gt;ASSIGN total-&amp;gt;* TO &amp;lt;ftotal&amp;gt;.&lt;/P&gt;&lt;P&gt;ASSIGN subto-&amp;gt;* TO &amp;lt;fsubto&amp;gt;.&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;LOOP AT &amp;lt;ftotal&amp;gt; INTO wa_tot.&lt;/P&gt;&lt;P&gt;  wa_tot-delpc = wa_tot-delpr * 100 / wa_tot-totpr. " Set any value for this&lt;/P&gt;&lt;P&gt;  MODIFY &amp;lt;ftotal&amp;gt; FROM wa_tot INDEX sy-tabix.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL METHOD gr_alvgrid-&amp;gt;set_ready_for_input&lt;/P&gt;&lt;P&gt;    EXPORTING i_ready_for_input = 1.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 May 2008 17:28:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-oops/m-p/3846734#M924855</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-13T17:28:27Z</dc:date>
    </item>
    <item>
      <title>Re: alv oops</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-oops/m-p/3846735#M924856</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Tanju&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The &lt;STRONG&gt;classical SE16 list&lt;/STRONG&gt; display corresponds to function module &lt;STRONG&gt;REUSE_ALV_GRID_DISPLAY&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you switch to &lt;STRONG&gt;grid display&lt;/STRONG&gt; this corresponds to fm &lt;STRONG&gt;REUSE_ALV_GRID_DISPLAY_LVC&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Technically REUSE_ALV_GRID_DISPLAY belongs to the old-fashioned SLIS-based ALV lists whereas REUSE_ALV_GRID_DISPLAY_LVC is similar like the OO-based ALV lists. Its interface is almost identical to method SET_TABLE_FOR_FIRST_DISPLAY of class CL_GUI_ALV_GRID.&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;  Uwe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 May 2008 18:54:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-oops/m-p/3846735#M924856</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2008-05-13T18:54:34Z</dc:date>
    </item>
  </channel>
</rss>

