How to disable sorting for some columns in a ALV GRID?

Hi i have requirement where I have to disable sorting for some columns in a ALV GRID. i am using REUSE_ALV_GRID_DISPLAY function module.
Can anybody help me. how to acieve this? Any code snippets will really be appreciated.

Hi,
I have tried this but not completely successful. I think this can be done using the OOPS method.
  DATA: it_event_exit TYPE  slis_t_event_exit.
  DATA: w_exit TYPE slis_event_exit.
  w_exit-ucomm = '&ODN'.
  w_exit-before = 'X'.
  CLEAR w_exit-after.
  APPEND w_exit TO it_event_exit.
  w_exit-ucomm = '&OUP'.
  w_exit-before = 'X'.
  CLEAR w_exit-after.
  APPEND w_exit TO it_event_exit.
  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      i_callback_program          = w_repid
      i_callback_top_of_page      = 'ALV_TOP_OF_PAGE'
      i_callback_html_top_of_page = 'ALV_HTML_TOP_OF_PAGE'
      i_callback_user_command     = 'USER_COMMAND'  <- User command form
      is_layout                   = wm_layout
      it_fieldcat                 = wt_fieldcat
      it_events                   = i_events
      it_event_exit               = it_event_exit    <- Need to fill
      it_sort                     = wt_sort
      i_default                   = 'X'
Now you can capture this events in the user command
FORM user_command  USING r_ucomm LIKE sy-ucomm
                         rs_selfield TYPE slis_selfield.
  IF r_ucomm = '&OUP' and rs_selfield-SEL_TAB_FIELD = 'Your field name'.
  ENDIF.
ENDFORM.                    "user_command
In this form you will get the function code in 'r_ucomm' and the field selected for sorting in 'rs_selfield-SEL_TAB_FIELD'. But reseting 'r_ucomm' will not work.
May be somebody else can give some help on this.
But this will work if you follow the oop method.
Please see this document for more info.
http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/an easy reference for alv grid control.pdf
Thanks
Vinod

