<?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: Objects in normal reports in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/objects-in-normal-reports/m-p/2694046#M623458</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure if Bruces example is complete or not, but here is another which I found in my bag of tricks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

report zrich_0001.

* Used to limit user commands on selection-screen
include rsdbc1xx.

data: begin of i_alv occurs 0,
      matnr type mara-matnr,
      maktx type makt-maktx,
      end of i_alv.

data: alv_grid       type ref to cl_gui_alv_grid.
data: fieldcat  type lvc_t_fcat.

selection-screen begin of block b1 with frame title text-001 .
select-options: s_matnr for i_alv-matnr.
selection-screen end of block b1.

selection-screen begin of screen 1010.
selection-screen end of screen 1010.

* Events
at selection-screen output.
  if sy-dynnr = '1010'.
    current_scr-mode = 'S'.
    append 'SPOS' to current_scr-excl.
    append 'SCRH' to current_scr-excl.
    append 'ONLI' to current_scr-excl.
  endif.

start-of-selection.

  perform get_data.

  create object alv_grid
         exporting
               i_parent           =  cl_gui_container=&amp;gt;screen0.

*  Populate Field Catalog
  perform get_fieldcatalog.

  call method alv_grid-&amp;gt;set_table_for_first_display
      changing
           it_outtab              = i_alv[]
           it_fieldcatalog        = fieldcat[].

  call selection-screen 1010.

************************************************************************
* FORM GET_DATA
************************************************************************
form get_data.

  select * into corresponding fields of table i_alv
        from mara
          inner join makt
            on mara~matnr = makt~matnr
               where mara~matnr in s_matnr
                 and makt~spras = sy-langu.

  sort i_alv ascending by matnr.

endform.

************************************************************************
*      Form  Get_Fieldcatalog - Set Up Columns/Headers
************************************************************************
form get_fieldcatalog.

  data: ls_fcat type lvc_s_fcat.
  refresh: fieldcat.

  clear: ls_fcat.
  ls_fcat-reptext    = 'Material Number'.
  ls_fcat-coltext    = 'Material Number'.
  ls_fcat-fieldname  = 'MATNR'.
  ls_fcat-ref_table  = 'I_ALV'.
  ls_fcat-outputlen  = '18'.
  ls_fcat-col_pos    = 1.
  append ls_fcat to fieldcat.

  clear: ls_fcat.
  ls_fcat-reptext    = 'Material Description'.
  ls_fcat-coltext    = 'Material Description'.
  ls_fcat-fieldname  = 'MAKTX'.
  ls_fcat-ref_table  = 'I_ALV'.
  ls_fcat-outputlen  = '40'.
  ls_fcat-col_pos    = 2.
  append ls_fcat to fieldcat.

