Disabling "Default layout setting" in ALV grid display

Hello,
   We have a requirement where we need to disable layout default settings in ALV grid display.
   Only certain users should be able to save the report layout as default.
   We would be creating an authorization group for this and then based on the Authority check we would need to enable or disable Default layout save option.
  I found that using I_SAVE in the FM "REUSE_ALV_GRID_DISPLAY", we can either enable or disable layout save option.
  But our requirement is to disable Default layout save option based on the authority check.
  We will find this option next to User specific option when we save the report layout.
  Can anyone guide me on this?
  Thanks,
Regards,
Anid

Hi Anid,
First of all check if you can do this excluding the buttons from the ALV with the excluding tab. If not, here is the code for the ALV OO to exclude the buttons.
FORM F_DISPLAY_ALV.
* Layout
PERFORM f_layout.
* Exclude Buttons
DATA:  gt_excl           TYPE ttb_button
REFRESH gt_excl.
* Append those you want to exclude. These are some of them. Check Class in SE24 -> Atributes of class cl_gui_alv_grid.
APPEND: cl_gui_alv_grid=>mc_fc_loc_cut            TO gt_excl,
        cl_gui_alv_grid=>mc_fc_loc_undo           TO gt_excl,
        cl_gui_alv_grid=>mc_fc_loc_copy           TO gt_excl,
        cl_gui_alv_grid=>mc_fc_loc_paste          TO gt_excl,
        cl_gui_alv_grid=>mc_fc_loc_copy_row       TO gt_excl,
        cl_gui_alv_grid=>mc_fc_loc_move_row       TO gt_excl,
        cl_gui_alv_grid=>mc_fc_loc_delete_row     TO gt_excl,
        cl_gui_alv_grid=>mc_fc_loc_insert_row     TO gt_excl,
        cl_gui_alv_grid=>mc_fc_loc_append_row     TO gt_excl,
        cl_gui_alv_grid=>mc_fc_loc_paste_new_row  TO gt_excl,
        cl_gui_alv_grid=>mc_fc_to_office          TO gt_excl,
        cl_gui_alv_grid=>mc_fc_expcrdesig         TO gt_excl.
CALL METHOD gv_alv_grid->set_table_for_first_display
    EXPORTING
      it_toolbar_excluding       = gt_excl[]
      is_layout                     = wa_layout_main
      is_variant                    = wa_variant
      i_save                        = 'A'
    CHANGING
      it_outtab                     = gt_alv[]
      it_fieldcatalog               = gt_fieldcat[]
      it_sort                       = gt_sort[].
Edited by: Ernesto Caballero on Mar 11, 2010 5:59 PM
Edited by: Ernesto Caballero on Mar 11, 2010 6:03 PM

