<?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: Active Sum button alv in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/active-sum-button-alv/m-p/3976019#M949655</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;For fieldcatalog for any amount filed use :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
gs_fieldcat-do_sum = 'X'.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sriarm Ponna.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 19 Jun 2008 13:27:46 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-06-19T13:27:46Z</dc:date>
    <item>
      <title>Active Sum button alv</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/active-sum-button-alv/m-p/3976015#M949651</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How active the standard sum button in the alv oo?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jun 2008 13:16:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/active-sum-button-alv/m-p/3976015#M949651</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-19T13:16:19Z</dc:date>
    </item>
    <item>
      <title>Re: Active Sum button alv</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/active-sum-button-alv/m-p/3976016#M949652</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is it factory method or set table as first display?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jun 2008 13:22:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/active-sum-button-alv/m-p/3976016#M949652</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-19T13:22:58Z</dc:date>
    </item>
    <item>
      <title>Re: Active Sum button alv</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/active-sum-button-alv/m-p/3976017#M949653</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;CALL METHOD gr_alvgrid-&amp;gt;set_table_for_first_display&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jun 2008 13:25:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/active-sum-button-alv/m-p/3976017#M949653</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-19T13:25:05Z</dc:date>
    </item>
    <item>
      <title>Re: Active Sum button alv</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/active-sum-button-alv/m-p/3976018#M949654</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 guess its not only sum button no button is displayed right.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The documentatin for the standard ALV Grid tool par is located in the Function module documentation for I_CALLBACK_PF_STATUS_SET&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is likely what you are looking for.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the caller wants to use a self-defined user interface (for example, in order to provide additional list functions or use existing&lt;/P&gt;&lt;P&gt;functions), we recommend that you copy standard status STANDARD from function group SALV and modify it accordingly.&lt;/P&gt;&lt;P&gt;ALV standard function codes always start with '&amp;amp;'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Vikranth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jun 2008 13:25:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/active-sum-button-alv/m-p/3976018#M949654</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-19T13:25:48Z</dc:date>
    </item>
    <item>
      <title>Re: Active Sum button alv</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/active-sum-button-alv/m-p/3976019#M949655</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;For fieldcatalog for any amount filed use :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
gs_fieldcat-do_sum = 'X'.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sriarm Ponna.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jun 2008 13:27:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/active-sum-button-alv/m-p/3976019#M949655</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-19T13:27:46Z</dc:date>
    </item>
    <item>
      <title>Re: Active Sum button alv</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/active-sum-button-alv/m-p/3976020#M949656</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try this code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp; Report  ZTEST_DEMO_ALV
*&amp;amp;
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;
*&amp;amp;
*&amp;amp;---------------------------------------------------------------------*

report  ztest_demo_alv.


class cl_event_reciever definition deferred.
data:
wa_vbak type vbak.
data:
i_vbak type standard table of vbak,
i_vbap type standard table of vbap.


data:
v_container1 type scrfname value 'CONT1',
v_grid1      type ref to cl_gui_alv_grid,
v_custom_container1 type ref to cl_gui_custom_container,
v_container2 type scrfname value 'CONT2',
v_grid2      type ref to cl_gui_alv_grid,
v_custom_container2 type ref to cl_gui_custom_container,
ok_code type syucomm,
v_event_reciever type ref to cl_event_reciever.

*----------------------------------------------------------------------*
*       CLASS cl_event_reciever DEFINITION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
class cl_event_reciever definition.
  public section.

    methods:
      handle_double_click for event double_click of cl_gui_alv_grid
        importing e_row e_column.



endclass.                    "cl_event_reciever DEFINITION

*----------------------------------------------------------------------*
*       CLASS cl_event_reciever IMPLEMENTATION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
class cl_event_reciever implementation.
  method handle_double_click.

    read table i_vbak
    into wa_vbak
    index e_row.
    if sy-subrc = 0.

      select * from vbap
        into table i_vbap

        where vbeln = wa_vbak-vbeln.
      if sy-subrc = 0.
        set screen 00.
        leave to screen 100.
      endif.
    endif.
  endmethod.                    "handle_double_click
endclass.                    "cl_event_reciever IMPLEMENTATION

select-options:
s_vbeln for  wa_vbak-vbeln.


start-of-selection.

  select * from  vbak
    into table i_vbak
    up to 50 rows
    where vbeln in s_vbeln.
  if sy-subrc &amp;lt;&amp;gt; 0.
    message i000(z_zzz_ca_messages)  with 'No data found!'.
    leave list-processing.

  endif.

end-of-selection.
  call screen 100.


*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Module  STATUS_0100  OUTPUT
*&amp;amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
module status_0100 output.
  set pf-status '100'.
*  SET TITLEBAR 'xxx'.

  if v_custom_container1 is not bound.

    create object v_custom_container1
    exporting container_name = v_container1.

    create object v_grid1
      exporting i_parent = v_custom_container1.

    call method v_grid1-&amp;gt;set_table_for_first_display
       exporting
*       i_buffer_active               =
*       i_bypassing_buffer            =
*       i_consistency_check           =
         i_structure_name              = 'VBAK'
