<?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: What is the difference b/w ALV Function Module and ALV Methods? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-the-difference-b-w-alv-function-module-and-alv-methods/m-p/2201887#M470535</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you want to say boject oriented ALV by alv methods???&lt;/P&gt;&lt;P&gt;In that case,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. OO ALv uses classes and its methods where as function module alv uses several function module. &lt;/P&gt;&lt;P&gt;2. In OO ALV you have to create a screen and a container on thet screen. In  &lt;/P&gt;&lt;P&gt; function module alv, you can create without screen. &lt;/P&gt;&lt;P&gt;3. There are several function ( such add a button ) is possible in OO ALV very easity. That can not be created in functional module alv.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ex of object oriented ALV : &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT  zdemoab.


************************************
*DATA DECLARATION
*************************************
*---Global data deckaration for alv
*--ALV Grid instance referance
DATA: gr_alvgrid TYPE REF TO cl_gui_alv_grid,
*--Name of the custom control added to the screen
      gc_custom_control_name TYPE scrfname VALUE 'CUSTOM_CONTROL',
*--Custom container instance referance
      gr_container TYPE REF TO cl_gui_custom_container,
*--Field catalog table
      gt_fieldcat TYPE lvc_t_fcat,
*--Layout structure
      gs_layout TYPE lvc_s_layo.

DATA: ok_code LIKE sy-ucomm,
      save_ok LIKE sy-ucomm.


*---Input table
TYPES: BEGIN OF t_mara,
        matnr TYPE mara-matnr,
        mtart TYPE mara-mtart,
        matkl TYPE mara-matkl,
        meins TYPE mara-meins,
      END OF t_mara.
TYPES: t_mara_table TYPE STANDARD TABLE OF t_mara.

DATA: gt_mara TYPE STANDARD TABLE OF t_mara.

************************************
*MAIN
*************************************
CALL SCREEN 101.

*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Module  STATUS_0101  OUTPUT
*&amp;amp;---------------------------------------------------------------------*

MODULE status_0101 OUTPUT.
  SET PF-STATUS 'STATUS-0101'.
  SET TITLEBAR 'TITLE'.

ENDMODULE.                 " STATUS_0101  OUTPUT
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Module  display_alv  OUTPUT
*&amp;amp;---------------------------------------------------------------------*

MODULE display_alv OUTPUT.

  IF gr_alvgrid IS INITIAL.
*----Create custom container instance
    CREATE OBJECT gr_container
      EXPORTING
        container_name              = gc_custom_control_name
      EXCEPTIONS
        cntl_error                  = 1
        cntl_system_error           = 2
        create_error                = 3
        lifetime_error              = 4
        lifetime_dynpro_dynpro_link = 5
        OTHERS                      = 6 .
    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 ALV grid instance
    CREATE OBJECT gr_alvgrid
      EXPORTING
        i_parent          = gr_container
      EXCEPTIONS
        error_cntl_create = 1
        error_cntl_init   = 2
        error_cntl_link   = 3
        error_dp_create   = 4
        OTHERS            = 5 .
    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.

* select the material data from database
    PERFORM get_input CHANGING gt_mara..
* prepare field catalog
    PERFORM prepare_fieldcatalog CHANGING gt_fieldcat.
* prepare layout
    PERFORM prepare_layout CHANGING gs_layout.


    CALL METHOD gr_alvgrid-&amp;gt;set_table_for_first_display
      EXPORTING
        is_layout                     = gs_layout
      CHANGING
        it_outtab                     = gt_mara[]
        it_fieldcatalog               = gt_fieldcat
      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.
  ELSE.
    CALL METHOD gr_alvgrid-&amp;gt;refresh_table_display
      EXCEPTIONS
        finished = 1
        OTHERS   = 2.
    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.


  ENDIF.
ENDMODULE.                 " display_alv  OUTPUT
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  get_input
*&amp;amp;---------------------------------------------------------------------*
FORM get_input CHANGING gt_mara_table TYPE t_mara_table.
  SELECT matnr mtart matkl meins INTO TABLE gt_mara_table
                                 FROM mara UP TO 10 ROWS.