Similar Messages

  • How to get the SAVE Layout  ICON on ALV Grid display report

    Hi,
      I am using the standard ALV Layout, and I do not get the SAVE LAYOUT Icon on the Menubar, where I could save the report Layout.I am using the layout routine as,
    FORM layout_build USING   u_lf_layout TYPE slis_layout_alv.
      u_lf_layout-box_fieldname       = 'SELK'.  " Checkbox
      u_lf_layout-zebra               =  'X'.
      u_lf_layout-colwidth_optimize   =  'X'.
      u_lf_layout-confirmation_prompt =  'X'.
      u_lf_layout-get_selinfos        =  'X'.
      u_lf_layout-f2code              =  '&ETA' .
      u_lf_layout-detail_titlebar     =  'Delivery Due List'.
      u_lf_layout-key_hotspot         =  'X'.
      u_lf_layout-info_fieldname      =  'COL'.
    ENDFORM.                    " layout_build
    Is there anything that I am missing. Please suggest.Many thanks for your help.
    Regards,
    Mira

    Hi,
    i think you've forgotten param. <b>i_save</b>
      x_save = 'X'.
      gs_variant-report     = sy-repid.
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
           EXPORTING
                I_STRUCTURE_NAME = 'ZTAB01'
                IS_VARIANT       = gs_variant
                IS_layout        = lay
                I_SAVE           = x_save
           TABLES
                T_OUTTAB         = gridtab
           EXCEPTIONS
                OTHERS           = 1.
    regards Andreas

  • Default Layout for Multiple ALV displays

    Hello All,
    I have a requirement where I am displaying multiple ALV grid displays on different tabs of a screen.
    Now I have to set a default layout for each of the grids separately as they have different fields.
    Please let me know how to do it, I am using OO ALV display.
    Thanks a lot
    Ruchi

    Hi,
    According to your grid called pass the variant name
        gs_variant-report       = sy-repid.
        gs_variant-username     = sy-uname.
        gs_variant-variant      = v_vari.   " Your variant Name
        call method grid1->set_table_for_first_display 
          exporting
            is_layout                     = gs_layout
            is_variant                    = gs_variant  "<<<<<<<<<
            i_save                        = 'A'
            it_toolbar_excluding          = i_exclude[]
          changing
            it_outtab                     = i_output[]
            it_fieldcatalog               = i_fieldcat[]
          exceptions
            invalid_parameter_combination = 1
            program_error                 = 2
            too_many_lines                = 3
            others                        = 4.

  • ALV GRID DISPLAY -Problem with Layout

    Hi,
    I'm using ALV GRID DISPLAY. I ran the program and in the output i created a layout Test1.Later i created a layout Test2. Now when i run the report, when i select layout Test1, the display is not as selected for the layout. but when i manualy select the layout throu change layout-->Test1, the display is working good. Can someone tell me what the problem can be?
    Thanks
    Challa

    hi,
    in the FM have you filled the structure IS_VARIANT.
    is_variant-report = sy-repid.
    is_variant-variant = <variant name>.
    Regards,
    Leo

  • Field Catolgue in alv grid display

    Hi Abapers,
    I need to display the percentage rows with decimals and other rows without decimal . Is their any option in field catalog to do like this. Or tell me any other alternative to achieve this.
    sno  total     col1      col2      col3
    1      220       100        20       100
    2      320      120         50        150
    tot    540       220        70         250
    per               40.74     1.87  and so on
    or ,
    I have two different internal tables how can i put it in one field catalog to pass it to alv grid display.
    Regards,
    Priya

    Don't   do  total  by your  self  in the Pogram.
    in the   Fieldcatalog  there is an Attribute which will do total  &  Average .
    Enable it so that  from one  internal  table   data   it self it will do  good.
    example program
    Below is an example ABAP program which will populate a simple internal table(it_ekpo) with data and
    display it using the basic ALV grid functionality(including column total). The example details the main
    sections of coding required to implement the ALV grid functionality:
                             Data declaration
                             Data retrieval
                             Build fieldcatalog
                             Build layout setup
    REPORT  zdemo_alvgrid                 .
    TABLES:     ekko.
    type-pools: slis.                                 "ALV Declarations
    *Data Declaration
    TYPES: BEGIN OF t_ekko,
      ebeln TYPE ekpo-ebeln,
      ebelp TYPE ekpo-ebelp,
      statu TYPE ekpo-statu,
      aedat TYPE ekpo-aedat,
      matnr TYPE ekpo-matnr,
      menge TYPE ekpo-menge,
      meins TYPE ekpo-meins,
      netpr TYPE ekpo-netpr,
      peinh TYPE ekpo-peinh,
    END OF t_ekko.
    DATA: it_ekko TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
          wa_ekko TYPE t_ekko.
    *ALV data declarations
    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,
          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.
    * There are a number of ways to create a fieldcat.
    * For the purpose of this example i will build the fieldcatalog manualy
    * by populating the internal table fields individually and then
    * appending the rows. This method can be the most time consuming but can
    * also allow you  more control of the final product.
    * Beware though, you need to ensure that all fields required are
    * populated. When using some of functionality available via ALV, such as
    * total. You may need to provide more information than if you were
    * simply displaying the result
    *               I.e. Field type may be required in-order for
    *                    the 'TOTAL' function to work.
      fieldcatalog-fieldname   = 'EBELN'.
      fieldcatalog-seltext_m   = 'Purchase Order'.
      fieldcatalog-col_pos     = 0.
      fieldcatalog-outputlen   = 10.
      fieldcatalog-emphasize   = 'X'.
      fieldcatalog-key         = 'X'.
    *  fieldcatalog-do_sum      = 'X'.
    *  fieldcatalog-no_zero     = 'X'.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'EBELP'.
      fieldcatalog-seltext_m   = 'PO Item'.
      fieldcatalog-col_pos     = 1.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'STATU'.
      fieldcatalog-seltext_m   = 'Status'.
      fieldcatalog-col_pos     = 2.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'AEDAT'.
      fieldcatalog-seltext_m   = 'Item change date'.
      fieldcatalog-col_pos     = 3.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'MATNR'.
      fieldcatalog-seltext_m   = 'Material Number'.
      fieldcatalog-col_pos     = 4.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'MENGE'.
      fieldcatalog-seltext_m   = 'PO quantity'.
      fieldcatalog-col_pos     = 5.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'MEINS'.
      fieldcatalog-seltext_m   = 'Order Unit'.
      fieldcatalog-col_pos     = 6.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'NETPR'.
      fieldcatalog-seltext_m   = 'Net Price'.
      fieldcatalog-col_pos     = 7.
      fieldcatalog-outputlen   = 15. 
      fieldcatalog-do_sum      = 'X'.        "Display column total
      fieldcatalog-datatype     = 'CURR'.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'PEINH'.
      fieldcatalog-seltext_m   = 'Price Unit'.
      fieldcatalog-col_pos     = 8.
      append fieldcatalog to fieldcatalog.
      clear  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                = it_ekko
           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.                    " DISPLAY_ALV_REPORT
    *&      Form  DATA_RETRIEVAL
    *       Retrieve data form EKPO table and populate itab it_ekko
    form data_retrieval.
    select ebeln ebelp statu aedat matnr menge meins netpr peinh
    up to 10 rows
      from ekpo
      into table it_ekko.
    endform.                    " DATA_RETRIEVAL
    gowri
    Message was edited by:
            Gowri Krishna

  • EDIT THE FIELV VALUE IN ALV GRID DISPLAY

    Hi Guru ,
    How can I edit the value of a particular one or two fields in ALV GRID DISPLAY .
    Please reply me

    hi,
    1.Set status of all cells to editable using the layout structure.
    2.Use SET_READY_FOR_INPUT to activate the edit feature initially.
       (state "editable activated").
    3.Use IS_READY_FOR_INPUT to fetch current substate of editable cells.
    4.Use SET_READY_FOR_INPUT to switch between the substates.
        CALL METHOD g_grid->set_table_for_first_display
             EXPORTING i_structure_name = 'SFLIGHT'
                       is_layout        = gs_layout
             CHANGING  it_outtab        = gt_outtab.
    *§2.Use SET_READY_FOR_INPUT to allow editing initially.
    *   (state "editable and ready for input").
        CALL METHOD g_grid->set_ready_for_input
              EXPORTING i_ready_for_input = 1.
    *Use IS_READY_FOR_INPUT to fetch current substate of editable cells.
      IF g_grid->is_ready_for_input( ) EQ 0.
    *Use SET_READY_FOR_INPUT to switch between the substates.
        CALL METHOD g_grid->set_ready_for_input
                         EXPORTING i_ready_for_input = 1.
      ELSE.
        CALL METHOD g_grid->set_ready_for_input
                         EXPORTING i_ready_for_input = 0.
      ENDIF.

  • How to devide the top of page in alv grid display

    hi all
    in the alv grid display am getting the page number and total number of pages in the left hand side
    but what i need is i need in the right hand side
    how to get that

    Hi,
    PLease refer to the code below:
    *& Report  ZDEMO_ALVGRID                                               *
    *& Example of a simple ALV Grid Report                                 *
    *& The basic requirement for this demo is to display a number of       *
    *& fields from the EKKO table.                                         *
    REPORT  zdemo_alvgrid                 .
    TABLES:     ekko.
    type-pools: slis.                                 "ALV Declarations
    *Data Declaration
    TYPES: BEGIN OF t_ekko,
      ebeln TYPE ekpo-ebeln,
      ebelp TYPE ekpo-ebelp,
      statu TYPE ekpo-statu,
      aedat TYPE ekpo-aedat,
      matnr TYPE ekpo-matnr,
      menge TYPE ekpo-menge,
      meins TYPE ekpo-meins,
      netpr TYPE ekpo-netpr,
      peinh TYPE ekpo-peinh,
    END OF t_ekko.
    DATA: it_ekko TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
          wa_ekko TYPE t_ekko.
    *ALV data declarations
    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,
          gd_repid     like sy-repid,
          gt_events     type slis_t_event,
          gd_prntparams type slis_print_alv.
    *Start-of-selection.
    START-OF-SELECTION.
    perform data_retrieval.
    perform build_fieldcatalog.
    perform build_layout.
    perform build_events.
    perform build_print_params.
    perform display_alv_report.
    *&      Form  BUILD_FIELDCATALOG
    *       Build Fieldcatalog for ALV Report
    form build_fieldcatalog.
    * There are a number of ways to create a fieldcat.
    * For the purpose of this example i will build the fieldcatalog manualy
    * by populating the internal table fields individually and then
    * appending the rows. This method can be the most time consuming but can
    * also allow you  more control of the final product.
    * Beware though, you need to ensure that all fields required are
    * populated. When using some of functionality available via ALV, such as
    * total. You may need to provide more information than if you were
    * simply displaying the result
    *               I.e. Field type may be required in-order for
    *                    the 'TOTAL' function to work.
      fieldcatalog-fieldname   = 'EBELN'.
      fieldcatalog-seltext_m   = 'Purchase Order'.
      fieldcatalog-col_pos     = 0.
      fieldcatalog-outputlen   = 10.
      fieldcatalog-emphasize   = 'X'.
      fieldcatalog-key         = 'X'.
    *  fieldcatalog-do_sum      = 'X'.
    *  fieldcatalog-no_zero     = 'X'.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'EBELP'.
      fieldcatalog-seltext_m   = 'PO Item'.
      fieldcatalog-col_pos     = 1.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'STATU'.
      fieldcatalog-seltext_m   = 'Status'.
      fieldcatalog-col_pos     = 2.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'AEDAT'.
      fieldcatalog-seltext_m   = 'Item change date'.
      fieldcatalog-col_pos     = 3.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'MATNR'.
      fieldcatalog-seltext_m   = 'Material Number'.
      fieldcatalog-col_pos     = 4.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'MENGE'.
      fieldcatalog-seltext_m   = 'PO quantity'.
      fieldcatalog-col_pos     = 5.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'MEINS'.
      fieldcatalog-seltext_m   = 'Order Unit'.
      fieldcatalog-col_pos     = 6.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'NETPR'.
      fieldcatalog-seltext_m   = 'Net Price'.
      fieldcatalog-col_pos     = 7.
      fieldcatalog-outputlen   = 15.
      fieldcatalog-do_sum      = 'X'.
      fieldcatalog-datatype     = 'CURR'.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'PEINH'.
      fieldcatalog-seltext_m   = 'Price Unit'.
      fieldcatalog-col_pos     = 8.
      append fieldcatalog to fieldcatalog.
      clear  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_events
                is_print                = gd_prntparams
                i_save                  = 'X'
    *            is_variant              = z_template
           tables
                t_outtab                = it_ekko
           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.                    " DISPLAY_ALV_REPORT
    *&      Form  DATA_RETRIEVAL
    *       Retrieve data form EKPO table and populate itab it_ekko
    form data_retrieval.
    select ebeln ebelp statu aedat matnr menge meins netpr peinh
    up to 10 rows
      from ekpo
      into table it_ekko.
    endform.                    " DATA_RETRIEVAL
    * Form  TOP-OF-PAGE                                                 *
    * ALV Report Header                                                 *
    Form top-of-page.
    *ALV Header declarations
    data: t_header type slis_t_listheader,
          wa_header type slis_listheader,
          t_line like wa_header-info,
          ld_lines type i,
          ld_linesc(10) type c.
    * Title
      wa_header-typ  = 'H'.
      wa_header-info = 'EKKO Table Report'.
      append wa_header to t_header.
      clear wa_header.
    * Date
      wa_header-typ  = 'S'.
      wa_header-key = 'Date: '.
      CONCATENATE  sy-datum+6(2) '.'
                   sy-datum+4(2) '.'
                   sy-datum(4) INTO wa_header-info.   "todays date
      append wa_header to t_header.
      clear: wa_header.
    * Total No. of Records Selected
      describe table it_ekko lines ld_lines.
      ld_linesc = ld_lines.
      concatenate 'Total No. of Records Selected: ' ld_linesc
                        into t_line separated by space.
      wa_header-typ  = 'A'.
      wa_header-info = t_line.
      append wa_header to t_header.
      clear: wa_header, t_line.
      call function 'REUSE_ALV_COMMENTARY_WRITE'
           exporting
                it_list_commentary = t_header.
    *            i_logo             = 'Z_LOGO'.
    endform.
    *       FORM USER_COMMAND                                          *
    *       --> R_UCOMM                                                *
    *       --> RS_SELFIELD                                            *
    FORM user_command USING r_ucomm LIKE sy-ucomm
                      rs_selfield TYPE slis_selfield.
    * Check function code
      CASE r_ucomm.
        WHEN '&IC1'.
    *   Check field clicked on within ALVgrid report
        IF rs_selfield-fieldname = 'EBELN'.
    *     Read data table, using index of row user clicked on
          READ TABLE it_ekko INTO wa_ekko INDEX rs_selfield-tabindex.
    *     Set parameter ID for transaction screen field
          SET PARAMETER ID 'BES' FIELD wa_ekko-ebeln.
    *     Sxecute transaction ME23N, and skip initial data entry screen
          CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.
        ENDIF.
      ENDCASE.
    ENDFORM.
    *&      Form  BUILD_EVENTS
    *       Build events table
    form build_events.
      data: ls_event type slis_alv_event.
      call function 'REUSE_ALV_EVENTS_GET'
           exporting
                i_list_type = 0
           importing
                et_events   = gt_events[].
      read table gt_events with key name =  slis_ev_end_of_page
                               into ls_event.
      if sy-subrc = 0.
        move 'END_OF_PAGE' to ls_event-form.
        append ls_event to gt_events.
      endif.
        read table gt_events with key name =  slis_ev_end_of_list
                               into ls_event.
      if sy-subrc = 0.
        move 'END_OF_LIST' to ls_event-form.
        append ls_event to gt_events.
      endif.
    endform.                    " BUILD_EVENTS
    *&      Form  BUILD_PRINT_PARAMS
    *       Setup print parameters
    form build_print_params.
      gd_prntparams-reserve_lines = '3'.   "Lines reserved for footer
      gd_prntparams-no_coverpage = 'X'.
    endform.                    " BUILD_PRINT_PARAMS
    *&      Form  END_OF_PAGE
    form END_OF_PAGE.
      data: listwidth type i,
            ld_pagepos(10) type c,
            ld_page(10)    type c.
      write: sy-uline(50).
      skip.
      write:/40 'Page:', sy-pagno .
    endform.
    *&      Form  END_OF_LIST
    form END_OF_LIST.
      data: listwidth type i,
            ld_pagepos(10) type c,
            ld_page(10)    type c.
      skip.
      write:/40 'Page:', sy-pagno .
    endform.
    Thanks,
    Sriram Ponna.

  • Re: alv grid display.

    Hi All,
                  I have a final alv grid display and i have two fields which are edited by clicking the EDIT button given on the output PF-Status.
    now i want to disable this EDIT button when the user changes the value of these two fields. after which user presses the save button to save the updated list.
    Please let me know any method or any parameter which has to be passed or any SAMPLE CODE to do this.
    satisfactory answers will be rewarded.
    Thanks,
    Naveen

    Try this to deactivate the button..
    Set pf-status 'STATUS' excluding itab. <---Populate the itab with EDIT Button
    double click on STATUS, goto -> attributes -> push button assignment -> display all.
    Now when you use the excluding itab the buton gets deactivated but not completely removed
    As your requirement is when the field gets changed
    IF ...         <---------------Write the condition here if the field get changed
      Set pf-status 'STATUS' excluding itab
    else.
    Set pf-status 'STATUS'.
    endif.

  • ALV GRID Display function module giving Run time error

    Hello Experts,
    I have ALV report, In which I am using ALV grid dispaly FM to display the report.
    But when my out table which I am passing to FM is empty that time ALV grid display shows blank ALV report. but when out table is not empty that time  I am getting the Run time error, which shows message "Field symbol has not yet been assigned".
    Can any one please help me out in this.
    Thanks

    TYPES: BEGIN OF type_out,
            col00    TYPE   ytlet-rzzyyproduct,
            col01    TYPE   ytlet-kslvt,
            col02    TYPE   ytlet-kslvt,
            col03    TYPE   ytlet-kslvt,
            col04    TYPE   ytlet-kslvt,
            col05    TYPE   ytlet-kslvt,
            col06    TYPE   ytlet-kslvt,
            col07    TYPE   ytlet-kslvt,
            col08    TYPE   ytlet-kslvt,
            col09    TYPE   ytlet-kslvt,
            col10    TYPE   ytlet-kslvt,
            col11    TYPE   ytlet-kslvt,
            col12    TYPE   ytlet-kslvt,
            col13    TYPE   ytlet-kslvt,
            col14    TYPE   ytlet-kslvt,
            col15    TYPE   ytlet-kslvt,
            col16    TYPE   ytlet-kslvt,
            col17    TYPE   ytlet-kslvt,
            col18    TYPE   ytlet-kslvt,
            col19    TYPE   ytlet-kslvt,
            col20    TYPE   ytlet-kslvt,
            col21    TYPE   ytlet-kslvt,
            col22    TYPE   ytlet-kslvt,
            col23    TYPE   ytlet-kslvt,
            col24    TYPE   ytlet-kslvt,
            col25    TYPE   ytlet-kslvt,
            col26    TYPE   ytlet-kslvt,
            col27    TYPE   ytlet-kslvt,
            col28    TYPE   ytlet-kslvt,
            col29    TYPE   ytlet-kslvt,
            col30    TYPE   ytlet-kslvt,
            col31    TYPE   ytlet-kslvt,
            col32    TYPE   ytlet-kslvt,
            col33    TYPE   ytlet-kslvt,
            col34    TYPE   ytlet-kslvt,
            col35    TYPE   ytlet-kslvt,
            col36    TYPE   ytlet-kslvt,
            col37    TYPE   ytlet-kslvt,
            col38    TYPE   ytlet-kslvt,
            col39    TYPE   ytlet-kslvt,
            col40    TYPE   ytlet-kslvt,
            col41    TYPE   ytlet-kslvt,
            col42    TYPE   ytlet-kslvt,
            col43    TYPE   ytlet-kslvt,
            col44    TYPE   ytlet-kslvt,
          END OF type_out.
    DATA: t_fieldcat   TYPE slis_t_fieldcat_alv,   "Field catelog table
          w_fieldcat   TYPE slis_fieldcat_alv,     "Field catelog Work area
          w_layout     TYPE slis_layout_alv,       "Layout structure
          w_event      TYPE slis_alv_event,        "Event structure
          t_event      TYPE slis_t_event,          "Event structure
          t_sort       TYPE STANDARD TABLE OF slis_sortinfo_alv,
          t_callback_main_user_command  TYPE  slis_formname,
          v_selfield TYPE slis_selfield.
    FIELD-SYMBOLS: <ksl>.
    FORM DISPLAY_REPORT .
    *Prepare Field Catlog
      PERFORM  creat_field_catlog.
    *Set layout
      PERFORM  set_layout.
    *Get Event
      PERFORM get_event.
    *Display Report
      PERFORM display_alv_report.
    ENDFORM.                    " DISPLAY_REPORT
    FORM creat_field_catlog .
      PERFORM add_fields_catlog USING:
           '01'    'RZZYYPRODUCT'     'IT_OUT'    'MPMs' ' ',
           '02'    'KSLVT'     'IT_OUT'    'License Fee' ' ',
           '03'    'KSLVT'     'IT_OUT'    'Ad Sales' ' ',
           '04'    'KSLVT'     'IT_OUT'    'Promo Fees' ' ',
           '05'    'KSLVT'     'IT_OUT'    'Total Ad Sales/Promo' ' ',
           '06'    'KSLVT'     'IT_OUT'    'Other' ' ',
           '07'    'KSLVT'     'IT_OUT'    'Total' ' ',
           '08'    'KSLVT'     'IT_OUT'    'Dom Station' ' ',
           '09'    'KSLVT'     'IT_OUT'    'Basic Cable/Free VOD' ' ',
           '10'    'KSLVT'     'IT_OUT'    'License Fee' ' ',
           '11'    'KSLVT'     'IT_OUT'    'Ad Sales (incl Internet)' ' ',
           '12'    'KSLVT'     'IT_OUT'    'Promo Fees' ' ',
           '13'    'KSLVT'     'IT_OUT'    'Ad Sales & Promo Fees' ' ',
           '14'    'KSLVT'     'IT_OUT'    'Foreign' ' ',
           '15'    'KSLVT'     'IT_OUT'    'Pay TV' ' ',
           '16'    'KSLVT'     'IT_OUT'    'Other' ' ',
           '17'    'KSLVT'     'IT_OUT'    'Total' ' ',
           '18'    'KSLVT'     'IT_OUT'    'Home Entertainment' ' ',
           '19'    'KSLVT'     'IT_OUT'    'SPTI' ' ',
           '20'    'KSLVT'     'IT_OUT'    'All Other Divisions' ' ',
           '21'    'KSLVT'     'IT_OUT'    'Total' ' ',
           '22'    'KSLVT'     'IT_OUT'    'Total Revenue' ' ',
           '23'    'KSLVT'     'IT_OUT'  'PV Net Down & Producers Share' '',
           '24'    'KSLVT'     'IT_OUT'    'Total Net Revenue' ' ',
           '25'    'KSLVT'     'IT_OUT'    'Development Expense' ' ',
           '26'    'KSLVT'     'IT_OUT'    'SOP Deficits' ' ',
           '27'    'KSLVT'     'IT_OUT'    'Amortization' ' ',
           '28'    'KSLVT'     'IT_OUT'    'Other COS ' ' ',
           '29'    'KSLVT'     'IT_OUT'    'Total COS' ' ',
           '30'    'KSLVT'     'IT_OUT'    'Profit Before Releasing' ' ',
           '31'    'KSLVT'     'IT_OUT'    'Gross Profit %' ' ',
           '32'    'KSLVT'     'IT_OUT'    'SPT' ' ',
           '33'    'KSLVT'     'IT_OUT'    'Home Entertainment' ' ',
           '34'    'KSLVT'     'IT_OUT'    'SPTI' ' ',
           '35'    'KSLVT'     'IT_OUT'    'All Other Divisions' ' ',
           '36'    'KSLVT'     'IT_OUT'    'Other' ' ',
           '37'    'KSLVT'     'IT_OUT'    'Total' ' ',
           '38'    'KSLVT'     'IT_OUT'    'Gross Profit' ' ',
           '39'    'KSLVT'     'IT_OUT'    'SPT' ' ',
           '40'    'KSLVT'     'IT_OUT'    'Home Entertainment' ' ',
           '41'    'KSLVT'     'IT_OUT'    'SPTI' ' ',
           '42'    'KSLVT'     'IT_OUT'    'All Other Divisions' ' ',
           '43'    'KSLVT'     'IT_OUT'    'Other' ' ',
           '44'    'KSLVT'     'IT_OUT'    'Total' ' ',
           '45'    'KSLVT'     'IT_OUT'    'Net Margin' ' '.
    ENDFORM.                    " CREAT_FIELD_CATLOG
    *&      Form  ADD_FIELDS_CATLOG
          Filling of field Catlog
    FORM add_fields_catlog  USING    p_colpos
                                     p_fildname
                                     p_tabname
                                     p_fildtext
                                     p_ndisplay.
      w_fieldcat-row_pos       = '1'.
      w_fieldcat-col_pos       = p_colpos.
      w_fieldcat-fieldname     = p_fildname.
      w_fieldcat-tabname       = p_tabname.
      w_fieldcat-reptext_ddic  = p_fildtext.
      w_fieldcat-no_out        = p_ndisplay.
      APPEND w_fieldcat TO t_fieldcat.
      CLEAR: w_fieldcat.
    ENDFORM.                    " ADD_FIELDS_CATLOG
    *&      Form  SET_LAYOUT
          Set Layout
    FORM set_layout .
      w_layout-colwidth_optimize = 'X'.
    ENDFORM.                    " SET_LAYOUT
    *&      Form  GET_EVENT
          text
    FORM get_event .
      w_event-name = 'TOP-OF-PAGE'.
      w_event-form = 'F_TOP-OF_PAGE'.
      APPEND w_event TO t_event.
    ENDFORM.                    " GET_EVENT
    *&      Form  TOP-OF-PAGE
          Top of Page
    FORM top-of-page.
      DATA : t_list_commentry   TYPE slis_t_listheader,
               w_header           TYPE slis_listheader,
               lv_text(90)        TYPE c,
               l_text(90)         TYPE c,
               lv_rundate(10)     TYPE c,
               lv_runtime(10)     TYPE c.
      CONSTANTS: c_space(2) TYPE c VALUE '  ',
                 c_space2(6) TYPE c VALUE '      '.
      w_header-typ  = 'S'.
      w_header-key  = 'Program:'.
      w_header-info = sy-repid.
      APPEND w_header TO t_list_commentry.
      WRITE: sy-datum TO lv_rundate MM/DD/YYYY.
      WRITE: sy-uzeit TO lv_runtime USING EDIT MASK '__:__:__'.
    CLEAR w_header.
    w_header-typ  = 'S'.
    w_header-key  = text-021.
    w_header-info = lv_rundate.
    APPEND w_header TO t_list_commentry.
      CLEAR: w_header.
      w_header-typ  = 'S'.
      w_header-key  = 'User Id'.
      w_header-info = sy-uname.
      APPEND w_header TO t_list_commentry.
      CLEAR: w_header.
      w_header-typ  = 'S'.
      w_header-key  = 'Run Date'.
      w_header-info = lv_rundate.
      APPEND w_header TO t_list_commentry.
      CLEAR: w_header.
      w_header-typ  = 'S'.
      w_header-key  = 'Run Time'.
      w_header-info = lv_runtime.
      APPEND w_header TO t_list_commentry.
      CLEAR: w_header.
      w_header-typ  = 'H'.
      w_header-key  = 'order'.
      w_header-info = 'MCR Report'.
      APPEND w_header TO t_list_commentry.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          it_list_commentary = t_list_commentry.
    ENDFORM.                    "TOP-OF-PAGE
    FORM display_alv_report .
      CONSTANTS : gc_save TYPE c VALUE 'A'. "Save Layout
    t_callback_main_user_command  = c_user_command.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
      I_INTERFACE_CHECK                 = ' '
      I_BYPASSING_BUFFER                = ' '
      I_BUFFER_ACTIVE                   = ' '
         i_callback_program                = sy-repid
      I_CALLBACK_PF_STATUS_SET          = ' '
        i_callback_user_command           = t_callback_main_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                         = w_layout
         it_fieldcat                       = t_fieldcat
      IT_EXCLUDING                      =
      IT_SPECIAL_GROUPS                 =
      IT_SORT                           =
      IT_FILTER                         =
      IS_SEL_HIDE                       =
      I_DEFAULT                         = 'X'
         i_save                            = gc_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_out
    EXCEPTIONS
      PROGRAM_ERROR                     = 1
      OTHERS                            = 2
       ENDIF.

  • Wan to add push button in the output of ALV Grid display.

    Hi Friends,
    I wan to add a Push button in the output of ALV GRID display with STANDARD ikons.
    How to copy standard ikons of GRID output.
    How to apply the copied status into my code.
    Regards,
    Viji

    Hi,
    Goto SE41, create a pf-status for your alv report program.
    On the next screen, click menu EXTRAS --> click option ADJUST TEMPLATES and select radiobutton LIST VIEWER --> you will get all standard buttons of alv in the pf-status.
    Delete the unwanted buttons and also you can add new buttons if reqd.
    Activate pf-status --> and apply in alv program.
    Now to apply this pf-status in your alv report follow code:-
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
         i_callback_program                = v_rep_id       " report id
         i_callback_pf_status_set          = 'PF'           " for PF-STATUS
         i_callback_user_command           = 'USER_COMMAND' " for User-Command
         is_layout                         = wa_layout      " for layout
         it_fieldcat                       = it_field       " field catalog
         it_sort                           = it_sort        " sort info
        TABLES
          t_outtab                          = it_final      " internal table
       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.
    *&      Form  pf
    *       SUB-ROUTINE PF IS USED TO SET THE PF-STATUS OF THE SCREEN
    *       ON WHICH THE ALV GRID IS DISPLAYED
    *       -->RT_EXTAB
    FORM pf USING rt_extab TYPE slis_t_extab.
      SET PF-STATUS 'ZTG_STAT'. "<--pass pf-status name here
    ENDFORM.                    "pf
    *&      Form  USER_COMMAND
    *       SUB-ROUTINE USER_COMMAND IS USED TO HANDLE THE USER ACTION
    *       AND EXECUTE THE APPROPIATE CODE
    *      -->LV_OKCODE   used to capture the function code
    *                     of the user-defined push-buttons
    *      -->L_SELFIELD   text
    FORM user_command USING lv_okcode LIKE sy-ucomm l_selfield TYPE slis_selfield.
    * assign the function code to variable v_okcode
      lv_okcode = sy-ucomm.
    * handle the code execution based on the function code encountered
      CASE lv_okcode.
        WHEN '<function_code>'. "<--to handle user actions
      ENDCASE.
    ENDFORM.                    "USER_COMMAND
    Hope this helps you.
    Regards,
    Tarun

  • How to change the standard layout sets in ALV List

    Hi Gurus,
    How to change the standard layout sets in ALV list.
    Is there any standard program ? or specific way to acheive this?
    Kindly drop some clues?Every valuable clues rewarded more points........
    Thanks in Advance,
    Dharani

    Hello Dharani
    All required function modules can be found in function group SLVC (assuming that you are using OO-based ALV or, at least, fm REUSE_ALV_GRID_DISPLAY_LVC):
    LVC_VARIANT_DEFAULT_GET (Read default display variant (description only, w/o field catalog))
    LVC_VARIANT_EXISTENCE_CHECK
    LVC_VARIANT_F4 (Display variant selection dialog box)
    LVC_VARIANT_SELECT (Read a display variant)
    For a sample report using LVC_VARIANT_DEFAULT_GET have a look at BCALV_GRID_10.
    Regards,
      Uwe

  • Kindly help to develop alv grid display

    Hi ,
    I have a requirement in which I need to display ALV GRID display and in its tool bar 4 butons are required. In the same view down to alv display i want to develop a tabstrip and its functionalities.I have designed classic alv using SALV_WD_TABLE component. I want a good GRID Display, not like flat field names that comes in list display, looking for bulged fields(like what comes for ALV GRID in normal abap)  display with print version etc hidden and buttons at the top of ALV.  Kindly help
    Highly rewarded
    Kindly help
    Regards,
    Lakshmi
    Edited by: Lakshmi Menon on Nov 27, 2008 4:49 PM

    Well Web Dynpro is generally output in HTML so the output formatting is never going to quite look like a desktop application (which is the case with the ALV Grid).  You have very little control over the look of the column headers.  In fact you can only manipulate what is available via the Portal Theme. 
    There is a new Tradeshow Plus theme available in NetWeaver 7.01 which uses a gradiant background for the column headers.  This gives them a little more depth:
    http://www.flickr.com/photos/tjung/3068850120/
    The other option is next year when NetWeaver Business Client version 3.0 comes out, you will be able to render Web Dynpro applications using the NWBC Smart Client Rendering.  This will render Web Dynpro applications using desktop libraries instead of HTML/Browser. This gives Web Dynpro a more SAPGUI/Desktop appears of course.
    http://www.flickr.com/photos/tjung/2685619882/in/set-72157606418550143/

  • Update values in AlV grid display after entering value

    Hi,
         I have an issue in ALV grid display.
        Let me explain.
        i have 8 fields to display in which one is editiable.
       Fields are: date
                       material,
                       material Description,
                       Opening Stock,
                       Closing stock-  (  this field is editiable)
                       Closing stock,
                       Received Stock,
                       Actual production.
    Actual production = Closing stock + removal stock
                                 - receipt stock - opening stock.
    when i change the value of closing stock and press enter, actual production should get update, the new values should display.
    Thany you in advance.

    Hi,
    Please refer the code below:
    REPORT z_demo_alv_jg.*******************************************************************
    * TYPE-POOLS                                                      *
    TYPE-POOLS: slis. *******************************************************************
    * INTERNAL TABLES/WORK AREAS/VARIABLES     *
    DATA: i_fieldcat TYPE slis_t_fieldcat_alv,
          i_index TYPE STANDARD TABLE OF i WITH HEADER LINE,
          w_field TYPE slis_fieldcat_alv,
          p_table LIKE dd02l-tabname,
          dy_table TYPE REF TO data,
          dy_tab TYPE REF TO data,
          dy_line TYPE REF TO data.*******************************************************************
    * FIELD-SYMBOLS                                                   *
    FIELD-SYMBOLS: <dyn_table> TYPE STANDARD TABLE,
                   <dyn_wa> TYPE ANY,
                   <dyn_field> TYPE ANY,
                   <dyn_tab_temp> TYPE STANDARD TABLE.*******************************************************************
    * SELECTION SCREEN                                                *
    PARAMETERS: tabname(30) TYPE c,
                lines(5)  TYPE n.*******************************************************************
    * START-OF-SELECTION                                              *
    START-OF-SELECTION.* Storing table name
      p_table = tabname.* Create internal table dynamically with the stucture of table name
    * entered in the selection screen
      CREATE DATA dy_table TYPE STANDARD TABLE OF (p_table).
      ASSIGN dy_table->* TO <dyn_table>.
      IF sy-subrc <> 0.
        MESSAGE i000(z_zzz_ca_messages) WITH ' No table found'.    LEAVE TO LIST-PROCESSING.
      ENDIF.
    * Create workarea for the table
      CREATE DATA dy_line LIKE LINE OF <dyn_table>.
      ASSIGN dy_line->* TO <dyn_wa>.* Create another temp. table
      CREATE DATA dy_tab TYPE STANDARD TABLE OF (p_table).
      ASSIGN dy_tab->* TO <dyn_tab_temp>.  SORT i_fieldcat BY col_pos.* Select data from table
      SELECT * FROM (p_table)
      INTO TABLE <dyn_table>
      UP TO lines ROWS.  REFRESH <dyn_tab_temp>.* Display report
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
        EXPORTING
          i_callback_program       = sy-repid
          i_structure_name         = p_table
          i_callback_user_command  = 'USER_COMMAND'
          i_callback_pf_status_set = 'SET_PF_STATUS'
        TABLES
          t_outtab                 = <dyn_table>
        EXCEPTIONS
          program_error            = 1
          OTHERS                   = 2.  IF sy-subrc <> 0.  ENDIF.*&-----------------------------------------------------------------*
    *&      Form  SET_PF_STATUS
    *       Setting custom PF-Status
    *      -->RT_EXTAB   Excluding table
    FORM set_pf_status USING rt_extab TYPE slis_t_extab.  SET PF-STATUS 'Z_STANDARD'.ENDFORM.                    "SET_PF_STATUS*&----------------------------------------------------------------*
    *&      Form  user_command
    *       Handling custom function codes
    *      -->R_UCOMM      Function code value
    *      -->RS_SELFIELD  Info. of cursor position in ALV
    FORM user_command  USING    r_ucomm LIKE sy-ucomm
                               rs_selfield TYPE slis_selfield.* Local data declaration
      DATA: li_tab TYPE REF TO data,
            l_line TYPE REF TO data.* Local field-symbols
      FIELD-SYMBOLS:<l_tab> TYPE table,
                    <l_wa>  TYPE ANY.* Create table
      CREATE DATA li_tab TYPE STANDARD TABLE OF (p_table).
      ASSIGN li_tab->* TO <l_tab>.* Create workarea
      CREATE DATA l_line LIKE LINE OF <l_tab>.
      ASSIGN l_line->* TO <l_wa>.  CASE r_ucomm.*   When a record is selected
        WHEN '&IC1'.*     Read the selected record
          READ TABLE <dyn_table> ASSIGNING <dyn_wa> INDEX
          rs_selfield-tabindex.      IF sy-subrc = 0.*       Store the record in an internal table
            APPEND <dyn_wa> TO <l_tab>.*       Fetch the field catalog info
            CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
              EXPORTING
                i_program_name         = 'Z_DEMO_PDF_JG'
                i_structure_name       = p_table
              CHANGING
                ct_fieldcat            = i_fieldcat
              EXCEPTIONS
                inconsistent_interface = 1
                program_error          = 2
                OTHERS                 = 3.
            IF sy-subrc = 0.*         Make all the fields input enabled except key fields
              w_field-input = 'X'.          MODIFY i_fieldcat FROM w_field TRANSPORTING input
              WHERE key IS INITIAL.        ENDIF.*       Display the record for editing purpose
            CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
              EXPORTING
                i_callback_program    = sy-repid
                i_structure_name      = p_table
                it_fieldcat           = i_fieldcat
                i_screen_start_column = 10
                i_screen_start_line   = 15
                i_screen_end_column   = 200
                i_screen_end_line     = 20
              TABLES
                t_outtab              = <l_tab>
              EXCEPTIONS
                program_error         = 1
                OTHERS                = 2.        IF sy-subrc = 0.*         Read the modified data
              READ TABLE <l_tab> INDEX 1 INTO <l_wa>.*         If the record is changed then track its index no.
    *         and populate it in an internal table for future
    *         action
              IF sy-subrc = 0 AND <dyn_wa> <> <l_wa>.
                <dyn_wa> = <l_wa>.
                i_index = rs_selfield-tabindex.
                APPEND i_index.
              ENDIF.
            ENDIF.      ENDIF.*   When save button is pressed
        WHEN 'SAVE'.*     Sort the index table
          SORT i_index.*     Delete all duplicate records
          DELETE ADJACENT DUPLICATES FROM i_index.      LOOP AT i_index.*       Find out the changes in the internal table
    *       and populate these changes in another internal table
            READ TABLE <dyn_table> ASSIGNING <dyn_wa> INDEX i_index.
            IF sy-subrc = 0.
              APPEND <dyn_wa> TO <dyn_tab_temp>.
            ENDIF.      ENDLOOP.*     Lock the table
          CALL FUNCTION 'ENQUEUE_E_TABLE'
            EXPORTING
              mode_rstable   = 'E'
              tabname        = p_table
            EXCEPTIONS
              foreign_lock   = 1
              system_failure = 2
              OTHERS         = 3.      IF sy-subrc = 0.*       Modify the database table with these changes
            MODIFY (p_table) FROM TABLE <dyn_tab_temp>.        REFRESH <dyn_tab_temp>.*       Unlock the table
            CALL FUNCTION 'DEQUEUE_E_TABLE'
              EXPORTING
                mode_rstable = 'E'
                tabname      = p_table.      ENDIF.
      ENDCASE.  rs_selfield-refresh = 'X'.ENDFORM.                    "user_command
    Thanks,
    Sriram Ponna.

  • How to capture the checkbox status in ALV Grid display

    I need some immediate help regarding Grid ALV.
    My Requirement: I need to display an ALV grid report along with checkboxes. Further, I need to provide an option wherein the user can checkboxes and select the records that I need to process further (by clicking the process button on the ALV Report).
    My Query: The problem here is that I am not able to capture the status of the checkboxes. This means that I am not able to capture which of the records have been selected by checking their resp checkboxes.
    Solutions that I have tried: I have tried capturing the same at user command by checking the value in slis_selfield. But all the records show the value as 1 for the checkbox field.
    Kinldy suggest how to go about it.
    I am not using Object Oriented ALV. Please suggest something to be used in ALV Grid display in 4.6C version.
    Regards,
    Namrata

    Here is a Sample code , it might help you
    TABLES : sflight.
    TYPE-POOLS: slis.
    DATA : w_repid LIKE sy-repid.
    w_repid = sy-repid.
    DATA: BEGIN OF it_sflight OCCURS 0,
      checkbox(1),
      carrid LIKE sflight-carrid,
    END OF it_sflight.
    *layout
    DATA: wa_layout TYPE slis_layout_alv.
    *field catalog
    DATA: it_fieldcatalog TYPE slis_t_fieldcat_alv,
              wa_fieldcatalog TYPE slis_fieldcat_alv.
    START-OF-SELECTION.
      SELECT carrid FROM sflight
         INTO CORRESPONDING FIELDS OF TABLE it_sflight.
    END-OF-SELECTION.
      CLEAR it_fieldcatalog.
      REFRESH it_fieldcatalog.
      wa_fieldcatalog-fieldname = 'CHECKBOX'.
      wa_fieldcatalog-outputlen = '3'.
      wa_fieldcatalog-col_pos = '1'.
      wa_fieldcatalog-seltext_m = 'Chk'.
      wa_fieldcatalog-checkbox = 'X'.
      wa_fieldcatalog-edit = 'X'.
      APPEND wa_fieldcatalog TO it_fieldcatalog.
      CLEAR wa_fieldcatalog.
      wa_fieldcatalog-fieldname = 'CARRID'.
      wa_fieldcatalog-outputlen = '10'.
      wa_fieldcatalog-col_pos = '2'.
      wa_fieldcatalog-seltext_m = 'Carrid'.
      APPEND wa_fieldcatalog TO it_fieldcatalog.
      CLEAR wa_fieldcatalog.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program = w_repid
          is_layout = wa_layout
          i_callback_user_command = 'USER_COMMAND'
          it_fieldcat = it_fieldcatalog
        TABLES
          t_outtab = it_sflight
        EXCEPTIONS
          program_error = 1
          OTHERS = 2.
    *& Form USER_COMMAND
    FORM user_command USING p_ucomm TYPE sy-ucomm
      p_selfld TYPE slis_selfield.
      CASE p_ucomm.
       WHEN '&DATA_SAVE'.
          DATA ref1 TYPE REF TO cl_gui_alv_grid.
          CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
             IMPORTING
               e_grid = ref1.
          CALL METHOD ref1->check_changed_data.
          LOOP AT it_sflight WHERE checkbox = 'X'.
             DELETE it_sflight INDEX sy-tabix.
          ENDLOOP.
          p_selfld-refresh = 'X'.
      ENDCASE.
    ENDFORM. "user_command

  • How to color a row in ALV grid display

    Hi,
    A few rows in the output of ALV grid display should be shown in different color.How can I achieve this?

    Hi,
    Try out this code
    DATA : BEGIN OF G_T_CASH OCCURS 0,
           PARTICULARS TYPE CHAR120,
           AMOUNT1 TYPE CHAR20,
           AMOUNT2 TYPE CHAR20,
           AMOUNT3 TYPE CHAR20,    
           ROW_COLOR TYPE CHAR4,----
    add this in the internal table for alv
          END OF G_T_CASH.
      CLEAR G_WA_CASH.
      G_WA_CASH-PARTICULARS = 'Opening Cash Balance'.
      G_WA_CASH-AMOUNT1 = G_DMBTR.
      G_WA_CASH-AMOUNT2 = ''.
      G_WA_CASH-AMOUNT3 = ''.
    while appending other values also add the following code
      G_WA_CASH-ROW_COLOR = 'C200'.----- C200 depicts light gray color
      APPEND G_WA_CASH TO G_T_CASH.
    add the following code in layout
    MOVE 'ROW_COLOR' TO WA_LS_LAYOUT-INFO_FIELDNAME.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          I_BYPASSING_BUFFER = ' '
          I_SAVE             = 'A'
        I_CALLBACK_PROGRAM                = SY-REPID
      I_CALLBACK_PF_STATUS_SET          = 'SET_PF_STATUS'
       I_CALLBACK_USER_COMMAND           = 'USER_COMMAND'
         IS_LAYOUT                        = WA_LS_LAYOUT
         IT_FIELDCAT                      = G_T_CATALOG
         IT_EVENTS                         = GT_EVENTS
         TABLES
           T_OUTTAB                       = G_T_CASH[]
    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.
    Let me know if the problem still persist.
    Regards,
    Janaki

