ALV Reuse_alv_grid_display

Hi ,
I am running a small report.
Now i enter some values on the selection screen.
And the results i am able to display in an ALV using the FM Reuse_alv_grid_display.
I am trying to have a Push Button & i have added the following code in my program.
REPORT  Z_TABLE_UPLOAD.
SET PF-STATUS 'XYZ'.
LL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
      EXPORTING
        I_CALLBACK_PROGRAM       = SY-REPID
        IT_FIELDCAT              = WA_FIELD
        I_GRID_TITLE             = 'ZTDA DETAILS'
        I_CALLBACK_PF_STATUS_SET = 'XYZ'
      TABLES
        T_OUTTAB                 = IT_ZTDA[]
      EXCEPTIONS
        PROGRAM_ERROR            = 1
        OTHERS                   = 2.
I have added a push button in  XYZ.
But i am not getting any push button in the application toolbar.
pls suggest.
regards,
Kevin.

Hi,
See this code snippet:
FORM alv_display.
  DATA: l_repid TYPE sy-repid.
  l_repid = sy-repid.
  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
   EXPORTING
     i_callback_program                = l_repid
     i_callback_pf_status_set          = 'SET_PF_STATUS'   "pass subroutine name not status name here
     i_callback_user_command           = 'USER_COMMAND'
     i_callback_top_of_page            = 'TOP_OF_PAGE'
     is_layout                         = wa_alv_layout
     it_fieldcat                       = it_alv_fieldcat[]
     it_sort                           = it_alv_sortinfo[]
     i_default                         = 'X'
     i_save                            = 'A'
     it_events                         = it_alv_events[]
    TABLES
      t_outtab                          = ft_alv_outtab[]
   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.
ENDFORM.
FORM set_pf_status USING ft_extab TYPE slis_t_extab.  "subroutine must have this signature
  SET PF-STATUS 'ALV_STATUS'.  "here you set your status
ENDFORM.                   
Regards
Marcin