ENDFORM.                    " get_input
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  prepare_fieldcatalog
*&amp;amp;---------------------------------------------------------------------*

FORM prepare_fieldcatalog  CHANGING gt_fieldcat_table TYPE lvc_t_fcat.

  DATA: ls_fcat TYPE lvc_s_fcat,
        l_col_no TYPE i.

  CLEAR: ls_fcat,
         l_col_no .

  l_col_no = l_col_no + 1.
  ls_fcat-fieldname = 'MATNR'.
  ls_fcat-ref_table = 'MARA'.
  ls_fcat-col_pos   = l_col_no.
  ls_fcat-outputlen = 18.
  ls_fcat-coltext   = 'Material No'.
  ls_fcat-seltext   = 'Material No'.
  APPEND ls_fcat TO gt_fieldcat_table.

  l_col_no = l_col_no + 1.
  ls_fcat-fieldname = 'MTART'.
  ls_fcat-ref_table = 'MARA'.
  ls_fcat-col_pos   = l_col_no.
  ls_fcat-outputlen = 4.
  ls_fcat-coltext   = 'Material type'.
  ls_fcat-seltext   = 'Material type'.
  APPEND ls_fcat TO gt_fieldcat_table.

  l_col_no = l_col_no + 1.
  ls_fcat-fieldname = 'MATKL'.
  ls_fcat-ref_table = 'MARA'.
  ls_fcat-col_pos   = l_col_no.
  ls_fcat-outputlen = 9.
  ls_fcat-coltext   = 'Material group'.
  ls_fcat-seltext   = 'Material group'.
  APPEND ls_fcat TO gt_fieldcat_table.

  l_col_no = l_col_no + 1.
  ls_fcat-fieldname = 'MEINS'.
  ls_fcat-ref_table = 'MARA'.
  ls_fcat-col_pos   = l_col_no.
  ls_fcat-outputlen = 3.
  ls_fcat-coltext   = 'Unit'.
  ls_fcat-seltext   = 'Unit'.
  APPEND ls_fcat TO gt_fieldcat_table.

  CLEAR: ls_fcat,
         l_col_no .

ENDFORM.                    " prepare_fieldcatalog
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  prepare_layout
*&amp;amp;---------------------------------------------------------------------*
FORM prepare_layout  CHANGING p_gs_layout TYPE lvc_s_layo.

  p_gs_layout-zebra = 'X'.
  p_gs_layout-grid_title = 'Material'.
  p_gs_layout-smalltitle = 'X'.

ENDFORM.                    " prepare_layout
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Module  USER_COMMAND_0101  INPUT
*&amp;amp;---------------------------------------------------------------------*

MODULE user_command_0101 INPUT.
  save_ok = ok_code.
  CLEAR ok_code.
  CASE save_ok.
    WHEN 'EXIT'.
      PERFORM exit_program.
  ENDCASE.
ENDMODULE.                 " USER_COMMAND_0101  INPUT
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  exit_program
*&amp;amp;---------------------------------------------------------------------*
FORM exit_program .
  LEAVE PROGRAM.
