<?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: Refresh in ALV OOPS in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/refresh-in-alv-oops/m-p/5148076#M1193008</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;Store the value of sy-ucomm in a local variable and&lt;/P&gt;&lt;P&gt;put if or case on that variable, &lt;/P&gt;&lt;P&gt;when it is for refresh write your code there.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Phani.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 04 Feb 2009 12:32:39 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-02-04T12:32:39Z</dc:date>
    <item>
      <title>Refresh in ALV OOPS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/refresh-in-alv-oops/m-p/5148070#M1193002</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;     I have displayed ALV using OOPS.I have the all standard buttons like Refresh,Filter etc.....&lt;/P&gt;&lt;P&gt;     Now ,if i press the REFRESH button in the ALV standard Toolbar,i need to trigger a custom code.&lt;/P&gt;&lt;P&gt;    How can i do this???&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;Madan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Feb 2009 08:29:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/refresh-in-alv-oops/m-p/5148070#M1193002</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-04T08:29:38Z</dc:date>
    </item>
    <item>
      <title>Re: Refresh in ALV OOPS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/refresh-in-alv-oops/m-p/5148071#M1193003</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Reply please&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Feb 2009 10:00:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/refresh-in-alv-oops/m-p/5148071#M1193003</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-04T10:00:36Z</dc:date>
    </item>
    <item>
      <title>Re: Refresh in ALV OOPS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/refresh-in-alv-oops/m-p/5148072#M1193004</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;Capture the sy-ucomm for refresh button and use this demo code to refresh as per your code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For refreshing the ALV grid using OO use code:-&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
*&amp;amp;---------------------------------------------------------------------*
*          TABLES
*&amp;amp;---------------------------------------------------------------------*
TABLES : ekpo.
 
*&amp;amp;---------------------------------------------------------------------*
*          PARAMETERS DECLARATION
*&amp;amp;---------------------------------------------------------------------*
PARAMETERS : z_ebeln TYPE ekpo-ebeln.
 
*&amp;amp;---------------------------------------------------------------------*
*          TYPE DECLARATION
*&amp;amp;---------------------------------------------------------------------*
TYPES : BEGIN OF t_ekpo,
        ebeln TYPE ekpo-ebeln,
        ebelp TYPE ekpo-ebelp,
        matnr TYPE ekpo-matnr,
        werks TYPE ekpo-werks,
        menge TYPE ekpo-menge,
        END OF t_ekpo.
 
*&amp;amp;---------------------------------------------------------------------*
*          DATA DECLARATION
*&amp;amp;---------------------------------------------------------------------*
 
DATA : rep_name TYPE sy-repid,
       check(1),
       rep(25),
       ok_code TYPE sy-ucomm.
 
*INTERNAL TABLE
DATA : it_ekpo TYPE STANDARD TABLE OF t_ekpo.
 
*NAME OF CUSTOM CONTAINER ADDED ON SCREEN
DATA : z_container TYPE scrfname VALUE 'PO_CONTAINER'. "name of container on screen
 
DATA : z_custom_container TYPE REF TO cl_gui_custom_container.
 
*ALV GRID CONTAINER
DATA : z_grid TYPE REF TO cl_gui_alv_grid.
 
*FIELD CATALOG
DATA : it_fieldcat TYPE lvc_t_fcat,
       wa_fieldcat TYPE lvc_s_fcat.
 
*LAYOUT
DATA : wa_layout TYPE lvc_s_layo.
 
*&amp;amp;---------------------------------------------------------------------*
*          INITIALIZATION
*&amp;amp;---------------------------------------------------------------------*
INITIALIZATION.
  rep_name = sy-repid.
  check = 'X'.
  CONCATENATE text-001 rep_name INTO rep SEPARATED BY space.
 
*----------------------------------------------------------------------*
*       CLASS lcl_oo_alv DEFINITION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS lcl_oo_alv DEFINITION.
  PUBLIC SECTION.
    METHODS populate_itab IMPORTING ebeln TYPE zekpo-ebeln.
    METHODS create_field_catalog.
    METHODS create_layout.
    METHODS display_alv.
    METHODS refresh_alv.
 
  PRIVATE SECTION.
    DATA : po TYPE ekpo-ebeln.
 
ENDCLASS.                    "lcl_oo_alv DEFINITION
 