endform.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Of course, I must recommend that you use the new ALV Object Model as Uwe has suggested.  If you are on a NetWeaver release, then it is available to you.&lt;/P&gt;&lt;P&gt;&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;RIch Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 21 Aug 2007 20:23:16 GMT</pubDate>
    <dc:creator>RichHeilman</dc:creator>
    <dc:date>2007-08-21T20:23:16Z</dc:date>
    <item>
      <title>Objects in normal reports</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/objects-in-normal-reports/m-p/2694040#M623452</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi friends,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If i want to create a simple report in alv through objects i have to create a screen and gui status to show the output utilizing the class cl_gui_alv_grid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any alternative i can avoid creating screen and gui status and show the output in selection screen. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Praveen Lobo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Aug 2007 05:17:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/objects-in-normal-reports/m-p/2694040#M623452</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-21T05:17:33Z</dc:date>
    </item>
    <item>
      <title>Re: Objects in normal reports</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/objects-in-normal-reports/m-p/2694041#M623453</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi praveen&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;jut go through these sample programs&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ALV related Sample programs:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BCALV_GRID_01&lt;/P&gt;&lt;P&gt;BCALV_GRID_02&lt;/P&gt;&lt;P&gt;BCALV_GRID_03&lt;/P&gt;&lt;P&gt;BCALV_GRID_04&lt;/P&gt;&lt;P&gt;BCALV_GRID_05&lt;/P&gt;&lt;P&gt;BCALV_GRID_06&lt;/P&gt;&lt;P&gt;BCALV_GRID_07&lt;/P&gt;&lt;P&gt;BCALV_GRID_08&lt;/P&gt;&lt;P&gt;BCALV_GRID_09&lt;/P&gt;&lt;P&gt;BCALV_GRID_10&lt;/P&gt;&lt;P&gt;BCALV_GRID_11&lt;/P&gt;&lt;P&gt;BCALV_GRID_AND_POPUP&lt;/P&gt;&lt;P&gt;BCALV_GRID_DEMO &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;nagaraju.m&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Aug 2007 05:35:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/objects-in-normal-reports/m-p/2694041#M623453</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-21T05:35:42Z</dc:date>
    </item>
    <item>
      <title>Re: Objects in normal reports</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/objects-in-normal-reports/m-p/2694042#M623454</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Praveen&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;chk these pro's in sap&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BCALV*&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward points to all helpful answers &lt;/P&gt;&lt;P&gt;kiran.M&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Aug 2007 05:38:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/objects-in-normal-reports/m-p/2694042#M623454</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-21T05:38:45Z</dc:date>
    </item>
    <item>
      <title>Re: Objects in normal reports</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/objects-in-normal-reports/m-p/2694043#M623455</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;mr nagaraju this is nageswarrao from AP i need ur mail id my id is pnr_sap@yahoo.co.in&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Aug 2007 09:49:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/objects-in-normal-reports/m-p/2694043#M623455</guid>
      <dc:creator>paruchuri_nagesh</dc:creator>
      <dc:date>2007-08-21T09:49:05Z</dc:date>
    </item>
    <item>
      <title>Re: Objects in normal reports</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/objects-in-normal-reports/m-p/2694044#M623456</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Praveen&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In order to display OO-based ALV lists (class CL_GUI_ALV_GRID) you &amp;lt;u&amp;gt;must &amp;lt;/u&amp;gt;have a screen (&amp;lt;&amp;gt; selection screen) in your report. For simplified examples search the &amp;lt;i&amp;gt;ABAP Objects&amp;lt;/i&amp;gt; forum for &amp;lt;b&amp;gt;ZUS_SDN&amp;lt;/b&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alternatively, if you have already the new ALV object model (&amp;lt;b&amp;gt;CL_SALV_TABLE&amp;lt;/b&amp;gt;) available in your SAP system then you do not need a screen. For an example see report &amp;lt;b&amp;gt;ZUS_SDN_CL_SALV_TABLE_COLUMN&amp;lt;/b&amp;gt; in thread&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_thread" href="https://community.sap.com/" __jive_macro_name="thread" modifiedtitle="true" __default_attr="331613"&gt;&lt;/A&gt;&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, 21 Aug 2007 10:31:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/objects-in-normal-reports/m-p/2694044#M623456</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2007-08-21T10:31:47Z</dc:date>
    </item>
    <item>
      <title>Re: Objects in normal reports</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/objects-in-normal-reports/m-p/2694045#M623457</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Praveen,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this code that I found previously on this forum.  I don't remember who posted it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;selection-screen begin of screen 1001.&lt;/P&gt;&lt;P&gt;selection-screen end   of screen 1001.&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;  data: l_alv      type ref to   cl_gui_alv_grid.&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Creation of the ALV object, when we use cl_gui_container=&amp;gt;screen0 as&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;parent, the ALVGrid control will automatically use the full screen to&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;display the grid, NO CONTAINER DEFINITION IS REQUIRED !&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;  create object l_alv exporting i_parent = cl_gui_container=&amp;gt;screen0.&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;calling the display of the grid, the system will automatically create&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;the fieldcatalog based on the (table/structure) passed in parameter&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;  call method l_alv-&amp;gt;set_table_for_first_display&lt;/P&gt;&lt;P&gt;    exporting&lt;/P&gt;&lt;P&gt;      i_structure_name   = 'ZALV_ZFAPI014'  " ALV structure for this program&lt;/P&gt;&lt;P&gt;      i_bypassing_buffer = 'X'&lt;/P&gt;&lt;P&gt;    changing&lt;/P&gt;&lt;P&gt;      it_outtab          = i_alv.     " table of type ZALV_ZFAPI014&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;You have to create an EMPTY screen, put NOTHING in the layout&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;  call selection-screen 1001.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bruce&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Aug 2007 20:16:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/objects-in-normal-reports/m-p/2694045#M623457</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-21T20:16:35Z</dc:date>
    </item>
    <item>
      <title>Re: Objects in normal reports</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/objects-in-normal-reports/m-p/2694046#M623458</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure if Bruces example is complete or not, but here is another which I found in my bag of tricks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

