<?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 program with Field Catalog in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-program-with-field-catalog/m-p/1855130#M361687</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 ALV GRID DISPLAY (using &amp;lt;b&amp;gt;OOPS&amp;lt;/b&amp;gt;),&lt;/P&gt;&lt;P&gt;1)Create an object of the &amp;lt;b&amp;gt;container&amp;lt;/b&amp;gt;(an instance of a class like cl_gui_custom_container).&lt;/P&gt;&lt;P&gt;2)Create an object of the &amp;lt;b&amp;gt;ALV using class cl_gui_alv_grid&amp;lt;/b&amp;gt; and give the CONTAINER name that you define in your screen layout as the parent of the ALV.&lt;/P&gt;&lt;P&gt;3)Call the method &amp;lt;b&amp;gt;SET_TABLE_FOR_FIRST_DISPLAY&amp;lt;/b&amp;gt; of the class cl_gui_alv_grid.&lt;/P&gt;&lt;P&gt;4)&amp;lt;b&amp;gt;Field catalog&amp;lt;/b&amp;gt; is used when you want a variation of the standard structure to be displayed on your ALV.A  variable of table type &amp;lt;b&amp;gt;LVC_T_FCAT&amp;lt;/b&amp;gt; is defined and variations can be made as per the requirements.The variable is then passed in the method SET_TABLE_FOR_FIRST_DISPLAY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;A SAMPLE PROGRAM:&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT SAMPLE:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*-- GLOBAL DATA DECLARATIONS FOR ALV&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;DATA gr_alvgrid TYPE REF TO cl_gui_alv_grid.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;DATA gc_custom_control_name TYPE scrfname VALUE 'CC_ALV'.&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;DATA gr_ccontainer TYPE REF TO cl_gui_custom_container.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;DATA gt_fieldcat TYPE lvc_t_fcat.&lt;/P&gt;&lt;P&gt;Data:i_spfli type table of spfli.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*The value CC_ALV is given to the custom container in the screen layout&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; select * from spfli into table i_spfli.&lt;/P&gt;&lt;P&gt; Call screen 100.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; MODULE STATUS_0100 OUTPUT&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MODULE STATUS_0100 OUTPUT.&lt;/P&gt;&lt;P&gt;  SET PF-STATUS 'SCREEN_100'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Create container&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;CREATE OBJECT gr_ccontainer&lt;/P&gt;&lt;P&gt;EXPORTING container_name = gc_custom_control_name.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Create ALV&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;CREATE OBJECT gr_alvgrid&lt;/P&gt;&lt;P&gt;EXPORTING i_parent = gr_ccontainer.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*field catalog&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;PERFORM prepare_field_catalog CHANGING gt_fieldcat.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*to display the ALV&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;CALL METHOD gr_alvgrid-&amp;gt;set_table_for_first_display&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;  I_STRUCTURE_NAME              = 'SPFLI'&lt;/P&gt;&lt;P&gt;CHANGING&lt;/P&gt;&lt;P&gt;it_outtab = i_spfli[]&lt;/P&gt;&lt;P&gt;it_fieldcatalog = gt_fieldcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDMODULE.                    "display_alv OUTPUT&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; MODULE USER_COMMAND_0100 INPUT&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MODULE user_command_0100 INPUT.&lt;/P&gt;&lt;P&gt;IF sy-ucomm = 'BACK' OR&lt;/P&gt;&lt;P&gt;     sy-ucomm = 'EXIT' OR&lt;/P&gt;&lt;P&gt;     sy-ucomm = 'CANCEL'.&lt;/P&gt;&lt;P&gt;    LEAVE PROGRAM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;ENDMODULE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp; Form prepare_field_catalog&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM prepare_field_catalog CHANGING pt_fieldcat TYPE lvc_t_fcat.&lt;/P&gt;&lt;P&gt;DATA ls_fcat TYPE lvc_s_fcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ls_fcat-ref_table = 'SPFLI'.&lt;/P&gt;&lt;P&gt;ls_fcat-fieldname = 'CARRID'.&lt;/P&gt;&lt;P&gt;APPEND ls_fcat TO pt_fieldcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLEAR ls_fcat.&lt;/P&gt;&lt;P&gt;ls_fcat-fieldname = 'CONNID'.&lt;/P&gt;&lt;P&gt;ls_fcat-ref_table = 'SPFLI'.&lt;/P&gt;&lt;P&gt;APPEND ls_fcat TO pt_fieldcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLEAR ls_fcat.&lt;/P&gt;&lt;P&gt;ls_fcat-fieldname = 'DEPTIME'.&lt;/P&gt;&lt;P&gt;ls_fcat-ref_table = 'SPFLI'.&lt;/P&gt;&lt;P&gt;APPEND ls_fcat TO pt_fieldcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLEAR ls_fcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ls_fcat-fieldname = 'ARRTIME'.&lt;/P&gt;&lt;P&gt;ls_fcat-ref_table = 'SPFLI'.&lt;/P&gt;&lt;P&gt;APPEND ls_fcat TO pt_fieldcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLEAR ls_fcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;For more sample programs refer:&amp;lt;/b&amp;gt;&lt;A href="http://www.geocities.com/victorav15/sapr3/abap_ood.html#d_grid" target="test_blank"&gt;http://www.geocities.com/victorav15/sapr3/abap_ood.html#d_grid&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapdevelopment.co.uk/reporting/alv/alvgrid_color.htm" target="test_blank"&gt;http://www.sapdevelopment.co.uk/reporting/alv/alvgrid_color.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapdevelopment.co.uk/reporting/alvhome.htm" target="test_blank"&gt;http://www.sapdevelopment.co.uk/reporting/alvhome.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;--&amp;gt;download the PDF from following link.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.sap.com/www.abap4.it/download/ALV.pdf" target="test_blank"&gt;www.abap4.it/download/ALV.pdf&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVALV/BCSRVALV.pdf" target="test_blank"&gt;http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVALV/BCSRVALV.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Some more:&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sap-hefte.de/download/dateien/1025/087_leseprobe.pdf" target="test_blank"&gt;http://www.sap-hefte.de/download/dateien/1025/087_leseprobe.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/e8a1d690-0201-0010-b7ad-d9719a415907" target="test_blank"&gt;https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/e8a1d690-0201-0010-b7ad-d9719a415907&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.alvgmbh.de/dwnload/gonio_t.pdfhttp://" target="test_blank"&gt;http://www.alvgmbh.de/dwnload/gonio_t.pdfhttp://&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;You can get all demo programs for ALV:&amp;lt;/b&amp;gt;Go to se38 and type BCALV* and press F4 for all demo porgrams.&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;Beejal&lt;/P&gt;&lt;P&gt;**Reward if this helps&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 05 Feb 2007 04:21:19 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-02-05T04:21:19Z</dc:date>
    <item>
      <title>ALV program with Field Catalog</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-program-with-field-catalog/m-p/1855127#M361684</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;Can any body please provide me sample ALV programs with Field Catalog and GRID DISPLAY. and also please give me the steps for writing the program. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;KP&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 04 Feb 2007 17:36:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-program-with-field-catalog/m-p/1855127#M361684</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-04T17:36:16Z</dc:date>
    </item>
    <item>
      <title>Re: ALV program with Field Catalog</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-program-with-field-catalog/m-p/1855128#M361685</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There are a lot of examples, here in the ABAP forum.  You can search for more.  Here is a very simple one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