Similar Messages

  • ** Filtering is not working correctly in ALV (REUSE_ALV_GRID_DISPLAY)

    Hi Friends,
    We have one Z report that output is displayed in ALV. We are using the standard FM 'REUSE_ALV_GRID_DISPLAY. 
    We have requirement to remove leading zeros for the field like Material Number (MATNR), Equipment Number (EQUNR) etc. We did the changes by applying the field catalog properties as below.
    lw_fieldcat-lzero = space.
    lw_fieldcat-no_zero = 'X'.
    After this, the MATNR and EQUNR is displayed correctly in the ALV. (Leading zeros are suppressed). But, when we do filter for these fields, in the filter window it displays all the values with leading zeros.
    1. We don't understand why it is showing in the Filter widow with all leading zeros. All it shows all the records instead of unique items.
    Later on, we removed the above fieldcat coding. Then, we have called the CONVERSION_EXIT routines (in the domain) for the fields to remove leading zeros.
    Now, the MATNR and EQUNR is displayed correctly (without leading zeros) in ALV. When we do filter, it is also doing filtering correctly. But, when we do filter which have EQUNR having long values (after zero suppression), it is not working correctly. i.e no items are displayed in the ALV.
    Not only for this items. If we filter character columns which have long text, it is not filtering correctly.
    2. It is not able to understand why the filtering is not working for long items. But in the standard report, the filtering is working correctly.
    We are using SAP ECC 6.0.
    Friends, can you clarify the about doubts. It is surprising for me.
    Kind regards,
    Jegathees P.
    Our customer is asked to remove the leading zeros for the numeric field

    Hi Clemens Li
    I agreed on your point. When we define the Internal table the type for element EQUNR & QUMNR , we are referring the SAP data element for EQUNR, QMNUM field.
    Our doubt is even though we refer the standard data element, in the ALV display, it shows with leading zeros and also it creates problems in the filtering and in the filter window all values instead of unique nos.
    Hi Abhii
    I have given below the fieldcat coding.
    Friends, can you kindly clarify the above said problems. Since we use SAP ECC 6.0 any notes or patches apply is required. ( this is the basic functionality in ALV, that is my doubt).
        wls_fieldcat-col_pos   = wpv_pos.
        wls_fieldcat-fieldname = wpv_champ.
        wls_fieldcat-tabname   = wlc_tabname.
      wls_fieldcat-seltext_s = wls_fieldcat-seltext_m
        wls_fieldcat-seltext_l = wpv_libelle.
        wls_fieldcat-ddictxt   = 'L'.
        wls_fieldcat-no_out    = wv_no_out.
        APPEND wls_fieldcat TO gt_fieldcat.
    Kind regards,
    Jegathees P.

  • Reg: ALV (REUSE_ALV_GRID_DISPLAY)

    Hi Experts,
    I need to know how to give drop down list in one of the field in my ALV.
    I found some posting in sdn, but that are related to OOPS concepts.
    But i am using REUSE function module.
    Can you please provide me the solution how to achecive drop down list in ALV using REUSE_ALV_GRID_DISPLAY.
    Thanks
    Vijay.R

    Hi Vijayendran,
       There is only oops method available to create drop down list in ALV.
    Go through the program below and modify your program accordingly.
    Only thing that you have to do is to create container for your alv and use this container for displaying drop down list.
    This program displays a dropdown list in one of the fields of the ALV.
    *& Report  Z_LISTBOX_ALV
    *& Program to display a dropdown list in ALV.
    REPORT  z_listbox_alv.
    TYPE-POOLS: slis.
    TYPES: BEGIN OF ty_rating,
             task(20) TYPE c,
             rating TYPE i,
             weightage(2) TYPE c,
             comments(40) TYPE c,
           END OF ty_rating.
    DATA: g_alvgrid TYPE REF TO cl_gui_alv_grid,
          g_alv_container TYPE REF TO cl_gui_custom_container,
          int_fieldcat TYPE lvc_t_fcat,
          ok_code TYPE sy-ucomm.
    DATA: int_outputdata TYPE TABLE OF ty_rating.
    INITIALIZATION.
    START-OF-SELECTION.
    * call new screen for displaying the oop alv
      CALL SCREEN 1100.
    * Double click on the screen, it takes you the screen painter (SE51). Create
    * Custom Container on the screen and name is as u2018CONTAINERu2019. Set the Ok-Code
    * the screen as u2018OK_CODEu2019. Also create a GUI status named 'STANDARD' and
    * in set Ok-code '&F03' for the back button.
    * The screen 1100 thus gets created to hold the grid ALV.
    * In the PBO of the screen, call the modules to set pf-status, title and
    * to display the ALV list.
    * In case we have an interactive ALV or for additional functionalities we can
    * create OK-CODES and based on the user command we do the coding in the PAI.
    *&      Module  STATUS_0600  OUTPUT
    *       set the PF status of the screen. Called in PBO of screen.
    MODULE status_0600 OUTPUT.
      SET PF-STATUS 'STANDARD'.
    ENDMODULE.                 " STATUS_0600  OUTPUT
    *&      Module  DISPLAY_ALV  OUTPUT
    *       Displays the alv list. Called in PBO of screen.
    MODULE display_alv OUTPUT.
    *  get the data.
      PERFORM retrieve_data.
    *  prepare fieldcatalog for displaying the alv
      PERFORM prepare_fieldcatalog.
    *  create a container to display the list
      CREATE OBJECT g_alv_container
        EXPORTING
          container_name = 'CONTAINER'.
    *  create a reference for the alv
      CREATE OBJECT g_alvgrid
        EXPORTING
          i_parent = g_alv_container.
    *  prepare a listbox for the rating column
      PERFORM fill_dropdown.
    *  call the method to display the list
      CALL METHOD g_alvgrid->set_table_for_first_display
        EXPORTING
          i_bypassing_buffer            = 'X'
          i_save                        = 'X'
        CHANGING
          it_outtab                     = int_outputdata
          it_fieldcatalog               = int_fieldcat
        EXCEPTIONS
          invalid_parameter_combination = 1
          program_error                 = 2
          too_many_lines                = 3
          others                        = 4
      IF sy-subrc <> 0.
       MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                  WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDMODULE.                    "DISPLAY_ALV OUTPUT
    *&      Form  PREPARE_FIELDCATALOG
    *       prepares fieldcatalog
    FORM prepare_fieldcatalog .
      DATA: lws_fieldcat TYPE lvc_s_fcat.
      CLEAR int_fieldcat.
      CLEAR lws_fieldcat.
      lws_fieldcat-col_pos   = 1.
      lws_fieldcat-fieldname = 'TASK'.
      lws_fieldcat-scrtext_m = 'TASK'.
      APPEND lws_fieldcat TO int_fieldcat.
      CLEAR lws_fieldcat.
      lws_fieldcat-col_pos   = 2.
      lws_fieldcat-fieldname = 'RATING'.
      lws_fieldcat-edit = 'X'.
      lws_fieldcat-scrtext_m = 'RATING'.
      lws_fieldcat-just = 'L'.
      lws_fieldcat-outputlen = '6'.
      lws_fieldcat-drdn_hndl = '1'.        "handle for listbox
      APPEND lws_fieldcat TO int_fieldcat.
      CLEAR lws_fieldcat.
      lws_fieldcat-col_pos   = 3.
      lws_fieldcat-fieldname = 'WEIGHTAGE'.
      lws_fieldcat-scrtext_m = 'WEIGHTAGE'.
      lws_fieldcat-outputlen = '9'.
      APPEND lws_fieldcat TO int_fieldcat.
      CLEAR lws_fieldcat.
      lws_fieldcat-col_pos   = 4.
      lws_fieldcat-fieldname = 'COMMENTS'.
      lws_fieldcat-scrtext_m = 'COMMENTS'.
      lws_fieldcat-edit = 'X'.
      APPEND lws_fieldcat TO int_fieldcat.
    ENDFORM.                    " PREPARE_FIELDCATALOG
    *&      Form  RETRIEVE_DATA
    *       retreives the data to be displayed
    FORM retrieve_data .
      DATA: lws_outputdata TYPE ty_rating.
      CLEAR int_outputdata.
      CLEAR lws_outputdata.
      lws_outputdata-task = 'proj. related'.
      lws_outputdata-weightage = '20'.
      APPEND lws_outputdata TO int_outputdata.
      CLEAR lws_outputdata.
      lws_outputdata-task = 'process. related'.
      lws_outputdata-weightage = '10'.
      APPEND lws_outputdata TO int_outputdata.
      CLEAR lws_outputdata.
      lws_outputdata-task = 'knowledge mgnt.'.
      lws_outputdata-weightage = '30'.
      APPEND lws_outputdata TO int_outputdata.
    ENDFORM.                    " RETRIEVE_DATA
    *&      Form  FILL_DROPDOWN
    *       prepares the listbox to be displayed and assigns it to the alv
    FORM fill_dropdown .
      DATA: lint_dropdown TYPE lvc_t_drop,
            lws_dropdown TYPE lvc_s_drop.
      CLEAR lint_dropdown.
      CLEAR lws_dropdown.
      lws_dropdown-handle = '1'.
      lws_dropdown-value = '5'.
      APPEND lws_dropdown TO lint_dropdown.
      CLEAR lws_dropdown.
      lws_dropdown-handle = '1'.
      lws_dropdown-value = '4'.
      APPEND lws_dropdown TO lint_dropdown.
      CLEAR lws_dropdown.
      lws_dropdown-handle = '1'.
      lws_dropdown-value = '3'.
      APPEND lws_dropdown TO lint_dropdown.
      CLEAR lws_dropdown.
      lws_dropdown-handle = '1'.
      lws_dropdown-value = '2'.
      APPEND lws_dropdown TO lint_dropdown.
      CLEAR lws_dropdown.
      lws_dropdown-handle = '1'.
      lws_dropdown-value = '1'.
      APPEND lws_dropdown TO lint_dropdown.
      CALL METHOD g_alvgrid->set_drop_down_table
        EXPORTING
          it_drop_down = lint_dropdown.
    ENDFORM.                    " FILL_DROPDOWN
    *&      Module  HANDLE_GOBACK  INPUT
    *       handles 'back' button. Called in PAI of the screen.
    MODULE handle_goback INPUT.
      IF ok_code EQ '&F03'.
        LEAVE PROGRAM.
      ENDIF.
    ENDMODULE.
    Get back to me for any clarification.
    Regards,
    Bhavesh

  • ALV REUSE_ALV_GRID_DISPLAY in new screen.

    Hello Friends,
    I have a small problem and would appreciate any input.
    I have an ALV grid, where I click a button and another ALV grid pops up.
    My problem is the GUI status. When I leave the screen of the second ALV, the first ALV shows the same GUI status. How do I get the first gui_status not to be changed when I return??
    best regards B

    REPORT  ZALV_SECONDSCREEN.
    DEFINE m_fieldcat.
      add 1 to ls_fieldcat-col_pos.
      ls_fieldcat-fieldname   = &1.
      ls_fieldcat-ref_tabname = &2.
      ls_fieldcat-cfieldname  = &3.
      ls_fieldcat-qfieldname  = &4.
      append ls_fieldcat to lt_fieldcat.
    END-OF-DEFINITION.
    TYPE-POOLS: slis.                      " ALV Global types
    TYPES:
      BEGIN OF ty_vbak,
        vkorg TYPE vbak-vkorg,             " Sales organization
        kunnr TYPE vbak-kunnr,             " Sold-to party
        vbeln TYPE vbak-vbeln,             " Sales document
        netwr TYPE vbak-netwr,             " Net Value of the Sales Order
        waerk TYPE vbak-waerk,             " Currency
      END OF ty_vbak,
      BEGIN OF ty_vbap,
        vbeln  TYPE vbap-vbeln,            " Sales document
        posnr  TYPE vbap-posnr,            " Sales document item
        matnr  TYPE vbap-matnr,            " Material number
        arktx  TYPE vbap-arktx,            " Short text for sales order item
        kwmeng TYPE vbap-kwmeng,           " Order quantity
        vrkme  TYPE vbap-vrkme,            " Quantity Unit
        netwr  TYPE vbap-netwr,            " Net value of the order item
        waerk  TYPE vbap-waerk,            " Currency
      END OF ty_vbap.
    DATA :
      gs_vbak TYPE ty_vbak,
    Data displayed in the first list
      gt_vbak TYPE TABLE OF ty_vbak,
    Data displayed in the second list
      gt_vbap TYPE TABLE OF ty_vbap.
    SELECT-OPTIONS :
      s_vkorg FOR gs_vbak-vkorg,           " Sales organization
      s_kunnr FOR gs_vbak-kunnr,           " Sold-to party
      s_vbeln FOR gs_vbak-vbeln.           " Sales document
    SELECTION-SCREEN :
      SKIP, BEGIN OF LINE,COMMENT 5(27) v_1 FOR FIELD p_max.    "#EC NEEDED
    PARAMETERS p_max(2) TYPE n DEFAULT '20' OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    INITIALIZATION.
      v_1 = 'Maximum of records to read'.
    START-OF-SELECTION.
      PERFORM f_read_data_vbak.
      PERFORM f_display_data_vbak.
         Form  f_read_data_vbak
    FORM f_read_data_vbak.
      SELECT vkorg kunnr vbeln netwr waerk
        INTO CORRESPONDING FIELDS OF TABLE gt_vbak
          UP TO p_max ROWS
        FROM vbak
       WHERE kunnr IN s_kunnr
         AND vbeln IN s_vbeln
         AND vkorg IN s_vkorg
         and vbtyp = 'C'.                  " C = Sales Orders.
    ENDFORM.                               " F_READ_DATA_VBAK
         Form  f_display_data_vbak
    FORM f_display_data_vbak.
      DATA:
        ls_fieldcat TYPE slis_fieldcat_alv,
        lt_fieldcat TYPE slis_t_fieldcat_alv.
    Build the field catalog
      m_fieldcat 'VKORG' 'VBAK' '' ''.
      m_fieldcat 'KUNNR' 'VBAK' '' ''.
      m_fieldcat 'VBELN' 'VBAK' ''  ''.
      m_fieldcat 'NETWR' 'VBAK' 'WAERK' ''.
      m_fieldcat 'WAERK' 'VBAK' ''  ''.
    Display the first list
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program      = sy-cprog
          i_callback_user_command = 'USER_COMMAND'
          it_fieldcat             = lt_fieldcat
        TABLES
          t_outtab                = gt_vbak.
    ENDFORM.                               " F_DISPLAY_DATA_VBAK
          FORM USER_COMMAND                                             *
    FORM user_command USING u_ucomm     TYPE syucomm
                            us_selfield TYPE slis_selfield.     "#EC CALLED
      CASE u_ucomm.
        WHEN '&IC1'.
          READ TABLE gt_vbak INDEX us_selfield-tabindex INTO gs_vbak.
          CHECK sy-subrc EQ 0.
          PERFORM f_read_data_vbap.        " Read data from VBAP
          PERFORM f_display_data_vbap.
      ENDCASE.
    ENDFORM.                               " USER_COMMAND
         Form  f_read_data_vbap
    FORM f_read_data_vbap.
      SELECT vbeln posnr matnr arktx kwmeng vrkme netwr waerk
        INTO CORRESPONDING FIELDS OF TABLE gt_vbap
        FROM vbap
       WHERE vbeln = gs_vbak-vbeln.
    ENDFORM.                               " F_READ_DATA_VBAP
         Form  f_display_data_vbap
    FORM f_display_data_vbap.
      DATA:
        ls_fieldcat TYPE slis_fieldcat_alv,
        lt_fieldcat TYPE slis_t_fieldcat_alv.
    Build the field catalog
      m_fieldcat 'VBELN'  'VBAP' '' ''.
      m_fieldcat 'POSNR'  'VBAP' '' ''.
      m_fieldcat 'MATNR'  'VBAP' '' ''.
      m_fieldcat 'ARKTX'  'VBAP' '' ''.
      m_fieldcat 'KWMENG' 'VBAP' '' 'VRKME'.
      m_fieldcat 'VRKME'  'VBAP' '' ''.
      m_fieldcat 'NETWR'  'VBAP' 'WAERK' ''.
      m_fieldcat 'WAERK'  'VBAP' '' ''.
    Display the second list
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          it_fieldcat = lt_fieldcat
        TABLES
          t_outtab    = gt_vbap.
    ENDFORM.                               " F_DISPLAY_DATA_VBAP

  • Total number lines, in an alv (REUSE_ALV_GRID_DISPLAY)

    Hi,
    i want to know, if it´s possible to show the total number of lines displayed in an alv. I´not not sure if that, is an event of the table gt_events[] (maybe the end_of_list one???)
    I would like to show this total, like an status message...
    Thanks in advance
    Carles

    report  ztest_alv1                              .
    type-pools: slis.
    data:
      ls_fieldcat type slis_fieldcat_alv,
      lt_fieldcat type slis_t_fieldcat_alv,
      lt_sort     type slis_t_sortinfo_alv,
      ls_sort     type slis_sortinfo_alv.
    data: v_line type i,
          lines(3) type c.
    DATA: GT_LIST_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER.
    data: it_events type slis_t_event,
          x_events type slis_alv_event.
    data: begin of itab occurs 0,
           vbeln like vbak-vbeln,
           posnr like vbap-posnr,
          end of itab.
    itab-vbeln  = '12345'.
    itab-posnr = '10'.
    append itab.
    clear itab.
    itab-vbeln = '12345'.
    itab-posnr = '11'.
    append itab.
    clear itab.
    itab-vbeln = '12345'.
    itab-posnr = '12'.
    append itab.
    clear itab.
    itab-vbeln = '12356'.
    itab-posnr = '10'.
    append itab.
    clear itab.
    itab-vbeln = '12356'.
    itab-posnr = '11'.
    append itab.
    clear itab.
    itab-vbeln = '12356'.
    itab-posnr = '12'.
    append itab.
    clear itab.
    describe table itab lines v_line.
    lines = v_line.
    PERFORM E04_COMMENT_BUILD  USING GT_LIST_TOP_OF_PAGE[].
    x_events-name = 'TOP_OF_PAGE'.
    x_events-form = 'TOP_OF_PAGE'.
    append x_events to it_events.
    call function 'REUSE_ALV_FIELDCATALOG_MERGE'
      exporting
        i_program_name         = sy-repid
        i_internal_tabname     = 'ITAB'
        i_inclname             = sy-repid
      changing
        ct_fieldcat            = lt_fieldcat
      exceptions
        inconsistent_interface = 1
        program_error          = 2
        others                 = 3.
    if sy-subrc <> 0.
      message id sy-msgid type sy-msgty number sy-msgno
              with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    endif.
    ls_sort-fieldname = 'VBELN'.
    ls_sort-up        = 'X'.
    *ls_sort-group = 'UL'.
    append ls_sort to lt_sort.
    clear ls_sort.
    ls_sort-fieldname = 'POSNR'.
    ls_sort-up        = 'X'.
    *ls_sort-group = '*'.
    append ls_sort to lt_sort.
    call function 'REUSE_ALV_GRID_DISPLAY'
      exporting
        it_fieldcat = lt_fieldcat
        it_sort     = lt_sort
        it_events   = it_events
      tables
        t_outtab    = itab.
    FORM E04_COMMENT_BUILD USING E04_LT_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER.
      DATA: LS_LINE TYPE SLIS_LISTHEADER.
      CLEAR LS_LINE.
      LS_LINE-TYP  = 'S'.
      LS_LINE-KEY  = 'NO of lines'.
      LS_LINE-INFO = lines.
      APPEND LS_LINE TO E04_LT_TOP_OF_PAGE.
    ENDFORM.
    * FORM TOP_OF_PAGE *
    form top_of_page.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
           EXPORTING
                I_LOGO             = 'ENJOYSAP_LOGO'
                IT_LIST_COMMENTARY = GT_LIST_TOP_OF_PAGE.
    endform.                    "top_of_page
    check this code..
    regards
    vijay

  • ALV tree in docking container

    i am trying to call a docking container (on hotspot click of ALV.-> Reuse_alv_grid_display).
    And a alv tree is to be displayed in docking container.
    I have wrote the entire code and there is no error is thrown by the system, but docking container displayed.
    I am posting entire code .Please let me know where i am mistaken.
    check r_ucomm eq '&IC1'."when user double click on any cell of ALV.
       CASE rs_selfield-SEL_TAB_FIELD.
         WHEN 'I_MKPF-WERKS'.
           perform create_dock.
           perform create_alv_tree.
    *           WHEN .
    *           WHEN OTHERS.
       ENDCASE.
    FORM CREATE_DOCK ."docking container is created
       check obj1 is initial.
       CREATE OBJECT OBJ1
         EXPORTING
    *    PARENT                      =
         REPID                       = sy-repid
         DYNNR                       = sy-dynnr
           SIDE                        = obj1->DOCK_AT_bottom
         EXTENSION                   = 500
         EXCEPTIONS
           CNTL_ERROR                  = 1
           CNTL_SYSTEM_ERROR           = 2
           CREATE_ERROR                = 3
           LIFETIME_ERROR              = 4
           LIFETIME_DYNPRO_DYNPRO_LINK = 5
           others                      = 6
       IF SY-SUBRC <> 0.
         MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
       ENDIF.
    ENDFORM.         
    FORM CREATE_ALV_TREE . "alv Tree
    create object tree
         exporting
             parent              = obj1
             node_selection_mode = cl_gui_column_tree=>node_sel_mode_single
             item_selection      = 'X'
             no_html_header      = 'X'
             no_toolbar          = ''
         exceptions
             cntl_error                   = 1
             cntl_system_error            = 2
             create_error                 = 3
             lifetime_error               = 4
             illegal_node_selection_mode  = 5
             failed                       = 6
             illegal_column_name          = 7.
       if sy-subrc <> 0.
         message x208(00) with 'ERROR'.                          "#EC NOTEXT
       endif.
       data l_hierarchy_header type treev_hhdr.
       perform build_hierarchy_header changing l_hierarchy_header.
       IF gt_fieldcatalog[] is   initial.
         perform buildfield_cat using 'TRNTYP' 'TRNTYP' .
         perform buildfield_cat using 'EXDAT' 'Excise Doc' .
         perform buildfield_cat using 'WERKS' 'Excise Doc' .
         perform buildfield_cat using 'EXNUM' 'Excise Doc' .
         perform buildfield_cat using 'EXYEAR' 'Excise Doc' .
         perform buildfield_cat using 'MATNR' 'Excise Doc' .
         perform buildfield_cat using 'RITEM1' 'Excise Doc' .
         perform buildfield_cat using 'RITEM2' 'Excise Doc' .
         perform buildfield_cat using 'MAKTX' 'Excise Doc' .
         perform buildfield_cat using 'REMOVAL' 'Excise Doc' .
         perform buildfield_cat using 'MEINS' 'Excise Doc' .
         perform buildfield_cat using 'EXBAS' 'Excise Doc' .
         perform buildfield_cat using 'EXBED' 'Excise Doc' .
       endif.
    call method tree->set_table_for_first_display
         EXPORTING
    *      i_structure_name    = 'SFLIGHT'
           is_hierarchy_header = l_hierarchy_header
         CHANGING
           it_outtab           = t_J_1IEXCDTL[] "table must be empty !
           it_fieldcatalog     = gt_fieldcatalog.
    perform create_hierarchy.
    call method tree->frontend_update.
    FORM CREATE_HIERARCHY .
    sort IJ_1IEXCDTL by chapid matnr.
       LOOP AT IJ_1IEXCDTL into WJ_1IEXCDTL.
         on change of WJ_1IEXCDTL-chapid.
           perform add_carrid_line using    WJ_1IEXCDTL
                                        changing l_carrid_key.
         endon.
         on change of WJ_1IEXCDTL-matnr.
           perform add_complete_line using  WJ_1IEXCDTL"last complete line.
                                            l_carrid_key
                                   changing l_last_key.
         endon.
       ENDLOOP.
    endform.
    form add_carrid_line using     WJ_1IEXCDTL1 type J_1IEXCDTL
                                    p_relat_key type lvc_nkey
                          changing  p_node_key type lvc_nkey.
       data: l_node_text type lvc_value.
       l_node_text =   WJ_1IEXCDTL1-chapid.
       call method tree->add_node
         EXPORTING
           i_relat_node_key = p_relat_key
           i_relationship   = cl_gui_column_tree=>relat_last_child
           i_node_text      = l_node_text
           is_outtab_line   = WJ_1IEXCDTL
         IMPORTING
           e_new_node_key   = p_node_key.
    endform.                    "add_carrid_line
    form add_complete_line using   WJ_1IEXCDTL2 type J_1IEXCDTL
                                  p_relat_key type lvc_nkey
                        changing  p_node_key type lvc_nkey.
       data: l_node_text type lvc_value.
       write WJ_1IEXCDTL2-matnr to l_node_text .
       call method tree->add_node
         EXPORTING
           i_relat_node_key = p_relat_key
           i_relationship   = cl_gui_column_tree=>relat_last_child
           is_outtab_line   = WJ_1IEXCDTL2
           i_node_text      = l_node_text
         IMPORTING
           e_new_node_key   = p_node_key.
    endform.                    "add_complete_line

    This is the ALV and i want docking container containing alv tree to be displayed with the details of this alv
    at bottom of screen.

  • Header in alv pop up

    Hello,
    i need to dislay header as well as item details in an alv pop up. I am using FM REUSE_ALV_POPUP_TO_SELECT. but I am not able to get the header information. I am able to get the item details for a particular Purchase order number. I need to display purchase order number in the header of alv POPUP.
    how can i achieve this using the same FM?

    hi
    hope this wil help to u
    ...tables vbak.
    data it_vbak like vbak occurs 0 with header line.
    selection-screen begin of block b1 with frame.
    parameters: alv1 radiobutton group alv, "REUSE_ALV_LIST_DISPLAY
    alv2 radiobutton group alv, "REUSE_ALV_POPUP_TO_SELECT
    alv3 radiobutton group alv, "REUSE_ALV_GRID_DISPLAY
    alv4 radiobutton group alv. " NORMAL DISPLAY
    selection-screen end of block b1.
    select * from vbak
    into corresponding fields of table it_vbak
    up to 10 rows.
    if alv1 = 'X'. perform alv_func1.
    elseif alv2 = 'X'. perform alv_func2.
    elseif alv3 = 'X'. perform alv_func3.
    elseif alv4 = 'X'. perform norm.
    endif.
    **& Form ALV_FUNC1
    *form alv_func1 .
    call function 'REUSE_ALV_LIST_DISPLAY'
    exporting
    i_structure_name = 'VBAK'
    tables
    t_outtab = it_vbak
    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.
    endform. " ALV_FUNC1
    **& Form ALV_FUNC2
    *form alv_func2 .
    call function 'REUSE_ALV_POPUP_TO_SELECT'
    exporting
    i_title = 'SALES ORDER INFO'
    i_zebra = 'X'
    i_tabname = 1
    i_structure_name = 'vbak'
    tables
    t_outtab = it_vbak
    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.
    endform. " ALV_FUNC2
    **& Form ALV_FUNC3
    *form alv_func3 .
    call function 'REUSE_ALV_GRID_DISPLAY'
    exporting
    i_structure_name = 'vbak'
    i_grid_title = 'SALES ORDER INFO'
    tables
    t_outtab = it_vbak
    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.
    endform. " ALV_FUNC3
    **& Form NORM
    *form norm .
    format intensified.
    skip 1.
    write: /'SALES DOC.',
    ' Created on ',
    ' Time',
    ' Created by',
    ' Valid from ',
    ' Sold-to party'.
    format intensified off. skip 2.
    loop at it_vbak.
    write: / it_vbak-vbeln,
    it_vbak-erdat,
    it_vbak-erzet,
    it_vbak-ernam,
    it_vbak-angdt,
    it_vbak-kunnr.
    endloop.
    endform. " NORM 
    Edited by: Nawanandana Edirisinghe on Sep 3, 2009 12:52 PM

  • Classical to ALV classical

    Hi All,
    Please help in converting classical report to classical ALV report as in my classical report between the program  four Internal table were used for calculation , now after calculation block i have deleted all the WRITE statement to convert it into classical ALV and after end of the program i have used
    PERFORM LAYOUT_INIT USING gs_layout.
    PERFORM COMMENT_BUILD USING gt_list_top_of_page[].
    PERFORM build_fldcat CHANGING field_cat1.
    PERFORM build_layout.
    PERFORM set_events CHANGING lt_events.
    and FM Reuse_alv_grid_display.
    but in FM i can only pass one internal table so what should i do  please suggest
    Please suggest the right way where to use these perform statements & the FM Reuse_alv_grid_display.
    either in place of the deleted write statements or any where else in the program so that the calculation part output is displayed in Grid form.
    Thanks.

    see this simple example for converting into different formats
    report  zalv_sample                            .
    tables vbak.
    data it_vbak like vbak occurs 0 with header line.
    selection-screen begin of block b1 with frame.
    parameters: alv1 radiobutton group alv,       "REUSE_ALV_LIST_DISPLAY
                alv2 radiobutton group alv,       "REUSE_ALV_POPUP_TO_SELECT
                alv3 radiobutton group alv,       "REUSE_ALV_GRID_DISPLAY
                alv4 radiobutton group alv.       " NORMAL DISPLAY
    selection-screen end of block b1.
    select * from  vbak
             into corresponding fields of table it_vbak
             up to 10 rows.
    if alv1 = 'X'.
      perform alv_func1.
    elseif alv2 = 'X'.
      perform alv_func2.
    elseif alv3 = 'X'.
      perform alv_func3.
    elseif alv4 = 'X'.
      perform norm.
    endif.
    *&      Form  ALV_FUNC1
    form alv_func1 .
      call function 'REUSE_ALV_LIST_DISPLAY'
        exporting
          i_structure_name = 'VBAK'
        tables
          t_outtab         = it_vbak
        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.
    endform.                                                    " ALV_FUNC1
    *&      Form  ALV_FUNC2
    form alv_func2 .
      call function 'REUSE_ALV_POPUP_TO_SELECT'
        exporting
          i_title          = 'SALES ORDER INFO'
          i_zebra          = 'X'
          i_tabname        = 1
          i_structure_name = 'vbak'
        tables
          t_outtab         = it_vbak
        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.
    endform.                                                    " ALV_FUNC2
    *&      Form  ALV_FUNC3
    form alv_func3 .
      call function 'REUSE_ALV_GRID_DISPLAY'
        exporting
          i_structure_name = 'vbak'
          i_grid_title     = 'SALES ORDER INFO'
        tables
          t_outtab         = it_vbak
        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.
    endform.                                                    " ALV_FUNC3
    *&      Form  NORM
    form norm .
      format intensified.
      skip 1.
      write: /'SALES DOC.',
              '    Created on ',
              '    Time',
              '      Created by',
              '       Valid from ',
              '     Sold-to party'.
      format intensified off.
      skip 2.
      loop at it_vbak.
        write: / it_vbak-vbeln,'   ',
                 it_vbak-erdat,'   ',
                 it_vbak-erzet,'   ',
                 it_vbak-ernam,'   ',
                 it_vbak-angdt,'       ',
                 it_vbak-kunnr.
      endloop.
    endform.                    " NORM

  • How to put ZEBRA color in F4 Search help

    My Requirement:
    Suppose I am having a search help with the following data.
    MATNR
    SLNO
    OPERN
    PREHT
    A
    1
    A1
    X
    A
    2
    A2
    A
    3
    A3
    X
    A
    4
    A4
    B
    1
    B1
    B
    2
    B2
    B
    3
    B3
    C
    1
    C1
    C
    2
    C2
    Now I want to display the Search help with two colours [ZEBRA]
    as shown above. The criteria will be defined by "Group by MATNR"
    as shown above.
    " What I did till now.
    SELECTION-SCREEN:
         BEGIN OF BLOCK bl WITH FRAME TITLE text-001.
    PARAMETERS:
         s_matnr    TYPE matnr        OBLIGATORY,     " Material Number
        s_matkl      TYPE matkl        OBLIGATORY.     " Material Group
    SELECTION-SCREEN:
       END OF BLOCK bl.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_matnr.
       PERFORM f4_help_for_material USING 'S_MATNR'.     " Search Help Working Fine
    *******F4 Help **********
    FORM f4_help_for_material USING  l_dynprofield.
       TYPES: BEGIN OF str_mat_oper,
                 matnr  TYPE zpp_oper_master-matnr,
                 slno  TYPE zpp_oper_master-slno,
                 opern  TYPE zpp_oper_master-opern,
                 preht  TYPE zpp_oper_master-preht,
              END OF str_mat_oper.
       DATA: it_mat_oper TYPE STANDARD TABLE OF str_mat_oper INITIAL SIZE 0,
             wa_mat_oper TYPE str_mat_oper.
       SELECT * FROM zpp_oper_master
       CLIENT SPECIFIED INTO CORRESPONDING FIELDS OF TABLE it_mat_oper
       WHERE mandt = sy-mandt
       ORDER BY matnr slno ASCENDING.
       CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
         EXPORTING
           retfield    = 'MATNR'
           dynpprog    = sy-repid
           dynpnr      = sy-dynnr
           dynprofield = l_dynprofield
           value_org   = 'S'
         TABLES
           value_tab   = it_mat_oper.
    ENDFORM.                    " F4_HELP_FOR_MATERIAL
    Thanks in advance
    Satpathy

    Hi Satpathy,
    Ok...
    Then try some thing like this....
    Step1: call a subscreen whenever F4 event triggers: use CALL SCREEN...
    Step2: In that subscreen display an ALV (REUSE_ALV_GRID_DISPLAY)and while displaying assign colors to the rows based on the MATNR
    Step3: Enable user command event to capture the selected row value and pass back this to the req field.
    Srikanth.

  • Report validation

    hi guys,
    need ur help.
    i have a selection screen with the fields material (select-option), plant(parameter) and inspection type(parameter). Now i want to validate the material according to the palnt and display all the material that do not belong to the plant keyed in.
    How can this be done ?? please help me out.

    u can go for ALV-Reuse_alv_grid_display where u can display the list of values.
    this is the best method.
    orelse u can go for table contro.l.
    s_matnr - select-options, l_plant - plant parameter
    if not l_plant is inital.
    if not s_matnr is initial.
    Select MATNR PLANT from MARC into table t_marc where plantt = l_pant and
        matnr in s_matnr.
    build fieldcatelog and then use reuse_alv_grid_display.

  • In u201CReuse_alv_grid_displayu201D

    Normal O/P in GRID
    0001
    AAA
    0001
    AAB
    0001
    AAA
    0002
    BAA
    0002
    BAB
    0002
    BAC
    But i Client Required like is? how to do so in ALV 'Reuse_ALV_Grid_Display'
    0001
    AAA
    AAB
    AAA
    0002
    BAA
    BAB
    BAC

    Hi,
    Use sot in ALV , build a sort field
    data : IT_SORT       TYPE SLIS_T_SORTINFO_ALV,
             WA_SORT       TYPE SLIS_SORTINFO_ALV.
      WA_SORT-SPOS        = 1.
      WA_SORT-FIELDNAME   = '<your first field name in capital letters>'.
      WA_SORT-TABNAME     = 'ITABNAME'
      WA_SORT-UP          = 'X'
      APPEND WA_SORT TO IT_SORT.
    and use in FM
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
          EXPORTING
            I_CALLBACK_PROGRAM      = SY-REPID
            IS_LAYOUT               = WA_LAYOUT
           I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
            IT_FIELDCAT             = FP_T_FIELDCAT
            IT_SORT                 = IT_SORT
            IT_EVENTS               = IT_EVENTS
            I_DEFAULT               = 'X'
            I_SAVE                  = 'A'
          TABLES
            T_OUTTAB                = FP_T_DISPLAY
          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.                   
    regards,
    Kannan

  • Function module for popup window  with list display.

    Hi,
       I need simple program or function module name that accepts internal table as input and displays the content of the internal table as list in popup window.
    Regards
    Madhu.

    Hii Madhu
    check this fm
    <b>REUSE_ALV_POPUP_TO_SELECT</b>
    check this implementation..
    *& Report  ZALV_SAMPLE                                                *
    *& Program for displaying data using function modules :                *
    *& REUSE_ALV_LIST_DISPLAY                                              *
    *& REUSE_ALV_POPUP_TO_SELECT                                           *
    *& REUSE_ALV_GRID_DISPLAY                                              *
    REPORT  ZALV_SAMPLE                            .
    TABLES VBAK.
    DATA it_vbak LIKE VBAK OCCURS 0 WITH HEADER LINE.
    SELECTION-SCREEN uline.
    PARAMETERS: ALV1 RADIOBUTTON GROUP ALV,       "REUSE_ALV_LIST_DISPLAY
                ALV2 RADIOBUTTON GROUP ALV,       "REUSE_ALV_POPUP_TO_SELECT
                ALV3 RADIOBUTTON GROUP ALV,       "REUSE_ALV_GRID_DISPLAY
                ALV4 RADIOBUTTON GROUP ALV.       " NORMAL DISPLAY
    SELECTION-SCREEN uline.
    SELECT * FROM  VBAK
             INTO CORRESPONDING FIELDS OF TABLE it_vbak
             UP TO 10 ROWS.
    IF ALV1 = 'X'.
       PERFORM ALV_FUNC1.
    ELSEIF ALV2 = 'X'.
       PERFORM ALV_FUNC2.
    ELSEIF ALV3 = 'X'.
      PERFORM ALV_FUNC3.
    ELSEIF ALV4 = 'X'.
      PERFORM NORM.
    ENDIF.
    *&      Form  ALV_FUNC1
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM ALV_FUNC1 .
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
      EXPORTING
        I_STRUCTURE_NAME               = 'VBAK'
      TABLES
        T_OUTTAB                       = it_vbak
       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.
    ENDFORM.                    " ALV_FUNC1
    *&      Form  ALV_FUNC2
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM ALV_FUNC2 .
    CALL FUNCTION 'REUSE_ALV_POPUP_TO_SELECT'
      EXPORTING
        I_TITLE                       = 'SALES ORDER INFO'
        I_ZEBRA                       = 'X'
        I_TABNAME                     = 1
        I_STRUCTURE_NAME              = 'vbak'
      TABLES
        T_OUTTAB                      = it_vbak
       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.
    ENDFORM.                    " ALV_FUNC2
    *&      Form  ALV_FUNC3
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM ALV_FUNC3 .
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
      EXPORTING
        I_STRUCTURE_NAME                  = 'vbak'
        I_GRID_TITLE                      = 'SALES ORDER INFO'
      TABLES
        T_OUTTAB                          = it_vbak
       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.
    ENDFORM.                    " ALV_FUNC3
    *&      Form  NORM
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM NORM .
    format intensified.
    skip 1.
    WRITE: /'SALES DOC.',
            '    Created on ',
            '    Time',
            '      Created by',
            '       Valid from ',
            '     Sold-to party'.
    format intensified off.
    skip 2.
    LOOP AT it_vbak.
    write: / it_vbak-vbeln,'   ',
             it_vbak-erdat,'   ',
             it_vbak-erzet,'   ',
             it_vbak-ERNAM,'   ',
             it_vbak-ANGDT,'       ',
             it_vbak-KUNNR.
    endloop.
    ENDFORM.                    " NORM
    Reward points if helpful
    Revert back for more help
    REGARDS
    Naresh

  • How to color a specific cell in ALV (not REUSE_ALV_GRID_DISPLAY)

    Hi
    I want to change color font or background to a specify position in ALV grid
    It is possible but by creating ALV container (not FM for example REUSE_ALV_GRID_DISPLAY)?

    Hi,
    REPORT ZALV_LIST1.
    TABLES:
    SPFLI.
    TYPE-POOLS:
    SLIS.
    PARAMETERS:
    P_COL TYPE I ,
    P_ROW TYPE I,
    P_COLOR(4) TYPE C .
    DATA:
    T_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
    FS_FIELDCAT LIKE LINE OF T_FIELDCAT,
    FS_LAYOUT TYPE SLIS_LAYOUT_ALV ,
    W_COLOR(4) ,
    W_ROW TYPE I,
    W_FIELDNAME(20),
    W_PROG TYPE SY-REPID.
    DATA:
    BEGIN OF T_SPFLI OCCURS 0,
    COLOR(4),
    CHECKBOX ,
    CELL TYPE SLIS_T_SPECIALCOL_ALV,
    CARRID TYPE SPFLI-CARRID,
    CONNID TYPE SPFLI-CONNID,
    CITYFROM TYPE SPFLI-CITYFROM,
    CITYTO TYPE SPFLI-CITYTO,
    DISTANCE TYPE SPFLI-DISTANCE,
    END OF T_SPFLI.
    DATA:
    FS_CELL LIKE LINE OF T_SPFLI-CELL.
    SELECT *
    FROM SPFLI
    INTO CORRESPONDING FIELDS OF TABLE T_SPFLI.
    W_COLOR = P_COLOR.
    T_SPFLI-COLOR = P_COLOR.
    IF P_COL IS INITIAL AND P_ROW GT 0.
    MODIFY T_SPFLI INDEX P_ROW TRANSPORTING COLOR.
    ENDIF.
    FS_FIELDCAT-FIELDNAME = 'CARRID'.
    FS_FIELDCAT-REF_TABNAME = 'SPFLI'.
    FS_FIELDCAT-COL_POS = 1.
    FS_FIELDCAT-KEY = 'X'.
    FS_FIELDCAT-HOTSPOT = 'X'.
    APPEND FS_FIELDCAT TO T_FIELDCAT.
    CLEAR FS_FIELDCAT .
    FS_FIELDCAT-FIELDNAME = 'CONNID'.
    FS_FIELDCAT-REF_TABNAME = 'SPFLI'.
    FS_FIELDCAT-COL_POS = 2.
    FS_FIELDCAT-KEY = 'X'.
    FS_FIELDCAT-HOTSPOT = 'X'.
    APPEND FS_FIELDCAT TO T_FIELDCAT.
    CLEAR FS_FIELDCAT .
    FS_FIELDCAT-FIELDNAME = 'DISTANCE'.
    FS_FIELDCAT-REF_TABNAME = 'SPFLI'.
    FS_FIELDCAT-COL_POS = 3.
    FS_FIELDCAT-KEY = ' '.
    FS_FIELDCAT-EDIT = 'X'.
    APPEND FS_FIELDCAT TO T_FIELDCAT.
    CLEAR FS_FIELDCAT.
    FS_FIELDCAT-FIELDNAME = 'CITYFROM'.
    FS_FIELDCAT-REF_TABNAME = 'SPFLI'.
    FS_FIELDCAT-COL_POS = 4.
    FS_FIELDCAT-KEY = ' '.
    APPEND FS_FIELDCAT TO T_FIELDCAT.
    LOOP AT T_FIELDCAT INTO FS_FIELDCAT.
    IF FS_FIELDCAT-COL_POS EQ P_COL.
    FS_FIELDCAT-EMPHASIZE = P_COLOR.
    W_FIELDNAME = FS_FIELDCAT-FIELDNAME.
    IF P_ROW IS INITIAL AND P_COL GT 0.
    MODIFY T_FIELDCAT FROM FS_FIELDCAT TRANSPORTING EMPHASIZE.
    ENDIF.
    ENDIF.
    ENDLOOP.
    FS_CELL-FIELDNAME = W_FIELDNAME .
    FS_CELL-COLOR-COL = 6.
    FS_CELL-NOKEYCOL = 'X'.
    APPEND FS_CELL TO T_SPFLI-CELL.
    IF P_ROW IS NOT INITIAL AND P_COL IS NOT INITIAL.
    MODIFY T_SPFLI INDEX P_ROW TRANSPORTING CELL.
    ENDIF.
    FS_LAYOUT-INFO_FIELDNAME = 'COLOR'.
    FS_LAYOUT-BOX_FIELDNAME = 'CHECKBOX'.
    FS_LAYOUT-COLTAB_FIELDNAME = 'CELL'.
    FS_LAYOUT-F2CODE = '&ETA'.
    W_PROG = SY-REPID.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
    I_CALLBACK_PROGRAM = W_PROG
    IS_LAYOUT = FS_LAYOUT
    IT_FIELDCAT = T_FIELDCAT
    TABLES
    T_OUTTAB = T_SPFLI
    EXCEPTIONS
    PROGRAM_ERROR = 1
    OTHERS = 2

  • ALV Grid Excel in Place using REUSE_ALV_GRID_DISPLAY

    I have a ALV grid displayed in a report and i have a bunch of layouts created by various users and the layouts works fine when selected. But when I use 'Excel'  (excel-in-place) button to export the grid into an excel sheet, the order of the columns are all jumbled up and not in sync with the ALV grid layout on the screen. However, when I use export to local file>excel option, the order of columns are in sync with the layout. Can any one explain why this is happening and how I can fix it ? Is there any OSS note or something that I need to apply ?
    PS : I am using REUSE_ALV_GRID_DISPLAY to display the report and I am building the fieldcatalog manually
    Eg :
    CLEAR r_fieldcatalog.
      MOVE 'TB_OUTPUT'  TO r_fieldcatalog-tabname.
      MOVE 'BUKRS'      TO r_fieldcatalog-fieldname.
      MOVE 'VBAK'       TO r_fieldcatalog-ref_tabname.
      MOVE 'BUKRS_VF'   TO r_fieldcatalog-ref_fieldname.
      MOVE text-f01     TO r_fieldcatalog-seltext_s.
      MOVE text-f01     TO r_fieldcatalog-seltext_m.
      MOVE text-f01     TO r_fieldcatalog-seltext_l.
      add '1' to lv_col_pos .
      move lv_col_pos to r_fieldcatalog-col_pos .
      APPEND r_fieldcatalog TO tc_fieldcatalog.
      CLEAR r_fieldcatalog.
      MOVE 'TB_OUTPUT'  TO r_fieldcatalog-tabname.
      MOVE 'VKORG'      TO r_fieldcatalog-fieldname.
      MOVE 'VBAK'       TO r_fieldcatalog-ref_tabname.
      MOVE 'VKORG'      TO r_fieldcatalog-ref_fieldname.
      MOVE text-f02     TO r_fieldcatalog-seltext_s.
      MOVE text-f02     TO r_fieldcatalog-seltext_m.
      MOVE text-f02     TO r_fieldcatalog-seltext_l.
      add '1' to lv_col_pos .
      move lv_col_pos to r_fieldcatalog-col_pos .
      APPEND r_fieldcatalog     TO tc_fieldcatalog.
    Thanks in advance,
    Shareen

      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_pf_status_set = 'ALV_PF_STATUS'
          i_callback_program       = sy-repid
          is_layout                = gs_layout
          it_fieldcat              = gt_fieldcat[]
          i_default                = ' '
          i_save                   = g_save
        TABLES
          t_outtab                 = it_tab
        EXCEPTIONS
          program_error            = 1
          OTHERS                   = 2.
    and beneath this just put a form.as its shown.
    FORM alv_pf_status USING l_alv_excl TYPE STANDARD TABLE.
      SET PF-STATUS 'STANDARD_FULLSCREEN' "excluding lt_extab
                    OF PROGRAM 'SAPLSETB'.
    ENDFORM.                    "alv_pf_status

  • Checkbox field in ALV for REUSE_ALV_GRID_DISPLAY

    how to handle Checkbox field in ALV for REUSE_ALV_GRID_DISPLAY????
    For example Alv has displayed 400 entries if user checks 4 entries and wants to donwload only those 4 entries from ALV using Copy to local file option then how should it be done. please provide some help...

    REPORT  YHRMR_LTC_TAXABLE NO STANDARD PAGE HEADING LINE-SIZE 120.
    TYPE-POOLS: SLIS.
    Start of Data Declaration                                            *
    DATA: G_PLVAR               TYPE PLVAR.
    DATA: P_MONTH               TYPE TFMATAGE.
    DATA: TOTAL_NO              TYPE I.
    DATA: TOTAL_NO_SUM          TYPE I.
    DATA: COUNT_15              TYPE I.
    DATA: COUNT_15_SUM          TYPE I.
    DATA: COUNT_LTC             TYPE I.
    DATA: COUNT_LTC_SUM         TYPE I.
    DATA: COUNT_ERROR_IT15      TYPE I.
    DATA: COUNT_ERROR_IT15_SUM  TYPE I.
    DATA: COUNT_ERROR_LTC       TYPE I.
    DATA: COUNT_ERROR_LTC_SUM   TYPE I.
    DATA: COUNT_ENTRY_IT15      TYPE I.
    DATA: COUNT_ENTRY_IT15_SUM  TYPE I.
    --LOCAL TABLE TYPE--
    DATA: T_DATA_LTC     LIKE YHRMT_LTC OCCURS 0 WITH HEADER LINE.
    DATA: T_DATA_LTC_NEW LIKE YHRMT_LTC OCCURS 0 WITH HEADER LINE.
    DATA: T_PA0015 LIKE PA0015 OCCURS 0 WITH HEADER LINE.
    DATA: T_P0015 LIKE PA0015 OCCURS 0 WITH HEADER LINE.
    DATA: BEGIN OF T_FINAL OCCURS 0,
          CHECK_BOX(1),
          MANDT        TYPE MANDT,
          PERNR        TYPE PERSNO,
          ABKRS        TYPE ABKRS,
          PERSK        TYPE PERSK,
          WAGETYPE     TYPE LGART,
          LTCSTART     TYPE YAJAHR,
          LTCEND       TYPE YYAJAHR,
          FLAG         TYPE YCHAR1,
          SEQNR        TYPE SEQNR,
          LEVSTART     TYPE URBEG,
          LEVEND       TYPE BDATU_052R,
          PAYDATE      TYPE YBEGDA,
          AMOUNTPAY    TYPE AMUNT,
          TAXYR        TYPE PHK_TAXYR,
          DOCUNO       TYPE YCHAR20,
          DOCUDATE     TYPE YENDDA,
          VOUCHNO      TYPE YCHAR20,
          APDATE       TYPE BPS_APPDA,
          CANCEL_MOD   TYPE YCANCELMOD,
          LTC_IND      TYPE ATZH1,
          APPL_TAG     TYPE YAPPTAG,
          CANCEL_DATE  TYPE AEDTM,
          CANCEL_USER  TYPE AENAM,
          LASTCHANGE   TYPE AEDTM,
          USERNAME     TYPE AENAM,
          END OF T_FINAL.
    DATA: BEGIN OF T_PA0001 OCCURS 0,
          PERNR LIKE PA0001-PERNR,
          ABKRS LIKE PA0001-ABKRS,
          END OF T_PA0001.
    --Message Part Declaration--
    DATA: BEGIN OF T_SUCCESS OCCURS 0,
          PERNR       TYPE PERSNO,
          MESSAGE(50) TYPE C,
          END OF T_SUCCESS.
    DATA: BEGIN OF T_ERROR OCCURS 0,
          PERNR       TYPE PERSNO,
          MESSAGE(50)  TYPE C,
          END OF T_ERROR.
    --TABLE TYPE OF SLIS TYPE-GROUP--
    DATA: G_FLD TYPE SLIS_T_FIELDCAT_ALV,
          G_EV TYPE SLIS_T_EVENT,
          G_SORT TYPE SLIS_T_SORTINFO_ALV,
          G_LST TYPE SLIS_T_LISTHEADER.
    DATA: FIELDCATALOG TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE,
          GD_TAB_GROUP TYPE SLIS_T_SP_GROUP_ALV,
          GD_LAYOUT    TYPE SLIS_LAYOUT_ALV,
          I_EVENTS TYPE SLIS_T_EVENT,
          GD_REPID     LIKE SY-REPID.
    --STRUCTURE TYPE OF SLIS TYPE-GROUP--
    DATA: L_EV TYPE SLIS_ALV_EVENT.
    CONSTANTS : C_PF TYPE SLIS_FORMNAME VALUE 'PF_STATUS_SET',
                C_UCOM TYPE SLIS_FORMNAME VALUE 'USER_COMMAND'.
    *---- Start Change by Bibek/Shankar Dated : 12-03-2008 via cmr no : J/08/03/062/1.
    DATA: L_ENDDATE   LIKE SY-DATUM.
    *---- End   Change by Bibek/Shankar Dated : 12-03-2008 via cmr no : J/08/03/062/1.
    End of Data Declaration                                              *
    Start of Selection screen Parameters                                 *
    SELECTION-SCREEN BEGIN OF BLOCK A WITH FRAME TITLE TEXT-002.
    *START CHANGE BY SHAYARI ON 18.02.2008, CMR No.:- J/08/02/323
    PARAMETERS:P_ABKRS LIKE PA0001-ABKRS OBLIGATORY.
    *END CHANGE BY SHAYARI ON 18.02.2008,  CMR No.:- J/08/02/323
    *START CHANGE BY BIBEk Dt : 06.03.2008, CMR No.:- J/08/03/062/1
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN POSITION 1.
    SELECTION-SCREEN COMMENT 1(78) TEXT-006 FOR FIELD P_LES.
    PARAMETER P_LES RADIOBUTTON GROUP RB1.
    SELECTION-SCREEN END OF LINE.
    *END CHANGE BY BIBEk Dt : 06.03.2008, CMR No.:- J/08/03/062/1
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN POSITION 1.
    SELECTION-SCREEN COMMENT 1(78) TEXT-003 FOR FIELD P_ONE.
    PARAMETER P_ONE RADIOBUTTON GROUP RB1.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN POSITION 1.
    SELECTION-SCREEN COMMENT 1(78) TEXT-004 FOR FIELD P_TWO.
    PARAMETER P_TWO  RADIOBUTTON GROUP RB1.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN POSITION 1.
    SELECTION-SCREEN COMMENT 1(78) TEXT-005 FOR FIELD P_MORE.
    PARAMETER P_MORE RADIOBUTTON GROUP RB1.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK A.
    End of Selection screen Parameters                                   *
    *Get Plan Version
    CALL FUNCTION 'RH_GET_PLVAR'
      IMPORTING
        PLVAR = G_PLVAR.
    PERFORM CLEAR.
    CALL FUNCTION 'HR_JP_MONTH_BEGIN_END_DATE'
      EXPORTING
        IV_DATE                   = SY-DATUM
    IMPORTING
      EV_MONTH_BEGIN_DATE       =
        EV_MONTH_END_DATE         = L_ENDDATE.
    SELECT *
      FROM YHRMT_LTC
      INTO TABLE T_DATA_LTC
    WHERE FLAG   = '1'
       AND WAGETYPE = '1640'
       AND LEVEND LE L_ENDDATE
       AND PAYDATE GE '20080101'.
    If SY-SUBRC <> 0.
    MESSAGE I398(00) with 'No Records to display '.
    ENDIF.
    DELETE T_DATA_LTC WHERE LEVEND = '00000000'.
    *START CHANGE BY BIBEk Dt : 06.03.2008, CMR No.:- J/08/03/062/1
    *For Less Than One Month from Leave End Date
    IF P_LES = 'X'.
      LOOP AT T_DATA_LTC.
        CLEAR P_MONTH.
        CALL FUNCTION 'HR_AUPBS_MONTH_DAY'
          EXPORTING
            BEG_DA   = T_DATA_LTC-LEVEND
            END_DA   = SY-DATUM
          IMPORTING
            NO_MONTH = P_MONTH.
        IF P_MONTH LT '1'.
          T_FINAL-MANDT       =  T_DATA_LTC-MANDT.
          T_FINAL-PERNR       =  T_DATA_LTC-PERSONNELNO.
          T_FINAL-PERSK       =  T_DATA_LTC-PERSK.
          T_FINAL-WAGETYPE    =  T_DATA_LTC-WAGETYPE.
          T_FINAL-LTCSTART    =  T_DATA_LTC-LTCSTART.
          T_FINAL-LTCEND      =  T_DATA_LTC-LTCEND.
          T_FINAL-FLAG        =  T_DATA_LTC-FLAG.
          T_FINAL-SEQNR       =  T_DATA_LTC-SEQNR.
          T_FINAL-LEVSTART    =  T_DATA_LTC-LEVSTART.
          T_FINAL-LEVEND      =  T_DATA_LTC-LEVEND.
          T_FINAL-PAYDATE     =  T_DATA_LTC-PAYDATE.
          T_FINAL-AMOUNTPAY   =  T_DATA_LTC-AMOUNTPAY.
          T_FINAL-TAXYR       =  T_DATA_LTC-TAXYR.
          T_FINAL-DOCUNO      =  T_DATA_LTC-DOCUNO.
          T_FINAL-DOCUDATE    =  T_DATA_LTC-DOCUDATE.
          T_FINAL-VOUCHNO     =  T_DATA_LTC-VOUCHNO.
          T_FINAL-APDATE      =  T_DATA_LTC-APDATE.
          T_FINAL-CANCEL_MOD  =  T_DATA_LTC-CANCEL_MOD.
          T_FINAL-LTC_IND     =  T_DATA_LTC-LTC_IND.
          T_FINAL-APPL_TAG    =  T_DATA_LTC-APPL_TAG.
          T_FINAL-CANCEL_DATE =  T_DATA_LTC-CANCEL_DATE.
          T_FINAL-CANCEL_USER =  T_DATA_LTC-CANCEL_USER.
          T_FINAL-LASTCHANGE  =  T_DATA_LTC-LASTCHANGE.
          T_FINAL-USERNAME    =  T_DATA_LTC-USERNAME.
          APPEND T_FINAL.
          CLEAR  T_FINAL.
        ENDIF.
      ENDLOOP.
    *For One Month from Leave End Date
    ELSEIF P_ONE = 'X'.
      LOOP AT T_DATA_LTC.
        CLEAR P_MONTH.
        CALL FUNCTION 'HR_AUPBS_MONTH_DAY'
          EXPORTING
            BEG_DA   = T_DATA_LTC-LEVEND
            END_DA   = SY-DATUM
          IMPORTING
            NO_MONTH = P_MONTH.
        IF P_MONTH EQ '1' AND P_MONTH LT '2'.
          T_FINAL-MANDT       =  T_DATA_LTC-MANDT.
          T_FINAL-PERNR       =  T_DATA_LTC-PERSONNELNO.
          T_FINAL-PERSK       =  T_DATA_LTC-PERSK.
          T_FINAL-WAGETYPE    =  T_DATA_LTC-WAGETYPE.
          T_FINAL-LTCSTART    =  T_DATA_LTC-LTCSTART.
          T_FINAL-LTCEND      =  T_DATA_LTC-LTCEND.
          T_FINAL-FLAG        =  T_DATA_LTC-FLAG.
          T_FINAL-SEQNR       =  T_DATA_LTC-SEQNR.
          T_FINAL-LEVSTART    =  T_DATA_LTC-LEVSTART.
          T_FINAL-LEVEND      =  T_DATA_LTC-LEVEND.
          T_FINAL-PAYDATE     =  T_DATA_LTC-PAYDATE.
          T_FINAL-AMOUNTPAY   =  T_DATA_LTC-AMOUNTPAY.
          T_FINAL-TAXYR       =  T_DATA_LTC-TAXYR.
          T_FINAL-DOCUNO      =  T_DATA_LTC-DOCUNO.
          T_FINAL-DOCUDATE    =  T_DATA_LTC-DOCUDATE.
          T_FINAL-VOUCHNO     =  T_DATA_LTC-VOUCHNO.
          T_FINAL-APDATE      =  T_DATA_LTC-APDATE.
          T_FINAL-CANCEL_MOD  =  T_DATA_LTC-CANCEL_MOD.
          T_FINAL-LTC_IND     =  T_DATA_LTC-LTC_IND.
          T_FINAL-APPL_TAG    =  T_DATA_LTC-APPL_TAG.
          T_FINAL-CANCEL_DATE =  T_DATA_LTC-CANCEL_DATE.
          T_FINAL-CANCEL_USER =  T_DATA_LTC-CANCEL_USER.
          T_FINAL-LASTCHANGE  =  T_DATA_LTC-LASTCHANGE.
          T_FINAL-USERNAME    =  T_DATA_LTC-USERNAME.
          APPEND T_FINAL.
          CLEAR  T_FINAL.
        ENDIF.
      ENDLOOP.
    *For Two Month from Leave End Date
    ELSEIF P_TWO = 'X'.
      LOOP AT T_DATA_LTC.
        CLEAR P_MONTH.
        CALL FUNCTION 'HR_AUPBS_MONTH_DAY'
          EXPORTING
            BEG_DA   = T_DATA_LTC-LEVEND
            END_DA   = SY-DATUM
          IMPORTING
            NO_MONTH = P_MONTH.
        IF P_MONTH EQ '2' AND P_MONTH LT '3'.
          T_FINAL-MANDT       =  T_DATA_LTC-MANDT.
          T_FINAL-PERNR       =  T_DATA_LTC-PERSONNELNO.
          T_FINAL-PERSK       =  T_DATA_LTC-PERSK.
          T_FINAL-WAGETYPE    =  T_DATA_LTC-WAGETYPE.
          T_FINAL-LTCSTART    =  T_DATA_LTC-LTCSTART.
          T_FINAL-LTCEND      =  T_DATA_LTC-LTCEND.
          T_FINAL-FLAG        =  T_DATA_LTC-FLAG.
          T_FINAL-SEQNR       =  T_DATA_LTC-SEQNR.
          T_FINAL-LEVSTART    =  T_DATA_LTC-LEVSTART.
          T_FINAL-LEVEND      =  T_DATA_LTC-LEVEND.
          T_FINAL-PAYDATE     =  T_DATA_LTC-PAYDATE.
          T_FINAL-AMOUNTPAY   =  T_DATA_LTC-AMOUNTPAY.
          T_FINAL-TAXYR       =  T_DATA_LTC-TAXYR.
          T_FINAL-DOCUNO      =  T_DATA_LTC-DOCUNO.
          T_FINAL-DOCUDATE    =  T_DATA_LTC-DOCUDATE.
          T_FINAL-VOUCHNO     =  T_DATA_LTC-VOUCHNO.
          T_FINAL-APDATE      =  T_DATA_LTC-APDATE.
          T_FINAL-CANCEL_MOD  =  T_DATA_LTC-CANCEL_MOD.
          T_FINAL-LTC_IND     =  T_DATA_LTC-LTC_IND.
          T_FINAL-APPL_TAG    =  T_DATA_LTC-APPL_TAG.
          T_FINAL-CANCEL_DATE =  T_DATA_LTC-CANCEL_DATE.
          T_FINAL-CANCEL_USER =  T_DATA_LTC-CANCEL_USER.
          T_FINAL-LASTCHANGE  =  T_DATA_LTC-LASTCHANGE.
          T_FINAL-USERNAME    =  T_DATA_LTC-USERNAME.
          APPEND T_FINAL.
          CLEAR  T_FINAL.
        ENDIF.
      ENDLOOP.
    *For More than Two Month from Leave End Date
    ELSEIF P_MORE = 'X'.
      LOOP AT T_DATA_LTC.
        CLEAR P_MONTH.
        CALL FUNCTION 'HR_AUPBS_MONTH_DAY'
          EXPORTING
            BEG_DA   = T_DATA_LTC-LEVEND
            END_DA   = SY-DATUM
          IMPORTING
            NO_MONTH = P_MONTH.
        IF P_MONTH GT '2' .
          T_FINAL-MANDT       =  T_DATA_LTC-MANDT.
          T_FINAL-PERNR       =  T_DATA_LTC-PERSONNELNO.
          T_FINAL-PERSK       =  T_DATA_LTC-PERSK.
          T_FINAL-WAGETYPE    =  T_DATA_LTC-WAGETYPE.
          T_FINAL-LTCSTART    =  T_DATA_LTC-LTCSTART.
          T_FINAL-LTCEND      =  T_DATA_LTC-LTCEND.
          T_FINAL-FLAG        =  T_DATA_LTC-FLAG.
          T_FINAL-SEQNR       =  T_DATA_LTC-SEQNR.
          T_FINAL-LEVSTART    =  T_DATA_LTC-LEVSTART.
          T_FINAL-LEVEND      =  T_DATA_LTC-LEVEND.
          T_FINAL-PAYDATE     =  T_DATA_LTC-PAYDATE.
          T_FINAL-AMOUNTPAY   =  T_DATA_LTC-AMOUNTPAY.
          T_FINAL-TAXYR       =  T_DATA_LTC-TAXYR.
          T_FINAL-DOCUNO      =  T_DATA_LTC-DOCUNO.
          T_FINAL-DOCUDATE    =  T_DATA_LTC-DOCUDATE.
          T_FINAL-VOUCHNO     =  T_DATA_LTC-VOUCHNO.
          T_FINAL-APDATE      =  T_DATA_LTC-APDATE.
          T_FINAL-CANCEL_MOD  =  T_DATA_LTC-CANCEL_MOD.
          T_FINAL-LTC_IND     =  T_DATA_LTC-LTC_IND.
          T_FINAL-APPL_TAG    =  T_DATA_LTC-APPL_TAG.
          T_FINAL-CANCEL_DATE =  T_DATA_LTC-CANCEL_DATE.
          T_FINAL-CANCEL_USER =  T_DATA_LTC-CANCEL_USER.
          T_FINAL-LASTCHANGE  =  T_DATA_LTC-LASTCHANGE.
          T_FINAL-USERNAME    =  T_DATA_LTC-USERNAME.
          APPEND T_FINAL.
          CLEAR  T_FINAL.
        ENDIF.
      ENDLOOP.
    ENDIF.
    ****Payroll Area Put
    SELECT PERNR ABKRS FROM PA0001
    INTO CORRESPONDING FIELDS OF TABLE T_PA0001
    FOR ALL ENTRIES IN T_FINAL
    WHERE PERNR = T_FINAL-PERNR
    AND ABKRS = P_ABKRS
    AND BEGDA LE SY-DATUM
    AND ENDDA GE SY-DATUM.
    LOOP AT T_FINAL.
      READ TABLE T_PA0001 WITH KEY PERNR = T_FINAL-PERNR.
      IF SY-SUBRC = 0.
        T_FINAL-ABKRS = T_PA0001-ABKRS.
        MODIFY T_FINAL.
        CLEAR  T_FINAL.
      ENDIF.
    ENDLOOP.
    CLEAR T_FINAL.
    DELETE T_FINAL WHERE ABKRS = ''.
    *Output Form ALV List
    PERFORM ALV.
    *&      Form  ALV
    FORM ALV .
      PERFORM BUILD_FIELDCATALOG.
      PERFORM BUILD_EVENT.
      PERFORM DISPLAY_DATA.
    ENDFORM.                    " ALV
    *&      Form  BUILD_FIELDCATALOG
    FORM BUILD_FIELDCATALOG .
      FIELDCATALOG-TABNAME     = 'T_FINAL'.
      FIELDCATALOG-FIELDNAME   = 'PERNR'.
      FIELDCATALOG-SELTEXT_M   = 'Personnel number'.
      FIELDCATALOG-COL_POS     = 1.
      FIELDCATALOG-OUTPUTLEN   = 17.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR  FIELDCATALOG.
      FIELDCATALOG-TABNAME     = 'T_FINAL'.
      FIELDCATALOG-FIELDNAME   = 'ABKRS'.
      FIELDCATALOG-SELTEXT_M   = 'Payroll Area'.
      FIELDCATALOG-COL_POS     = 2.
      FIELDCATALOG-OUTPUTLEN   = 17.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR  FIELDCATALOG.
      FIELDCATALOG-TABNAME     = 'T_FINAL'.
      FIELDCATALOG-FIELDNAME   = 'LTCSTART'.
      FIELDCATALOG-SELTEXT_M   = 'LTC Start year'.
      FIELDCATALOG-COL_POS     = 3.
      FIELDCATALOG-OUTPUTLEN   = 15.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR  FIELDCATALOG.
      FIELDCATALOG-TABNAME     = 'T_FINAL'.
      FIELDCATALOG-FIELDNAME   = 'LTCEND'.
      FIELDCATALOG-SELTEXT_M   = 'LTC End year'.
      FIELDCATALOG-COL_POS     = 4.
      FIELDCATALOG-OUTPUTLEN   = 15.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR  FIELDCATALOG.
      FIELDCATALOG-TABNAME     = 'T_FINAL'.
      FIELDCATALOG-FIELDNAME   = 'LEVSTART'.
      FIELDCATALOG-SELTEXT_M   = 'Start of leave'.
      FIELDCATALOG-COL_POS     = 5.
      FIELDCATALOG-OUTPUTLEN   = 15.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR  FIELDCATALOG.
      FIELDCATALOG-TABNAME     = 'T_FINAL'.
      FIELDCATALOG-FIELDNAME   = 'LEVEND'.
      FIELDCATALOG-SELTEXT_M   = 'End of leave'.
      FIELDCATALOG-COL_POS     = 6.
      FIELDCATALOG-OUTPUTLEN   = 15.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR  FIELDCATALOG.
      FIELDCATALOG-TABNAME     = 'T_FINAL'.
      FIELDCATALOG-FIELDNAME   = 'AMOUNTPAY'.
      FIELDCATALOG-SELTEXT_M   = 'Amount'.
      FIELDCATALOG-DO_SUM      = 'X'.
      FIELDCATALOG-COL_POS     = 7.
      FIELDCATALOG-OUTPUTLEN   = 13.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR  FIELDCATALOG.
      FIELDCATALOG-TABNAME     = 'T_FINAL'.
      FIELDCATALOG-FIELDNAME   = 'PAYDATE'.
      FIELDCATALOG-SELTEXT_M   = 'Payment Date'.
      FIELDCATALOG-COL_POS     = 8.
      FIELDCATALOG-OUTPUTLEN   = 15.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR  FIELDCATALOG.
      FIELDCATALOG-TABNAME     = 'T_FINAL'.
      FIELDCATALOG-FIELDNAME   = 'APPL_TAG'.
      FIELDCATALOG-SELTEXT_M   = 'Application Tag '.
      FIELDCATALOG-COL_POS     = 9.
      FIELDCATALOG-OUTPUTLEN   = 15.
      APPEND FIELDCATALOG TO FIELDCATALOG.
      CLEAR  FIELDCATALOG.
    *Check Box Field Add
      CLEAR GD_LAYOUT.
      GD_LAYOUT-BOX_FIELDNAME = 'CHECK_BOX'.
      GD_LAYOUT-BOX_TABNAME = 'T_FINAL'.
    ENDFORM.                    " BUILD_FIELDCATALOG
    *&      Form  BUILD_EVENT
    FORM BUILD_EVENT .
    *Event Handler
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
        EXPORTING
          I_LIST_TYPE     = 0
        IMPORTING
          ET_EVENTS       = G_EV
        EXCEPTIONS
          LIST_TYPE_WRONG = 1
          OTHERS          = 2.
      IF SY-SUBRC <> 0.
      ELSE.
        READ TABLE G_EV INTO L_EV WITH KEY NAME = SLIS_EV_PF_STATUS_SET.
        IF SY-SUBRC = 0.
          MOVE C_PF TO L_EV-FORM.
          MODIFY G_EV FROM L_EV INDEX SY-TABIX TRANSPORTING FORM.
        ENDIF.
        READ TABLE G_EV INTO L_EV WITH KEY NAME = SLIS_EV_USER_COMMAND.
        IF SY-SUBRC = 0.
          MOVE C_UCOM TO L_EV-FORM.
          MODIFY G_EV FROM L_EV INDEX SY-TABIX TRANSPORTING FORM.
        ENDIF.
      ENDIF.
    ENDFORM.                    " BUILD_EVENT
    *&      Form  DISPLAY_DATA
    FORM DISPLAY_DATA .
      GD_REPID = SY-REPID.
      CLEAR I_EVENTS. REFRESH I_EVENTS.
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
        EXPORTING
          I_CALLBACK_PROGRAM       = GD_REPID
          I_CALLBACK_PF_STATUS_SET = C_PF
          I_CALLBACK_USER_COMMAND  = C_UCOM
          IS_LAYOUT                = GD_LAYOUT
          IT_FIELDCAT              = FIELDCATALOG[]
          IT_EVENTS                = G_EV
        TABLES
          T_OUTTAB                 = T_FINAL.
    ENDFORM.                    " DISPLAY_DATA
          FORM PF_STATUS_SET                                            *
    FORM PF_STATUS_SET USING RX_TAB TYPE SLIS_T_EXTAB.
      SET PF-STATUS 'LTC'.
    ENDFORM.                    "PF_STATUS_SET
          FORM USER_COMMAND                                             *
    FORM USER_COMMAND USING R_UCOM LIKE SY-UCOMM
                            RS_SELFIELD TYPE SLIS_SELFIELD.
      CASE R_UCOM.
        WHEN 'POST'.
          PERFORM POST_IT15_LTC_TABLE.
      ENDCASE.
    ENDFORM.                    "USER_COMMAND
    *&      Form  POST_IT15_LTC_TABLE
    FORM POST_IT15_LTC_TABLE .
    ENDFORM.                    " POST_IT15_LTC_TABLE
    *&      Form  clear
    FORM CLEAR .
      CLEAR   T_DATA_LTC.
      REFRESH T_DATA_LTC.
      CLEAR   T_DATA_LTC_NEW.
      REFRESH T_DATA_LTC_NEW.
      CLEAR   T_FINAL.
      REFRESH T_FINAL.
      CLEAR   T_PA0015.
      REFRESH T_PA0015.
      CLEAR   T_SUCCESS.
      REFRESH T_SUCCESS.
      CLEAR   T_ERROR.
      REFRESH T_ERROR.
      CLEAR G_PLVAR.
      CLEAR P_MONTH.
      CLEAR COUNT_15.
      CLEAR COUNT_15_SUM.
      CLEAR COUNT_LTC.
      CLEAR COUNT_LTC_SUM.
      CLEAR TOTAL_NO.
      CLEAR TOTAL_NO_SUM.
      CLEAR COUNT_ERROR_IT15.
      CLEAR COUNT_ERROR_IT15_SUM.
      CLEAR COUNT_ERROR_LTC.
      CLEAR COUNT_ERROR_LTC_SUM.
      CLEAR COUNT_ENTRY_IT15.
      CLEAR COUNT_ENTRY_IT15_SUM.
    ENDFORM.                    " clear