ENDFORM.                    " exit_program&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Steps :&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1.	Call a screen.&lt;/P&gt;&lt;P&gt;2.	Go to the screen layout  and add a custom control .&lt;/P&gt;&lt;P&gt;3.	Go to attribute and give a name to the custom control (Ex: 'CUSTOM_CONTROL').&lt;/P&gt;&lt;P&gt;4.	Give a name to the ok_code ( Ex: ok_code) in the attribute of the screen. &lt;/P&gt;&lt;P&gt;5.	Data Declaration section:&lt;/P&gt;&lt;P&gt;I.	Data declaration for ALV&lt;/P&gt;&lt;P&gt;a.	Declare a object type cl_gui_alv_grid for ALV Grid instance referance &lt;/P&gt;&lt;P&gt;b.	Declare a object type cl_gui_custom_container for Custom container instance referance&lt;/P&gt;&lt;P&gt;c.	Declare Name of the custom control added to the screen&lt;/P&gt;&lt;P&gt;d.	Declare field catalog table of type lvc_t_fcat.&lt;/P&gt;&lt;P&gt;e.	Declare layout of type lvc_s_layo. &lt;/P&gt;&lt;P&gt;II.	Data declaration for fetching data as input&lt;/P&gt;&lt;P&gt;III.	Declare variables for ok_code.&lt;/P&gt;&lt;P&gt;6.	Set pf-status and titlebar for the screen.&lt;/P&gt;&lt;P&gt;7.	Write PBO. IN PBO do the following:&lt;/P&gt;&lt;P&gt;i.	Check whether gr_alvgrid is initial.&lt;/P&gt;&lt;P&gt;a.	If yes do the following.&lt;/P&gt;&lt;P&gt;&amp;#149;	Create instance for  custom container (gr_container) by passing the container name.&lt;/P&gt;&lt;P&gt;&amp;#149;	Create instance for ALV grid by passing the custom control instance reference.&lt;/P&gt;&lt;P&gt;&amp;#149;	select the material data from database&lt;/P&gt;&lt;P&gt;&amp;#149;	Build field ctalog&lt;/P&gt;&lt;P&gt;&amp;#149;	Build layout&lt;/P&gt;&lt;P&gt;&amp;#149;	Call method &amp;#145;set_table_for_first_display&amp;#146; for the object gr_alvgrid(alv grid instance reference) with passing layout, input table and field catalog.&lt;/P&gt;&lt;P&gt;b.	If NO do the following.&lt;/P&gt;&lt;P&gt;&amp;#149;	Call method &amp;#145;refresh_table_display for the object gr_alvgrid(alv grid instance reference).&lt;/P&gt;&lt;P&gt;ii.	&lt;/P&gt;&lt;P&gt;8.	Write PAI. IN PAI do the following:&lt;/P&gt;&lt;P&gt;         Check the ok_code, if &amp;#145;Exit&amp;#146; then leave from program.&lt;/P&gt;&lt;P&gt;         All the user commands where user do any actions in the screen will be code here . For this purpose check the value of ok_code and according that ok_code, code the functionality for the particular user actions.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 22 Apr 2007 08:07:56 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-04-22T08:07:56Z</dc:date>
    <item>
      <title>What is the difference b/w ALV Function Module and ALV Methods?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-the-difference-b-w-alv-function-module-and-alv-methods/m-p/2201886#M470534</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Friends,&lt;/P&gt;&lt;P&gt;      Can anybody help me in finding out the difference between ALV Function Modules and ALV methods?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards&lt;/P&gt;&lt;P&gt; Sathish Kumar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 22 Apr 2007 05:57:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-the-difference-b-w-alv-function-module-and-alv-methods/m-p/2201886#M470534</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-22T05:57:35Z</dc:date>
    </item>
    <item>
      <title>Re: What is the difference b/w ALV Function Module and ALV Methods?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-the-difference-b-w-alv-function-module-and-alv-methods/m-p/2201887#M470535</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you want to say boject oriented ALV by alv methods???&lt;/P&gt;&lt;P&gt;In that case,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. OO ALv uses classes and its methods where as function module alv uses several function module. &lt;/P&gt;&lt;P&gt;2. In OO ALV you have to create a screen and a container on thet screen. In  &lt;/P&gt;&lt;P&gt; function module alv, you can create without screen. &lt;/P&gt;&lt;P&gt;3. There are several function ( such add a button ) is possible in OO ALV very easity. That can not be created in functional module alv.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ex of object oriented ALV : &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT  zdemoab.


************************************
*DATA DECLARATION
*************************************
*---Global data deckaration for alv
*--ALV Grid instance referance
DATA: gr_alvgrid TYPE REF TO cl_gui_alv_grid,
*--Name of the custom control added to the screen
      gc_custom_control_name TYPE scrfname VALUE 'CUSTOM_CONTROL',