Maybe you are looking for

  • BI Publisher 11g 11.1.1.6.0 and OIM Reports Not Showing Up

    After upgrading to OIM BP04, I following the readme to install BI Publishing, but used the 11.1.1.6.0 version. After creating: C:\Oracle\Middleware\Oracle_BIP\user_projects\domains\bifoundation_domain\config\bipublisher\repository\Reports\Oracle Iden

  • My question was not answered in a timely matter so I'll ask again...

    My Guardians of the Galaxy Blu-Ray copy gave me a code to download the movie on iTunes for free. The download seemed successful, and when I played it, the title screen came up, but when I tried to play the movie or the bonus features, there was no au

  • Duplex Printing for MX922

    Hey I didn't see this in the forums anywhere so thought I'd make a new topic. How do I duplex print with the mx922? I'm printing from a USB stick and can't seem to find how to print both sides of the paper. Bonus question: my printer only seems to ac

  • No songs available...

    Help!!!! I´ve got Nokia X6 comes with music. All music is gone from the player of the phone. My computer finds them, but my phone keeps telling, that there are no music in my player in the phone????

  • After Effects CS6 - Project Files Virused?

    Guys, I'm collaborating on a stereo TV show with several other CG artists (living around the U.S.), and one of them has been complaining for months now about how his AE project files (created with CS6, running under Windows 8 64-bit) have gotten huge