REFRESH FUNCTIONALITy in ALV GRID

Hi Experts,
I have added two custom buttons (CO40 and REFRESH) in ALV GRID .
WHEN CO40 button is clicked it will go the CO40 transaction.
here the problem is when clicking the REFRESH , the REFRESH fuctionality is not working.
(here i went to CO40 transaction by clicking CO40 button and deleted one planned order and come back and clicked REFRESH button but the planned order still showing in the output but the planned oreder is deleted in the table ) please help me rgarding this
pls see my code and pls send me the code with modifications
Thanks
Nagendra
REPORT  zpp_plannedorder_conv LINE-SIZE 200.
TYPE-POOLS: slis.
TABLES: plaf, vbak.
PLANNED ORDER TABLE
CONSTANTS: c_e TYPE c LENGTH 01 VALUE 'E'.
TYPES: BEGIN OF ty_plaf,
       kdauf     TYPE kdauf,
       kdpos     TYPE kdpos,
       plnum TYPE plnum,     
       dispo TYPE dispo,
       matnr     TYPE matnr,
       maktx     TYPE maktx,
       pwwrk     TYPE pwwrk,
       paart     TYPE paart,
       beskz     TYPE beskz,
       gsmng     TYPE gsmng,
       END OF ty_plaf.
SALES FIELDS
TYPES: BEGIN OF ty_vbak,
       vbeln TYPE vbeln,
       posnr TYPE posnr,
       kunnr     TYPE kunnr,
       grkor     TYPE grkor,
       autlf     TYPE autlf,
       mvgr2     TYPE mvgr2,
       fixmg     TYPE  fixmg,
       bstdk     TYPE bstdk,
       edatu     TYPE edatu,
       posex  TYPE posex,
       END OF ty_vbak.
output table.
TYPES: BEGIN OF ty_out,
       plnum TYPE plnum,     
       dispo TYPE dispo,
       matnr     TYPE matnr,
       maktx     TYPE maktx,
       pwwrk     TYPE pwwrk,
       paart     TYPE paart,
       beskz     TYPE beskz,
       gsmng     TYPE gsmng,
       kdauf     TYPE kdauf,
       kdpos     TYPE kdpos,
       kunnr     TYPE kunnr,
       grkor     TYPE grkor,
       autlf     TYPE autlf,
       mvgr2     TYPE mvgr2,
       fixmg     TYPE  fixmg,
       bstdk     TYPE bstdk,
       edatu     TYPE edatu,
       posex  TYPE posex,
       END OF ty_out.
DATA: tb_plaf TYPE STANDARD TABLE OF ty_plaf,
      tb_vbak TYPE STANDARD TABLE OF ty_vbak,
      tb_out  TYPE STANDARD TABLE OF ty_out.
DATA: lv_plaf TYPE ty_plaf,
      lv_vbak TYPE ty_vbak,
      lv_out  TYPE ty_out.
TYPES: BEGIN OF ty_vbep,
    vbeln TYPE vbeln,
    posnr TYPE posnr,
    etenr TYPE etenr,
    edatu TYPE edatu,
   END OF ty_vbep.
DATA: tb_vbep TYPE STANDARD TABLE OF ty_vbep.
DATA: lv_flag(1) TYPE c.
**Start changes RFS: SANN - 0856
DATA:  w_repid            TYPE sy-repid.
DATA:  it_fieldcat        TYPE slis_t_fieldcat_alv, "field catalog table
       gs_layout          TYPE slis_layout_alv, "struct data type
       it_sort            TYPE slis_t_sortinfo_alv,
       it_events          TYPE slis_t_event,
       gt_event_exit          TYPE slis_t_event_exit.
**End changes RFS: SANN - 0856
SELECT OPTIONS.
SELECTION-SCREEN BEGIN OF BLOCK a1 WITH FRAME TITLE text-t01.
SELECT-OPTIONS: sel_pln FOR plaf-plnum,
                sel_pww FOR plaf-pwwrk OBLIGATORY,
                sel_dis FOR plaf-dispo,
                sel_kun FOR vbak-kunnr,
                sel_paa FOR plaf-paart,
                sel_kda FOR plaf-kdauf.