*--Custom container instance referance
      gr_container TYPE REF TO cl_gui_custom_container,
*--Field catalog table
      gt_fieldcat TYPE lvc_t_fcat,
*--Layout structure
      gs_layout TYPE lvc_s_layo.

DATA: ok_code LIKE sy-ucomm,
      save_ok LIKE sy-ucomm.


*---Input table
TYPES: BEGIN OF t_mara,
        matnr TYPE mara-matnr,
        mtart TYPE mara-mtart,
        matkl TYPE mara-matkl,
        meins TYPE mara-meins,
      END OF t_mara.
TYPES: t_mara_table TYPE STANDARD TABLE OF t_mara.

DATA: gt_mara TYPE STANDARD TABLE OF t_mara.

************************************
*MAIN
*************************************
CALL SCREEN 101.

*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Module  STATUS_0101  OUTPUT
*&amp;amp;---------------------------------------------------------------------*

MODULE status_0101 OUTPUT.
  SET PF-STATUS 'STATUS-0101'.
  SET TITLEBAR 'TITLE'.

ENDMODULE.                 " STATUS_0101  OUTPUT
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Module  display_alv  OUTPUT
*&amp;amp;---------------------------------------------------------------------*

MODULE display_alv OUTPUT.

  IF gr_alvgrid IS INITIAL.
*----Create custom container instance
    CREATE OBJECT gr_container
      EXPORTING
        container_name              = gc_custom_control_name
      EXCEPTIONS
        cntl_error                  = 1
        cntl_system_error           = 2
        create_error                = 3
        lifetime_error              = 4
        lifetime_dynpro_dynpro_link = 5
        OTHERS                      = 6 .
    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 ALV grid instance
    CREATE OBJECT gr_alvgrid
      EXPORTING
        i_parent          = gr_container
      EXCEPTIONS
        error_cntl_create = 1
        error_cntl_init   = 2
        error_cntl_link   = 3
        error_dp_create   = 4
        OTHERS            = 5 .
    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.

* select the material data from database
    PERFORM get_input CHANGING gt_mara..
* prepare field catalog
    PERFORM prepare_fieldcatalog CHANGING gt_fieldcat.
* prepare layout
    PERFORM prepare_layout CHANGING gs_layout.


    CALL METHOD gr_alvgrid-&amp;gt;set_table_for_first_display
      EXPORTING
        is_layout                     = gs_layout
      CHANGING
        it_outtab                     = gt_mara[]
        it_fieldcatalog               = gt_fieldcat
      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.
  ELSE.
    CALL METHOD gr_alvgrid-&amp;gt;refresh_table_display
      EXCEPTIONS
        finished = 1
        OTHERS   = 2.
    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.


  ENDIF.
ENDMODULE.                 " display_alv  OUTPUT
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  get_input
*&amp;amp;---------------------------------------------------------------------*
FORM get_input CHANGING gt_mara_table TYPE t_mara_table.
  SELECT matnr mtart matkl meins INTO TABLE gt_mara_table
                                 FROM mara UP TO 10 ROWS.
ENDFORM.                    " get_input
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  prepare_fieldcatalog
*&amp;amp;---------------------------------------------------------------------*

