Refresh Normal ALV

Hi everybody,
I have done normal ALV report.I did not use any methods for displaying . now i want to refresh the normal ALV report. is there any command for refreshing the alv report....
thanks and regards,
varahagiri.

Um mean to say u want to auto-refesh ur ALV list? If it is then try this sample code...
REPORT z_alv_auto_refresh.
TYPE-POOLS: slis.                      " ALV Global Types
DATA :
  gt_user LIKE uinfo OCCURS 0 WITH HEADER LINE. " User info in SM04
START-OF-SELECTION.
  PERFORM f_read_data.
  PERFORM f_display_data.
      Form  F_LIRE_DATA
FORM f_read_data.
  REFRESH gt_user.
Get User's info
  CALL FUNCTION 'THUSRINFO'
       TABLES
            usr_tabl = gt_user.
Wait in a task
  PERFORM f_call_rfc_wait.
ENDFORM.                               " F_READ_DATA
     Form  F_DISPLAY_DATA
FORM f_display_data.
  DEFINE m_sort.
    add 1 to ls_sort-spos.
    ls_sort-fieldname = &1.
    append ls_sort to lt_sort.
  END-OF-DEFINITION.
  DEFINE m_event_exit.
    clear ls_event_exit.
    ls_event_exit-ucomm = &1.
    ls_event_exit-after = 'X'.
    append ls_event_exit to lt_event_exit.
  END-OF-DEFINITION.
  DATA :
    ls_layout     TYPE slis_layout_alv,
    lt_sort       TYPE slis_t_sortinfo_alv,
    ls_sort       TYPE slis_sortinfo_alv,
    lt_event_exit TYPE slis_t_event_exit,
    ls_event_exit TYPE slis_event_exit.
Build Sort Table
  m_sort 'ZEIT'.
Build Event Exit Table
  m_event_exit '&NTE'.                 " Refresh
  ls_layout-zebra = 'X'.
  ls_layout-colwidth_optimize = 'X'.
  CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
       EXPORTING
            i_callback_program      = sy-cprog
            i_callback_user_command = 'USER_COMMAND'
            is_layout               = ls_layout
            i_structure_name        = 'UINFO'
            it_sort                 = lt_sort
            it_event_exit           = lt_event_exit
       TABLES
            t_outtab                = gt_user.
ENDFORM.                               " F_DISPLAY_DATA
      FORM USER_COMMAND                                             **
FORM user_command USING i_ucomm     TYPE syucomm
                        is_selfield TYPE slis_selfield.     "#EC CALLED
  CASE i_ucomm.
    WHEN '&NTE'.
      PERFORM f_read_data.
      is_selfield-refresh = 'X'.
      SET USER-COMMAND '&OPT'.         " Optimize columns width
  ENDCASE.
ENDFORM.                               " USER_COMMAND
     Form  F_CALL_RFC_WAIT
FORM f_call_rfc_wait.
  DATA lv_mssg(80).                                         "#EC NEEDED
Wait in a task
  CALL FUNCTION 'RFC_PING_AND_WAIT' STARTING NEW TASK '001'
    PERFORMING f_task_end ON END OF TASK
    EXPORTING
      seconds               = 5        " Refresh time
      busy_waiting          = space
    EXCEPTIONS
      RESOURCE_FAILURE      = 1
      communication_failure = 2  MESSAGE lv_mssg
      system_failure        = 3  MESSAGE lv_mssg
      OTHERS                = 4.
ENDFORM.                               " F_CALL_RFC_WAIT
     Form  F_TASK_END
FORM f_task_end USING u_taskname.
  DATA lv_mssg(80).                                         "#EC NEEDED
Receiving task results
  RECEIVE RESULTS FROM FUNCTION 'RFC_PING_AND_WAIT'
    EXCEPTIONS
      RESOURCE_FAILURE      = 1
      communication_failure = 2  MESSAGE lv_mssg
      system_failure        = 3  MESSAGE lv_mssg
      OTHERS                = 4.
  CHECK sy-subrc EQ 0.
  SET USER-COMMAND '&NTE'.             " Refresh
ENDFORM.                               " F_TASK_END
If u want normal refresh based on clicking on a button then follow these steps:
1. Pass the subroutine name for event user_command to ALV list like:
  CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
       EXPORTING
            i_callback_program      = sy-cprog
            i_callback_user_command = 'USER_COMMAND'
            is_layout               = ls_layout
            i_structure_name        = 'UINFO'
            it_sort                 = lt_sort
            it_event_exit           = lt_event_exit
       TABLES
            t_outtab                = gt_user.
2. In the routine USER_COMMAND trap the fcode and set the refesh field.
      FORM USER_COMMAND                                             **
FORM user_command USING i_ucomm     TYPE syucomm
                        is_selfield TYPE slis_selfield.     "#EC CALLED
  CASE i_ucomm.
    WHEN 'ABCD'.
      is_selfield-refresh = 'X'.
  ENDCASE.
ENDFORM.                               " USER_COMMAND
3. Attach custom pf-status and there define a button with fcode
ABCD.
So that whenever u press this button user_command routine will get called and ALV list get refreshed.
Regards,
Joy.