Similar Messages

  • Sap.m.Table: How to disable includeItemInSelection for one column?

    Dear UI5 Experts,
    I have used includeItemInSelection method for whole table as it is required for me on selectionChange event in sap.m.Table control.
    Now, I have a requirement where I need to disable that method for one column. Is there a way to disable includeItemInSelection method for only one column in sap.m.Table control. Please Advice.
    Thank you!
    Regards,
    Sai Vellanki

    Hi,
    you can use method oTable.bindAggregation
    Refer example sap.m.Table and see the source code.
    Regards,
    Chandra

  • Disable scrollbars for some columns in matrix

    Hi,
    I created a form which includes a matrix. This matrix contains a lot of columns. Because of the amount, the matrix automatically creates a scrollbar at the bottom.
    I don't want the matrix to have a scrollbar on the first and second columns. Is there a possibility to set a column of which the scrollbar starts.
    The form in which the user can enter a forecast (MRP > Forecasts) contains this feature. When specifying a date range in this form, the first two columns are not included in the scrollbar at the bottom of the matrix.
    Can anyone tell me how this is done?
    Thanks in advance!
    Jerrel

    Hi Jerrel,
    I don't think this is possible, but to double-check, please export the MRP>Forecasts form to XML - and check what might be special, but I suppose you won't find anything...
    Other than that you could just define 2 Matrixes and have them just side-by-side - but of course this would get tricky when it comes to vertical scrolling etc.
    ...but maybe someone else has a better idea?
    Regards,
    Frank

  • How to disable iMessage for a single contact?

    Hello apple communites, I have a simple and hopefully simple to answer question..
    I am curious as to how to disable iMessaging for a single contact.  My sister when she got her phone number originally had an iPhone, she has since gotten an android and kept the same phone number.  However I am running into issues with text messages to her, my phone still thinks she has an iPhone and continues to send every text as an iMessage, resulting in a failed message.  I can easily hit the "send again as a text message" option and the message/picture sends as normal.  I however find this a bit fustrating, and have tried everything I can think of to attempt to disable this.  However all the online tutorials I can find regarding disabling iMessage turns the feature off completly, I don't wish to do that. 
    I have attempted to completely delete, (including all existing all texts and call history), and then re-add the contact, but that does not work either, my iPhone still attempts to send messages to my sister as an iMessge. Any help, if any, would be appreciated. Thanks in advance.

    Your sister needs to disable iMessage on her iPhone if the iPhone is still available if she hasn't already done so.
    If she has, does she have iMessage enabled with the same Apple ID on another iOS device or on a Mac as was used to activate iMessage on her iPhone?

  • How to disable click for open a app mobile? i have picture.

    how to disable click for open a app mobile?
    How i do?
    why adobe captivate need to click for open app.
    i need to open auto.
    thank you

    Swiping down from the midle of the screen will open the search window on its upper section.

  • How to disable debugger for sapscript forms.

    How to disable debugger for sapscript forms.
    Once activated in se71-Utilities-Activate debugger I do not know how to disable it

    Thank you Rich
    I assigned you points for good answer on my preavious mail)
    . Actually my real problem is a transported the SAP script form “znalepke2” , printer definition ”nale”
    and device type “zststartsp” of a thermal printer.
    On original system (ak1) the printout is ok but on target system(ak2)
    not.
    Lateron I transported also :
    R3TR SCPD 1403(as the device type uses this character set)
    R3TR TABU TSP08 (All entries)
    R3TR TABU TSP1D(All entries)
    R3TR TABU TSP1T(All entries)
    I used also report  RSTXSCRP to traport form and device types. L
    Lately I discovered that when I performe printout preview I get also eronneous printout If I ssue an printout preview in language "EN" on system "ak1"(only on system ak1 and form preview in "SL" is oK. What steps you suggest me to solve the prolem
    Thank you in advance

  • How to disable cache for a particular Report in obiee 10g?

    HI
    My name is Rani .Learning obiee10g ifaced 1 interview in that they asked me like how u disable cache for a particular report?

    In the advanced tab of the report, under prefix you need to mention:
    SET VARIABLE DISABLE_CACHE_HIT=1;
    Refer below link
    http://tipsonobiee.blogspot.com/2009/06/step-by-step-to-bypass-all-caches.html
    Thanks

  • How do I sort data in columns using Pages

    How do I sort data in columns (alphabetically) using Pages?

    If you are referring to text or numbers in a column (not table), then get the free Service plug-in WordService, from Devon Technologies. Put it in the
    /Users/yourlogin/Library/Services folder location.
    Select your data to be sorted. From the Pages menu > Services > Sort Ascending will do the trick. This will work with Pages ’09 and Pages v5.2 or later, as well as Apple Mail, TextEdit, etc.
    The WordService files include a PDF (Read Me) that describes the services included with the package.
    The Service items will only appear in the Services submenu when you have selected your data prior to sort. If these WordService items do not appear in the Services menu as they should per the preceding sentence, then you will need to enable them.
    System Preferences > Keyboard > Shortcuts > Services. Scroll through the right hand list of services until you encounter Sort Ascending and ensure that it is selected.
    If you were referring to sorting a column of data in a table:
    Pages ’09
    Select all cells containing your unordered data. In the Table Inspector, under Edit Rows & Columns, choose Sort Ascending.
    Pages v5.2
    Select cells as before. In the Table heading (A, B, C, etc.) when you roll over the letter, a down-arrow appears. Click, and choose Sort Ascending from the drop down menu.

  • Disable sorting and resizing columns on table view

    Is there a way to disable sorting and resizing columns on table view?
    Thanks

    Use
    setSortable(false)
    setResizable(false)
    on each TableColumn

  • How to put colours for a column in ALV

    Dear All,
    I need to put green colour for 1 column in an ALV report.
    Can anybody tell me how we can do that ...
    Thanking you in advance,
    Shankar

    Here's a little sample program.....  this illistrates coloring at the column, row, and cell level.
    report zrich_0002 .
    * Use of colours in ALV grid (cell, line and column)            *
    * Table
    tables : mara.
    * Type
    types : begin of ty_mara,
              matnr         like mara-matnr,
              matkl         like mara-matkl,
              counter(4)    type n,
              free_text(15) type c,
              color_line(4) type c,           " Line color
              color_cell    type lvc_t_scol,  " Cell color
    end of ty_mara.
    * Structures
    data  : wa_mara     type ty_mara,
            wa_fieldcat type lvc_s_fcat,
            is_layout   type lvc_s_layo,
            wa_color    type lvc_s_scol.
    * Internal table
    data : it_mara     type standard table of ty_mara,
           it_fieldcat type standard table of lvc_s_fcat,
           it_color    type table          of lvc_s_scol.
    * Variables
    data : okcode like sy-ucomm,
           w_alv_grid          type ref to cl_gui_alv_grid,
           w_docking_container type ref to cl_gui_docking_container.
    parameters : p_column as checkbox,
                 p_line   as checkbox,
                 p_cell   as checkbox.
    at selection-screen output.
      perform get_data.
      perform fill_catalog.
      if w_docking_container is initial.
        perform create_objects.
      endif.
    *&      Form  create_objects
    form create_objects.
      create object w_docking_container
        exporting
          ratio                       = 60
        exceptions
          cntl_error                  = 1
          cntl_system_error           = 2
          create_error                = 3
          lifetime_error              = 4
          lifetime_dynpro_dynpro_link = 5
          others                      = 6.
      create object w_alv_grid
        exporting
          i_parent          = w_docking_container.
    * Field that identify color line in internal table
      move 'COLOR_LINE' to is_layout-info_fname.
    * Field that identify cell color in inetrnal table
      move 'COLOR_CELL' to is_layout-ctab_fname.
      call method w_alv_grid->set_table_for_first_display
        exporting
          is_layout                     = is_layout
        changing
          it_outtab                     = it_mara
          it_fieldcatalog               = it_fieldcat
        exceptions
          invalid_parameter_combination = 1
          program_error                 = 2
          too_many_lines                = 3
          others                        = 4.
    endform.
    *&      Form  get_data
    form get_data.
      select * from mara up to 5 rows.
        clear : wa_mara-color_line, wa_mara-color_cell.
        move-corresponding mara to wa_mara.
        add 1                   to wa_mara-counter.
        move 'Blabla'           to wa_mara-free_text.
        if wa_mara-counter = '0002'
        and p_line = 'X'.
    * Color line
          move 'C410' to wa_mara-color_line.
        elseif wa_mara-counter = '0004'
        and p_cell = 'X'.
    * Color cell
          move 'FREE_TEXT' to wa_color-fname.
          move '6'         to wa_color-color-col.
          move '1'         to wa_color-color-int.
          move '1'         to wa_color-color-inv.
          append wa_color to it_color.
          wa_mara-color_cell[] = it_color[].
        endif.
        append wa_mara to it_mara.
      endselect.
    endform.
    *&      Form  fill_catalog
    form fill_catalog.
    * Colour code :                                                 *
    * Colour is a 4-char field where :                              *
    *              - 1st char = C (color property)                  *
    *              - 2nd char = color code (from 0 to 7)            *
    *                                  0 = background color         *
    *                                  1 = blue                     *
    *                                  2 = gray                     *
    *                                  3 = yellow                   *
    *                                  4 = blue/gray                *
    *                                  5 = green                    *
    *                                  6 = red                      *
    *                                  7 = orange                   *
    *              - 3rd char = intensified (0=off, 1=on)           *
    *              - 4th char = inverse display (0=off, 1=on)       *
    * Colour overwriting priority :                                 *
    *   1. Line                                                     *
    *   2. Cell                                                     *
    *   3. Column                                                   *
      data : w_position type i value '1'.
      clear wa_fieldcat.
      move w_position to wa_fieldcat-col_pos.
      move 'MATNR'    to wa_fieldcat-fieldname.
      move 'MARA'     to wa_fieldcat-ref_table.
      move 'MATNR'    to wa_fieldcat-ref_field.
      append wa_fieldcat to it_fieldcat.
      add 1 to w_position.
      clear wa_fieldcat.
      move w_position to wa_fieldcat-col_pos.
      move 'MATKL'    to wa_fieldcat-fieldname.
      move 'MARA'     to wa_fieldcat-ref_table.
      move 'MATKL'    to wa_fieldcat-ref_field.
    * Color column
      if p_column = 'X'.
        move 'C610'     to wa_fieldcat-emphasize.
      endif.
      append wa_fieldcat to it_fieldcat.
      add 1 to w_position.
      clear wa_fieldcat.
      move w_position to wa_fieldcat-col_pos.
      move 'COUNTER'  to wa_fieldcat-fieldname.
      move 'N'        to wa_fieldcat-inttype.
      move '4'        to wa_fieldcat-intlen.
      move 'Counter'  to wa_fieldcat-coltext.
      append wa_fieldcat to it_fieldcat.
      add 1 to w_position.
      clear wa_fieldcat.
      move w_position  to wa_fieldcat-col_pos.
      move 'FREE_TEXT' to wa_fieldcat-fieldname.
      move 'C'         to wa_fieldcat-inttype.
      move '20'        to wa_fieldcat-intlen.
      move 'Text'      to wa_fieldcat-coltext.
      append wa_fieldcat to it_fieldcat.
    endform.
    Regards,
    Rich HEilman

  • How to disable IPv6 for loopback adapter (lo0)

    I was wondering if anyone knows how to disable IPv6 for the loopback (lo0) adpater. I know how to do it for other adapters using the Network preferences pane, but lo0 doesn't appear there...
    Thanks,
    - alan

    I need to temporary disable ipv6 address of lo0 (which by the way is not 127.0.0.1 but ::1) for testing development purpose..

  • How to disable iMessage for certain contacts

    I was wondering how to disable iMessage for certain contacts!

    Try deleting the phone number from the persons contact and then re-entering it as a new number.
    You don't have to delete the entire contact.
    Worked for me.

  • How to disable iMessage for an old Apple ID which is only used for AppStore?

    How to disable iMessage for an old Apple ID which is only used for AppStore?
    I used my old Apple ID for iMessage and AppStore Apps. Now I'm using my iCloud Account (second Apple ID) on my Mac as iCloud and iMessage Account.
    New Apple ID - iCloud & iMessage (**** thing that I can't use my okd Apple ID for iMessage and another for iCloud) on new Mac
    Old Apple ID - AppStore, iMessage days ago
    So now how to disable the iMessage function for my old Apple ID which isn't used anymore?
    Thank you!

    Yeah the problem is that I want to be reachable by:
    *new apple id
    *mobile number
    Earlier:
    *old apple id
    *mobile number
    Problem - if I set in Settings => Messages => Receive at:
    *new apple id
    *mobile number
    Others still can see my old apple id as "iMessage" although it isn't used a iMessage anymore. So how to disbale iMessage function for that?

  • Grid Control how to disable alert for Tablespace UNDO is 99 percent  full

    I am new to Grid control and want to know how to disable alert for UNDO tablespace full.
    Target Name=xxxx
    Target type=Database Instance
    Host=xxx
    Occurred At=Dec 24, 2010 1:21:00 AM EST
    Message=Tablespace UNDOTBS1 is 99 percent full
    Metric=Tablespace Space Used (%)
    Metric value=99
    Tablespace Name=UNDOTBS1
    Severity=Critical
    Acknowledged=No
    Notification Rule Name=Database E-Mail Notifications
    Notification Rule Owner=SYSMAN

    You should post in the grid control foruma.
    But just go to databases, select your database, metric and policy settings, find the tablespace metric, edit and exclude the undo tablespace.

  • How to provide hyperlink for a particular field in ALV

    Hi,
      How to provide hyperlink for a particular field in alv report.
    Regards,
    Ramu.

    Yes you can do that. using the fieldcatalog there is an option for that. give HOT_SPOT = 'X'. for the column you want.
    wa_field-hotspot = 'X'.
    REPORT  ztest_alv.
    TYPE-POOLS:slis.
    DATA:it_fieldcat  TYPE  slis_t_fieldcat_alv,
         wa_field LIKE LINE OF it_fieldcat.
    DATA: BEGIN OF it_likp OCCURS 0,
           vbeln TYPE likp-vbeln,
          END OF it_likp.
    DATA: layout TYPE slis_layout_alv.
    wa_field-fieldname = 'VBELN'.
    wa_field-tabname = 'IT_LIKP'.
    wa_field-hotspot = 'X'.
    wa_field-outputlen = 10.
    wa_field-no_zero = 'X'.
    wa_field-seltext_l = 'Sales'.
    APPEND wa_field TO it_fieldcat.
    SELECT vbeln FROM likp
    UP TO 10 ROWS
    INTO TABLE it_likp.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
      EXPORTING
        i_callback_program      = sy-repid
        is_layout               = layout
        i_callback_user_command = 'USER_COMMAND'
        it_fieldcat             = it_fieldcat
      TABLES
        t_outtab                = it_likp
      EXCEPTIONS
        program_error           = 1.
    *&      Form  user_Command
    *       text
    *      -->UCOMM      text
    *      -->SELFIELD   text
    FORM user_command USING ucomm TYPE sy-ucomm
                        selfield TYPE slis_selfield.
      CASE ucomm.
        WHEN '&IC1'.
          SET PARAMETER ID 'VL'  FIELD selfield-value.
          CALL TRANSACTION 'VL02N' AND SKIP FIRST SCREEN.
      ENDCASE.
    ENDFORM.                    "user_Command

Maybe you are looking for