FORM prepare_fieldcatalog  CHANGING gt_fieldcat_table TYPE lvc_t_fcat.

  DATA: ls_fcat TYPE lvc_s_fcat,
        l_col_no TYPE i.

  CLEAR: ls_fcat,
         l_col_no .

  l_col_no = l_col_no + 1.
  ls_fcat-fieldname = 'MATNR'.
  ls_fcat-ref_table = 'MARA'.
  ls_fcat-col_pos   = l_col_no.
  ls_fcat-outputlen = 18.
  ls_fcat-coltext   = 'Material No'.
  ls_fcat-seltext   = 'Material No'.
  APPEND ls_fcat TO gt_fieldcat_table.

  l_col_no = l_col_no + 1.
  ls_fcat-fieldname = 'MTART'.
  ls_fcat-ref_table = 'MARA'.
  ls_fcat-col_pos   = l_col_no.
  ls_fcat-outputlen = 4.
  ls_fcat-coltext   = 'Material type'.
  ls_fcat-seltext   = 'Material type'.
  APPEND ls_fcat TO gt_fieldcat_table.

  l_col_no = l_col_no + 1.
  ls_fcat-fieldname = 'MATKL'.
  ls_fcat-ref_table = 'MARA'.
  ls_fcat-col_pos   = l_col_no.
  ls_fcat-outputlen = 9.
  ls_fcat-coltext   = 'Material group'.
  ls_fcat-seltext   = 'Material group'.
  APPEND ls_fcat TO gt_fieldcat_table.

  l_col_no = l_col_no + 1.
  ls_fcat-fieldname = 'MEINS'.
  ls_fcat-ref_table = 'MARA'.
  ls_fcat-col_pos   = l_col_no.
  ls_fcat-outputlen = 3.
  ls_fcat-coltext   = 'Unit'.
  ls_fcat-seltext   = 'Unit'.
  APPEND ls_fcat TO gt_fieldcat_table.

  CLEAR: ls_fcat,
         l_col_no .

ENDFORM.                    " prepare_fieldcatalog
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  prepare_layout
*&amp;amp;---------------------------------------------------------------------*
FORM prepare_layout  CHANGING p_gs_layout TYPE lvc_s_layo.

  p_gs_layout-zebra = 'X'.
  p_gs_layout-grid_title = 'Material'.
  p_gs_layout-smalltitle = 'X'.

ENDFORM.                    " prepare_layout
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Module  USER_COMMAND_0101  INPUT
*&amp;amp;---------------------------------------------------------------------*

MODULE user_command_0101 INPUT.
  save_ok = ok_code.
  CLEAR ok_code.
  CASE save_ok.
    WHEN 'EXIT'.
      PERFORM exit_program.
  ENDCASE.
ENDMODULE.                 " USER_COMMAND_0101  INPUT
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  exit_program
*&amp;amp;---------------------------------------------------------------------*
FORM exit_program .
  LEAVE PROGRAM.
