Refreshing the Output Table in ALV

Hi All,
Please let me know how to refresh the output table using refresh button in ALV.
Thanks & Regards,
Priya.
Edited by: SathyaPriya Neelagaru on Jun 26, 2008 7:00 AM

Hi,
We can refresh the output table for ALV by below code :
CLEAR  : g_wa_outtab.
REFRESH: g_t_outtab.
When we append something to output table of ALV we need to clear the workarea for that table.
APPEND g_wa_outtab TO g_t_outtab.
CLEAR g_wa_outtab.
If you are using object oreinted concept we have
CALL METHOD g_alv_grid_9001->refresh_table_display.
In case you have to use your own PF Status - Always copy the standard GUI status
(Program : SAPLSLVC_FULLSCREEN,
Status : STANDARD_FULLSCREEN )
For REFRESH - Include parameter for "USER_COMMAND" in the Function module interface.
Inside the User command subroutine - set
"RS_SELFIELD-REFRESH" = "X".
It will automatically refresh the ALV and there is no requirement to call ALV again.
Or else if u have a Refresh button on screen.
we can have
WHEN 'REFRESH'.
      CLEAR : g_wa_outtab.         
      REFRESH : g_t_outtab.
Hope this helps you.
Plz reward if useful.
Thanks,
Dhanashri
Edited by: Dhanashri Pawar on Jun 26, 2008 7:08 AM
Edited by: Dhanashri Pawar on Jun 26, 2008 7:14 AM
Edited by: Dhanashri Pawar on Jun 26, 2008 7:15 AM