report zrich_0001.

* Used to limit user commands on selection-screen
include rsdbc1xx.

data: begin of i_alv occurs 0,
      matnr type mara-matnr,
      maktx type makt-maktx,
      end of i_alv.

data: alv_grid       type ref to cl_gui_alv_grid.
data: fieldcat  type lvc_t_fcat.

selection-screen begin of block b1 with frame title text-001 .
select-options: s_matnr for i_alv-matnr.
selection-screen end of block b1.

selection-screen begin of screen 1010.
selection-screen end of screen 1010.

* Events
at selection-screen output.
  if sy-dynnr = '1010'.
    current_scr-mode = 'S'.
    append 'SPOS' to current_scr-excl.
    append 'SCRH' to current_scr-excl.
    append 'ONLI' to current_scr-excl.
  endif.

start-of-selection.

  perform get_data.

  create object alv_grid
         exporting
               i_parent           =  cl_gui_container=&amp;gt;screen0.

*  Populate Field Catalog
  perform get_fieldcatalog.

  call method alv_grid-&amp;gt;set_table_for_first_display
      changing
           it_outtab              = i_alv[]
           it_fieldcatalog        = fieldcat[].

  call selection-screen 1010.

************************************************************************
* FORM GET_DATA
************************************************************************
form get_data.

  select * into corresponding fields of table i_alv
        from mara
          inner join makt
            on mara~matnr = makt~matnr
               where mara~matnr in s_matnr
                 and makt~spras = sy-langu.

  sort i_alv ascending by matnr.

endform.

************************************************************************
*      Form  Get_Fieldcatalog - Set Up Columns/Headers
************************************************************************
form get_fieldcatalog.

  data: ls_fcat type lvc_s_fcat.
  refresh: fieldcat.

  clear: ls_fcat.
  ls_fcat-reptext    = 'Material Number'.
  ls_fcat-coltext    = 'Material Number'.
  ls_fcat-fieldname  = 'MATNR'.
  ls_fcat-ref_table  = 'I_ALV'.
  ls_fcat-outputlen  = '18'.
  ls_fcat-col_pos    = 1.
  append ls_fcat to fieldcat.

  clear: ls_fcat.
  ls_fcat-reptext    = 'Material Description'.
  ls_fcat-coltext    = 'Material Description'.
  ls_fcat-fieldname  = 'MAKTX'.
  ls_fcat-ref_table  = 'I_ALV'.
  ls_fcat-outputlen  = '40'.
  ls_fcat-col_pos    = 2.
  append ls_fcat to fieldcat.

endform.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Of course, I must recommend that you use the new ALV Object Model as Uwe has suggested.  If you are on a NetWeaver release, then it is available to you.&lt;/P&gt;&lt;P&gt;&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;RIch Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Aug 2007 20:23:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/objects-in-normal-reports/m-p/2694046#M623458</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2007-08-21T20:23:16Z</dc:date>
    </item>
    <item>
      <title>Re: Objects in normal reports</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/objects-in-normal-reports/m-p/2694047#M623459</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the valuable answers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Points awarded.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Praveen Lobo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Aug 2007 04:53:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/objects-in-normal-reports/m-p/2694047#M623459</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-23T04:53:31Z</dc:date>
    </item>
    <item>
      <title>Re: Objects in normal reports</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/objects-in-normal-reports/m-p/2694048#M623460</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi nageshwar rao&lt;/P&gt;&lt;P&gt;my mailid is m.nagaraju@hcl.in&lt;/P&gt;&lt;P&gt;ph no: 09958011191&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Aug 2007 08:54:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/objects-in-normal-reports/m-p/2694048#M623460</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-23T08:54:15Z</dc:date>
    </item>
  </channel>
</rss>