SELECTION-SCREEN END OF BLOCK a1.
START-OF-SELECTION.
  REFRESH: tb_plaf ,tb_vbak.
  SELECT pkdauf pkdpos pplnum pdispo pmatnr mmaktx
          ppwwrk ppaart pbeskz pgsmng INTO TABLE tb_plaf
          FROM plaf AS p JOIN makt AS m
            ON pmatnr EQ mmatnr
            WHERE p~plnum IN sel_pln
              AND p~pwwrk IN sel_pww
              AND p~dispo IN sel_dis
              AND p~paart IN sel_paa
              AND p~kdauf IN sel_kda
              AND m~spras EQ c_e.
  IF NOT  tb_plaf[] IS INITIAL.
    SORT tb_plaf BY kdauf DESCENDING.
    SELECT  kvbeln pposnr kkunnr pgrkor kautlf pmvgr2 p~fixmg     
            kbstdk vedatu p~posex INTO TABLE tb_vbak
             FROM vbak AS k JOIN vbap AS p
               ON kvbeln EQ pvbeln
                  INNER JOIN vbep AS v
                     ON pvbeln EQ vvbeln
                    AND pposnr EQ vposnr
    FOR ALL ENTRIES IN tb_plaf
        WHERE k~vbeln EQ tb_plaf-kdauf
          AND p~posnr EQ tb_plaf-kdpos
          AND k~kunnr IN sel_kun
          AND v~etenr EQ '0001'.
    IF NOT  tb_vbak[] IS INITIAL.
      LOOP AT tb_plaf INTO lv_plaf.
        CLEAR lv_out.
        MOVE-CORRESPONDING lv_plaf TO lv_out.
        IF NOT lv_plaf-kdauf IS INITIAL.
          READ TABLE tb_vbak INTO lv_vbak WITH KEY vbeln = lv_plaf-kdauf
                                                   posnr = lv_plaf-kdpos.
          MOVE-CORRESPONDING lv_vbak TO lv_out.
        ENDIF.
        APPEND lv_out TO tb_out.
      ENDLOOP.
    ENDIF.
  ENDIF.
END-OF-SELECTION.
  PERFORM f_build_fcat.
  PERFORM f_get_display.
*&      Form  F_BUILD_FCAT
FORM f_build_fcat .
  CLEAR: w_repid.
  PERFORM fill_fieldcat " TABLES it_fieldcat
        USING:
               text-f01 'TB_OUT'  text-k01  text-k01 '10' ,
               text-f02 'TB_OUT'  text-k02  text-k02 '10' ,
               text-f03 'TB_OUT'  text-k03  text-k03 '06' ,
               text-f04 'TB_OUT'  text-k04  text-k04 '18' ,
               text-f05 'TB_OUT'  text-k05  text-k05 '06' ,
               text-f06 'TB_OUT'  text-k06  text-k06 '08' ,
               text-f07 'TB_OUT'  text-k07  text-k07 '05' ,
               text-f08 'TB_OUT'  text-k08  text-k08 '05' ,
               text-f09 'TB_OUT'  text-k09  text-k09 '15' ,
               text-f10 'TB_OUT'  text-k10  text-k10 '05' ,
               text-f11 'TB_OUT'  text-k11  text-k11 '05' ,
               text-f12 'TB_OUT'  text-k12  text-k12 '10' ,
               text-f13 'TB_OUT'  text-k13  text-k13 '10' ,
               text-f14 'TB_OUT'  text-k14  text-k14 '10' ,
               text-f15 'TB_OUT'  text-t15  text-k15 '10' ,
               text-f16 'TB_OUT'  text-k16  text-k16 '10' ,
               text-f17 'TB_OUT'  text-k17  text-k17 '10' .
ENDFORM.                    " F_BUILD_FCAT
*&      Form  fill_fieldcat
FORM  fill_fieldcat  " TABLES  l_catalog TYPE slis_t_fieldcat_alv       "#EC *
                   USING    p_field                         "#EC *
                            p_table                         "#EC *
                            p_desc                          "#EC *
                            p_desc_l                        "#EC *
                            p_len.                          "#EC *
  DATA: ls_fieldcat   TYPE slis_fieldcat_alv.
  ls_fieldcat-fieldname       = p_field.
  ls_fieldcat-tabname         = p_table.
  ls_fieldcat-seltext_l       = p_desc_l.
  ls_fieldcat-reptext_ddic    = p_desc.
  ls_fieldcat-outputlen       = p_len.
  APPEND ls_fieldcat TO it_fieldcat.
  CLEAR ls_fieldcat.
ENDFORM.                    " fill_fieldcat
*&     FORM F_GET_DISPLAY
      text
FORM f_get_display .
  CLEAR w_repid.
  MOVE sy-repid TO w_repid.
  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      i_callback_program       = w_repid
      i_callback_pf_status_set = 'PF_STATUS'
      i_callback_user_command  = 'USER_COMMAND'
      is_layout                = gs_layout
      it_fieldcat              = it_fieldcat
      it_sort                  = it_sort
      i_save                   = 'X'
    TABLES
      t_outtab                 = tb_out
    EXCEPTIONS
      program_error            = 1
      OTHERS                   = 2.
  IF sy-subrc EQ 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.