Similar Messages

  • How to refresh output table in alv tree?

    Hi !
    I searched,
    there is many solutions.
    FRONTEND_UPDATE,
    refresh_table_display,
    or expand_nodes..
    But I want just fresh output table.
    Look this, please.
    IF p_tree IS NOT INITIAL.
        CALL METHOD g_container2->set_focus
          EXPORTING
            control = p_tree.
        CALL METHOD p_tree->frontend_update.
      CALL METHOD p_tree->refresh_table_display
       EXCEPTIONS
          program_error = 1
          OTHERS        = 2.
    *=> this method is privated. So I can't use it.
      ENDIF.
       CHECK p_tree IS INITIAL.
    create tree object
      CREATE OBJECT p_tree
        EXPORTING
          parent              = g_container2
          node_selection_mode = cl_gui_column_tree=>node_sel_mode_single
          no_html_header      = 'X'
          item_selection      = 'X'.
      DATA lt_fieldcat TYPE lvc_t_fcat.
      DATA ls_head TYPE treev_hhdr.
      PERFORM get_tree_head USING ls_head.
      PERFORM get_tree_fieldcat TABLES lt_fieldcat.
      CALL METHOD p_tree->set_table_for_first_display
        EXPORTING
          is_hierarchy_header = ls_head
          i_background_id     = 'ALV_BACKGROUND'
        CHANGING
          it_outtab           = gt_template
          it_fieldcatalog     = lt_fieldcat.
      PERFORM add_node USING p_tree.
      PERFORM register_tree_events USING p_tree.
      SET HANDLER lcl_event_receiver=>on_link_click FOR p_tree.
      CALL METHOD g_container2->set_focus
        EXPORTING
          control = p_tree.
    I just want refresh only output table( gt_template) without create object.
    method FRONTEND_UPDATE can't solve this problem.
    Please,
    If you know the solution about this problem,
    give me an answer.
    Thank you so much,
    From Juhee Bhang.
    Edited by: Ju-hee Bhang on Jun 2, 2009 10:48 AM

    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
         EXPORTING
           i_callback_program                = sy-cprog
           i_callback_pf_status_set          = 'PF_STATUS'
           i_callback_user_command           = 'CALLBACK_USER_COMMAND' "----->is the form name in
           i_callback_top_of_page            = 'TOP_OF_PAGE'                             which we write the code
           is_layout                         = s_layout
           it_fieldcat                       = t_fieldcat
           it_sort                           = t_sort
        I_DEFAULT                         = 'X'
           i_save                            = 'A'
           is_variant                        = s_variant
          TABLES
            t_outtab                          = t_output[]
         EXCEPTIONS
           program_error                     = 1
           OTHERS                            = 2.
    FORM callback_user_command USING i_ucomm       LIKE sy-ucomm
                                     i_wa_selfield TYPE slis_selfield.
      i_wa_selfield-refresh = 'X'.
    Endform

  • Query to refresh the output data.

    Hi,
    I have displayed an hierarchy list using 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'  FM.  Now I am trying to refresh the output screen, I have tried the selfield-refresh = 'X' functionality but its is not working.
    Have thought of other ways like getting the screen instance and then call the refresh method etc, but don't know if that's feasible.
    Please suggest..
    Thanks,
    Ketan

    Please find my piece code below..
    **Function module to display the ALV output.
      CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
           EXPORTING
                i_callback_program        = ws_repid
                i_callback_user_command   = 'F0009_USER_COMMAND'
                i_callback_pf_status_set  = 'f0008_set_pf_stat'
                is_layout                 = wa_layo
                it_fieldcat               = i_fieldcat[]
                is_variant                = wa_vari
                i_tabname_header          =  'I_VTTK_1'
                i_tabname_item            =  'I_HEADER'
                is_keyinfo                = ws_keyinfo
           TABLES
                t_outtab_header           = i_vttk_1
                t_outtab_item             = i_header
           EXCEPTIONS
                program_error             = 1
                OTHERS                    = 2.
    FORM f0009_user_command  USING ucomm LIKE sy-ucomm
                                   selfield TYPE slis_selfield. "#EC CALLED
    to handle the user commands if different from standard ALV
      CASE ucomm.
         WHEN 'REFRESH'.
    Here I am reselecting the data again to get the new changes done.
          PERFORM f0002_get_selection_data.
    Here the flag is getting set.
          selfield-refresh = 'X'.
      ENDCASE.
    ENDFORM.

  • How to call a screen /t-code by double clicking on the output of an alv?

    Hi,
    I want to call a screen /  t-code on double clicking on the output of an alv report.
    Suppose we click on a value in the "Pur Req" feild of the ALV output  it should  open the the transaction code and give us  the  details of that particular value. How can I do that?
    Thanx in advance..

    If you displaying ALV using Classes..( CL_GUI_ALV_GRID)... You need to create event receiver and register the double click event handler method dynamically.... Here's the sample code...
    *                            C L A S S E S                             *
    class lcl_event_receiver definition.
      public section.
        methods:  handle_double_click
                  for event double_click
                  of cl_gui_alv_grid
                  importing e_row e_column.
    endclass.
    *       CLASS lcl_event_receiver IMPLEMENTATION
    class lcl_event_receiver implementation.
      method handle_double_click.
        data: l_cc like line of gt_cc.
        data:
        g_row type i,
          g_value(10),
          g_col type i,
          g_row_id type lvc_s_row,
          g_col_id type lvc_s_col,
          g_row_no type lvc_s_roid.
    *  Read the double click cell
        call method gr_grid->get_current_cell
               importing
                 e_row     = g_row
                 e_value   = g_value
                 e_col     = g_col
                 es_row_id = g_row_id
                 es_col_id = g_col_id
                 es_row_no = g_row_no.
        clear wa_itab
        read table gt_itab index g_row_id into wa_itab.
        case g_col_id.
          when 'EBELN'.                   "Show Process Order
            if not wa_itab-ebeln is initial.
              set parameter id 'BES' field wa_cc-ebeln.
              call transaction 'ME22N'  and skip first screen.
            endif.
        call method gr_grid->set_table_for_first_display
            exporting
            i_consistency_check   =  g_consistency_check
            it_toolbar_excluding  =  gt_exclude
            is_variant            =  gs_variant
            i_save                =  g_save
            i_default             =  'X'
            is_layout             =  g_layout
        changing it_outtab        =  gt_cc[]
                 it_fieldcatalog  =  gt_fieldcat[]
                 it_sort          =  gt_sortcat[].
        create object event_receiver.
    *   Register the 'Double Click' event handler method dynamically.
        set handler event_receiver->handle_double_click for gr_grid.

  • Restrict WERKS values in the output of simple ALV(using REUSE_GRID_DISPLAY

    Hi ,
    I have one  requirement as follows:-
    --> I want to restrict WERKS values in the output of simple ALV(using REUSE_GRID_DISPLAY).
    currently the values ae displayed from standard search-help.
    I want to fields WERKS(MRP Type) values from table T001W with field VKFLZ = 'B'.
    Now the fieltered values should be displaeyd in ALV output.
    I was thinking of using the event, but i cannot find appropriate event where i can code my changes...please suggest
    Thanks in Advance.

    Hi Sandeep,
        I have the events in IT_EVENTS table.
        None of them i find suitable event for restrcition of F4 vaues in field werks.
        CALLER_EXIT
    USER_COMMAND
    TOP_OF_PAGE
    TOP_OF_COVERPAGE
    END_OF_COVERPAGE
    FOREIGN_TOP_OF_PAG
    FOREIGN_END_OF_PAG
    PF_STATUS_SET
    LIST_MODIFY
    TOP_OF_LIST
    END_OF_PAGE
    END_OF_LIST
    AFTER_LINE_OUTPUT
    BEFORE_LINE_OUTPUT
    REPREP_SEL_MODIFY
    SUBTOTAL_TEXT
    GROUPLEVEL_CHANGE.
    Please suggest, what other options we can have on this.
    Thanks in Advance.

  • How to hide columns in the output table in webdynpro based on input

    Hi Experts,
       I have 2 inputs and 1 input is optional.If both inputs are given proper table output is displayed,but if only 1 input is given a column is empty in the output table  so i want to hide this column dynamically at runtime based on my inputs.And i want to hide some empty rows also at runtime based on inputs.
    Can anyone help me out to solve this.
    Thanks in advance.
    Regards,
    Anita.

    Hi Anitha,
    What i understood from your question is,you want to control the table from your inputs.I have a one question for you what do you want to show defaultly i.e when you run the application what you want to show,either no table or table with some values.
    Any how i am giving solution in this way.
    If both inputs are given proper table output is displayed
    Write your below logic in the WDDOMODIFYVIEW )
    Here i am assuming that you already have a table element in the view.
    Get the values entered in the input fields and compare those 2 values ,if the condition is satisfied then bind the values which you want to show in the table to the context node.
    but if only 1 input is given a column is empty in the output table so i want to hide this column dynamically at runtime based on my inputs
    You are telling that you know the empty column.If so get the view element reference and use the REMOVE_COLUMN to remove the column.
    data:lr_table type ref to cl_wd_table,
           lr_column type ref to L_WD_TABLE_COLUMN.
    lr_table ?= view->get_element( 'TABLE1' ).
    CALL METHOD LR_TABLE->REMOVE_COLUMN
        EXPORTING
          ID          = 'TABLE1_color'
         INDEX      =
        RECEIVING
          THE_COLUMN = lr_column.
    i want to hide some empty rows also at runtime based on inputs.
    Removing the rows is very simple.if you know the key fields data of internal table from your input fields then do in this way.
    delete itab from wa where key1= "12" and key2="abd".
    Now bind the internal table to context node.
    LO_ND_hcm->BIND_TABLE(
          NEW_ITEMS            = it_final
          SET_INITIAL_ELEMENTS = ABAP_TRUE ).

  • Automatic refresh the alarm table in oracle bpel 10.1.3.5 on Linux

    Automatic refresh the alarm table in oracle bpel 10.1.3.5 on Linux
    I have bpel process with wait activity ..those are getting hang during thre processing. when I
    refresh the alaram table..they are processing normally.
    Is there a way to refresh the alarm table automatically for every few minutes.?
    I have checked the Best Practices Guide
    Tuning
    com.oracle.bpel.expirationAgent.threadCount = 50
    and com.oracle.bpel.threadPool.threadCount = 5
    Does not help. What I am after is some way for an automatic refresh to be done say every 1hr or so.
    Can this be done?? If YES, how??

    Hi,
    I had a similar requirement a while back, since due to poor system config we also Wait timers not expiring on time. I couldn't find a method within BPEL console to do this automatically.
    I'm not a Java developer, but at the time I did use google to and put together the following. I can't tell if it is working since there is nothing written in the BPEL logs to indicate the refresh. My plan was to develop a script to detect waits not expiring, and then to run the java (below).
    I used the the following blog as the basis : http://oraclebpelindepth.blogspot.com/2008/09/undeploy-bpel-with-java.html
    import java.util.Properties;
    import com.oracle.bpel.client.IBPELDomainHandle;
    import com.oracle.bpel.client.Locator;
    import com.oracle.bpel.client.ServerException;
    import com.oracle.bpel.client.BPELDomainStatus;
    import com.oracle.bpel.client.Server;
    import com.oracle.bpel.client.auth.ServerAuth;
    import com.oracle.bpel.client.auth.ServerAuthFactory;
    public class DoRefreshAlarmTable {
         public static void main(String[] args) throws ServerException {
              //Properties with BPEL server connection information
              Properties props = new Properties();
              props.put("orabpel.platform", "ias_10g");
              props.put("java.naming.factory.initial", "com.evermind.server.rmi.RMIInitialContextFactory");
              props.put("java.naming.provider.url", "opmn:ormi://omv2rrm2:6003:oc4j_soa/orabpel");
              props.put("java.naming.security.principal", "oc4jadmin");
              props.put("java.naming.security.credentials", "pass4bpel");
              props.put("dedicated.connection","true");
              //Get a locator in default domain
              Locator locator = new Locator("default","welcome1",props);
              //Get a handle to the domain
              IBPELDomainHandle iBPELDomainHandle = locator.lookupDomain();
              //Refresh the alarm table
              iBPELDomainHandle.refreshAlarmTable();
    Edited by: Anit Patel on Jan 20, 2012 10:46 AM

  • How to refresh the page/table after completion of taskflow in popup

    Hi,
    Scenario:
    In main page, having an emp-table and popup(which contains taskflow as region). In taskflow, iam modifying the emp-table data and after successfully completion of taskflow, want to refresh the emp-table present in the main page. How can we do this...?
    Note:
    (1) In Taskflow last activity is 'taskflow-return', where iam commiting all the data.After this i want to refresh the emp-table,(pop-up closes when it reaches last activity).
    (2) Tried PPR in bean code of main page, it refreshes, but before commiting.
    Something like, Refreshing the entire page either closing/hiding of popup, will help......?
    Regards.

    try with regionNavigationListener:
    public void myRegionNavigationListener(RegionNavigationEvent event) {
          String newViewId = event.getNewViewId();
          if (newViewId == null) { // null new view id indicates the taskflow has ended !
                refreshEmpTableSomehow();
    }As one alternative, take a look at my last message from this thread:
    Re: How to handle the "cancel" button and "close" icon of a popup ?
    Edited by: Cvele_new_account on Oct 5, 2012 12:19 AM

  • How to refresh the result of an ALV

    Hello,
    I'm try to use an ALV Grid and I want to refresh the data with a request. It work the first time but not the others. This is my code :
    REPORT  ZRAP_TRANS.
    DATA it_lgu_log_hre TYPE TABLE OF ZLGU_LOG_HRE.
    DATA: R_CONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER,
          R_GRID TYPE REF TO CL_GUI_ALV_GRID.
    DATA: r_cont_date_beg TYPE REF TO CL_GUI_CUSTOM_CONTAINER,
          r_calendar_date_beg TYPE REF TO CL_GUI_CALENDAR.
    DATA: date_beg LIKE sy-datum,
          date_end LIKE sy-datum,
          hour_beg LIKE sy-timlo,
          hour_end LIKE sy-timlo.
    date_beg = sy-datum.
    date_end = sy-datum.
    hour_beg = 28800.
    hour_end = 61200.
    SELECT * FROM ZLGU_LOG_HRE INTO TABLE it_lgu_log_hre.
    MODULE POPULATE_LIST OUTPUT.
      CREATE OBJECT r_container
        EXPORTING
          CONTAINER_NAME = 'CONT_TRANSACTIONS'.
      CREATE OBJECT r_grid
        EXPORTING
          I_PARENT = r_container.
      CALL METHOD r_grid->set_table_for_first_display
        EXPORTING
          i_structure_name = 'ZTRANS'
        CHANGING
          it_outtab        = it_lgu_log_hre.
    ENDMODULE.
    MODULE USER_COMMAND_9000 INPUT.
      CASE SY-UCOMM.
        WHEN 'SEARCH' OR 'PICK'.
          r_container->set_visible( visible = 'TRUE' ).
          SELECT * FROM ZLGU_LOG_HRE INTO TABLE it_lgu_log_hre WHERE AEDTM >= date_beg AND AEDTM <= date_end.
          r_grid->refresh_table_display( ).
        WHEN 'BACK'.
          SET SCREEN 0.
      ENDCASE.
    ENDMODULE.
    When I arrive in my Dynpro I see all my table. When I search the first time I view the correct result and when I search a second time, with diffrent data, I have the result of the first search.
    Do you have an idea?
    Thanks a lot.

    Hi,
    The method refresh_table_display( ) should be coded in the PBO module (use the parameter is_stable to keep current grid position)...
    You could have something like e.g:
    MODULE POPULATE_LIST OUTPUT.
      IF r_container IS INITIAL.
        CREATE OBJECT r_container
          EXPORTING
            CONTAINER_NAME = 'CONT_TRANSACTIONS'.
        CREATE OBJECT r_grid
          EXPORTING
            I_PARENT = r_container.
        CALL METHOD r_grid->set_table_for_first_display
          EXPORTING
            i_structure_name = 'ZTRANS'
          CHANGING
            it_outtab        = it_lgu_log_hre.
      ELSE.
        r_grid->refresh_table_display( ).
      ENDIF.
    ENDMODULE.
    Kr,
    Manu.

  • Change the data in fieldcat and update the database table in alv oops

    Hi,
    my requirement is i have displayed a fieldcat in change mode and when i change the data and click on save it has to be updated the database table..
    this has to be done using alv oops...

    Hi,
    This code will reflect all the changes into the internal table that is being displayed.
    * 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->check_changed_data.
          ENDIF.
    Now after this code is executed the internal table is modified as per the changes done in alv output.
    Now you can use this internal table to update the database table.
    Hope this helps you.
    Regards,
    Tarun

  • How to change the ColumnName in the output of an ALV List

    ello Experts,
    Can you please let me know how can I change the column name of a field in an ALV List. For eg: I want to see the 'I_FIELDCAT-MATNR' field's name as 'ITEM NUMBER' in the output.
    Thanks for the help

    Hi Raj,
    Have a look at this file.
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/eac1fa0b-0e01-0010-0990-8530de4908a6
    Reward if useful.
    Thanks
    Aneesh.

  • How to control the output fields in ALV

    Hi Pals,
    I have a Z program which outputs around 400 characters length. It is working fine when we run in foreground(online).. But i have the problem with the length of the output of the report when i run in BACKGROUND mode. That is, only 255 characters are being displayed.
    So, i have decided to supress some of the unwanted output fields being diplayed, so that the total output length becomes 255 characters.
    How can i handle this situation in the ALV's?
    Someone please send me some sample code.
    Thanks in advance,
    Ram.

    Hi
       Better create the Layout Variants with the desired columns.
    ALV is providing that functionality.
    Use
    CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
        EXPORTING
          is_variant = alv_variant
          i_save     = 'A'
        IMPORTING
          es_variant = alv_variant
        EXCEPTIONS
          not_found  = 2.
    Regards,
    Kumar

  • How to set the output list in alv

    hai all,
    i have copied the standard alv program into customized and the out put of customized have changed . but the output listy of this customized program is to be changed like standard program . please tell me how to do this i have setting the current layout of it . it will display only for time been whemni come out of that program it will change .

    Hi,
    After changing the layout to desired output. Save the layout and set it as default. Then it will work for every time.
    Thanks
    Chandra

  • How to create the Hierarchial table using ALV.in WD4A

    Hi All,
    I am struggling hard to make the hierarchial ALV,  But could not do it.
    Could you help me.
    Actually I want the column to be hierarchial. For this i am using
    if_salv_wd_column_hierarchy~set_hierarchy_column.
    Also i tried to display the whole table as Hierarchial
        lr_table_settings->set_display_type( if_salv_wd_c_table_settings=>display_type_hierarchy ).
    For both the possibilities the result is not as desired.
    Regards,
    Arti.

    Hi Aleem,
    The link u have provided gives the solution for the Table.
    I want the implementation for ALV.
    Also my requirement is that the first column of the ALV should be hierarchial.
    On expanding the table cell of first column one more table should open of same type.
    This way user can navigate to three diffierent database tables.
    The tree is populated at runtime with the data. So the depth of branches is unknown at design time.
    I hope the requirements are clear to u now.
    Thanks and Regards,
    Arti.

  • Refresh the screen after a ALV hotspot click

    I have a value type I painted on my screen, i wan it to be updated after i trigger the hotspot click on my ALV list. How to do refresh the value on the screen?Because hotspot click does not update the screen for the latest value.

    Hello Lai
    I trigger PAI in the event handler method using the following coding:
    *   Trigger PAI
        CALL METHOD cl_gui_cfw=>set_new_ok_code
          EXPORTING
            new_code = e_ucomm
    *      IMPORTING
    *        rc       =
    When you are at PAI you can do all kinds of refreshing your ALV list before displaying it again. For an example see thread
    Blanking values on ALV Grid Row Duplicate
    Regards
      Uwe

Maybe you are looking for