*----------------------------------------------------------------------*
*       CLASS lcl_oo_alv IMPLEMENTATION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS lcl_oo_alv IMPLEMENTATION.
 
  METHOD populate_itab.
    me-&amp;gt;po = ebeln.
 
    SELECT ebeln
       ebelp
       matnr
       werks
       menge
       FROM ekpo
       INTO TABLE it_ekpo
       WHERE ebeln EQ po.
  ENDMETHOD.                    "populate_itab
 
  METHOD create_field_catalog.
    wa_fieldcat-fieldname = 'EBELN'.
    wa_fieldcat-coltext = 'PO #'.
    APPEND wa_fieldcat TO it_fieldcat.
    CLEAR wa_fieldcat.
 
    wa_fieldcat-fieldname = 'EBELP'.
    wa_fieldcat-coltext = 'Item'.
    APPEND wa_fieldcat TO it_fieldcat.
    CLEAR wa_fieldcat.
 
    wa_fieldcat-fieldname = 'MATNR'.
    wa_fieldcat-coltext = 'Material'.
    APPEND wa_fieldcat TO it_fieldcat.
    CLEAR wa_fieldcat.
 
    wa_fieldcat-fieldname = 'WERKS'.
    wa_fieldcat-coltext = 'Plant'.
    APPEND wa_fieldcat TO it_fieldcat.
    CLEAR wa_fieldcat.
 
    wa_fieldcat-fieldname = 'MENGE'.
    wa_fieldcat-coltext = 'Qty.'.
    APPEND wa_fieldcat TO it_fieldcat.
    CLEAR wa_fieldcat.
  ENDMETHOD.                    "create_field_catalog
 
  METHOD create_layout.
    wa_layout-grid_title = rep.
    wa_layout-zebra = check.
  ENDMETHOD.                    "create_layout
 
  METHOD display_alv.
 
    CALL METHOD z_grid-&amp;gt;set_table_for_first_display
    EXPORTING
*    i_buffer_active               =
*    i_bypassing_buffer            =
*    i_consistency_check           =
*    i_structure_name              =
*    is_variant                    =
*    i_save                        =
*    i_default                     = 'X'
      is_layout                     = wa_layout
*    is_print                      =
*    it_special_groups             =
*    it_toolbar_excluding          =
*    it_hyperlink                  =
*    it_alv_graphics               =
*    it_except_qinfo               =
*    ir_salv_adapter               =
    CHANGING
      it_outtab                     = it_ekpo
      it_fieldcatalog               = it_fieldcat
*    it_sort                       =
*    it_filter                     =
*  EXCEPTIONS
*    invalid_parameter_combination = 1
*    program_error                 = 2
*    too_many_lines                = 3
*    others                        = 4
          .
    IF sy-subrc  0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
 
  ENDMETHOD.                    "display_alv
 
  METHOD refresh_alv.
 
    REFRESH it_ekpo.
 
    SELECT ebeln
           ebelp
           matnr
           werks
           menge
           FROM ekpo
           INTO TABLE it_ekpo.
 
 
    CALL METHOD z_grid-&amp;gt;refresh_table_display
*  EXPORTING
*    is_stable      =
*    i_soft_refresh =
*  EXCEPTIONS
*    finished       = 1
*    others         = 2
            .
    IF sy-subrc  0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
 
 
  ENDMETHOD.                    "refresh_alv
 
ENDCLASS.                    "lcl_oo_alv IMPLEMENTATION
 
*&amp;amp;---------------------------------------------------------------------*
*          CLASS INSTANCE VARIABLE
*&amp;amp;---------------------------------------------------------------------*
DATA : obj1 TYPE REF TO lcl_oo_alv.
 
*&amp;amp;---------------------------------------------------------------------*
*          START OF SELECTION
*&amp;amp;---------------------------------------------------------------------*
START-OF-SELECTION.
 
*CREATE OBJECT
  CREATE OBJECT : obj1.
 
  CALL METHOD obj1-&amp;gt;populate_itab
    EXPORTING
      ebeln = z_ebeln.
 
*&amp;amp;---------------------------------------------------------------------*
*          CALL SCREEN
*&amp;amp;---------------------------------------------------------------------*
  CALL SCREEN 1011.
 
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Module  STATUS_1010  OUTPUT
*&amp;amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE status_1011 OUTPUT.
  SET PF-STATUS '1011'.
*  SET TITLEBAR 'xxx'.
 
*CUSTOM CONTAINER INSTANCE
  CREATE OBJECT z_custom_container
    EXPORTING