Similar Messages

  • How to REFRESH Normal ALV..

    Hi Experts,
    I have Display normal ALV REPORT using 'REUSE_ALV_GRID_DISPLAY'.
    When Double Click on a Particular Field say EBELN I need to Modify the Text say TXZ01( In below Source Code I Cleared Text just for Example).
    Using u2018&IC1u2019 I modified in Internal Table, but it is not visible in the Screen.
    Can anyone Give Idea on This.
    TYPE-POOLS slis.
    DATA : it_ekpo TYPE STANDARD TABLE OF ekpo,
           it_fcat TYPE slis_t_fieldcat_alv.
    START-OF-SELECTION.
      SELECT * FROM ekpo INTO TABLE it_ekpo UP TO 10 ROWS.
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
        EXPORTING
          i_structure_name       = 'EKPO'
        CHANGING
          ct_fieldcat            = it_fcat
        EXCEPTIONS
          inconsistent_interface = 1
          program_error          = 2.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program      = sy-cprog
          i_callback_user_command = 'USER_COMMAND'
          it_fieldcat             = it_fcat
        TABLES
          t_outtab                = it_ekpo
        EXCEPTIONS
          program_error           = 1.
    *&      Form  USER_COMMAND
          text
         -->SLIS_SELFIELD  text
    FORM user_command USING command TYPE sy-ucomm
                            field   TYPE slis_selfield.
      FIELD-SYMBOLS <lfs_fcat>  TYPE ekpo.
      IF command EQ '&IC1'.
        IF  field-fieldname  EQ 'EBELN'.
          READ TABLE it_ekpo ASSIGNING <lfs_fcat> INDEX field-tabindex.
          IF sy-subrc EQ 0.
            CLEAR <lfs_fcat>-txz01.
          ENDIF.
          CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_REFRESH' .
        ENDIF.
      ENDIF.
    ENDFORM.            "USER_COMMAND
    Regards,
    Kumar

    Hi,
      Try like below:
    *& Form USER_COMMAND
    * text
    * -->SLIS_SELFIELD text
    FORM user_command USING command TYPE sy-ucomm
    field TYPE slis_selfield.
    FIELD-SYMBOLS <lfs_fcat> TYPE ekpo.
    IF command EQ '&IC1'.
    IF field-fieldname EQ 'EBELN'.
    READ TABLE it_ekpo ASSIGNING <lfs_fcat> INDEX field-tabindex.
    IF sy-subrc EQ 0.
    CLEAR <lfs_fcat>-txz01.
    ENDIF.
    ENDIF.
    ENDIF.
    field-refresh ' X'.                      <----Add this
    ENDFORM. "USER_COMMAND
    Regards,
    Himanshu

  • Refresh in alv report

    hi masters,
    i m working on alv report where i have to change the data. after changing the data i have to do the refresh for that i m using the method below
    wa_STBL-ROW = 'X'.
    wa_STBL-COL = 'X'.
    CALL METHOD grid_obj->refresh_table_display
        EXPORTING
             IS_STABLE      = wa_stbl
              I_SOFT_REFRESH = 'X '
    EXCEPTIONS
    finished = 1
    OTHERS = 2.
    but after executing this method its giving run time error saying that ' Access via 'NULL' object reference not possible.  You attempted to use a 'NULL' object reference (points to 'nothing') access a component (variable: "GRID_OBJ").'. can u plz help me where i m going wrong. and how to implement the refresh in alv report in details..
    thanks in advance.
    regards,
    vicky

    hi,
    when i clicked on refresh button it is going to pf-status after that as i shown in below code it goes to refresh_report. but in this 'form refresh_report'  it won't display the data. it goes into the infinite loop. within that form- endform. plz can u give me solution for this problem?
    set pf-status 'STANDARD_FULLSCREEN'.
      case sy-ucomm.
        when '&REFRESH'.
    perform refresh_report.
    endcase.
    form refresh_report .
      perform build_fieldcatlog.
      perform event_call.
      perform populate_event.
      perform data_retrieval.
      perform build_listheader using it_listheader.
      perform display_alv_report_fm.
    endform.                    " REFRESH_REPORT

  • ALV OO and refreshing the ALV grid

    Hi,
    i have some problems with my ALV 00 program.
    On screen 1 i have to fill in a material number.
    For that material i'm getting some data and show in screen 2 in a ALV grid.
    Via BACK-button i'm getting back to screen 1 and can fill in another material number.
    But the 2nd (and 3rd, etc) time i fill a material, the ALV grid data from material 1 is shown. Even if the internal table I_ALV where the data is, is changed.
    What should i do ?
    I have initialized the customer container and the grid, but that didn't solved the problem.
    regards,
    Hans

    Hi,
    Try clearing and refreshing the alv grid data table in screen 2.
    Check with this code. this code is working fine. If we go back and change the input, it is showing the output corresponding to the second input only.
    Have you use this method?
    <b> GR_ALVGRID->REFRESH_TABLE_DISPLAY</b>
    TYPE-POOLS : SLIS.
    * Tables                                                              *
    TABLES:
      VBRK,
      VBRP.
    * Parameters and select options OR SELECTION SCREEN
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    SELECT-OPTIONS:
                S_VBELN FOR VBRK-VBELN.
    SELECTION-SCREEN END OF BLOCK B1.
    * Internal Tables                                                     *
    * work areas
    DATA: BEGIN OF IT_VBRP OCCURS 0,
           VBELN LIKE VBRK-VBELN,
           POSNR LIKE VBRP-POSNR,
           UEPOS LIKE VBRP-UEPOS,
           FKIMG LIKE VBRP-FKIMG,
           NETWR LIKE VBRP-NETWR,
           MEINS LIKE VBRP-MEINS.
    DATA : END OF IT_VBRP.
    * Variables                                                           *
    DATA : GR_ALVGRID TYPE REF TO CL_GUI_ALV_GRID,
           GC_CUSTOM_CONTROL_NAME TYPE SCRFNAME VALUE 'CC_ALV',
           GR_CCONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER,
           GT_FIELDCAT TYPE LVC_T_FCAT,
           GS_LAYOUT TYPE LVC_S_LAYO,
           V_FLAG VALUE 'X'.
    * Start of Program                                                    *
    *       INITIALIZATION.                                               *
    INITIALIZATION.
      S_VBELN-LOW = 1.
      S_VBELN-HIGH = 1000000000.
      S_VBELN-OPTION = 'EQ'.
      S_VBELN-SIGN = 'I'.
      APPEND S_VBELN.
    *       SELECTION-SCREEN                                              *
    AT SELECTION-SCREEN.
      PERFORM VALIDATION.
    *       START-OF-SELECTION                                            *
    START-OF-SELECTION.
      PERFORM GET_DATA.
      CALL SCREEN 0100.
    *       END-OF-SELECTION                                              *
    END-OF-SELECTION.
    *       TOP-OF-PAGE                                                   *
    TOP-OF-PAGE.
    *       END-OF-PAGE                                                   *
    END-OF-PAGE.
    *       AT USER-COMMAND                                               *
    *&      Form  VALIDATION
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM VALIDATION .
      SELECT SINGLE VBELN
      FROM VBRK
      INTO VBRK-VBELN
      WHERE VBELN IN S_VBELN.
      IF SY-SUBRC <> 0.
        MESSAGE E000 WITH 'no billing documents found'.
      ENDIF.
    ENDFORM.                    " VALIDATION
    *&      Form  GET_DATA
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM GET_DATA .
      SELECT VBELN
             POSNR
             UEPOS
             FKIMG
             NETWR
             MEINS
      FROM VBRP
      INTO TABLE IT_VBRP
      WHERE VBELN IN S_VBELN.
    ENDFORM.                    " GET_DATA
    *&      Module  DISPLAY_ALV  OUTPUT
    *       text
    MODULE DISPLAY_ALV OUTPUT.
      IF V_FLAG = 'X'.
        PERFORM DISPLAY_ALV.
        PERFORM PREPARE_FIELD_CATALOG CHANGING GT_FIELDCAT.
        PERFORM PREPARE_LAYOUT CHANGING GS_LAYOUT.
       CALL METHOD GR_ALVGRID->SET_TABLE_FOR_FIRST_DISPLAY
            EXPORTING
    *      I_BUFFER_ACTIVE               =
    *      I_BYPASSING_BUFFER            =
    *      I_CONSISTENCY_CHECK           =
    *      I_STRUCTURE_NAME              = 'VBRP'
    *      IS_VARIANT                    =
    *      I_SAVE                        =
    *      I_DEFAULT                     = 'X'
              IS_LAYOUT                     = GS_LAYOUT
    *      IS_PRINT                      =
    *      IT_SPECIAL_GROUPS             =
    *      IT_TOOLBAR_EXCLUDING          =
    *      IT_HYPERLINK                  =
    *      IT_ALV_GRAPHICS               =
    *      IT_EXCEPT_QINFO               =
            CHANGING
              IT_OUTTAB                     = IT_VBRP[]
              IT_FIELDCATALOG               = GT_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.
          CALL METHOD GR_ALVGRID->SET_READY_FOR_INPUT
            EXPORTING
              I_READY_FOR_INPUT = 1.
        ELSE.
          <b>CALL METHOD GR_ALVGRID->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.</b>
        ENDIF.
        CLEAR V_FLAG.
      ENDIF.
    ENDMODULE.                 " DISPLAY_ALV  OUTPUT
    *&      Form  DISPLAY_ALV
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM DISPLAY_ALV .
      IF GR_ALVGRID IS INITIAL.
        CREATE OBJECT GR_ALVGRID
          EXPORTING
    *    I_SHELLSTYLE      = 0
    *    I_LIFETIME        =
            I_PARENT          = GR_CCONTAINER
    *    I_APPL_EVENTS     = space
    *    I_PARENTDBG       =
    *    I_APPLOGPARENT    =
    *    I_GRAPHICSPARENT  =
    *    I_NAME            =
          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.
      ENDIF.
    ENDFORM.                    " DISPLAY_ALV
    *&      Form  PREPARE_FIELD_CATALOG
    *       text
    *      <--P_GT_FIELDCAT  text
    FORM PREPARE_FIELD_CATALOG  CHANGING P_GT_FIELDCAT TYPE LVC_T_FCAT.
      DATA : LS_FCAT TYPE LVC_S_FCAT,
             L_POS TYPE I.
      L_POS = L_POS + 1.
      LS_FCAT-FIELDNAME = 'VBELN'.
      LS_FCAT-TABNAME = 'IT_VBRP'.
      LS_FCAT-COL_POS = L_POS.
      LS_FCAT-SCRTEXT_M = 'Billing Document'.
      LS_FCAT-OUTPUTLEN = '10'.
      APPEND LS_FCAT TO P_GT_FIELDCAT.
      CLEAR LS_FCAT.
      L_POS = L_POS + 1.
      LS_FCAT-FIELDNAME = 'POSNR'.
      LS_FCAT-TABNAME = 'IT_VBRP'.
      LS_FCAT-COL_POS = L_POS.
      LS_FCAT-SCRTEXT_M = 'Billing Item'.
      LS_FCAT-OUTPUTLEN = '6'.
      APPEND LS_FCAT TO P_GT_FIELDCAT.
      CLEAR LS_FCAT.
      L_POS = L_POS + 1.
      LS_FCAT-FIELDNAME = 'UEPOS'.
      LS_FCAT-TABNAME = 'IT_VBRP'.
      LS_FCAT-COL_POS = L_POS.
      LS_FCAT-SCRTEXT_M = 'Higher Level Item'.
      LS_FCAT-OUTPUTLEN = '6'.
      APPEND LS_FCAT TO P_GT_FIELDCAT.
      CLEAR LS_FCAT.
      L_POS = L_POS + 1.
      LS_FCAT-FIELDNAME = 'FKIMG'.
      LS_FCAT-TABNAME = 'IT_VBRP'.
      LS_FCAT-COL_POS = L_POS.
      LS_FCAT-SCRTEXT_M = 'Invoice Quantity'.
      LS_FCAT-OUTPUTLEN = '13'.
      APPEND LS_FCAT TO P_GT_FIELDCAT.
      CLEAR LS_FCAT.
      L_POS = L_POS + 1.
      LS_FCAT-FIELDNAME = 'NETWR'.
      LS_FCAT-TABNAME = 'IT_VBRP'.
      LS_FCAT-COL_POS = L_POS.
      LS_FCAT-SCRTEXT_M = 'Net Value'.
      LS_FCAT-OUTPUTLEN = '15'.
      APPEND LS_FCAT TO P_GT_FIELDCAT.
      CLEAR LS_FCAT.
      L_POS = L_POS + 1.
      LS_FCAT-FIELDNAME = 'MEINS'.
      LS_FCAT-TABNAME = 'IT_VBRP'.
      LS_FCAT-COL_POS = L_POS.
      LS_FCAT-SCRTEXT_M = 'Unit of Measure'.
      LS_FCAT-OUTPUTLEN = '3'.
      APPEND LS_FCAT TO P_GT_FIELDCAT.
      CLEAR LS_FCAT.
      L_POS = L_POS + 1.
    ENDFORM.                    " PREPARE_FIELD_CATALOG
    *&      Form  PREPARE_LAYOUT
    *       text
    *      <--P_GS_LAYOUT  text
    FORM PREPARE_LAYOUT  CHANGING P_GS_LAYOUT TYPE LVC_S_LAYO.
      P_GS_LAYOUT-ZEBRA = 'X'.
      P_GS_LAYOUT-GRID_TITLE = 'INVOICE DETAILS'.
      P_GS_LAYOUT-SMALLTITLE = 'X'.
      P_GS_LAYOUT-EDIT = 'X'.
    ENDFORM.                    " PREPARE_LAYOUT
    *&      Module  STATUS_0100  OUTPUT
    *       text
    MODULE STATUS_0100 OUTPUT.
      SET PF-STATUS 'CANCEL'.
    *  SET TITLEBAR 'xxx'.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    *&      Module  USER_COMMAND_0100  INPUT
    *       text
    MODULE USER_COMMAND_0100 INPUT.
      CASE SY-UCOMM.
        WHEN 'BACK'.
          LEAVE TO SCREEN 0.
        WHEN 'CANCEL'.
          LEAVE TO SCREEN 0.
        WHEN 'EXIT'.
          CALL TRANSACTION 'SE38'.
        WHEN 'CHANGE'.
          IF GR_ALVGRID->IS_READY_FOR_INPUT( ) = 0.
            CALL METHOD GR_ALVGRID->SET_READY_FOR_INPUT
              EXPORTING
                I_READY_FOR_INPUT = 1.
          ELSE.
            CALL METHOD GR_ALVGRID->SET_READY_FOR_INPUT
              EXPORTING
                I_READY_FOR_INPUT = 0.
          ENDIF.
      ENDCASE.
    Regards,
    Aswin

  • How to refresh the ALV Tree

    Hi,
    I have an ALV Tree report developed using the OOPS. In my ALV Tree output, I have some buttons which will update the database after clicking. The data is correctly updating in the database. But, it is not getting updated in the ALV Tree display. That means, it is not REFRESHing the ALV Tree display. We have to again execute the program in order to see the updated output.
    Could anyone please suggest me how to Refresh the ALV Tree display..?
    We can't use the method 'REFRESH_TABLE_DISPLAY' as it is a PRIVATE method is the class CL_GUI_ALV_TREE.
    Please share your valuable thoughts.
    Thanks & Regards,
    Paddu.

    Hi paddu.
    please check out the link mentioned below,this will help u.
    How to Refresh data on ALV tree
    Regards
    Theres

  • How to create field catalog using field-symbols in normal alv report?

    hi all,
    how to create field catalog using field-symbols in normal alv report? i.e, using function modules...reuse_alv_list_display/grid_display?
    regards,
    jack

    HI
    LIKE THIS
    TYPE-POOLS : slis.
    DATA : t_fieldcat TYPE slis_t_fieldcat_alv,
           st_fieldcat TYPE slis_fieldcat_alv.
    st_fieldcat-fieldname     = 'STATUS'.
      st_fieldcat-seltext_l     = 'STATUS INDICATOR'.
      st_fieldcat-outputlen     = 17.
      APPEND st_fieldcat TO t_fieldcat.
      CLEAR st_fieldcat.
      st_fieldcat-fieldname     = 'VBELN'.
      st_fieldcat-do_sum        = ' '.
      st_fieldcat-seltext_l     = 'Sales Document No.'.
      st_fieldcat-outputlen     = 10.
      APPEND st_fieldcat TO t_fieldcat.
      CLEAR st_fieldcat.
      st_fieldcat-fieldname     = 'AUDAT'.
      st_fieldcat-do_sum        = ' '.
      st_fieldcat-seltext_l     = 'Document Date'.
      st_fieldcat-outputlen     = 10.
      APPEND st_fieldcat TO t_fieldcat.
      CLEAR st_fieldcat.
      st_fieldcat-fieldname     = 'VBTYP'.
      st_fieldcat-do_sum        = ' '.
      st_fieldcat-seltext_l     = 'Document Type'.
      st_fieldcat-outputlen     = 4.
      APPEND st_fieldcat TO t_fieldcat.
      CLEAR st_fieldcat.
      st_fieldcat-fieldname     = 'AUART'.
      st_fieldcat-do_sum        = ' '.
      st_fieldcat-seltext_l     = 'Category'.
      st_fieldcat-outputlen     = 1.
      APPEND st_fieldcat TO t_fieldcat.
      CLEAR st_fieldcat.
      st_fieldcat-fieldname     = 'AUGRU'.
      st_fieldcat-do_sum        = ' '.
      st_fieldcat-seltext_l     = 'Reason'.
      st_fieldcat-outputlen     = 3.
      APPEND st_fieldcat TO t_fieldcat.
      CLEAR st_fieldcat.
      st_fieldcat-fieldname     = 'NETWR'.
      st_fieldcat-do_sum        = 'X'.
      st_fieldcat-seltext_l     = 'Net Amount'.
      st_fieldcat-outputlen     = 15.
      APPEND st_fieldcat TO t_fieldcat.
      CLEAR st_fieldcat.
      st_fieldcat-fieldname     = 'WAERK'.
      st_fieldcat-do_sum        = ' '.
      st_fieldcat-seltext_l     = 'Unit'.
      st_fieldcat-outputlen     = 5.
      APPEND st_fieldcat TO t_fieldcat.
      CLEAR st_fieldcat.
    *sortinfo
      st_sort-fieldname = 'AUART'.
      st_sort-up        = 'X'.
      st_sort-subtot    = 'X'.
      APPEND st_sort TO t_sort.
      CLEAR st_sort.
      st_sort-fieldname = 'VBTYP'.
      st_sort-up        = 'X'.
      st_sort-subtot    = ' '.
      APPEND st_sort TO t_sort.
      CLEAR st_sort.
      st_sort-fieldname = 'WAERK'.
      st_sort-up        = 'X'.
      st_sort-subtot    = 'X'.
      APPEND st_sort TO t_sort.
      CLEAR st_sort.
      st_sort-fieldname = 'VBELN'.
      st_sort-up        = ' '.
      st_sort-subtot    = 'X'.
      APPEND st_sort TO t_sort.
      CLEAR st_sort.
    CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
       EXPORTING
         i_list_type     = 0
       IMPORTING
         et_events       = it_eventcat
       EXCEPTIONS
         list_type_wrong = 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.
      IF grid = 'X'.
        CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
         I_INTERFACE_CHECK                 = ' '
         I_BYPASSING_BUFFER                = ' '
         I_BUFFER_ACTIVE                   = ' '
          i_callback_program                = g_program
          I_CALLBACK_PF_STATUS_SET          = 'SET_PF_STATUS'
         I_CALLBACK_USER_COMMAND           = ' '
          I_CALLBACK_TOP_OF_PAGE            = 'TOP_OF_PAGE'
         I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
         I_CALLBACK_HTML_END_OF_LIST       = ' '
         I_STRUCTURE_NAME                  =
         I_BACKGROUND_ID                   = ' '
         I_GRID_TITLE                      =
         I_GRID_SETTINGS                   =
         IS_LAYOUT                         =
           it_fieldcat                       = t_fieldcat
         IT_EXCLUDING                      =
         IT_SPECIAL_GROUPS                 =
          it_sort                           = t_sort
         IT_FILTER                         =
         IS_SEL_HIDE                       =
         I_DEFAULT                         = 'X'
         I_SAVE                            = ' '
         IS_VARIANT                        =
         IT_EVENTS                         =
         IT_EVENT_EXIT                     =
         IS_PRINT                          =
         IS_REPREP_ID                      =
         I_SCREEN_START_COLUMN             = 0
         I_SCREEN_START_LINE               = 0
         I_SCREEN_END_COLUMN               = 0
         I_SCREEN_END_LINE                 = 0
         I_HTML_HEIGHT_TOP                 = 0
         I_HTML_HEIGHT_END                 = 0
         IT_ALV_GRAPHICS                   =
         IT_HYPERLINK                      =
         IT_ADD_FIELDCAT                   =
         IT_EXCEPT_QINFO                   =
         IR_SALV_FULLSCREEN_ADAPTER        =
       IMPORTING
         E_EXIT_CAUSED_BY_CALLER           =
         ES_EXIT_CAUSED_BY_USER            =
          TABLES
            t_outtab                          = it_final
          EXCEPTIONS
            program_error                     = 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.
    REWARD IF USEFULL

  • How to refresh the ALV Control

    Hi Experts,
    I have a selection screen and ALV control in webdydnpro report. If i enter valid input values in the selection screen the ALV contol is diplaying datas correctly but when i enter invalid data in the selection screen the ALV table control values still diplaying in the previous datas. I need to Refresh the ALV contol values once the incorrect data enter in the selection screen. How can i REFRESH the ALV control in Webdynpro report. I have Refreh button in the Selection screen when you press REFRESH button the ALV table control data should be initilize  Kindly help me out this issue.
    Thanks ,
    Kumar

    Hi.
    You have a selection screen where user can enter some data, with this data you
    perform a selection and then you bind the result to the ALV, right?
    Question is how you bind the result to ALV? Do you use external context mapping
    or the set_data method ?
    So I guess you have a method where you validate the select options and if they
    are correct you perform the selction and bind the result to the node for the ALV. If
    the select options are incorrect you just need to get the node for the ALV (which contains the
    previous result )and call the invalidate method on that node which deletes all
    elements of this node and after that the ALV should be empty again.

  • Normal ALVs vrs ALV OOPs

    I am using ALV OOPs. In ALV OOPs Appl tool bar is working by default when we create PF-STATUS. But in case of normal ALVs we need to write code for SY-UCOMM in PAI. why this happens, can anybody give tips. 
    Regards,
    Naseer.

    Hi Naseer,
    In Normal ALV we use Function mnodule and in OOPs we use classes and methods.
    In Normal ALV we cannot place grids on screens but in OOALV we can place grids on screens.
    we can insert logos in OOPS ALV.
    see the code below
    for displaying LOGO in ALV GRID CONTROL, we work with
    Predefined global class. CL_GUI_ALV_TREE_SIMPLE. FOR
    displaying LOGO. AND we use CL_GUI_CUSTOM_CONTAINTER for
    identifies the location where we r goinh to display.
    DECLARATIONS;
    TYPE-POOLS: SDYDO, SLIS.
    DATA: L_LOGO TYPE SDYDO_VALUE,” FOR DISPLAYING LOGO
    L_LIST TYPE SLIS_T_LISTHEADER. ” FOR LIST HEADING
    DATA: LOGO TYPE SCRFNAME VALUE ‘SLOGO’,
    CONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER,
    LOGO1 TYPE REF TO CL_GUI_ALV_TREE_SIMPLE.
    CREATE INSTANCE FOR ABOVE DEFINED CLASSES IN PBO EVENT
    OF SCREEN FLOW LOGIC.
    IF CONTAINER IS INITIAL.
    CREATE OBJECT CONTAINER EXPORTING CONTAINER_NAME =
    LOGO.
    CREATE OBJECT LOGO1 EXPORTING I_PARENT = CONTAINER.
    NOW CALL THE METHOD FOR DISPLAYING LOGO IN GRID CONTROL
    CALL METHOD LOGO->‘CREATE_REPORT_HEADER’
    EXPORTING
    I_LIST_COMMENTARY = L_LIST
    I_LOGO = ’ ’ ” HERE PASS WHERE LOGO EXISTING.
    THE ABOVE METHOD EXISTING
    Please reward points if helpful..
    Cheers,
    Chaitanya.

  • Maximum Number of Columns in OOPs ALV / Normal ALV Grid

    Hi Experts ,
    We got Stuck in Displaying the 150 Columns in the ALV Display .
    Need to Confirm how many Columns can be displayed in ALV - 60/90/99/1023  Or 1023 characters in ALv Display
    1. How It can be achieved to display 150 Columns in ALV .
    2. By Which way it should be More Efficient Using OOPs ALV or Normal ALV Grid.
    We had check almost all the forums Post but didnt get any satisfactory answer for the same .
    Thanks in advance
    Regards,
    Saurabh Goel

    Hello,
    If you are preparing your field catalog by using the function module REUSE_ALV_FIELDCAT_MERGE, then you can display a
    maximum of something around 70 to 82 fields.
    But if you are creating your field catalog manually, then you can display N number of columns in ALV grid.
    Check the point of fieldcat preparation.
    Hope this helps
    Cheers!
    Mishra

  • Normal ALV grid

    Hello,
          I am editing a field in alv grid but I am not able to save.
                I am using normal ALV and not OOALV.
         I am able to get the row which I am edit but how do i get modified cell.

    Hi try to get the concept from the below code snippet. keep a checkbox in your final itab that you want to show using ALV.then mark the checkbox for the line you want to edit a field.
    WHEN '&ZXZ'.
          CLEAR l_cntr.
          CLEAR WA_final.
          LOOP AT IT_final INTO WA_final.
            IF WA_final-chk = 'X'.
              l_cntr = l_cntr + 1.
            ENDIF.
          ENDLOOP.
          IF l_cntr GT 1.
            MESSAGE i011.
          ELSEIF l_cntr = 1.
            READ TABLE IT_final INTO WA_final WITH KEY chk = 'X'.
            CALL FUNCTION 'POPUP_TO_GET_VALUE'
              EXPORTING
               fieldname                 = 'MENGE'
                tabname                  = 'EKPO'
                titel                    = 'PO Quan.'
                valuein                  = WA_final-menge
              IMPORTING
    *           ANSWER                    =
               valueout                  = l_out_string
             EXCEPTIONS
               fieldname_not_found       = 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.
            CATCH SYSTEM-EXCEPTIONS conversion_errors = 1.
              l_out_final = l_out_string.
            ENDCATCH.
            IF sy-subrc = 1.
              MESSAGE i012 DISPLAY LIKE 'E'.
            ELSE.
              WA_final-menge = l_out_final.
              MODIFY IT_final FROM WA_final TRANSPORTING menge
              WHERE chk = 'X'.
              CLEAR WA_final.
              PERFORM disp_alv.
            ENDIF.
          ELSE.
            MESSAGE i010.
          ENDIF.
    I have kept this code snippet for the subroutine used corresponding to the pf-status.
    Regards.
    Sarbajit

  • Can i make a normal alv report web eabled if so please guide me

    can i make a normal alv report web eabled if so please guide me

    i m getting the error as below
    Business Server Page (BSP) error
    What happened?
    Calling the BSP page was terminated due to an error.
    SAP Note
    The following error text was processed in the system:
    Die URL enthält keine vollständige Domainangabe (ecc01 statt ecc01.).
    Exception Class
    CX_FQDN
    Error Name
    Program
    CX_FQDN=======================CP
    Include
    CX_FQDN=======================CM002
    ABAP Class
    CX_FQDN
    Analyze
    CHECK
    Line
    10
    Long text
    Error type: Exception
    Your SAP Business Server Pages Team

  • Icons in normal alv

    Hai
    can any one give me example of normal interactive alv ..
    report.
    I hav one alv rep having 5 secondary lists.
    1) i need to print this report via diff. options unconverted, richtext format, spreadsheet, html format
    2)i wnt icons such as firstpage, prev, nxt, last page icons on toolbar.
    3)back arrow, uparrow, close arrows as well.
    How to do this...plz tell me
    wt is the procedure..>> guide me in detail

    Hi
    just check this.
    this is how you call the basic list.
      g_repid = sy-repid.
      REFRESH : gt_events.
    basic list ALV Call
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program          = g_repid
          i_callback_pf_status_set    = 'FRM_PF_STATUS'      "set PF Status
          i_callback_user_command     = 'FRM_USER_COMMAND'   "secondary list
          i_callback_html_top_of_page = c_html_top_of_page
          it_fieldcat                 = gt_fieldcat
          i_html_height_top           = 13
        TABLES
          t_outtab                    = gt_isrlog1          "Basic list data
        EXCEPTIONS
          program_error               = 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.
    This is ur secondary list.
    *&      Form  FRM_USER_COMMAND
          User command
    FORM frm_user_command  USING p_ucomm LIKE sy-ucomm
                               rs_selfield TYPE slis_selfield.
      CLEAR gt_isrlog1.
      READ TABLE gt_isrlog1 INDEX rs_selfield-tabindex.
      CASE p_ucomm.
        WHEN '&IC1'.
    Build Secondary list
          PERFORM build_secondary_list.
      ENDCASE.
    ENDFORM.                  "FRM_USER_COMMAND
    There are so many standard ALV programs for you ref. just go to SE38 and give BCAL* and do a F4 you will get list of all the ALV's.
    Regards,
    Lakshmikanth.

  • Unable to display Refreshed editable alv

    hi
    I have developed editable alv which contains 7 colums. the final column is the addition of 4th n 5th cplumn. when i refresh after changing the values, the final column is not changing. but while debugging the changed values are reflected in internal table but its reflected in alv.
    help me out

    in the user_comand form you have to put rs_selfield-refresh = 'X'.
    like this:
    *& Form user_comand
    FORM user_command USING r_ucomm LIKE sy-ucomm
    rs_selfield TYPE slis_selfield.
    rs_selfield-refresh = 'X'.

  • Three normal alv output in a single screen

    Hi,
         SAP ABAP EXPERT,
                    i want to add 3 normal output of alv in a single screen without using any container can it be possible?
    suggest me suitable method for that ASAP.
    thanx n regards
    pankaj

    Hi Dear,
    yes it is possible.
    See at what respect u want to display three ALv ouput that i donot know.
    But suppose in ur ALV 10 fields are there and whenever the 1st field data will differ it should show as another Block and so on like Page -break it is possible .
    For this just use sort
    and give *
    Another way Class using Container
    then Block List
    Thanks
    Arbind Prasad.

  • Regarding  normal  ALVs

    Hi friends,
    I have developed a report in alv .it's working .
    1) when I tried to add some additional flds it's not working properly
    here iam giving my codig.I addeded matkl,arktx. it's giving wrong data of these 2flds.
    can any body help me to get this.
    2)
    when i tried to change from grid list to normal list it's working
    after addition of fields it's not work out. plz let me know the solution.
    Thanks in advance
    REPORT  Z_ALV.
    TABLES: vbak,vbap.
    select-options:s_vbeln for vbak-vbeln.
    TYPE-POOLS: slis. "ALV Declarations
    *Data Declaration
    TYPES: BEGIN OF t_final,
    vbeln LIKE vbak-vbeln,
    erdat LIKE vbak-erdat,
    matnr LIKE vbap-matnr,
    posnr LIKE vbap-posnr,
    matkl LIKE vbap-matkl,
    arktx LIKE vbap-arktx,
    END OF t_final.
    DATA: i_final TYPE STANDARD TABLE OF t_final initial size 0,
            wa_final TYPE t_final.
    *ALV data declarations
    DATA: fieldcatalog TYPE slis_t_fieldcat_alv,
          wa_fieldcatalog type slis_fieldcat_alv,
    *gd_tab_group TYPE slis_t_sp_group_alv,
    gd_layout TYPE slis_layout_alv,
    gd_repid LIKE sy-repid.
    *Start-of-selection.
    START-OF-SELECTION.
    PERFORM data_retrieval.
    PERFORM build_fieldcatalog.
    PERFORM build_layout.
    PERFORM display_alv_report.
    *& Form BUILD_FIELDCATALOG
    *• Build Fieldcatalog for ALV Report
    FORM build_fieldcatalog.
    wa_fieldcatalog-fieldname = 'VBELN'.
    wa_fieldcatalog-seltext_m = 'sales order'.
    wa_fieldcatalog-col_pos = 0.
    APPEND wa_fieldcatalog TO fieldcatalog.
    CLEAR wa_fieldcatalog.
    wa_fieldcatalog-fieldname = 'ERDAT'.
    wa_fieldcatalog-seltext_m = 'date'.
    wa_fieldcatalog-col_pos = 1.
    APPEND wa_fieldcatalog TO fieldcatalog.
    CLEAR wa_fieldcatalog.
    wa_fieldcatalog-fieldname = 'MATNR'.
    wa_fieldcatalog-seltext_m = 'material no.'.
    wa_fieldcatalog-col_pos = 2.
    APPEND wa_fieldcatalog TO fieldcatalog.
    CLEAR wa_fieldcatalog.
    wa_fieldcatalog-fieldname = 'POSNR'.
    wa_fieldcatalog-seltext_m = 'line item no.'.
    wa_fieldcatalog-col_pos = 3.
    APPEND wa_fieldcatalog TO fieldcatalog.
    CLEAR wa_fieldcatalog.
    wa_fieldcatalog-fieldname = 'matkl'.
    wa_fieldcatalog-seltext_m = 'mat grp.'.
    wa_fieldcatalog-col_pos = 4.
    APPEND wa_fieldcatalog TO fieldcatalog.
    CLEAR wa_fieldcatalog.
    wa_fieldcatalog-fieldname = 'arktx'.
    wa_fieldcatalog-seltext_m = 'short txt'.
    wa_fieldcatalog-col_pos = 5.
    append wa_fieldcatalog TO fieldcatalog.
    CLEAR wa_fieldcatalog.
    ENDFORM. " BUILD_FIELDCATALOG
    *& Form BUILD_LAYOUT
    *• Build layout for ALV grid report
    FORM build_layout.
    *gd_layout-no_input = 'X'.
    *gd_layout-colwidth_optimize = 'X'.
    *gd_layout-totals_text = 'Totals'(201).
    **• gd_layout-totals_only = 'X'.
    **• gd_layout-f2code = 'DISP'. "Sets fcode for when double
    **• "click(press f2)
    gd_layout-zebra = 'X'.
    **• gd_layout-group_change_edit = 'X'.
    gd_layout-header_text = 'helllllo'.
    ENDFORM. " BUILD_LAYOUT
    *& Form DISPLAY_ALV_REPORT
    *• Display report using ALV grid
    FORM display_alv_report.
    gd_repid = sy-repid.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    i_callback_program = gd_repid
    *• i_callback_top_of_page = 'TOP-OF-PAGE' "see FORM
    i_callback_user_command = 'USER_COMMAND'
    *• i_grid_title = outtext
    is_layout = gd_layout
    it_fieldcat = fieldcatalog[]
    *• it_special_groups = gd_tabgroup
    *• IT_EVENTS = GT_XEVENTS
    i_save = 'X'
    *• is_variant = z_template
    TABLES
    t_outtab = i_final
    EXCEPTIONS
    program_error = 1
    OTHERS = 2.
    IF sy-subrc ne 0.
    message ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDFORM. " DISPLAY_ALV_REPORT
    *& Form DATA_RETRIEVAL
    *• Retrieve data form EKPO table and populate itab it_ekko
    FORM data_retrieval.
    SELECT avbeln aerdat bmatnr bposnr bmatkl barktx FROM vbak AS a
    INNER JOIN vbap AS b ON avbeln = bvbeln
    INTO TABLE i_final WHERE a~vbeln in s_vbeln.
    ENDFORM. " DATA_RETRIEVAL
    when i chabged from grid to list.
    I addeded some extra fields in my outputlist. with this it goes to runtime error.

    Hi,
    Please mention the field names in Upper Case.
    as in...
    * wa_fieldcatalog-fieldname = 'matkl'.
    wa_fieldcatalog-fieldname = 'MATKL'.
    wa_fieldcatalog-seltext_m = 'mat grp.'.
    wa_fieldcatalog-col_pos = 4.
    APPEND wa_fieldcatalog TO fieldcatalog.
    CLEAR wa_fieldcatalog.
    *wa_fieldcatalog-fieldname = 'arktx'.
    wa_fieldcatalog-fieldname = 'ARKTX'.
    wa_fieldcatalog-seltext_m = 'short txt'.
    wa_fieldcatalog-col_pos = 5.
    append wa_fieldcatalog TO fieldcatalog.
    CLEAR wa_fieldcatalog.
    Reward points inorder to say thanks and encourage us,
    Kiran

Maybe you are looking for