<?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 Refreshing ALV in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/refreshing-alv/m-p/5325523#M1227259</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   I am generating an ALV output using REUSE_ALV_GRID_DISPLAY where I a field as editable. If I am changing any row / rows and If I press a  button, those rows should not come in ALV display (i.e. ALV should be refreshed ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; I made use of &lt;/P&gt;&lt;P&gt;      sf-refresh    = 'X'.&lt;/P&gt;&lt;P&gt;      sf-col_stable = 'X' .&lt;/P&gt;&lt;P&gt;      sf-row_stable = 'X' .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where sf is type slis_selfield&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;which is deleting only one line and not more than one line. And also, I should not recall REUSE_ALV_GRID_DISPLAY once again. The existing ALV must refreshed and the lines that I edited should not come.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Expecting your kind response,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Venkat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 12 Mar 2009 10:44:38 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-03-12T10:44:38Z</dc:date>
    <item>
      <title>Refreshing ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/refreshing-alv/m-p/5325523#M1227259</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   I am generating an ALV output using REUSE_ALV_GRID_DISPLAY where I a field as editable. If I am changing any row / rows and If I press a  button, those rows should not come in ALV display (i.e. ALV should be refreshed ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; I made use of &lt;/P&gt;&lt;P&gt;      sf-refresh    = 'X'.&lt;/P&gt;&lt;P&gt;      sf-col_stable = 'X' .&lt;/P&gt;&lt;P&gt;      sf-row_stable = 'X' .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where sf is type slis_selfield&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;which is deleting only one line and not more than one line. And also, I should not recall REUSE_ALV_GRID_DISPLAY once again. The existing ALV must refreshed and the lines that I edited should not come.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Expecting your kind response,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Venkat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Mar 2009 10:44:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/refreshing-alv/m-p/5325523#M1227259</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-12T10:44:38Z</dc:date>
    </item>
    <item>
      <title>Re: Refreshing ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/refreshing-alv/m-p/5325524#M1227260</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;Suppose u hv a Perform "DISPLAY" inside wic u hv written ur code for the FM-ALV.&lt;/P&gt;&lt;P&gt;Do somethng at press of the button u catch a user command and call this perform all over again. in this way it will get refreshed and you will get the updated values.&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;ags.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Mar 2009 10:50:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/refreshing-alv/m-p/5325524#M1227260</guid>
      <dc:creator>agnihotro_sinha2</dc:creator>
      <dc:date>2009-03-12T10:50:10Z</dc:date>
    </item>
    <item>
      <title>Re: Refreshing ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/refreshing-alv/m-p/5325525#M1227261</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;Take a button &lt;STRONG&gt;DELETE&lt;/STRONG&gt; with function code &lt;STRONG&gt;DELETE&lt;/STRONG&gt; in pf-status and then select records using checkbox and click DELETE button to remove records from ALV display&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use this code, its working:-&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
TYPE-POOLS : slis.

*INTERNAL TABLE
DATA : BEGIN OF it_final OCCURS 0,
         chk(1) TYPE c.
        INCLUDE STRUCTURE tcurc.
DATA : END OF it_final.

*FIELD CATALOG
DATA : it_field TYPE slis_t_fieldcat_alv,
       wa_field TYPE slis_fieldcat_alv.

*LAYOUT
DATA : wa_layout TYPE slis_layout_alv.

START-OF-SELECTION.

*fill internal table
  PERFORM get_data.

*create field catalogs
  PERFORM field_cat.

*create alv layout
  PERFORM alv_layout.

END-OF-SELECTION.

*display data in alv
  PERFORM alv_display.

*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  GET_DATA
*&amp;amp;---------------------------------------------------------------------*
*       Get data from database table
*----------------------------------------------------------------------*
FORM get_data .

  SELECT * FROM tcurc UP TO 10 ROWS
  INTO CORRESPONDING FIELDS OF TABLE it_final.

ENDFORM.                    " GET_DATA

*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  FIELD_CAT
*&amp;amp;---------------------------------------------------------------------*
*       Create Field Catalogs
*----------------------------------------------------------------------*
FORM field_cat .

  CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
      i_program_name         = sy-repid
      i_internal_tabname     = 'IT_FINAL'
      i_structure_name       = 'TCURC'
    CHANGING
      ct_fieldcat            = it_field
    EXCEPTIONS
      inconsistent_interface = 1
      program_error          = 2
      OTHERS                 = 3.
  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.

  wa_field-fieldname = 'CHK'.
  wa_field-tabname = 'IT_FINAL'.
  wa_field-outputlen = 2.
  wa_field-seltext_l = ' '.
  wa_field-edit = 'X'.
  wa_field-input = 'X'.
  wa_field-checkbox = 'X'.
  APPEND wa_field TO it_field.
  CLEAR wa_field.

ENDFORM.                    " FIELD_CAT

*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  ALV_LAYOUT
*&amp;amp;---------------------------------------------------------------------*
*       Set ALV Layout
*----------------------------------------------------------------------*
FORM alv_layout .

  wa_layout-zebra = 'X'.

ENDFORM.                    " ALV_LAYOUT
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  ALV_DISPLAY
*&amp;amp;---------------------------------------------------------------------*
*       Display data in ALV Grid
*----------------------------------------------------------------------*
FORM alv_display .

  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      i_callback_program       = sy-repid
      it_fieldcat              = it_field
      i_callback_user_command  = 'COMMAND'
      is_layout                = wa_layout
      i_callback_pf_status_set = 'PF'
    TABLES
      t_outtab                 = it_final
    EXCEPTIONS
      program_error            = 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.

ENDFORM.                    " ALV_DISPLAY

*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  pf
*&amp;amp;---------------------------------------------------------------------*
*       FOR PF-STATUS WITH USER DEFINED BUTTONS
*----------------------------------------------------------------------*
*      --&amp;gt;RT_EXTAB   text
*----------------------------------------------------------------------*
FORM pf USING rt_extab TYPE slis_t_extab.
  SET PF-STATUS 'ZPF_STAT'.
ENDFORM.                    "pf

*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  command
*&amp;amp;---------------------------------------------------------------------*
*       TO HANDLE USER ACTIONS AGAINST PF-STATUS
*----------------------------------------------------------------------*
*      --&amp;gt;UCOMM      text
*      --&amp;gt;SELFIELD   text
*----------------------------------------------------------------------*
FORM command USING ucomm LIKE sy-ucomm selfield TYPE slis_selfield.
  DATA : ok_code TYPE sy-ucomm.
  ok_code = ucomm.
  CASE ok_code.
    WHEN 'DELETE'.
      " to reflect the data changed into internal table
      DATA : ref_grid TYPE REF TO cl_gui_alv_grid. "new

      IF ref_grid IS INITIAL.
        CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
          IMPORTING
            e_grid = ref_grid.
      ENDIF.

      IF NOT ref_grid IS INITIAL.
        CALL METHOD ref_grid-&amp;gt;check_changed_data.
      ENDIF.

      SORT it_final BY chk DESCENDING.
      DELETE it_final WHERE chk = 'X'.

      selfield-refresh = 'X'.

  ENDCASE.
ENDFORM.                    "command
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Tarun&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Tarun Gambhir on Mar 12, 2009 4:27 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Mar 2009 10:56:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/refreshing-alv/m-p/5325525#M1227261</guid>
      <dc:creator>I355602</dc:creator>
      <dc:date>2009-03-12T10:56:48Z</dc:date>
    </item>
  </channel>
</rss>