ENDFORM.                    " exit_program&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Steps :&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1.	Call a screen.&lt;/P&gt;&lt;P&gt;2.	Go to the screen layout  and add a custom control .&lt;/P&gt;&lt;P&gt;3.	Go to attribute and give a name to the custom control (Ex: 'CUSTOM_CONTROL').&lt;/P&gt;&lt;P&gt;4.	Give a name to the ok_code ( Ex: ok_code) in the attribute of the screen. &lt;/P&gt;&lt;P&gt;5.	Data Declaration section:&lt;/P&gt;&lt;P&gt;I.	Data declaration for ALV&lt;/P&gt;&lt;P&gt;a.	Declare a object type cl_gui_alv_grid for ALV Grid instance referance &lt;/P&gt;&lt;P&gt;b.	Declare a object type cl_gui_custom_container for Custom container instance referance&lt;/P&gt;&lt;P&gt;c.	Declare Name of the custom control added to the screen&lt;/P&gt;&lt;P&gt;d.	Declare field catalog table of type lvc_t_fcat.&lt;/P&gt;&lt;P&gt;e.	Declare layout of type lvc_s_layo. &lt;/P&gt;&lt;P&gt;II.	Data declaration for fetching data as input&lt;/P&gt;&lt;P&gt;III.	Declare variables for ok_code.&lt;/P&gt;&lt;P&gt;6.	Set pf-status and titlebar for the screen.&lt;/P&gt;&lt;P&gt;7.	Write PBO. IN PBO do the following:&lt;/P&gt;&lt;P&gt;i.	Check whether gr_alvgrid is initial.&lt;/P&gt;&lt;P&gt;a.	If yes do the following.&lt;/P&gt;&lt;P&gt;&amp;#149;	Create instance for  custom container (gr_container) by passing the container name.&lt;/P&gt;&lt;P&gt;&amp;#149;	Create instance for ALV grid by passing the custom control instance reference.&lt;/P&gt;&lt;P&gt;&amp;#149;	select the material data from database&lt;/P&gt;&lt;P&gt;&amp;#149;	Build field ctalog&lt;/P&gt;&lt;P&gt;&amp;#149;	Build layout&lt;/P&gt;&lt;P&gt;&amp;#149;	Call method &amp;#145;set_table_for_first_display&amp;#146; for the object gr_alvgrid(alv grid instance reference) with passing layout, input table and field catalog.&lt;/P&gt;&lt;P&gt;b.	If NO do the following.&lt;/P&gt;&lt;P&gt;&amp;#149;	Call method &amp;#145;refresh_table_display for the object gr_alvgrid(alv grid instance reference).&lt;/P&gt;&lt;P&gt;ii.	&lt;/P&gt;&lt;P&gt;8.	Write PAI. IN PAI do the following:&lt;/P&gt;&lt;P&gt;         Check the ok_code, if &amp;#145;Exit&amp;#146; then leave from program.&lt;/P&gt;&lt;P&gt;         All the user commands where user do any actions in the screen will be code here . For this purpose check the value of ok_code and according that ok_code, code the functionality for the particular user actions.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 22 Apr 2007 08:07:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-the-difference-b-w-alv-function-module-and-alv-methods/m-p/2201887#M470535</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-22T08:07:56Z</dc:date>
    </item>
    <item>
      <title>Re: What is the difference b/w ALV Function Module and ALV Methods?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-the-difference-b-w-alv-function-module-and-alv-methods/m-p/2201888#M470536</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ALV using FM generates a window by itself and displays data in it.&lt;/P&gt;&lt;P&gt;As the name says ..it uses FM approach.&lt;/P&gt;&lt;P&gt;OO ALV works on methods. A container object has to be created and needs to associated with ALV instance in OO Approach.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Refer to the following link for more details.&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapfans.com/forums/viewtopic.php?t=66305" target="test_blank"&gt;http://www.sapfans.com/forums/viewtopic.php?t=66305&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Apr 2007 06:00:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-the-difference-b-w-alv-function-module-and-alv-methods/m-p/2201888#M470536</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-23T06:00:38Z</dc:date>
    </item>
    <item>
      <title>Re: What is the difference b/w ALV Function Module and ALV Methods?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-the-difference-b-w-alv-function-module-and-alv-methods/m-p/2201889#M470537</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sathish,&lt;/P&gt;&lt;P&gt;Plz go through this info. It is very useful.&lt;/P&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;chk these excellent links.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.geocities.com/mpioud/Abap_programs.html" target="test_blank"&gt;http://www.geocities.com/mpioud/Abap_programs.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapdevelopment.co.uk/reporting/reportinghome.htm" target="test_blank"&gt;http://www.sapdevelopment.co.uk/reporting/reportinghome.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Simple ALV report&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapgenie.com/abap/controls/alvgrid.htm" target="test_blank"&gt;http://www.sapgenie.com/abap/controls/alvgrid.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://wiki.ittoolbox.com/index.php/Code:Ultimate_ALV_table_toolbox" target="test_blank"&gt;http://wiki.ittoolbox.com/index.php/Code:Ultimate_ALV_table_toolbox&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapgenie.com/abap/controls/alvgrid.htm" target="test_blank"&gt;http://www.sapgenie.com/abap/controls/alvgrid.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://wiki.ittoolbox.com/index.php/Code:Ultimate_ALV_table_toolbox" target="test_blank"&gt;http://wiki.ittoolbox.com/index.php/Code:Ultimate_ALV_table_toolbox&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ALV&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Please give me general info on ALV.&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapfans.com/forums/viewtopic.php?t=58286" target="test_blank"&gt;http://www.sapfans.com/forums/viewtopic.php?t=58286&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapfans.com/forums/viewtopic.php?t=76490" target="test_blank"&gt;http://www.sapfans.com/forums/viewtopic.php?t=76490&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapfans.com/forums/viewtopic.php?t=20591" target="test_blank"&gt;http://www.sapfans.com/forums/viewtopic.php?t=20591&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapfans.com/forums/viewtopic.php?t=66305" target="test_blank"&gt;http://www.sapfans.com/forums/viewtopic.php?t=66305&lt;/A&gt; - this one discusses which way should you use - ABAP Objects calls or simple function modules.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. How do I program double click in ALV?&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapfans.com/forums/viewtopic.php?t=11601" target="test_blank"&gt;http://www.sapfans.com/forums/viewtopic.php?t=11601&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapfans.com/forums/viewtopic.php?t=23010" target="test_blank"&gt;http://www.sapfans.com/forums/viewtopic.php?t=23010&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. How do I add subtotals (I have problem to add them)...&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapfans.com/forums/viewtopic.php?t=20386" target="test_blank"&gt;http://www.sapfans.com/forums/viewtopic.php?t=20386&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapfans.com/forums/viewtopic.php?t=85191" target="test_blank"&gt;http://www.sapfans.com/forums/viewtopic.php?t=85191&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapfans.com/forums/viewtopic.php?t=88401" target="test_blank"&gt;http://www.sapfans.com/forums/viewtopic.php?t=88401&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapfans.com/forums/viewtopic.php?t=17335" target="test_blank"&gt;http://www.sapfans.com/forums/viewtopic.php?t=17335&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4. How to add list heading like top-of-page in ABAP lists?&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapfans.com/forums/viewtopic.php?t=58775" target="test_blank"&gt;http://www.sapfans.com/forums/viewtopic.php?t=58775&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapfans.com/forums/viewtopic.php?t=60550" target="test_blank"&gt;http://www.sapfans.com/forums/viewtopic.php?t=60550&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapfans.com/forums/viewtopic.php?t=16629" target="test_blank"&gt;http://www.sapfans.com/forums/viewtopic.php?t=16629&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;5. How to print page number / total number of pages X/XX in ALV?&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapfans.com/forums/viewtopic.php?t=29597" target="test_blank"&gt;http://www.sapfans.com/forums/viewtopic.php?t=29597&lt;/A&gt; (no direct solution)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;6. ALV printing problems. The favourite is: The first page shows the number of records selected but I don't need this.&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapfans.com/forums/viewtopic.php?t=64320" target="test_blank"&gt;http://www.sapfans.com/forums/viewtopic.php?t=64320&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapfans.com/forums/viewtopic.php?t=44477" target="test_blank"&gt;http://www.sapfans.com/forums/viewtopic.php?t=44477&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;7. How can I set the cell color in ALV?&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapfans.com/forums/viewtopic.php?t=52107" target="test_blank"&gt;http://www.sapfans.com/forums/viewtopic.php?t=52107&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;8. How do I print a logo/graphics in ALV?&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapfans.com/forums/viewtopic.php?t=81149" target="test_blank"&gt;http://www.sapfans.com/forums/viewtopic.php?t=81149&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapfans.com/forums/viewtopic.php?t=35498" target="test_blank"&gt;http://www.sapfans.com/forums/viewtopic.php?t=35498&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapfans.com/forums/viewtopic.php?t=5013" target="test_blank"&gt;http://www.sapfans.com/forums/viewtopic.php?t=5013&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;9. How do I create and use input-enabled fields in ALV?&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapfans.com/forums/viewtopic.php?t=84933" target="test_blank"&gt;http://www.sapfans.com/forums/viewtopic.php?t=84933&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapfans.com/forums/viewtopic.php?t=69878" target="test_blank"&gt;http://www.sapfans.com/forums/viewtopic.php?t=69878&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;10. How can I use ALV for reports that are going to be run in background?&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapfans.com/forums/viewtopic.php?t=83243" target="test_blank"&gt;http://www.sapfans.com/forums/viewtopic.php?t=83243&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapfans.com/forums/viewtopic.php?t=19224" target="test_blank"&gt;http://www.sapfans.com/forums/viewtopic.php?t=19224&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;11. How can I display an icon in ALV? (Common requirement is traffic light icon).&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapfans.com/forums/viewtopic.php?t=79424" target="test_blank"&gt;http://www.sapfans.com/forums/viewtopic.php?t=79424&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapfans.com/forums/viewtopic.php?t=24512" target="test_blank"&gt;http://www.sapfans.com/forums/viewtopic.php?t=24512&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;12. How can I display a checkbox in ALV?&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapfans.com/forums/viewtopic.php?t=88376" target="test_blank"&gt;http://www.sapfans.com/forums/viewtopic.php?t=88376&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapfans.com/forums/viewtopic.php?t=40968" target="test_blank"&gt;http://www.sapfans.com/forums/viewtopic.php?t=40968&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapfans.com/forums/viewtopic.php?t=6919" target="test_blank"&gt;http://www.sapfans.com/forums/viewtopic.php?t=6919&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Go thru these programs they may help u to try on some hands on&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ALV Demo program&lt;/P&gt;&lt;P&gt;BCALV_DEMO_HTML&lt;/P&gt;&lt;P&gt;BCALV_FULLSCREEN_DEMO ALV Demo: Fullscreen Mode&lt;/P&gt;&lt;P&gt;BCALV_FULLSCREEN_DEMO_CLASSIC ALV demo: Fullscreen mode&lt;/P&gt;&lt;P&gt;BCALV_GRID_DEMO Simple ALV Control Call Demo Program&lt;/P&gt;&lt;P&gt;BCALV_TREE_DEMO Demo for ALV tree control&lt;/P&gt;&lt;P&gt;BCALV_TREE_SIMPLE_DEMO&lt;/P&gt;&lt;P&gt;BC_ALV_DEMO_HTML_D0100&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OOPs:&lt;/P&gt;&lt;P&gt;Check this for basic concepts of OOPS&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap%20code%20samples/abap%20objects/abap%20code%20sample%20to%20learn%20basic%20concept%20of%20object-oriented%20programming.doc" target="test_blank"&gt;https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap%20code%20samples/abap%20objects/abap%20code%20sample%20to%20learn%20basic%20concept%20of%20object-oriented%20programming.doc&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap%20code%20samples/alv%20grid/abap%20code%20sample%20to%20display%20data%20in%20alv%20grid%20using%20object%20oriented%20programming.doc" target="test_blank"&gt;https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap%20code%20samples/alv%20grid/abap%20code%20sample%20to%20display%20data%20in%20alv%20grid%20using%20object%20oriented%20programming.doc&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tabstrip&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap%20code%20samples/alv%20grid/abap%20code%20sample%20for%20tab%20strip%20in%20alv.pdf" target="test_blank"&gt;https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap%20code%20samples/alv%20grid/abap%20code%20sample%20for%20tab%20strip%20in%20alv.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Editable ALV&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap%20code%20samples/alv%20grid/abap%20code%20sample%20to%20edit%20alv%20grid.doc" target="test_blank"&gt;https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap%20code%20samples/alv%20grid/abap%20code%20sample%20to%20edit%20alv%20grid.doc&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tree&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapdevelopment.co.uk/reporting/alv/alvtree/alvtree_usrint.htm" target="test_blank"&gt;http://www.sapdevelopment.co.uk/reporting/alv/alvtree/alvtree_usrint.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;General Tutorial for OOPS&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/an%20easy%20reference%20for%20alv%20grid%20control.pdf" target="test_blank"&gt;https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/an%20easy%20reference%20for%20alv%20grid%20control.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rewords some points if it is helpful.&lt;/P&gt;&lt;P&gt;Rgds,&lt;/P&gt;&lt;P&gt;P.Naganjana Reddy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Apr 2007 06:06:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-the-difference-b-w-alv-function-module-and-alv-methods/m-p/2201889#M470537</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-23T06:06:16Z</dc:date>
    </item>
  </channel>
</rss>