ENDFORM.                    " F_GET_DISPLAY
*&      Form  PF_STATUS
      text
FORM pf_status USING rt_extab TYPE slis_t_extab.
  DATA: wa_extab LIKE LINE OF rt_extab.
  REFRESH: rt_extab.
  wa_extab-fcode = '&REFRESH'.
  APPEND wa_extab TO rt_extab.
  SET PF-STATUS '0001' EXCLUDING rt_extab.
ENDFORM.                    "PF_STATUS
     -->COMMAND    text
     -->SELFIELD   text
FORM user_command USING command LIKE sy-ucomm selfield TYPE slis_selfield."#EC CALLED
  CLEAR : lv_out-plnum,lv_out-kdauf,lv_out-paart,lv_out-kdauf.
  CASE command.
    WHEN '&IC1'.                       "doubleclick
      CASE selfield-fieldname.
        WHEN 'PLNUM'.
          READ TABLE tb_out INTO lv_out INDEX selfield-tabindex.
          IF sy-subrc EQ 0.
            SET PARAMETER ID 'PAF'  FIELD lv_out-plnum.
            CALL TRANSACTION 'MD12' AND SKIP FIRST SCREEN.
          ENDIF.
        WHEN 'KDAUF'.
          READ TABLE tb_out INTO lv_out INDEX selfield-tabindex.
          IF sy-subrc EQ 0.
            SET PARAMETER ID 'AUN'  FIELD lv_out-kdauf.
            CALL TRANSACTION 'VA02' AND SKIP FIRST SCREEN.
          ENDIF.
      ENDCASE.
    WHEN 'CO40'.
      READ TABLE tb_out INTO lv_out INDEX selfield-tabindex.
      IF sy-subrc EQ 0.
        SET PARAMETER ID 'PAF'  FIELD lv_out-plnum.
        CALL TRANSACTION 'CO40' AND SKIP FIRST SCREEN.
      ENDIF.
    WHEN 'REFRESH'.
      PERFORM select_data.
  ENDCASE.
ENDFORM.                    "user_command
*End changes RFS: SANN - 0856
*&      Form  SELECT_DATA
      text
-->  p1        text
<--  p2        text
FORM select_data .
  commit work and wait.
  REFRESH:tb_plaf[],tb_vbak[],tb_out[].
  SELECT pkdauf pkdpos pplnum pdispo pmatnr mmaktx
          ppwwrk ppaart pbeskz pgsmng INTO TABLE tb_plaf
          FROM plaf AS p JOIN makt AS m
            ON pmatnr EQ mmatnr
            WHERE p~plnum IN sel_pln
              AND p~pwwrk IN sel_pww
              AND p~dispo IN sel_dis
              AND p~paart IN sel_paa
              AND p~kdauf IN sel_kda
              AND m~spras EQ c_e.
  IF NOT  tb_plaf[] IS INITIAL.
    SORT tb_plaf BY kdauf DESCENDING.
    SELECT  kvbeln pposnr kkunnr pgrkor kautlf pmvgr2 p~fixmg     
            kbstdk vedatu p~posex INTO TABLE tb_vbak
             FROM vbak AS k JOIN vbap AS p
               ON kvbeln EQ pvbeln
                  INNER JOIN vbep AS v
                     ON pvbeln EQ vvbeln
                    AND pposnr EQ vposnr
    FOR ALL ENTRIES IN tb_plaf
        WHERE k~vbeln EQ tb_plaf-kdauf
          AND p~posnr EQ tb_plaf-kdpos
          AND k~kunnr IN sel_kun
          AND v~etenr EQ '0001'.
    IF NOT  tb_vbak[] IS INITIAL.
      LOOP AT tb_plaf INTO lv_plaf.
        CLEAR lv_out.
        MOVE-CORRESPONDING lv_plaf TO lv_out.
        IF NOT lv_plaf-kdauf IS INITIAL.
          READ TABLE tb_vbak INTO lv_vbak WITH KEY vbeln = lv_plaf-kdauf
                                                   posnr = lv_plaf-kdpos.
          MOVE-CORRESPONDING lv_vbak TO lv_out.
        ENDIF.
        APPEND lv_out TO tb_out.
      ENDLOOP.
    ENDIF.
  ENDIF.
ENDFORM.                    " SELECT_DATA

Hi,
Gothrough the following link,
Handle Refresh button on ALV
Regards,
Harish

