<?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 ALV function modules in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-function-modules/m-p/4689246#M1102283</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;      What is the purpose of using special groups in ALV function modules i.e., using &lt;/P&gt;&lt;P&gt;it_sp_group type slis_t_sp_group_alv.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is any prerequisite required for using this. &lt;/P&gt;&lt;P&gt;Thankful if explained with an example,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to explore, but not so clear.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rgds&lt;/P&gt;&lt;P&gt;khadeer.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 04 Nov 2008 07:28:20 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-11-04T07:28:20Z</dc:date>
    <item>
      <title>ALV function modules</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-function-modules/m-p/4689246#M1102283</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;      What is the purpose of using special groups in ALV function modules i.e., using &lt;/P&gt;&lt;P&gt;it_sp_group type slis_t_sp_group_alv.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is any prerequisite required for using this. &lt;/P&gt;&lt;P&gt;Thankful if explained with an example,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to explore, but not so clear.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rgds&lt;/P&gt;&lt;P&gt;khadeer.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Nov 2008 07:28:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-function-modules/m-p/4689246#M1102283</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-04T07:28:20Z</dc:date>
    </item>
    <item>
      <title>Re: ALV function modules</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-function-modules/m-p/4689247#M1102284</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Khadeer,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is an example program that creates two special groups..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;report  zgroup.

type-pools: slis.

data: gs_fcat type slis_fieldcat_alv,
      gs_grp  type slis_sp_group_alv,
      gt_fcat type slis_t_fieldcat_alv,
      gt_grp  type slis_t_sp_group_alv,
      gt_t001 type table of t001.

start-of-selection.

  select * into table gt_t001 from t001.

  clear: gt_fcat, gt_grp.
  call function 'REUSE_ALV_FIELDCATALOG_MERGE'
    exporting
      i_structure_name       = 'T001'
    changing
      ct_fieldcat            = gt_fcat
    exceptions
      inconsistent_interface = 1
      program_error          = 2
      others                 = 3.

* Group some columns together under a label of Group A
  read table gt_fcat into gs_fcat with key fieldname = 'WAERS'.
  if ( sy-subrc = 0 ).
    gs_fcat-sp_group = 'A'.
    modify gt_fcat from gs_fcat index sy-tabix.
  endif.

  read table gt_fcat into gs_fcat with key fieldname = 'SPRAS'.
  if ( sy-subrc = 0 ).
    gs_fcat-sp_group = 'A'.
    modify gt_fcat from gs_fcat index sy-tabix.
  endif.

  gs_grp-sp_group = 'A'.
  gs_grp-text     = 'Group A'.
  append gs_grp to gt_grp.

* Group some columns together under a label of Group B
  read table gt_fcat into gs_fcat with key fieldname = 'STCEG'.
  if ( sy-subrc = 0 ).
    gs_fcat-sp_group = 'B'.
    modify gt_fcat from gs_fcat index sy-tabix.
  endif.

  read table gt_fcat into gs_fcat with key fieldname = 'TXJCD'.
  if ( sy-subrc = 0 ).
    gs_fcat-sp_group = 'B'.
    modify gt_fcat from gs_fcat index sy-tabix.
  endif.

  gs_grp-sp_group = 'B'.
  gs_grp-text     = 'Group B'.
  append gs_grp to gt_grp.

  call function 'REUSE_ALV_GRID_DISPLAY'
    exporting
      it_fieldcat                       = gt_fcat
      it_special_groups                 = gt_grp
    tables
      t_outtab                          = gt_t001
    exceptions
      program_error                     = 1
      others                            = 2.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you run the program and then select the Change Layout icon (CTRL + F8), and select say the sort order TAB. By default in the Hidden Column list you will see all the fields from T001, if you select the down arrow on the filter button you can change the displayed fields to those in your special group.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Darren&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Nov 2008 11:49:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-function-modules/m-p/4689247#M1102284</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-04T11:49:04Z</dc:date>
    </item>
  </channel>
</rss>