report zrich_0003 .



* Global ALV Data Declarations
type-pools: slis.

* Internal Tables
data: begin of ialv occurs 0,
      test1(10) type c,
      test2(10) type c,
      end of ialv.

data: fieldcat  type slis_t_fieldcat_alv.

start-of-selection.

  perform get_data.
  perform call_alv.

*********************************************************************
*      Form  GET_DATA
*********************************************************************
form get_data.

  ialv-test1 = 'ABC'.
  ialv-test2 = 'DEF'.
  append ialv.

  ialv-test1 = 'GHI'.
  ialv-test2 = 'JKL'.
  append ialv.


  ialv-test1 = '123'.
  ialv-test2 = '456'.
  append ialv.


endform.                    "GET_DATA

************************************************************************

*  CALL_ALV
************************************************************************

form call_alv.

  perform build_field_catalog.


* Call ABAP List Viewer (ALV)
  call function 'REUSE_ALV_GRID_DISPLAY'
    exporting
      it_fieldcat  = fieldcat
    tables
      t_outtab     = ialv.

endform.                    "CALL_ALV

************************************************************************

* BUILD_FIELD_CATALOG
************************************************************************

form build_field_catalog.


  clear: fieldcat. refresh: fieldcat.

  data: tmp_fc type slis_fieldcat_alv.

  tmp_fc-reptext_ddic = 'Test1'.
  tmp_fc-fieldname    = 'TEST1'.
  tmp_fc-tabname      = 'IALV'.
  tmp_fc-outputlen    = '10'.
  append tmp_fc to fieldcat.

  tmp_fc-reptext_ddic = 'Test2'.
  tmp_fc-fieldname    = 'TEST2'.
  tmp_fc-tabname      = 'IALV'.
  tmp_fc-outputlen    = '10'.
  append tmp_fc to fieldcat.