Similar Messages

  • How does the SORT function in ALV grid work?

    Hi,
    I have a report for which the o/p is displayed in ALV grid format.There is one column in the O/p strcuture which is "No of days".Based on certain conditions,i need to display the value for some of the days as Negative e.g. " - 45".Becasuse of this,I have declared the field for the "No of days" of the type "CHAR".
    Now when i sort(using ALV grid SORT function) the list on basis of this column,it doesnt give me the correct o/p.
    CAN anyone tell me how do i handle this?I want the list to be sorted correctly on basis of the "No of days" column.
    Thanks!

    This is your Fourth Cross Posting in last three days on same issue!!
    CHAR type column doesnt work for SORT function in ALV grid!
    How to sort a column of type CHAR
    I dont,ve link for your Fourth Thread on same,though i'm short memory loss.

  • How can I call functionality of ALV Grid by event of button outside grid?

    Hello,
    How can I call functionality of ALV Grid by event of button located outside ALV Grid? For example how to fire printing of this ALV Grid by button click elsewhere on the screen (not in toolbar of ALV Grid).
    Best regards,
    Josef Motl

    hi Motl,
    these are steps to create a button in ALV and trigger an event from it..
    1.Use the parameter i_callback_pf_status_set in the function module REUSE_ALV_GRID_DISPLAY
    i_callback_program = gd_repid
    i_callback_pf_status_set = 'SET_PF_STATUS'
    form set_pf_status using rt_extab type slis_t_extab.
    set pf-status 'NEWALVSTATUS'.
    endform.
    You have to copy the standard ALV pf stauts to 'NEWALVSTATUS' and add your button.
    2.You have to do the following to process the new button click.
    i_callback_user_command = 'USER_COMMAND'
    form user_command using i_ucomm like sy-ucomm
    is_selfield type slis_selfield.
    case i_ucomm.
    3. to copy the standard pf status to a new one.go to the ALV screen and take the menu System -> Status.  Then look for the standard pf status. Copy this to Z range and then add your new button.
    reward points if helpful
    regards
    satesh

  • Refreshing contents of ALV grid

    I am displaying 2 ALV grids in a splitter container on screen 100. There is an option for refresh on this screen to refresh the entries in both the grids (if any change). This refresh works fine using method REFRESH_TABLE_DISPLAY for both top and bottom grid contents.
    After processing the contents in screen 100, the user can navigate to screen 200 to view results of the current run. This screen also holds an ALV grid display of results on a custom container. When returning to screen 100 from 200, the results in top grid of screen 100 are fixed. The refresh option now only works with the grid on bottom container and not the top. I have tried using both REFRESH_TABLE_DISPLAY and SET_TABLE_FOR_FIRST_DISPLAY options and neither worked.
    How do I refresh the ALV to use the contents from the new dataset?
    Regards,
    Suri.

    Are you used refresh in PBO of 100 ?
    Like
        call method g_grid->refresh_table_display.   " Top grid
        call method g_grid1->refresh_table_display. " bottom grid

  • Generic function displaying alv grid for undefined structure

    Hi experts,
    I'm doing my first steps on abap development (Totally noob).
    I'm writing some little reports based on simple selections (1 or 2 tables).
    In every report, I've defined a structure (internal table) that i'm displaying with an ALV Grid.
    In every report, I need to create a catalog for my structure in order to make the alv grid working.
    What I would like to do is :
    Create a function that receives a undefined structure (for all my reports) as a parameter.
    This function sould create the catalog for the coresponding structure and call the alv grid function to display the data's contained in this structure.
    The goal is : In every report, I would like to use this function to show the selected data's without taking care of catalogs, alv grid, etc...
    Is it possible ?
    I really don't see how I can do that... Does anybody already tried something like that ?
    Thank you for your help
    Regards
    Quentin

    Hi,
    In this method Pass the structure name-
    CALL METHOD gh_grid->set_table_for_first_display
    EXPORTING
    I_BUFFER_ACTIVE =
    I_BYPASSING_BUFFER =
    I_CONSISTENCY_CHECK =
    I_STRUCTURE_NAME = "<- here pass the structure
    IS_VARIANT =
    I_SAVE =
    I_DEFAULT = 'X'
    IS_LAYOUT = "<-Layout variable if using layout
    IS_PRINT =
    IT_SPECIAL_GROUPS =
    IT_TOOLBAR_EXCLUDING =
    IT_HYPERLINK =
    IT_ALV_GRAPHICS =
    IT_EXCEPT_QINFO =
    CHANGING
    it_outtab = gt_line[]
    it_fieldcatalog = gt_fieldcat
    IT_SORT =
    IT_FILTER =
    EXCEPTIONS
    invalid_parameter_combination = 1
    program_error = 2
    too_many_lines = 3
    OTHERS = 4

  • "Control + F5"  standard filter functionality for ALV Grids

    Hi all,
    After an ALV Grid is displayed on screen there is a standard functionality to filter a selected column.
    You can select a column (click on the head) of the ALV, then "Control + F5" and a pop-up appears to insert a value or a range by which the filtration is going to be done.
    But a I have problem with a concrete field. It doesn`t seem different on comparison with other fields (CHAR30), but I don`t know why it doesn`t work correctly as others.
    Have you had any situation like this ??
    Thanks & sorry for my bad english,
    Rubè

    Hi Frank,
    When you are entering  89012  and pressing enter the additional zeros are adding up because of the data type of VBELN We have standard conversion routine attached with this .So when ever u wrtie any text that routine will works.
    Can you please check what data type are you using in the internal table that you are binding  to the node?
    Thanks and Regards,
    NSingh
    Edited by: Nsingh on Feb 17, 2012 4:52 AM

  • REFRESH BUTTON OF ALV GRID

    Hi Experts,
          In ALV report i have to apply custom functionality when user clicks on 'REFRESH' button.Please suggest me how to catch
    this event.I have used the event 'AFTER_REFRESH' OF CLASS CL_GUI_ALV_GRID.But it is not the right event.Please sugget me.
    regards,
    pavan t.

    hi,
    I'm currently not able to test, but have you tried teh events user_command and after_usercommand?
    regards,
    Hans Hohenfeld

  • Problem refreshing fieldcatalog in ALV grid classic

    Hi gurus,
    I´m really having problems with the column titles that are display in my ALV report and I cannot figure out why. I want to be able to print the text either in Spanish or in English, depending on the company code in the selection criteria screen. I refresh and populate the fieldcatalog with EN texts and I can see that changes are taken and pass to FM REUSE_ALV_GRID_DISPLAY but when I execute it they still show the Spanish text.
    Please help me with things. Points will be rewarded.
    I show here part of the code.
    FORM make_field_catalog.
      DATA: l_repid LIKE sy-repid.
      DATA: ls_fieldcat TYPE slis_fieldcat_alv.
      DATA: pos         TYPE i VALUE 1.
      l_repid   = sy-repid.
      CLEAR ls_fieldcat.
      REFRESH i_fieldcat.
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
       EXPORTING
          i_program_name     = l_repid
          i_internal_tabname = 'GT_OUTPUT'
          i_inclname         = l_repid
          i_bypassing_buffer = 'X'
       CHANGING
          ct_fieldcat        = i_fieldcat.
    Fields to output in the ALV.
    Show different languages, depending on the company code.
      IF is_es EQ 'X'.
        ls_fieldcat-col_pos        =   pos.
        ls_fieldcat-fieldname      =  'CUSTOMER'.
        ls_fieldcat-seltext_l      =  text-002.
        ls_fieldcat-ddictxt        =  'L'.
        ls_fieldcat-outputlen      =   10.
        ls_fieldcat-key            =  'X'.
        APPEND ls_fieldcat TO i_fieldcat.
        CLEAR ls_fieldcat.
        pos = pos + 1.
        ls_fieldcat-col_pos        =   pos.
        ls_fieldcat-fieldname      =  'DOC_NO'.
        ls_fieldcat-seltext_l      =  text-003.
        ls_fieldcat-ddictxt        =  'L'.
        ls_fieldcat-outputlen      =   10.
        APPEND ls_fieldcat TO i_fieldcat.
        CLEAR ls_fieldcat.
        pos = pos + 1.
        ls_fieldcat-col_pos        =   pos.
        ls_fieldcat-fieldname      =  'DOC_DATE'.
        ls_fieldcat-seltext_l      =  text-004.
        ls_fieldcat-ddictxt        =  'L'.
        ls_fieldcat-outputlen      =   10.
        APPEND ls_fieldcat TO i_fieldcat.
        CLEAR ls_fieldcat.
        pos = pos + 1.
        ls_fieldcat-col_pos        =   pos.
        ls_fieldcat-fieldname      =  'NET_AMOUNT'.
        ls_fieldcat-seltext_l      =  text-005.
        ls_fieldcat-ddictxt        =  'L'.
        ls_fieldcat-outputlen      =   15.
        ls_fieldcat-do_sum         =  'X'.
        ls_fieldcat-datatype       =  'QUAN'.
        APPEND ls_fieldcat TO i_fieldcat.
        CLEAR ls_fieldcat.
        pos = pos + 1.
      ELSE.
        ls_fieldcat-col_pos        =   pos.
        ls_fieldcat-fieldname      =  'CUSTOMER'.
        ls_fieldcat-seltext_l      =  text-012.
        ls_fieldcat-ddictxt        =  'L'.
        ls_fieldcat-outputlen      =   10.
        ls_fieldcat-key            =  ' '.
        APPEND ls_fieldcat TO i_fieldcat.
        CLEAR ls_fieldcat.
        pos = pos + 1.
        ls_fieldcat-col_pos        =   pos.
        ls_fieldcat-fieldname      =  'DOC_NO'.
        ls_fieldcat-seltext_l      =  text-013.
        ls_fieldcat-ddictxt        =  'L'.
        ls_fieldcat-outputlen      =   10.
        APPEND ls_fieldcat TO i_fieldcat.
        CLEAR ls_fieldcat.
        pos = pos + 1.
        ls_fieldcat-col_pos        =   pos.
        ls_fieldcat-fieldname      =  'DOC_DATE'.
        ls_fieldcat-seltext_l      =  text-014.
        ls_fieldcat-ddictxt        =  'L'.
        ls_fieldcat-outputlen      =   10.
        APPEND ls_fieldcat TO i_fieldcat.
        CLEAR ls_fieldcat.
        pos = pos + 1.
        ls_fieldcat-col_pos        =   pos.
        ls_fieldcat-fieldname      =  'NET_AMOUNT'.
        ls_fieldcat-seltext_l      =  text-015.
        ls_fieldcat-ddictxt        =  'L'.
        ls_fieldcat-outputlen      =   15.
        ls_fieldcat-do_sum         =  'X'.
        ls_fieldcat-datatype       =  'QUAN'.
        APPEND ls_fieldcat TO i_fieldcat.
        CLEAR ls_fieldcat.
        pos = pos + 1.
      ENDIF.
    ENDFORM.
    And later i make the call like follows:
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
           EXPORTING
                i_buffer_active       = g_alv_buffer
                i_callback_program    = l_repid
               i_callback_top_of_page = 'TOP_OF_PAGE'
               i_callback_html_top_of_page = 'TOP_OF_PAGE'
                is_layout             = g_layout
                it_fieldcat           = i_fieldcat
                it_special_groups     = g_fieldgroups_tab[]
                it_sort               = g_sortfields_tab[]
                i_default             = c_n
                i_save                = c_a
                is_variant            = g_variant
                it_events             = g_events_tab[]
                it_event_exit         = g_event_exit_tab[]
                is_print              = g_print
                i_screen_start_column = g_screen_start_column
                i_screen_start_line   = g_screen_start_line
                i_screen_end_column   = g_screen_end_column
                i_screen_end_line     = g_screen_end_line
           TABLES
                t_outtab              = gt_output
           EXCEPTIONS
                program_error         = 1
                OTHERS                = 2.
    Does anybody knows what am I missing?
    Thanks! Elena

    hi ..
    Ensure Field catalog is Refreshed every time before it is buid.
    Code:
    <b>REFRESH i_fieldcat.</b>
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
    i_program_name = l_repid
    i_internal_tabname = 'GT_OUTPUT'
    i_inclname = l_repid
    i_bypassing_buffer = 'X'
    CHANGING
    ct_fieldcat = i_fieldcat.
    <b>Reward if Helpful.</b>

  • How to create functionality to ALV Grid?

    Hi All,
    My ALV code is running successfully,but I just wanna add few customer specific functionality and my own PF status.Can you suggest me something for this.
    Thanks and Regards.
    Rajarshi.

    Hi Rajarshi,
    If you are using REUSE_ALV_GRID_CONTROL, Here is how you add 
    custom functionality.
    1) In the fM REUSE_ALV_GRID_CONTROL pass the parameters
    i_callback_user_command        = 'USER_COMMAND'  i_callback_pf_status_set       = 'SET_PF_STATUS'.  This are form name.
    2) Create a form in your program as below.
    FORM set_pf_status USING rt_extab TYPE slis_t_extab.
      SET PF-STATUS 'PFSTAT1' EXCLUDING rt_extab.
    ENDFORM.                    "SET_PF_STATUS
    PFSTAT1 is a copy of the Pf-status STANDARD_FULSCREEN of the program SAPLKKBL (copy it using SE41).
    Once PFSTAT1 is created you can modify it just like any other PF status and add your own menu or command buttons.
    3) To handle the functioanlity create a form of name user_command in your program as below.
    FORM user_command USING r_ucomm LIKE sy-ucomm
                            rs_selfield TYPE slis_selfield.
    The field "R_UCOMM" will contain the current value of   *"SY-UCOMM"
    "RS_SELFIELD" will hold contents of the selected line
      CASE r_ucomm.
      ENDCASE.
    ENDFORM.                    "USER_COMMAND
    Hope this helps

  • Disable F4 function on ALV grid row

    Hello,
    I have an ALV and I need to disable the F4 OR cancel event ONF4 for a cell, BUT ONLY in the last row.
    Is it possible? I've searched a lot, but I didn't found anything that help me.
    Could you help me?
    Thanks,
    Kleber

    Hi ,
    You cannot cancel the event for only a particular cell but
    You can use the following Logic to get your requirement.
    in the Implementation of onF4 event.
    on_f4 for event onf4 of cl_gui_alv_grid
                   importing e_fieldname
                             es_row_no
                            " This Contains the row Number of Cell on which You clicked F4
                             er_event_data
                             et_bad_cells
                             e_display.
    " in Implementation
    method on_f4.
    if es_row_no-row_id  ne <last Row>.
    "write your logic here
    endif.
    endmethod.
    "You can get Last row from
    "Select Query use sy-dbcnt
    "or if you modified any records deleting,inserting
    "at that time You can use read <itab> index 1 transporting no fields. then use  sy-tfil
    Hope this is useful for you
    Regards,
    Raghava Channooru

  • Question reg. converting code from ALV list to ALV grid

    I created a report based on a code posted by an SDN user in ABAP forums. The code is below. Now I want to create the same functionality using ALV grid and not simple ALV list. Can you please tell me what modifications to be done to the below coding?
    Appreciate your help and input.
    Thanks a lot,
    Krishen
    ******************Code start*******************
    **Change required before executing the report..
    1)
    Create a GUI status for the program in SE41 by copying
    from the program SAPLKKBL and Status 'STANDARD'..
    and store the resulting in status 'TEST2'.
    2)
    I have used table name as ZTABLE..Change accordingly
    to your ztable name..
    **Endchange
    declarations.
    TABLES: ztable.
    TYPE-POOLS: slis.
    DATA: t_fieldcatalog TYPE slis_t_fieldcat_alv.
    DATA: s_fieldcatalog TYPE slis_fieldcat_alv.
    DATA: s_layout TYPE slis_layout_alv.
    DATA: BEGIN OF t_ztable OCCURS 0.
    INCLUDE STRUCTURE ztable.
    DATA: BOX TYPE c,
    END OF t_ztable.
    DATA: v_repid TYPE syrepid.
    selection screen
    SELECT-OPTIONS so_id for ztable-id.
    SELECT-OPTIONS so_date for ztable-date.
    start-of-selection.
    Get the data.
    SELECT * FROM ztable
    INTO TABLE t_ztable.
    where id in so_id
    and date in so_date.
    IF sy-subrc <> 0.
    MESSAGE s208(00) WITH 'No data found'.
    LEAVE LIST-PROCESSING.
    ENDIF.
    v_repid = sy-repid.
    Get the field catalog.
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
    i_program_name = v_repid
    i_structure_name = 'ZTABLE'
    CHANGING
    ct_fieldcat = t_fieldcatalog.
    Set the layout.
    s_layout-box_fieldname = 'BOX'.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
    i_callback_program = v_repid
    is_layout = s_layout
    i_callback_pf_status_set = 'SET_PF_STATUS'
    i_callback_user_command = 'USER_COMMAND'
    it_fieldcat = t_fieldcatalog[]
    TABLES
    t_outtab = t_ztable.
    FORM SET_PF_STATUS *
    --> EXTAB *
    FORM set_pf_status USING extab TYPE slis_t_extab.
    SET PF-STATUS 'TEST2'.
    ENDFORM.
    FORM user_command *
    --> UCOMM *
    --> SELFIELD *
    FORM user_command USING ucomm LIKE sy-ucomm
    selfield TYPE slis_selfield.
    Check the ucomm.
    IF ucomm = 'DELETE'.
    LOOP AT t_ztable WHERE box = 'X'.
    DELETE FROM ztable WHERE matnr = t_ztable-matnr.
    COMMIT WORK.
    DELETE t_ztable.
    ENDLOOP.
    ENDIF.
    selfield-refresh = 'X'.
    ENDFORM.
    **********Code ending**********************

    I believe that the only change would be to replace the work LIST with GRID in the function call.
    CALL FUNCTION 'REUSE_ALV_<b>GRID</b>_DISPLAY'
         EXPORTING
            i_callback_program = v_repid
            is_layout = s_layout
            i_callback_pf_status_set = 'SET_PF_STATUS'
            i_callback_user_command = 'USER_COMMAND'
            it_fieldcat = t_fieldcatalog[]
         TABLES
            t_outtab = t_ztable.
    The function module interface should be exactly the same.
    Regards,
    Rich Heilman

  • ALV grid total  or based on two key fields

    Hello experts,
    I have ALV grid with  vendor, g/l account and amount field.
    I want to have sum or total of each vendor, and if vendor having mutliple g/l accounts i want to have sum for each g/l account.
    ex:  vendor   g/l account    amount.
            10           aa                  100
            10           bb                  200
            11           cc                   300
    olp   :   10      aa   100
                10      bb   200
                11      cc   300
    ex2 :   vendor g/ account   amount
               10       aa                 100
                10       aa                200
                11        cc               300
    o/p       10   aa   300.
                11  cc    300.
    Could you please help me and any suggestions
    <<Text removed>>
    Thanks
    reddy.
    Edited by: Matt on Jul 27, 2011 9:21 AM

    Hello Reddy,
    Try using the sort functionality of ALV grid
        CALL METHOD grid1->set_table_for_first_display
          EXPORTING
            i_save                                           = 'A'
            is_layout                                      = lwa_layout
            it_toolbar_excluding                    = i_excl_func
            i_default                                      = c_x
          CHANGING
            it_outtab                                     = i_outtab[]
            it_fieldcatalog                             = i_fieldcat[]
            it_sort                                         = li_sort[]            "use this functionality as per your requirement
          EXCEPTIONS
            invalid_parameter_combination  = 1
            program_error                            = 2
            too_many_lines                          = 3
            OTHERS                                      = 4.
    Hope this may be helpful.
    Sharin

  • Excel-Export in ALV-Grid not available

    Hello,
    I have a strange problem with the Export-functionality within ALV Grid. The Export-options "Spreadsheet", "Word processing", "Local file" and "Send" are not available at all PC's. I don't know if this issue is related to  SAP Gui, Patches ...

    Thanks for info - I was original thinking of the "Expert mode" option in some Report Writer outputs... but that was a different issue...
    Is it user specific or PC specific?  If the former, you might like to look in table SALV_BS_ADMIN (which can be maintained via report SALV_BS_ADMIN_MAINTAIN) as this can impact what the user sees in some ALV options - we were having problems a few weeks ago on an ECC5 system in this area - Note 1080608 and others explain more.
    Jonathan

  • ALV Grid in Edit mode

    Dear all,
    I would like to do a refresh of the ALV GRID table display in event "handle_data_changed_finished".
    "refresh_table_display" is NOT working.
    I obviously need to go through PAI & PBO to refresh the table display.
    Is there something to syncronize the data?
    There must be an easy solution...
    bye
    Niko
    Niko Prindesis
    Itelligence AG

    Dear Andreas,
    thank you!
    If I call "SAPGUI_SET_FUNCTIONCODE" in "handle_data_changed_finished", I can trigger the PAI/PBO.
    So this solves my problem!
    But ...
    ... isn't there a solution without going through PAI/PBO???
    I want to stay in the ALVGrid control!
    bye
    Niko

  • F4 Help in ALV GRID class based

    hi
    you have any idea about how to invoke the F4 help in ALV GRID Class based program.,
    if u have any other related document or program using F4 function in ALV GRId please send to me for reference
    Thanks & Regards
    K.G

    hi for what kind of fields you need to give f4.
    are they std or custom...
    please let me know about the fields..
    try to check my logic which i gave in the below post..
    it will give f4 help to the fields(if thet are standard table fieldS)
    Message was edited by: Vijay Babu Dudla

Maybe you are looking for

  • How to add two list in one frame using REUSE_ALV_LIST_DISPLAY

    Hi, I want to display two list in single output by calling FM 'REUSE_ALV_LIST_DISPLAY' twice. I saw one topic posted by Arunava Das as 'ALV Problem' but didn't get the steps to do that. Here is his way of doing that "What I have done is gone for the

  • 4TB Drive not recognized on Z87-G41

    Hi folks, This is an Ubuntu box that hosts VMs and serves as a NAS. I'm trying to get it to recognize some 4TB WD Red NAS drives, and they only show up as 3TB, even in the BIOS! So I don't think this is OS-level. Specifics:   - Ubuntu 14.04   - Insta

  • Can't run itunes on Vista - Data Execution Prevention issue

    Have installed iTunes on vista successfully. When I try to launch, was prompted to re-install iTunes again... digged a bit and came across this Data Execution Prevention issue... Any idea how to solve this issue?

  • Updating Cs3 to ACR 5.7

    I am running windows Vista and want to update ACR to 5.7 I have downloaded the update following instructions for windows XP but this did not work. I have the 5.7 folder on my desktop, How do I get it into cs3 ? Easy to follow instuctions would be app

  • Moderator please help me regarding my BT vision ac...

    Hi, i am trying to order bt sport and am continously being told online that i do not have the correct package in order to recieve the channel, even though i have been a full paying customer of phone/broadband/vision for a long time! all i want to do