Maybe you are looking for

  • Screen Saver "The selected folder contains no pictures"

    Hello, I recently had my HD replaced on my IBook after thermal damage took out the old one, and the good Apple Store folks recovered and replaces the date from the old fwinky drive. However, tweaking the configuration back into place, I noticed that

  • Archives are not transorting to standby database

    Hi Experts, DB version: 10.2.0.4 OS Version: Windows 2003 Here i have one issue, unable to transfer the archives from Primary to standby database. I have no errors found in primary and also in standby database, I can able to ping both primary & stand

  • Standby_issue

    Hi All,     I created 11g r2 physical Standby using ( ID 1075908.1) and after i check the standby redo there is nothing applied . please help me to solve this issue. STANDBY SIDE: SQL> !cat initpstdby.ora *.DB_NAME=PRIMDG *.DB_UNIQUE_NAME=pstdby *.DB

  • "Full Stop" in Mail--Preferences--Rules?

    I was going through my preferences and I saw this rule named "Full Stop"-but I don't know where it came from (I have another computer and it doesn't have it). I looked it up online but couldn't really find anything, which I thought was odd. Can anyon

  • Inspector does not show

    I have done all the options as mentioned in the following topic: http://discussions.apple.com/thread.jspa?threadID=1935482 But my inspector is just gone!! It is amazing and anoying. Please help!