endform.                    "BUILD_FIELD_CATALOG

&lt;/CODE&gt;&lt;/PRE&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>Sun, 04 Feb 2007 17:41:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-program-with-field-catalog/m-p/1855128#M361685</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2007-02-04T17:41:23Z</dc:date>
    </item>
    <item>
      <title>Re: ALV program with Field Catalog</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-program-with-field-catalog/m-p/1855129#M361686</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;Check the program BCALV_GRID_DEMO for Grid using OO..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check this example for using the FM REUSE_ALV_GRID_DISPLAY..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPE-POOLS: slis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Data declaration.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;DATA: BEGIN OF itab OCCURS 0,&lt;/P&gt;&lt;P&gt;        vbeln TYPE vbeln,&lt;/P&gt;&lt;P&gt;        erdat TYPE erdat,&lt;/P&gt;&lt;P&gt;        auart TYPE auart,&lt;/P&gt;&lt;P&gt;        netwr TYPE vbak-netwr,&lt;/P&gt;&lt;P&gt;      END OF itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: wa_kna1 TYPE kna1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: t_fieldcatalog TYPE slis_t_fieldcat_alv.&lt;/P&gt;&lt;P&gt;DATA: s_fieldcatalog TYPE slis_fieldcat_alv.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Selection-screen.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;PARAMETERS: p_kunnr TYPE kunnr OBLIGATORY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT SELECTION-SCREEN.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SELECT SINGLE * FROM kna1 INTO wa_kna1&lt;/P&gt;&lt;P&gt;         WHERE kunnr = p_kunnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;    MESSAGE s208(00) WITH 'Invalid customer'.&lt;/P&gt;&lt;P&gt;    LEAVE LIST-PROCESSING.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Building the field catalog.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  s_fieldcatalog-col_pos = '1'.&lt;/P&gt;&lt;P&gt;  s_fieldcatalog-fieldname = 'VBELN'.&lt;/P&gt;&lt;P&gt;  s_fieldcatalog-tabname   = 'ITAB'.&lt;/P&gt;&lt;P&gt;  s_fieldcatalog-rollname  = 'VBELN'.&lt;/P&gt;&lt;P&gt;  s_fieldcatalog-outputlen = '12'.&lt;/P&gt;&lt;P&gt;  APPEND s_fieldcatalog TO t_fieldcatalog.&lt;/P&gt;&lt;P&gt;  CLEAR: s_fieldcatalog.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  s_fieldcatalog-col_pos = '2'.&lt;/P&gt;&lt;P&gt;  s_fieldcatalog-fieldname = 'ERDAT'.&lt;/P&gt;&lt;P&gt;  s_fieldcatalog-tabname   = 'ITAB'.&lt;/P&gt;&lt;P&gt;  s_fieldcatalog-rollname  = 'ERDAT'.&lt;/P&gt;&lt;P&gt;  APPEND s_fieldcatalog TO t_fieldcatalog.&lt;/P&gt;&lt;P&gt;  CLEAR: s_fieldcatalog.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  s_fieldcatalog-col_pos = '3'.&lt;/P&gt;&lt;P&gt;  s_fieldcatalog-fieldname = 'AUART'.&lt;/P&gt;&lt;P&gt;  s_fieldcatalog-tabname   = 'ITAB'.&lt;/P&gt;&lt;P&gt;  s_fieldcatalog-rollname  = 'AUART'.&lt;/P&gt;&lt;P&gt;  APPEND s_fieldcatalog TO t_fieldcatalog.&lt;/P&gt;&lt;P&gt;  CLEAR: s_fieldcatalog.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  s_fieldcatalog-col_pos = '4'.&lt;/P&gt;&lt;P&gt;  s_fieldcatalog-fieldname = 'NETWR'.&lt;/P&gt;&lt;P&gt;  s_fieldcatalog-tabname   = 'ITAB'.&lt;/P&gt;&lt;P&gt;  s_fieldcatalog-rollname  = 'NETWR_AK'.&lt;/P&gt;&lt;P&gt;  s_fieldcatalog-do_sum    = 'X'.&lt;/P&gt;&lt;P&gt;  APPEND s_fieldcatalog TO t_fieldcatalog.&lt;/P&gt;&lt;P&gt;  CLEAR: s_fieldcatalog.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Get the sales orders.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  SELECT vbeln erdat auart netwr&lt;/P&gt;&lt;P&gt;         FROM&lt;/P&gt;&lt;P&gt;         vbak&lt;/P&gt;&lt;P&gt;         INTO TABLE itab&lt;/P&gt;&lt;P&gt;         WHERE kunnr = p_kunnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;    MESSAGE s208(00) WITH 'No records found'.&lt;/P&gt;&lt;P&gt;    LEAVE LIST-PROCESSING.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA: v_repid TYPE syrepid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  v_repid = sy-repid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Display the alv&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'&lt;/P&gt;&lt;P&gt;       EXPORTING&lt;/P&gt;&lt;P&gt;            i_callback_program = v_repid&lt;/P&gt;&lt;P&gt;            it_fieldcat        = t_fieldcatalog&lt;/P&gt;&lt;P&gt;       TABLES&lt;/P&gt;&lt;P&gt;            t_outtab           = itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Naren&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 04 Feb 2007 17:41:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-program-with-field-catalog/m-p/1855129#M361686</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-04T17:41:40Z</dc:date>
    </item>
    <item>
      <title>Re: ALV program with Field Catalog</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-program-with-field-catalog/m-p/1855130#M361687</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 ALV GRID DISPLAY (using &amp;lt;b&amp;gt;OOPS&amp;lt;/b&amp;gt;),&lt;/P&gt;&lt;P&gt;1)Create an object of the &amp;lt;b&amp;gt;container&amp;lt;/b&amp;gt;(an instance of a class like cl_gui_custom_container).&lt;/P&gt;&lt;P&gt;2)Create an object of the &amp;lt;b&amp;gt;ALV using class cl_gui_alv_grid&amp;lt;/b&amp;gt; and give the CONTAINER name that you define in your screen layout as the parent of the ALV.&lt;/P&gt;&lt;P&gt;3)Call the method &amp;lt;b&amp;gt;SET_TABLE_FOR_FIRST_DISPLAY&amp;lt;/b&amp;gt; of the class cl_gui_alv_grid.&lt;/P&gt;&lt;P&gt;4)&amp;lt;b&amp;gt;Field catalog&amp;lt;/b&amp;gt; is used when you want a variation of the standard structure to be displayed on your ALV.A  variable of table type &amp;lt;b&amp;gt;LVC_T_FCAT&amp;lt;/b&amp;gt; is defined and variations can be made as per the requirements.The variable is then passed in the method SET_TABLE_FOR_FIRST_DISPLAY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;A SAMPLE PROGRAM:&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT SAMPLE:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*-- GLOBAL DATA DECLARATIONS FOR ALV&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;DATA gr_alvgrid TYPE REF TO cl_gui_alv_grid.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;DATA gc_custom_control_name TYPE scrfname VALUE 'CC_ALV'.&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;DATA gr_ccontainer TYPE REF TO cl_gui_custom_container.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;DATA gt_fieldcat TYPE lvc_t_fcat.&lt;/P&gt;&lt;P&gt;Data:i_spfli type table of spfli.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*The value CC_ALV is given to the custom container in the screen layout&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; select * from spfli into table i_spfli.&lt;/P&gt;&lt;P&gt; Call screen 100.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; MODULE STATUS_0100 OUTPUT&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MODULE STATUS_0100 OUTPUT.&lt;/P&gt;&lt;P&gt;  SET PF-STATUS 'SCREEN_100'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Create container&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;CREATE OBJECT gr_ccontainer&lt;/P&gt;&lt;P&gt;EXPORTING container_name = gc_custom_control_name.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Create ALV&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;CREATE OBJECT gr_alvgrid&lt;/P&gt;&lt;P&gt;EXPORTING i_parent = gr_ccontainer.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*field catalog&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;PERFORM prepare_field_catalog CHANGING gt_fieldcat.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*to display the ALV&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;CALL METHOD gr_alvgrid-&amp;gt;set_table_for_first_display&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;  I_STRUCTURE_NAME              = 'SPFLI'&lt;/P&gt;&lt;P&gt;CHANGING&lt;/P&gt;&lt;P&gt;it_outtab = i_spfli[]&lt;/P&gt;&lt;P&gt;it_fieldcatalog = gt_fieldcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDMODULE.                    "display_alv OUTPUT&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; MODULE USER_COMMAND_0100 INPUT&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MODULE user_command_0100 INPUT.&lt;/P&gt;&lt;P&gt;IF sy-ucomm = 'BACK' OR&lt;/P&gt;&lt;P&gt;     sy-ucomm = 'EXIT' OR&lt;/P&gt;&lt;P&gt;     sy-ucomm = 'CANCEL'.&lt;/P&gt;&lt;P&gt;    LEAVE PROGRAM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;ENDMODULE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp; Form prepare_field_catalog&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM prepare_field_catalog CHANGING pt_fieldcat TYPE lvc_t_fcat.&lt;/P&gt;&lt;P&gt;DATA ls_fcat TYPE lvc_s_fcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ls_fcat-ref_table = 'SPFLI'.&lt;/P&gt;&lt;P&gt;ls_fcat-fieldname = 'CARRID'.&lt;/P&gt;&lt;P&gt;APPEND ls_fcat TO pt_fieldcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLEAR ls_fcat.&lt;/P&gt;&lt;P&gt;ls_fcat-fieldname = 'CONNID'.&lt;/P&gt;&lt;P&gt;ls_fcat-ref_table = 'SPFLI'.&lt;/P&gt;&lt;P&gt;APPEND ls_fcat TO pt_fieldcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLEAR ls_fcat.&lt;/P&gt;&lt;P&gt;ls_fcat-fieldname = 'DEPTIME'.&lt;/P&gt;&lt;P&gt;ls_fcat-ref_table = 'SPFLI'.&lt;/P&gt;&lt;P&gt;APPEND ls_fcat TO pt_fieldcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLEAR ls_fcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ls_fcat-fieldname = 'ARRTIME'.&lt;/P&gt;&lt;P&gt;ls_fcat-ref_table = 'SPFLI'.&lt;/P&gt;&lt;P&gt;APPEND ls_fcat TO pt_fieldcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLEAR ls_fcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;For more sample programs refer:&amp;lt;/b&amp;gt;&lt;A href="http://www.geocities.com/victorav15/sapr3/abap_ood.html#d_grid" target="test_blank"&gt;http://www.geocities.com/victorav15/sapr3/abap_ood.html#d_grid&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapdevelopment.co.uk/reporting/alv/alvgrid_color.htm" target="test_blank"&gt;http://www.sapdevelopment.co.uk/reporting/alv/alvgrid_color.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapdevelopment.co.uk/reporting/alvhome.htm" target="test_blank"&gt;http://www.sapdevelopment.co.uk/reporting/alvhome.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;--&amp;gt;download the PDF from following link.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.sap.com/www.abap4.it/download/ALV.pdf" target="test_blank"&gt;www.abap4.it/download/ALV.pdf&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVALV/BCSRVALV.pdf" target="test_blank"&gt;http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVALV/BCSRVALV.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Some more:&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sap-hefte.de/download/dateien/1025/087_leseprobe.pdf" target="test_blank"&gt;http://www.sap-hefte.de/download/dateien/1025/087_leseprobe.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/e8a1d690-0201-0010-b7ad-d9719a415907" target="test_blank"&gt;https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/e8a1d690-0201-0010-b7ad-d9719a415907&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.alvgmbh.de/dwnload/gonio_t.pdfhttp://" target="test_blank"&gt;http://www.alvgmbh.de/dwnload/gonio_t.pdfhttp://&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;You can get all demo programs for ALV:&amp;lt;/b&amp;gt;Go to se38 and type BCALV* and press F4 for all demo porgrams.&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;Beejal&lt;/P&gt;&lt;P&gt;**Reward if this helps&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Feb 2007 04:21:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-program-with-field-catalog/m-p/1855130#M361687</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-05T04:21:19Z</dc:date>
    </item>
    <item>
      <title>Re: ALV program with Field Catalog</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-program-with-field-catalog/m-p/1855131#M361688</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the information&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Feb 2007 20:07:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-program-with-field-catalog/m-p/1855131#M361688</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-06T20:07:47Z</dc:date>
    </item>
    <item>
      <title>Re: ALV program with Field Catalog</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-program-with-field-catalog/m-p/1855132#M361689</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Refer this link&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapdevelopment.co.uk/reporting/alvhome.htm" target="test_blank"&gt;http://www.sapdevelopment.co.uk/reporting/alvhome.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also see the same in&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;SE38 &amp;gt; Environment &amp;gt; control Examples.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;Please reward points and close the thread if ur problem got solved.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Feb 2007 05:54:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-program-with-field-catalog/m-p/1855132#M361689</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-08T05:54:04Z</dc:date>
    </item>
  </channel>
</rss>

