<?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 report using Class object in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-report-using-class-object/m-p/6439992#M1412120</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this way&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: gr_sorts TYPE REF TO cl_salv_sorts.
data: gr_agg type ref to cl_salv_aggregations.
gr_sorts = go_alv-&amp;gt;get_sorts( ).
gr_sorts-&amp;gt;add_sort( columnname = 'CARRID' subtotal = abap_true ).
gr_sorts-&amp;gt;add_sort( columnname = 'CONNID' subtotal = abap_true ).
gr_agg = go_alv-&amp;gt;get_aggregations( ).
gr_agg-&amp;gt;add_aggregation( 'PAYMENTSUM' ).
go_alv-&amp;gt;display( ).
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;a®&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 04 Dec 2009 05:46:26 GMT</pubDate>
    <dc:creator>former_member194669</dc:creator>
    <dc:date>2009-12-04T05:46:26Z</dc:date>
    <item>
      <title>ALV report using Class object</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-report-using-class-object/m-p/6439990#M1412118</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;&lt;/P&gt;&lt;P&gt;i am doing ALV report using class object. to create a ALV grid , i used         CALL METHOD cl_salv_table=&amp;gt;factory. &lt;/P&gt;&lt;P&gt;now my requirement is to find the total and subtotal. so the table should be sorted then do subtotal. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i check in some site and they have mentioned  CALL METHOD c_alv1-&amp;gt;set_table_for_first_display using screen..but my report is without screens..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how can i sort and subtoat using the method  CALL METHOD cl_salv_table=&amp;gt;factory. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;help please&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Dec 2009 05:33:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-report-using-class-object/m-p/6439990#M1412118</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-12-04T05:33:25Z</dc:date>
    </item>
    <item>
      <title>Re: ALV report using Class object</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-report-using-class-object/m-p/6439991#M1412119</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check Vijay's solution here : &lt;SPAN __jive_macro_name="message" id="5943801"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Dec 2009 05:38:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-report-using-class-object/m-p/6439991#M1412119</guid>
      <dc:creator>former_member156446</dc:creator>
      <dc:date>2009-12-04T05:38:21Z</dc:date>
    </item>
    <item>
      <title>Re: ALV report using Class object</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-report-using-class-object/m-p/6439992#M1412120</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this way&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: gr_sorts TYPE REF TO cl_salv_sorts.
data: gr_agg type ref to cl_salv_aggregations.
gr_sorts = go_alv-&amp;gt;get_sorts( ).
gr_sorts-&amp;gt;add_sort( columnname = 'CARRID' subtotal = abap_true ).
gr_sorts-&amp;gt;add_sort( columnname = 'CONNID' subtotal = abap_true ).
gr_agg = go_alv-&amp;gt;get_aggregations( ).
gr_agg-&amp;gt;add_aggregation( 'PAYMENTSUM' ).
go_alv-&amp;gt;display( ).
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;a®&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Dec 2009 05:46:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-report-using-class-object/m-p/6439992#M1412120</guid>
      <dc:creator>former_member194669</dc:creator>
      <dc:date>2009-12-04T05:46:26Z</dc:date>
    </item>
    <item>
      <title>Re: ALV report using Class object</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-report-using-class-object/m-p/6439993#M1412121</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;The following code also performs SUBTOTAL along with SORT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA : w_ref TYPE REF TO cl_salv_table, "Refernce to ALV class
 lr_sorts TYPE REF TO cl_salv_sorts, "Reference to ALV sort class 
lr_columns TYPE REF TO cl_salv_columns_table, "Reference to set ALV column properties
 lr_aggregations TYPE REF TO cl_salv_aggregations, "Reference to set ALV totals
 lr_content TYPE REF TO cl_salv_form_element, "Reference to set ALV display properties 
lw_long TYPE scrtext_l, "Long text
 lw_medium TYPE scrtext_m, "Medium text 
lw_short TYPE scrtext_s, "Short text 
lw_days TYPE string. "String to concatenate days 

CONSTANTS: lc_hyphen TYPE c VALUE '-', 
                       lc_pos type i value 1 , "Sort position 
                       lc_seq type SALV_DE_SORT_SEQUENCE value '1', "Sort sequence
                       lc_tot type sap_bool value 'X', "Subtotal
                       lc_grp type SALV_DE_SORT_GROUP value '2'. "Group *... set 
               sort lr_sorts = w_ref-&amp;gt;get_sorts( ). 
PERFORM f008_set_sorts USING lr_sorts 'LIFNR' lc_pos lc_seq lc_tot lc_grp.
 PERFORM f008_set_sorts USING lr_sorts 'NAME' lc_pos lc_seq SPACE lc_grp. 
w_ref-&amp;gt;display( ). 
*&amp;amp;------------------* *&amp;amp; Form f008_set_sorts *&amp;amp;------------------------------
-------------------------* * Sort and grouping the ALV *---------------------------------------------
*------------------------
FORM f008_set_sorts USING ir_sorts TYPE REF TO cl_salv_sorts
                                              lw_col type any 
                                            lc_pos type i lc_seq type SALV_DE_SORT_SEQUENCE 
                                          lc_tot type sap_bool lc_grp type SALV_DE_SORT_GROUP. 
TRY.
 ir_sorts-&amp;gt;set_group_active( abap_true ). 
TRY.
 ** Group grid on Vendor number
 ir_sorts-&amp;gt;add_sort( columnname = lw_col position = lc_pos sequence = lc_seq subtotal = lc_tot group = lc_grp ).
 CATCH cx_salv_data_error cx_salv_existing cx_salv_not_found. 
MESSAGE i023(salv_exception). 
CATCH cx_salv_method_not_supported.
 MESSAGE i028(salv_exception) WITH space space space space. 
ENDTRY. 
CATCH cx_salv_method_not_supported. 
MESSAGE i028(salv_exception) WITH space space space space. 
ENDTRY. 
ENDFORM. "f008_set_sorts
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Dec 2009 05:55:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-report-using-class-object/m-p/6439993#M1412121</guid>
      <dc:creator>former_member206377</dc:creator>
      <dc:date>2009-12-04T05:55:54Z</dc:date>
    </item>
  </channel>
</rss>