*           parent                      =
      container_name              = z_container
*           style                       =
*           lifetime                    = lifetime_default
*           repid                       =
*           dynnr                       =
*           no_autodef_progid_dynnr     =
*         EXCEPTIONS
*           cntl_error                  = 1
*           cntl_system_error           = 2
*           create_error                = 3
*           lifetime_error              = 4
*           lifetime_dynpro_dynpro_link = 5
*           others                      = 6
      .
  IF sy-subrc  0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.
 
*ALV GRID INSTANCE
  CREATE OBJECT z_grid
    EXPORTING
*    i_shellstyle      = 0
*    i_lifetime        =
      i_parent          = z_custom_container
*    i_appl_events     = space
*    i_parentdbg       =
*    i_applogparent    =
*    i_graphicsparent  =
*    i_name            =
*    i_fcat_complete   = space
*  EXCEPTIONS
*    error_cntl_create = 1
*    error_cntl_init   = 2
*    error_cntl_link   = 3
*    error_dp_create   = 4
*    others            = 5
      .
  IF sy-subrc  0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.
 
  CALL METHOD obj1-&amp;gt;create_field_catalog.
 
  CALL METHOD obj1-&amp;gt;create_layout.
 
  CALL METHOD obj1-&amp;gt;display_alv.
 
ENDMODULE.                 " STATUS_1010  OUTPUT
 
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Module  USER_COMMAND_1010  INPUT
*&amp;amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE user_command_1011 INPUT.
 
  ok_code = sy-ucomm.
 
  CASE ok_code.
     WHEN 'REFRESH'.
      CALL METHOD obj1-&amp;gt;refresh_alv.
     WHEN 'BACK'.
      LEAVE TO SCREEN 0.
     WHEN 'EXIT'.
      LEAVE PROGRAM.
   ENDCASE.
 ENDMODULE.                 " USER_COMMAND_1010  INPUT
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this solves your problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Tarun Gambhir&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Feb 2009 10:10:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/refresh-in-alv-oops/m-p/5148072#M1193004</guid>
      <dc:creator>I355602</dc:creator>
      <dc:date>2009-02-04T10:10:33Z</dc:date>
    </item>
    <item>
      <title>Re: Refresh in ALV OOPS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/refresh-in-alv-oops/m-p/5148073#M1193005</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;u can check the function code for the refresh button, in se41..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for that alv report, in the selection screen, in menu bar , &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;goto system -&amp;gt; status -&amp;gt; u can find  field with GUI status . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;take that value and go to se41 , pass program name and GUI status, u can find all the function codes for the given buttons..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rgds.,&lt;/P&gt;&lt;P&gt;subash&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Feb 2009 10:10:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/refresh-in-alv-oops/m-p/5148073#M1193005</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-04T10:10:47Z</dc:date>
    </item>
    <item>
      <title>Re: Refresh in ALV OOPS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/refresh-in-alv-oops/m-p/5148074#M1193006</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;have a look at demo report BCALV_GRID_05&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Feb 2009 10:10:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/refresh-in-alv-oops/m-p/5148074#M1193006</guid>
      <dc:creator>Sm1tje</dc:creator>
      <dc:date>2009-02-04T10:10:56Z</dc:date>
    </item>
    <item>
      <title>Re: Refresh in ALV OOPS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/refresh-in-alv-oops/m-p/5148075#M1193007</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Madan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to do some thing with that action you have to add your code in PAI of the screen and &lt;/P&gt;&lt;P&gt;pur your code in the implimentation for the local class defined in the program, please reffer the codes provided by Tarun.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;@Tarun - Tanks for the reference&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;Edited by: jyoti sahu on Feb 4, 2009 1:31 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Feb 2009 12:29:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/refresh-in-alv-oops/m-p/5148075#M1193007</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-04T12:29:06Z</dc:date>
    </item>
    <item>
      <title>Re: Refresh in ALV OOPS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/refresh-in-alv-oops/m-p/5148076#M1193008</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;Store the value of sy-ucomm in a local variable and&lt;/P&gt;&lt;P&gt;put if or case on that variable, &lt;/P&gt;&lt;P&gt;when it is for refresh write your code there.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Phani.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Feb 2009 12:32:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/refresh-in-alv-oops/m-p/5148076#M1193008</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-04T12:32:39Z</dc:date>
    </item>
  </channel>
</rss>

