About selecting single column in a alv table.........

Hi Experts,
I need single column to be selected from a ALV table...selected in da sense to be highlighted....as it happens..by default for a row.....
I hope u understood my query...
Please help me out in this..
I know u all will surely help me...
Thks and Regards,
Runali.

Hi Runali,
Get the reference to the column settings of your ALV Model. Then you can get the reference of each column by passing the column ID. There is a method set_selected_state in the column class, but that does not highlight the column as it does for a row. So what you can use is a cell design for a column that will highlight the column with a color or whatever.
lr_column = lr_column_settings->get_column( ID = id ).
lr_column->set_cell_design( preferred design ).
Hope this helps. Please award points if it solves your purpose.
Regards,
Nithya

Similar Messages

  • How to keep selection (or select) the row of SORTED ALV table?

    Dear Experts,
    I have WD ALV table with grouped and therefore sorted layout. I know that sorted ALV beahve differently.
    The problem is that if the values in cell is updated (setting attribute of selected element of context node bound to the ALV table), then the whole table is redrawn and selection disappears. It does not happen when layout of ALV is not sorted/grouped.
    I need somehow to select the ALV line again. Method MOV_To of IF_WD_CONTEXT_NODE for some reason is not working in sorted ALV (it selects element on node but not in ALV table). And in ALV Interface controller I also could not find anything usefull.
    Thanks.
    Best regards,
    Dmitry.

    Hallo Dmitry,
    See the sap note :1445428
    [https://service.sap.com/sap/support/notes/1445428|https://service.sap.com/sap/support/notes/1445428]
    Follow this thread which suggest a work around.
    [ALV Table set lead selection while sorting is enable for a column|ALV Table set lead selection while sorting is enable for a column]

  • Select single column but multiple rows in JTable

    Hi
    I have a jTable and want to be able to select multiple rows but only in a single column.
    I've set these properties which makes selection almost the way I would like it.
    table1.setCellSelectionEnabled(true);
    table1.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);the only problem now is that the user can select multiple columns.
    Is there a simple way to restrict selection to single column?
    regards
    abq

    table.setCellSelectionEnabled(true);
    table.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);
    DefaultListSelectionModel model =
         (DefaultListSelectionModel)table.getColumnModel().getSelectionModel();
    model.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);

  • Column name in ALV table dissapeared after new language package installatio

    Hi,
    We have a custom field in an ALV table in SAP system. In english everything was just fine with our custom field.
    But when we installed a new languaged the column name dissapeared.
    My question is:
    Where does the ALV get the column name from? Is there a standard method which I can search for which is used for this purpose in ALV?
    regards
    Baran

    the field name comes from data element FIELD name you have specified when creating ur custom field..
    try to change that field name for that field..
    hope it works
    award points if helpful

  • How can I change column name in ALV table in WebDynpro ABAP?

    Hi Everyone,
    I have created an ALV table in WebDynpro ABAP. I have created a context node and added the required attributes there - for the ALV display.
    Now I want to change one columnn name of the ALV table.... Currently it is showing the description of the data element, which I don't want to show. I cannot create a new DE only for this purpose.
    Please let me know how can I change the name of the column.
    Regards

    Hi,
    This may help you to define your own column text in the ALV Table of webdynpro.
    see the below code.
    Here 'STATUS_ICON' is the column of the the output display of the ALV Table of webdynpro.
    "change the label of the report.
    DATA: lr_weeknum TYPE REF TO cl_salv_wd_column.
    CALL METHOD l_value->if_salv_wd_column_settings~get_column
    EXPORTING
    id = 'STATUS_ICON'
    RECEIVING
    value = lr_weeknum.
    SET THE LABEL OF THE COLUMN
    DATA: hr_weeknum TYPE REF TO cl_salv_wd_column_header.
    CALL METHOD lr_weeknum->get_header
    RECEIVING
    value = hr_weeknum.
    CALL METHOD lr_weeknum->set_resizable
    EXPORTING
    value = abap_false.
    hr_weeknum->set_prop_ddic_binding_field(
    property = if_salv_wd_c_ddic_binding=>bind_prop_text
    value = if_salv_wd_c_ddic_binding=>ddic_bind_none ).
    set the text of the column
    CALL METHOD hr_weeknum->set_text
    EXPORTING
    value = 'C Form'.
    regarads,
    balu

  • Merge columns in an ALV Table

    Hi colleagues,
    is it possible to merge two or more columns in ALV Table (like ColSpan in the Matrix-Layout) to write a text over more than one column?
    I haven't found any solution for it until now.
    Best regards
    Stefan

    Although it may not be exactly what you were looking for, you can create a table ColumnGroup:
    http://help.sap.com/saphelp_nw70/helpdata/EN/f0/5d9041d3c72e7be10000000a1550b0/frameset.htm

  • How can I do a Header Group Using Group columns for WD ALV tables

    Hi
    I want to group columns into a header group.
    Eg:
                       from Date
    Availability
                       to date
    Any ideas if it is possible with WD ALV tables?

    Hi,
    Try to use the if_salv_wd_field_settings for the column grouping of the Model object.
    Also check the class CL_SALV_WD_FIELD.
    Regards,
    Lekha.

  • Visual Composer 7.2 SP3 - Adjust column widths of ALV tables by end user

    Hello,
    we're using ALV tables with values coming out of function modules and queries.
    Unfortunately I can't see an opportunity to adjust column widths at runtime by the end user. This is in contrast to VC 7.0 using flex.
    Is there a way to archieve this?
    Kind regards
    Stefan

    Hello Stefan,
    This is a feature of Webdynpro Flex runtime. You can adjust column widths at Flex runtime in 720 SP3 also.
    This is not supported by Webdynpro HTML runtime.
    Regards,
    Talia

  • How to split a single column row  in alv report

    Hi All,
    I need to split a row of the particular coolumn in alv report.
    for example row size is 10 that should be split into 5 & 5.
    Thanks
    Ram

    Hi Ram,
    You can add one more column for that..
    while processing your internal table you can split the value for that column using offset..
    DATA :  FIELD_STR(10) TYPE C.
    VAR1 = FIELD_STR+0(5) .
    VAR2 = FIELD_STR+5(5) .
    Now you can print this both VAR1 and VAR2 in seperate column.
    Please search on SCN before posting any question..
    Hope it will solve your problem..
    Thanks & Regards
    ilesh 24x7
    ilesh Nandaniya

  • How to fix the width of the column when using alv table

    Hi ,
    I am displaying the contents in a table. Of course using alv component i displayed the content. Now the problem is the column width is not fixed with value of the table entries( based on the domain length level). As  length  of field increases or decreses as the length of the content increases or decreases. I wanted to fix the column width whatever be the length of the contents.
    Can any one help in this regard ?
    Thanks Pons.

    Hi,
    Please find the code related to your problem.
    METHOD configure_alv .
    data declaration for column settings
      DATA  : lr_column_settings   TYPE REF TO if_salv_wd_column_settings,
              lr_col_header        TYPE REF TO cl_salv_wd_column_header,
              lt_columns           TYPE salv_wd_t_column_ref,
              ls_column            TYPE salv_wd_s_column_ref.
    data declaration for table settings
      DATA : lr_salv_wd_table_ctr  TYPE REF TO iwci_salv_wd_table,
             lr_table_settings_ctr TYPE REF TO if_salv_wd_table_settings,
             lr_header_ctr         TYPE REF TO cl_salv_wd_header.
    Variables for drop-down and inpufield reference
      DATA : lr_drdn_by_key        TYPE REF TO cl_salv_wd_uie_dropdown_by_key,
             lr_input_field        TYPE REF TO cl_salv_wd_uie_input_field,
             l_header              TYPE string.
    get ALV Component <CONTRACT_DETAILS>
      lr_salv_wd_table_ctr = wd_this->wd_cpifc_payment_detail( ).
      wd_this->alv_config_table = lr_salv_wd_table_ctr->get_model( ).
    set visible row count
      lr_table_settings_ctr ?= wd_this->alv_config_table.
      lr_table_settings_ctr->set_visible_row_count( '5' ).
      lr_table_settings_ctr->set_read_only( abap_false ).
      lr_table_settings_ctr->set_grid_mode( ).
      lr_table_settings_ctr->set_width(
        EXPORTING
          value = '980PX' ).
      wd_this->alv_config_table->if_salv_wd_table_settings~set_data_check( if_salv_wd_c_table_settings=>data_check_on_cell_event ).
      wd_this->alv_config_table->if_salv_wd_std_functions~set_pdf_allowed( abap_false ).
      wd_this->alv_config_table->if_salv_wd_std_functions~set_view_list_allowed( abap_false ).
      wd_this->alv_config_table->if_salv_wd_std_functions~set_edit_insert_row_allowed( abap_false ).
      wd_this->alv_config_table->if_salv_wd_std_functions~set_edit_delete_row_allowed( abap_true ).
      wd_this->alv_config_table->if_salv_wd_std_functions~set_export_allowed( abap_false ).
      wd_this->alv_config_table->if_salv_wd_std_functions~set_edit_check_available( abap_false ).
      CLEAR: l_header.
      l_header = wd_assist->if_wd_component_assistance~get_text( '030' ).
      lr_header_ctr = lr_table_settings_ctr->get_header( ).
      lr_header_ctr->set_text( l_header ).
    set text header for Columns.
      CLEAR: l_header,lt_columns.
      lr_column_settings ?= wd_this->alv_config_table.
      lt_columns = lr_column_settings->get_columns( ).
      LOOP AT lt_columns INTO ls_column.
        CASE ls_column-id.
          WHEN 'PAYMENT_METHOD'.
    get header details
            lr_col_header = ls_column-r_column->get_header( ).
    disable DDIC field label
            CALL METHOD lr_col_header->set_prop_ddic_binding_field
              EXPORTING
                property = if_salv_wd_c_ddic_binding=>bind_prop_text
                value    = if_salv_wd_c_ddic_binding=>ddic_bind_none.
    set user defined column header
            l_header = wd_assist->if_wd_component_assistance~get_text( key = '020' ).
            lr_col_header->set_text( l_header ).
            CREATE OBJECT lr_drdn_by_key
              EXPORTING
                selected_key_fieldname = ls_column-id.
            ls_column-r_column->set_cell_editor( lr_drdn_by_key ).
            ls_column-r_column->se_width( '100PX' ).
            lr_drdn_by_key->set_key_visible(
              EXPORTING
                value = abap_true ).
          WHEN OTHERS.
        ENDCASE.
        CLEAR: l_header,ls_column.
      ENDLOOP.
    ENDMETHOD.
    Regards
    Manoj Kumar

  • How to make single column scrollable in ALV report (for long Text)

    I have a 20 columns which we need to display in ALV grid, including one column for long text. In long text column currently it showing 40 character. I tried to change output length of field catalog but it's not working.
    Can any one help me ....
    Thanks
    Guru
    Message was edited by:
            gurusharan mandal

    hi,
    pls remeove if u give like this in the layout.
    gd_layout-colwidth_optimize = 'X'.
    rgds
    Anver

  • How to process Line Selection on ALV Table in ABAP WebDynpro

    Hi there,
    I have a view with an ALV table whose context node retrieves its data from a Service Call for a method.
    The method provides certain data of a database table which the ALV displays.
    Now I would like to be able to select one row of that ALV table and after pressing a button or doubleclicking on the row or whatever a different view (as for me it is also ok on the same view) should appear to display the details of that selection.
    I only need to know how to retrieve the selected data.
    Or its index within the internal table.
    I am already looking for hours for a useful thread and actually there is one which obviously is about a similar issue apart from the multiple selection part: 
    How to process multiple row selection in ALV table in Wendynpro ABAP? Help!
    but i am afraid that i don't understand it. Or at least I misunderstand it since it does not work with me.
    The system example mentioned in the thread does not help me either because it somehow does not correspond to my needs, does it?
    It would be GREAT if somebody could help me with that. Please keep it simple for I am not an expert in webdynpro yet (obviously ^^) and also please explain in detail what I have to do with the context nodes since I am not sure whether the selection is stored in my already existing node or whether I need a special one for that.
    Thanks!!
    christina

    Hi Christina,
    If you just want to get one column data of the line that user clicked, use the Web Dynpro Code Wizard to Read Context of attibute you needed, then you will get code as follow:
    * Define data for read attribute
        node_alv TYPE REF TO if_wd_context_node,
        elem_alv TYPE REF TO if_wd_context_element,
        stru_alv TYPE if_view_display=>element_alv ,
        item_column_name  LIKE stru_alv-column_name.
    * navigate from <CONTEXT> to <ALV> via lead selection
      node_alv = wd_context->get_child_node( name = if_view_display=>wdctx_alv ).
    * get element via lead selection
      elem_alv = node_alv->get_element(  ).
    * get single attribute
      elem_alv->get_attribute(
        EXPORTING
          name =  `COLUMN_NAME'
        IMPORTING
          value = item_column_name ).
    The value of column_name is stored in item_column_name.
    If you need the index that the user clicked, try this:
    * Definition of field symbol for index
      FIELD-SYMBOLS : <fs_index> TYPE data.
    * Get the selected index
      ASSIGN r_param->index->* TO <fs_index>.
    The index of clicked line is stored in field symbol <fs_index>.
    Hope it will help.
    Best Regards,
    Stephanie

  • Select single row in ALV grid

    ABAPer's ,
    Does anyone can guide me to select single row only in ALV grid , without OO.

    Hello,
    I did not get u.
    But check the below code it may help u.
    tables: mara.
    TYPE-POOLS: SLIS.
    data:repid like sy-repid.
    data: itb type mara occurs 0 with header line,
    IT_FIELDCAT TYPE STANDARD TABLE OF SLIS_FIELDCAT_ALV WITH HEADER LINE,
    IT_LAYOUT TYPE SLIS_LAYOUT_ALV,
    ITB1 TYPE MAKT OCCURS 0 WITH HEADER LINE.
    selection-screen begin of block b.
    parameters: p_matnr type matnr.
    selection-screen end of block b.
    select * from mara into table itb where matnr = p_matnr.
    SELECT * FROM MAKT INTO TABLE ITB1 WHERE MATNR = P_MATNR.
    repid = sy-repid.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
      I_INTERFACE_CHECK              = ' '
      I_BYPASSING_BUFFER             =
      I_BUFFER_ACTIVE                = ' '
       I_CALLBACK_PROGRAM             = repid
      I_CALLBACK_PF_STATUS_SET       = ' '
       I_CALLBACK_USER_COMMAND        = 'HANDLE_USER_COMMAND'
       I_STRUCTURE_NAME               = 'MARA'
       IS_LAYOUT                      = IT_LAYOUT
       IT_FIELDCAT                    = IT_FIELDCAT[]
      IT_EXCLUDING                   =
      IT_SPECIAL_GROUPS              =
      IT_SORT                        =
      IT_FILTER                      =
      IS_SEL_HIDE                    =
      I_DEFAULT                      = 'X'
      I_SAVE                         = ' '
      IS_VARIANT                     =
      IT_EVENTS                      =
      IT_EVENT_EXIT                  =
      IS_PRINT                       =
      IS_REPREP_ID                   =
      I_SCREEN_START_COLUMN          = 0
      I_SCREEN_START_LINE            = 0
      I_SCREEN_END_COLUMN            = 0
      I_SCREEN_END_LINE              = 0
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER        =
      ES_EXIT_CAUSED_BY_USER         =
      TABLES
        t_outtab                       = itb
    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 HANDLE_USER_COMMAND USING R_UCOMM LIKE SY-UCOMM RS_SELFIELD TYPE
    SLIS_SELFIELD.
    CASE R_UCOMM.
    WHEN '&IC1'.
    CLEAR IT_FIELDCAT[].
    IF RS_SELFIELD-FIELDNAME = 'MATNR'.
    READ TABLE ITB1 INDEX RS_SELFIELD-TABINDEX.
    WRITE: / ITB1-MAKTX.
    ENDIF.
    ENDCASE.
    ENDFORM. "HANDLE_USER_COMMAND
    Regards

  • How can i  change the column label text in a alv table display

    how can i change the column label text in a alv table display??
    A similar kinda of question was posted previuosly where the requirement was the label text was needed and following below code was given as solution :
    <i>*  declare column, settings, header object
    DATA: lr_column TYPE REF TO cl_salv_wd_column.
    DATA: lr_column_settings TYPE REF TO if_salv_wd_column_settings.
    DATA: lr_column_header type ref to CL_SALV_WD_COLUMN_HEADER.
    get column by specifying column name.
    lr_column = lr_column_settings->get_column( 'COLUMN_NAME1' ).
    set Header Text as null
    lr_column_header = lr_column->get_header( ).
    lr_column_header->set_text( ' ' ).</i>
    My specific requirement is i have an input field on the screen and i want reflect that value as the column label for one of the column in the alv table. I have used he above code with slight modification in the MODIFYVIEW method of the view since it is a process after input. The component gets activated without any errors but while run time i get an error stating
    <i>"The following error text was processed in the system CDV : Access via 'NULL' object reference not possible."</i>
    i have checked in debugging and the error occured at the statement :
    <i>lr_column = lr_column_settings->get_column( 'CURRENT_YEAR' ).</i>Please can you provide me an alternative for my requirement or correct me if i have done it wrong.
    Thanks,
    Suri

    I found it myself how to do it. The error says that it is not able to find the reference object i.e  it is asking us to refer to the table. The following piece of code will solve this problem. Have to implement this in WDDOMODIFYVIEW method of the view. This thing works comrades enjoy...
      DATA : lr_cmp_usage TYPE REF TO if_wd_component_usage,
             lr_if_controller  TYPE REF TO iwci_salv_wd_table,
             lr_cmdl   TYPE REF TO cl_salv_wd_config_table,
             lr_col    TYPE REF TO cl_salv_wd_column.
      DATA : node_year  TYPE REF TO if_wd_context_node,
             elem_year  TYPE REF TO if_wd_context_element,
             stru_year  TYPE if_alv_layout=>element_importing,
             item_year  LIKE stru_year-i_current_year,
             lf_string    TYPE char(x),
      DATA: lr_column TYPE REF TO cl_salv_wd_column.
      DATA: lr_column_header TYPE REF TO cl_salv_wd_column_header.
      DATA: lr_column_settings TYPE REF TO if_salv_wd_column_settings.
    Get the entered value from the input field of the screen
    node_year  = wd_context->get_child_node( name = 'IMPORTING_NODE' ).
    elem_year  = node_year->get_element( ).
      elem_year->get_attribute(
       EXPORTING
        name = 'IMPORT_NODE-PARAMETER'
       IMPORTING
        value = L_IMPORT_PARAM ).
      WRITE L_IMPORT_PARAM TO lf_string.
    Get the reference of the table
      lr_cmp_usage  =  wd_this->wd_cpuse_alv( ).
      IF lr_cmp_usage->has_active_component( ) IS INITIAL.
        lr_cmp_usage->create_component( ).
      ENDIF.
      lr_if_controller  = wd_this->wd_cpifc_alv( ).
      lr_column_settings = lr_if_controller->get_model( ).
    get column by specifying column name.
      IF lr_column_settings IS BOUND.
        lr_column = lr_column_settings->get_column( 'COLUMN_NAME').
    set Header Text as null
        lr_column_header = lr_column->get_header( ).
        lr_column_header->set_text( lf_string ).
    endif.

  • Inserting single column in internal table

    Hiii,
    I have to insert data into a single column of a internal table from a field.The rest of the columns of the internal table are already filled.
    wats is the syntax for it?? plz reply soon...its very urgent.

    Hi,
    try this
    data idx type sy-tabix.
    loop at itab.
    itab-fld1 = 'some value'.    " your empty field
    modify itab index idx.
    endloop.
    Regards,
    V.Balaji
    Reward if Usefull...

Maybe you are looking for

  • Can't view LR metadata modifications on Windows Explorer? What gives?

    Hi all, This is my first question to the community, I searched for the answer to this problem here and elsewhere but not able to find out why, hope you can help. I'm coming to grips with managing data in LR but I've stumbled upon a snag. I'm using LR

  • A few questions on Sf2's and Au's

    I am pretty new to GarageBand 11 I have always used FL Studio to make my music but now I'm looking to switch fully to Mac and get rid of my PC so I am learning GarageBand. I have watched a few tutorials on YouTube on importing Sf2 an AU files. For Sf

  • Goods receipt at 2 stages

    Hi Guys, We have a unique requirement for our client. They normally imort their goods from China. In the legacy system they recognize the goods receipt in two stages. When the goods are received at the Frieght Forwarder, they post a goods receipt whe

  • Can't set PredictedActionsEnabled to "True"

    Hello! Easy question: I want to enable PredictedActionsEnabled option in my OWA policy (it's disabled by default) but it seems Exchange doesn't know about it: Thank you in advance, Michael

  • Enlightenment - strange window behavior[Solved]

    Hello, I've just reinstalled arch with enlightenment desktop. And I experience a strange stacking order problem. For instance, I have gimp, or firefox open. Then, I open the terminal, or the file manager. They appear for a second on the top and immad