*       is_variant                    =
*       i_save                        =
*       i_default                     = 'X'
*       is_layout                     =
*       is_print                      =
*       it_special_groups             =
*       it_toolbar_excluding          =
*       it_hyperlink                  =
*       it_alv_graphics               =
*       it_except_qinfo               =
*       ir_salv_adapter               =
      changing
        it_outtab                     = i_vbak
*       it_fieldcatalog               =
*       it_sort                       =
*       it_filter                     =
      exceptions
        invalid_parameter_combination = 1
        program_error                 = 2
        too_many_lines                = 3
        others                        = 4
            .
    if sy-subrc &amp;lt;&amp;gt; 0.
      message id sy-msgid type sy-msgty number sy-msgno
                 with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    endif.
    create object v_event_reciever.
    set handler v_event_reciever-&amp;gt;handle_double_click for v_grid1.

  endif.

  if v_custom_container2 is not bound
    and i_vbap is not initial.

    create object v_custom_container2
    exporting container_name = v_container2.

    create object v_grid2
      exporting i_parent = v_custom_container2.

    call method v_grid2-&amp;gt;set_table_for_first_display
       exporting
*       i_buffer_active               =
*       i_bypassing_buffer            =
*       i_consistency_check           =
         i_structure_name              = 'VBAP'
*       is_variant                    =
*       i_save                        =
*       i_default                     = 'X'
*       is_layout                     =
*       is_print                      =
*       it_special_groups             =
*       it_toolbar_excluding          =
*       it_hyperlink                  =
*       it_alv_graphics               =
*       it_except_qinfo               =
*       ir_salv_adapter               =
      changing
        it_outtab                     = i_vbap
*       it_fieldcatalog               =
*       it_sort                       =
*       it_filter                     =
      exceptions
        invalid_parameter_combination = 1
        program_error                 = 2
        too_many_lines                = 3
        others                        = 4
            .
  endif.
  if v_custom_container2 is bound.
    call method v_grid2-&amp;gt;refresh_table_display.
  endif.

endmodule.                 " STATUS_0100  OUTPUT
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Module  USER_COMMAND_0100  INPUT
*&amp;amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
module user_command_0100 input.
  case ok_code.
    when 'BACK'.
      if v_grid1 is bound.
        call method v_grid1-&amp;gt;free.
      endif.
      if v_grid2 is bound.
        call method v_grid2-&amp;gt;free.
      endif.
      set screen 00.
      leave screen.

  endcase.


endmodule.                 " USER_COMMAND_0100  INPUT
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jun 2008 13:28:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/active-sum-button-alv/m-p/3976020#M949656</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-19T13:28:32Z</dc:date>
    </item>
    <item>
      <title>Re: Active Sum button alv</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/active-sum-button-alv/m-p/3976021#M949657</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;sum button in toolbar!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jun 2008 14:02:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/active-sum-button-alv/m-p/3976021#M949657</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-19T14:02:50Z</dc:date>
    </item>
    <item>
      <title>Re: Active Sum button alv</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/active-sum-button-alv/m-p/3976022#M949658</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;WHen you set the do_sum property in the fieldcatalog of any numeric field, the Sum button automatically appears on the toolbar.&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;Subramanian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jun 2008 14:06:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/active-sum-button-alv/m-p/3976022#M949658</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-19T14:06:21Z</dc:date>
    </item>
    <item>
      <title>Re: Active Sum button alv</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/active-sum-button-alv/m-p/3976023#M949659</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I try with do_sum in the quantity field of fieldcatalog but nothing happens......&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jun 2008 14:17:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/active-sum-button-alv/m-p/3976023#M949659</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-19T14:17:36Z</dc:date>
    </item>
    <item>
      <title>Re: Active Sum button alv</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/active-sum-button-alv/m-p/3976024#M949660</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can u pl. check from context menu (right mouse button click) whether u r able to see the total menu?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Joy.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jun 2008 14:38:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/active-sum-button-alv/m-p/3976024#M949660</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-19T14:38:28Z</dc:date>
    </item>
    <item>
      <title>Re: Active Sum button alv</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/active-sum-button-alv/m-p/3976025#M949661</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Alfonso,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not only do you have to set 'DO_SUM' attribute but also you have to set the "DATATYPE" attribute.  If you are using internal tables, you must set both attributes. Try setting these two field attributes as follow:- &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA: lwa_fcat    TYPE  lvc_s_fcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; clear lvc_s_fcat.&lt;/P&gt;&lt;P&gt; lwa_fcat-fieldname =  'W_COST'.       &lt;/P&gt;&lt;P&gt; lwa_fcat-ref_field    =  'W_COST'.          &lt;/P&gt;&lt;P&gt; lwa_fcat-ref_table   =  'IT_OUTPUT1'.     &lt;/P&gt;&lt;P&gt; lwa_fcat-datatype   =  'CURR'.            &lt;/P&gt;&lt;P&gt; lwa_fcat-do_sum    = 'X'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; append lwa_fcat  to p_fieldcat.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Aug 2008 18:43:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/active-sum-button-alv/m-p/3976025#M949661</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-14T18:43:44Z</dc:date>
    </item>
  </channel>
</rss>

