Making cells of ALV/ Table readonly

Hi,
We have some requirement in project where we have to make cells of ALV/ Table as readonly dynamically depending on the data.
As per our understanding, we can define readonly property at column level. Is it possible to do such dynamic cell level operation in ALV / Table.
If someone has some demo application for the same, please help us out in this issue.
Best Regards,
Ruchi

Hi Ruchi.
This can be done by using cell variants. If you serach for ALV and cell variant(s) you will find some threads regarding this topic which might help you.
Cheers,
Sascha

Similar Messages

  • How to set two different UIE in one cell in ALV table

    Hi all,
    I have a hierachy ALV table. For some reason I want to have two UI elements in one column. For example, the text and a menu next to the text. Is it possiable to do that?
    best regards,
    Wenwen

    Hi,
    thank you for your answer. Yes, now I also find the class CL_SALV_WD_MULTI_CELL_EDITOR which could be used to set different UIE in one cell. But it is quite limited, just the following UIE could be used
    - LinkToAction 
    - LinkToURL    
    - FileDownload 
    - Button       
    - ToggleButton 
    best regards,
    Wenwen

  • Merge of Cells in ALV table in ABAP webdynpro.

    Hi All,
    We have a requirement to merge cells vertically if the consecutive cells have same data.(The merge of cells happens when we click on sort of a column.) This functionality needs to be achived with out sorting the cells.Sorted data is populated in the ALV table.
    I will be greatfull if any one can help us on this issue.
    Thanks in advance
    Regards,
    Sharath

    Hi Sarath,
    Check this..
    http://help.sap.com/saphelp_nw70ehp2/helpdata/en/9b/46bb0d339b42cc8d30636ca0c9f5b6/frameset.htm
    and go through this..
    merging cells in table
    http://forums.sdn.sap.com/click.jspa?searchID=71460300&messageID=9768692
    cheers,
    Kris.
    Edited by: kissnas on Apr 18, 2011 12:10 PM

  • Cell Selection & ALV Table (SALV_WD_TABLE)

    Hi Experts,
    is it possible to select  more than one cell (not row!) in an ALV Table?
    I changed the cell editor to cl_salv_wd_uie_input_field and set the whole table editable.
    Now I am able to select one cell, but what about multiple selections? In the Java world I found this one: TableSingleMarkableCell
    Sounds good - what about ABAP?
    And if there is no way with the ALV Table, how I might get the functionality with other components?
    Thanks for your help, have a great week!
    Hendrik
    Edited by: Gedicke, Hendrik on Jul 28, 2008 11:06 AM

    Hi Thomas,
    I tried to integrate the cell variant TableSingleMarkableCell. But I think the ALV table does not support this cell variant, or am I wrong? The runtime class is .CL_WD_TABLE_SNGL_MARK_CELL
    (see http://help.sap.com/saphelp_nw70/helpdata/EN/a5/b8fa41c915da6fe10000000a1550b0/frameset.htm)
    I will try to explain:
    When you want to use a cell variant, it is necessary to "add" it to a column. Therefore you can use the public method "ADD_CELL_VARIANT" of the class "CL_SALV_WD_COLUMN".
    This method has got a "value" import parameter which is a referencing the class "CL_SALV_WD_CV".
    The thing is that the only sub class of "CL_SALV_WD_CV" is "CL_SALV_WD_CV_STANDARD" and this means that the TableSingleMarkableCell is not supported.
    Or did I made a mistake? This is my last chance to use a cell selection with the alv component.
    Thanks & Regards,
    Hendrik

  • Sorting  ALV  Table cells

    hi
    how to group the cells of alv table.
    where all the fields having same value should be displayed once and rest of the fields should contain the varying values.
    Edited by: chythanya on May 13, 2008 1:35 PM
    Edited by: chythanya on May 13, 2008 1:36 PM

    Hello,
    Please read these: [https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/1190424a-0801-0010-84b5-ef03fd2d33d9] at page 9 and [https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/40794172-b95a-2910-fb98-b86d8a0918b4].
    Regards,

  • Making cell non editabale (of dynamic table) in alv

    Hi,
    I am working on a editable alv with a dynamic table <itab> .This table gets populated during runtime.Now I want to make few cell of this table not editabale (only few cell not the full columns) I knwo that the procedure is to
    declare my outtab like
    TYPES: BEGIN OF gs_outtab.
    TYPES: celltab TYPE lvc_t_styl.        "field to switch editability
            INCLUDE TYPE /npu/edmt_aa_eac.
    TYPES: END OF gs_outtab.
    and in the celltab i pass the information of cells which will be non editable...But the problem is as my outtab is a dynamic table I cannot INCLUDE IT IN ANOTHER types.
    Please help me how to do it???? Or is there any other way of doing it???

    Hi Priya
    Add the field of type lvc_t_styl while creating the field catalog.
    Now
    DATA lo_table TYPE REF TO data.
      cl_alv_table_create=>create_dynamic_table(
        EXPORTING
          it_fieldcatalog = lt_fieldcat  "the field catalog table
        IMPORTING
          ep_table = lo_table ). "the reference to the table gt_outtab with the style tab
    FIELD-SYMBOLS <tab> TYPE ANY TABLE.
    ASSIGN lo_table->* TO <tab> .
    Now you can fill your <tab>.
    Pushpraj

  • How to create a context menu in ALV table cell editor(Webdynpro abap )

    Hello Experts,
    I am having a problem in creating a context menu in a table cell editor in the ALV table output.I have assigned a 'lta' as the cell editor.But befor assigning the lta as cell editor I have assigned the menu to the lta.But when the view is rendered I can see the lta with the actioned assigned to it.But I cannot see the context menu.
    The code snippet below:
      "Create menu for each coloumn
      create OBJECT lo_menu_actions type CL_SALV_WD_VE_MENU EXPORTING
          id = 'MITM_ACTIONS'.
      lo_menu_actions->set_visible( value = abap_true ). 
      lo_menu_actions->set_visible_fieldname( value = 'ACTIONS' ).
      "ADd menu items
      CREATE OBJECT lo_menu_item_create type CL_SALV_WD_VE_MENU
      exporting
        id = 'MITM_CREATE_EXPRESSION'.
      lo_menu_item_create->set_visible( value = abap_true ).
      lo_menu_item_create->set_visible_fieldname( value = 'Create' ).
      "Add item 1
      lo_menu_actions->ADD_ITEM( VALUE = lo_menu_item_create ). 
      "  Set the cell editor for each column cell(link to an action)
      LOOP AT lt_node_dec_tab_cols INTO ls_node_dec_tab_cols .
        lv_column_name = ls_node_dec_tab_cols-object_name.
        lr_column = lr_column_settings->get_column( lv_column_name ).
       "Create 'lta' Ui item
        CREATE OBJECT lo_lta TYPE cl_salv_wd_uie_link_to_action.
        lo_lta->set_menu( value = lo_menu_actions ).
        lo_lta->set_text_fieldname( lv_column_name ).
        lr_column->set_cell_editor( lo_lta ).
        IF ls_node_dec_tab_cols-is_result EQ abap_true.
          lr_column->set_cell_design( value =
                      cl_wd_table_column=>e_cell_design-key_medium ).
        ENDIF.
      ENDLOOP.

    Hi Prakash,
    I have not come across this requirement till now to have context menu in a cell editor of alv.
    Unfortunately  the implementation of method SET_MENU of alv ui elements ( ex: cl_salv_wd_uie_text_view ) is not updating alv configurable table, instead it just stores in a global attribute as string. Hence has no effect on context menu.
    If your user is very particular about this requirement of having context menu in cell editor, you can go for a normal table. Because, normal table's cell editor has the property to set the menuID as we do it for other ui elements.
    Regards,
    Rama

  • How to give color of particular cell in alv list display for dynamic table

    Dear Experts,
    i want to give color of a particular cell in alv list display (reuse_alv_list_display). Here i am passing data through dynamic table?

    Hi,
    Se this:
    DATA: lt_color    TYPE lvc_t_scol WITH HEADER LINE.
    DATA: BEGIN OF data_tab OCCURS 0.
             tabcolor     TYPE   lvc_t_scol,
          END OF data_tab.
    * Befone ALV call
      alv_layout-coltab_fieldname  = 'TABCOLOR'.
    * For each row in data_tab
    REFRESH: lt_color.
    CLEAR: lt_color.
    lt_color-color-col = 6.
    lt_color-color-int = 1.
    lt_color-fname = FIELD1'.
    APPEND lt_color.
    lt_color-color-col = 2.
    lt_color-color-int = 0.
    lt_color-fname = 'FIELD2'.
    APPEND lt_color.
    data_tab-tabcolor[] = lt_color[].
    append data_tab.
    Best regards,
    Leandro Mengue

  • Web dynpro ALV table cell popin

    from my understanding, it is possible to create a cell popin for a standard table.
    but now i wonder whether is it possible to create a cell popin for an ALV table?

    My question was about option Filter of ALV report.
    May be somebody knows how I can receive Interfacecontroller
    attributes: FILTER_VALUES. It should help to filter
    table inside code( in my ONFUNCTION method).
    Regards
    Irena

  • How Highlight a CELL on an ALV table

    Hi all!
    I'm trying to do some checks on an input field of an ALV table component. But using REPORT_ATTRIBUTE_T100_MESSAGE it doesn't highlight the CELL of the row if the check hasn't been passed succesfully.
    I've used this source code but nothing appears on the screen, no message and no cell highlighted. I put my source code for more information:
    LOOP AT lt_data_mod INTO ls_data_mod.
    alternative access via index
    lo_el_n_empleado = lo_nd_n_empleado->get_element( index = ls_data_mod-index ).
    CHECK VALUE
    report message
    CALL METHOD wd_comp_controller->go_message->report_attribute_t100_message
    EXPORTING
    msg = ls_msg
    element = lo_el_n_empleado
    attribute_name = ls_data_mod-attribute. " The name of input field that it is being modified
    All that source code is in ON_DATA_CHECK event of ALV component.
    Can anyone help me ?
    Thanks!

    Hello,
    I put my source code:
    ON_DATA_CHECK event of ALV:
      lt_data_mod[] = lr_data->t_modified_cells[].
      LOOP AT lt_data_mod INTO ls_data_mod.
    alternative access  via index
    lo_el_n_empleado = lo_nd_n_empleado->get_element( index = ls_data_mod-index ).
    get all declared attributes
        lo_el_n_empleado->get_static_attributes(
          IMPORTING
            static_attributes = ls_n_empleado ).
    Leemos la información inicial para hacer posteriormente los recalculos.
        READ TABLE wd_this->gt_empleados_inicial INTO ls_empleados_inicial WITH KEY pernr = ls_n_empleado-pernr.
        ASSIGN ls_data_mod-r_value->* TO .
    Fijamos el valor del campo INCIN o PERIN en función de si el usuario ha modificado el valor en pantalla
        IF ls_data_mod-r_value NE ls_data_mod-r_old_value AND
            GE ls_n_empleado-incsu.
          IF ls_data_mod-attribute = 'INCPA'.
            ls_n_empleado-incin = abap_true.
          ELSEIF ls_data_mod-attribute = 'PERVC'.
            ls_n_empleado-perin = abap_true.
          ENDIF.
    ELSEIF <fs_data> LT ls_n_empleado-incsu. " Check if user entry is less than incsu value then throw message...
          wd_comp_controller->show_message_2( imp_element = lo_el_n_empleado
                                                                               imp_msgno   = '622'
                                                                               imp_attr    = ls_data_mod-attribute ). " El valor introducido es menor que el "                 incremento sugerido
        ENDIF.
    METHOD show_message_2 .
      DATA lv_message_id TYPE string.
      DATA ls_msg TYPE symsg.
      ls_msg-msgty = 'E'.
      ls_msg-msgid = 'ZHR_CM'.
      ls_msg-msgno = imp_msgno.
    report message
      CALL METHOD wd_this->go_message->report_attribute_t100_message
        EXPORTING
          msg            = ls_msg
          element        = imp_element
          attribute_name = imp_attr.
    ENDMETHOD.
    Also I've tried with report_element_t100_message method but nothing happens.
    Thank you.
    Edited by: vanbelal on Mar 22, 2010 4:54 PM

  • ALV Table - Different Search Help depending on Cell

    Hey you experts,
    For my current project I'm working on an editable ALV Table. The table has three columns and shall contain:
    1) The name
    2) The Old value
    3) The New Value
    of an item.
    The name of the item is known (e.g. Product Category, Accounting Type and so on).
    The main problem: I have/want to offer search-help to the user in the second and third column depending on the content of the first cell ==> The search help can of course differ in several rows. Example:
    NAME         OLD-VALUE         NEW-VALUE
    P.Category     Computer           Notebook
    Acc.Type.       A                            B
    The Computer field, shall have a search-help for a differnt data-type (DDIC help) than the A/B types.
    Is this possible? There should be a kind of "On-Open-F4-Help" event in which i can adjust the F4 help, which shall be used depending on the currently selected cell.
    Thanks for any help,
    greetings,
    Timo Stark

    Hey Sam,
    Yes I was able to achieve it. Create a collective search help, which includes all relevant data-elements.
    Create a search hel exit.
    Use the following code:
      IF CALLCONTROL-STEP <> 'SELONE' AND
         CALLCONTROL-STEP <> 'SELECT' AND
         " AND SO ON
         CALLCONTROL-STEP <> 'DISP'.
         EXIT.
      ENDIF.
    * STEP SELONE  (Select one of the elementary searchhelps)
    * This step is only called for collective searchhelps. It may be used
    * to reduce the amount of elementary searchhelps given in SHLP_TAB.
    * The compound searchhelp is given in SHLP.
    * If you do not change CALLCONTROL-STEP, the next step is the
    * dialog, to select one of the elementary searchhelps.
    * If you want to skip this dialog, you have to return the selected
    * elementary searchhelp in SHLP and to change CALLCONTROL-STEP to
    * either to 'PRESEL' or to 'SELECT'.
      DATA: lv_line LIKE LINE OF SHLP_TAB,
            lv_line_tmp LIKE LINE OF SHLP_TAB.
      DATA lv_current_context_element TYPE REF TO IF_WD_CONTEXT_ELEMENT.
      DATA lv_parent_data TYPE /SIE/SRM_FYC_CHANGE.
      DATA:lv_current_node TYPE REF TO IF_WD_CONTEXT_NODE,
           lv_index TYPE i.
      IF CALLCONTROL-STEP = 'SELONE'.
        lv_current_context_element = CL_WDR_VALUE_HELP_HANDLER=>M_CONTEXT_ELEMENT.
        lv_current_node = lv_current_context_element->get_node( ).
        lv_index = lv_current_context_element->get_index( ).
        lv_current_node->get_static_attributes( exporting index = lv_index importing static_attributes = lv_parent_data ).
        "switch over parent data..
        CASE lv_parent_data-type.
          WHEN 10.
            "cost center
            lv_line-SHLPNAME = 'BBP_F4_COST_CTR'.
          WHEN 3.
            lv_line-SHLPNAME = 'COM_CAT'.
          WHEN OTHERS.
            lv_line-SHLPNAME = ''.
            callcontrol-step = 'EXIT'.
            EXIT.
         ENDCASE.
         LOOP AT shlp_tab INTO lv_line_tmp.
            IF lv_line_tmp-shlpname <> lv_line-shlpname.
              DELETE TABLE shlp_tab FROM lv_line_tmp.
              CONTINUE.
            ENDIF.
         ENDLOOP.
         callcontrol-step = 'PRESEL'.
        EXIT.
      ENDIF.
    * STEP PRESEL  (Enter selection conditions)
    * This step allows you, to influence the selection conditions either
    * before they are displayed or in order to skip the dialog completely.
    * If you want to skip the dialog, you should change CALLCONTROL-STEP
    * to 'SELECT'.
    * Normaly only SHLP-SELOPT should be changed in this step.
      IF CALLCONTROL-STEP = 'PRESEL'.
    *   PERFORM PRESEL ..........
        EXIT.
      ENDIF.
    * STEP SELECT    (Select values)
    * This step may be used to overtake the data selection completely.
    * To skip the standard seletion, you should return 'DISP' as following
    * step in CALLCONTROL-STEP.
    * Normally RECORD_TAB should be filled after this step.
    * Standard function module F4UT_RESULTS_MAP may be very helpfull in this
    * step.
      IF CALLCONTROL-STEP = 'SELECT'.
    *   PERFORM STEP_SELECT TABLES RECORD_TAB SHLP_TAB
    *                       CHANGING SHLP CALLCONTROL RC.
    *   IF RC = 0.
    *     CALLCONTROL-STEP = 'DISP'.
    *   ELSE.
    *     CALLCONTROL-STEP = 'EXIT'.
    *   ENDIF.
        EXIT. "Don't process STEP DISP additionally in this call.
      ENDIF.
    * STEP DISP     (Display values)
    * This step is called, before the selected data is displayed.
    * You can e.g. modify or reduce the data in RECORD_TAB
    * according to the users authority.
    * If you want to get the standard display dialog afterwards, you
    * should not change CALLCONTROL-STEP.
    * If you want to overtake the dialog on you own, you must return
    * the following values in CALLCONTROL-STEP:
    * - "RETURN" if one line was selected. The selected line must be
    *   the only record left in RECORD_TAB. The corresponding fields of
    *   this line are entered into the screen.
    * - "EXIT" if the values request should be aborted
    * - "PRESEL" if you want to return to the selection dialog
    * Standard function modules F4UT_PARAMETER_VALUE_GET and
    * F4UT_PARAMETER_RESULTS_PUT may be very helpfull in this step.
      IF CALLCONTROL-STEP = 'DISP'.
    *   PERFORM AUTHORITY_CHECK TABLES RECORD_TAB SHLP_TAB
    *                           CHANGING SHLP CALLCONTROL.
        EXIT.
      ENDIF.
    greetings

  • ALV table - cell editor??

    Hi,
      I am facing a strange issue, that my alv table is opening as editable format even i havnt write editable coding in doinit() method. i have written my coding in domodify().
    coding as follows:
    WHEN 'PRIORITY'.
    DATA: lr_column_settings_PRIORITY TYPE REF TO if_salv_wd_column_settings,
            lr_column_PRIORITY    TYPE REF TO cl_salv_wd_column,
            lr_input_field_PRIORITY TYPE REF TO CL_SALV_WD_UIE_DROPDOWN_BY_KEY.
    lr_column_settings_PRIORITY ?= lo_value.
    lr_column_PRIORITY = lr_column_settings_PRIORITY->get_column( 'PRIORITY').
    if MODIFY_PARAM eq ABAP_TRUE.
    *Getting the columns settings.
    CREATE OBJECT lr_input_field_PRIORITY EXPORTING SELECTED_KEY_FIELDNAME = 'PRIORITY'.
    lr_column_PRIORITY->set_cell_editor( lr_input_field_PRIORITY ).
    lr_table_settings->set_read_only( abap_false ).
    else.
        CREATE OBJECT lr_input_field_PRIORITY EXPORTING SELECTED_KEY_FIELDNAME = 'PRIORITY'.
        lr_input_field_PRIORITY->set_enabled( abap_false ).
    lr_column_PRIORITY->set_cell_editor( lr_input_field_PRIORITY ).
    lr_table_settings->set_read_only( abap_false ).
    ENDIF.
    What is wrong in this and how initially table is populating as editable?
    Please help me on this issue.
    Thanks,
    GS

    CREATE OBJECT lr_input_field_PRIORITY EXPORTING SELECTED_KEY_FIELDNAME = 'PRIORITY'.
    lr_column_PRIORITY->set_cell_editor( lr_input_field_PRIORITY ).
    lr_table_settings->set_read_only( abap_false ).
    else.
    CREATE OBJECT lr_input_field_PRIORITY EXPORTING SELECTED_KEY_FIELDNAME = 'PRIORITY'.
    lr_input_field_PRIORITY->set_enabled( abap_false ).
    lr_column_PRIORITY->set_cell_editor( lr_input_field_PRIORITY ).
    lr_table_settings->set_read_only( abap_false ).
    ENDIF.
    Write down the Read only property in your code as ABAP_TRUE.

  • In Alv table, a column is editable mode, but want few cells in read only

    Hi All,
    I have a ALV table which column A and B.
    Both are in editable mode. I want to make fews in column B, to be read only.
    How to make it. Please help me.
    Thanks
    Vimalraj

    hi,
    refer this program,
    *& Report  ZALV_COLOR_DISPLAY_EDIT
    REPORT  zalv_color_display_edit.
    TYPE-POOLS: slis.
    TABLES : zcust_master2.
    INTERNAL TABLE DECLARATION
    TYPES : BEGIN OF wi_zcust_master2,
            zcustid LIKE zcust_master2-zcustid,
            zcustname LIKE zcust_master2-zcustname,
            zaddr LIKE zcust_master2-zaddr,
            zcity LIKE zcust_master2-zcity,
            zstate LIKE zcust_master2-zstate,
            zcountry LIKE zcust_master2-zcountry,
            zphone LIKE zcust_master2-zphone,
            zemail LIKE zcust_master2-zemail,
            zfax LIKE zcust_master2-zfax,
            zstat LIKE zcust_master2-zstat,
            field_style  TYPE lvc_t_styl,
    END OF wi_zcust_master2.
    DATA: it_wi_zcust_master2 TYPE STANDARD TABLE OF wi_zcust_master2
                                                     INITIAL SIZE 0,
          wa_zcust_master2 TYPE wi_zcust_master2.
    *ALV data declarations
    DATA: fieldcatalog TYPE slis_t_fieldcat_alv WITH HEADER LINE.
    DATA: it_fieldcat TYPE lvc_t_fcat,     "slis_t_fieldcat_alv WITH HEADER
    line,
          wa_fieldcat TYPE lvc_s_fcat,
          gd_tab_group TYPE slis_t_sp_group_alv,
          gd_layout    TYPE lvc_s_layo,     "slis_layout_alv,
          gd_repid     LIKE sy-repid.
    START-OF-SELECTION.
      PERFORM data_retrieval.
      PERFORM set_specific_field_attributes.
      PERFORM build_fieldcatalog.
      PERFORM build_layout.
      PERFORM display_alv_report.
    *&      Form  BUILD_FIELDCATALOG
          Build Fieldcatalog for ALV Report
    FORM build_fieldcatalog.
      wa_fieldcat-fieldname   = 'ZCUSTID'.
      wa_fieldcat-scrtext_m   = 'CUSTOMER ID'.
      wa_fieldcat-col_pos     = 0.
      wa_fieldcat-outputlen   = 10.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR  wa_fieldcat.
      wa_fieldcat-fieldname   = 'ZCUSTNAME'.
      wa_fieldcat-scrtext_m   = 'CUSTOMER NAME'.
      wa_fieldcat-col_pos     = 1.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR  wa_fieldcat.
      wa_fieldcat-fieldname   = 'ZADDR'.
      wa_fieldcat-scrtext_m   = 'ADDRESS'.
      wa_fieldcat-col_pos     = 2.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR  wa_fieldcat.
      wa_fieldcat-fieldname   = 'ZCITY'.
      wa_fieldcat-scrtext_m   = 'CITY'.
      wa_fieldcat-col_pos     = 3.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR  wa_fieldcat.
      wa_fieldcat-fieldname   = 'ZSTATE'.
      wa_fieldcat-scrtext_m   = 'STATE'.
      wa_fieldcat-col_pos     = 4.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR  wa_fieldcat.
      wa_fieldcat-fieldname   = 'ZCOUNTRY'.
      wa_fieldcat-scrtext_m   = 'COUNTRY'.
      wa_fieldcat-col_pos     = 5.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR  wa_fieldcat.
      wa_fieldcat-fieldname   = 'ZPHONE'.
      wa_fieldcat-scrtext_m   = 'PHONE NUMBER'.
      wa_fieldcat-col_pos     = 6.
    wa_fieldcat-edit        = 'X'. "sets whole column to be editable
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR  wa_fieldcat.
      wa_fieldcat-fieldname   = 'ZEMAIL'.
      wa_fieldcat-scrtext_m   = 'EMAIL'.
      wa_fieldcat-edit        = 'X'. "sets whole column to be editable
      wa_fieldcat-col_pos     = 7.
      wa_fieldcat-outputlen   = 15.
      wa_fieldcat-datatype     = 'CURR'.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR  wa_fieldcat.
      wa_fieldcat-fieldname   = 'ZFAX'.
      wa_fieldcat-scrtext_m   = 'FAX'.
      wa_fieldcat-col_pos     = 8.
      wa_fieldcat-edit        = 'X'. "sets whole column to be editable
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR  wa_fieldcat.
      wa_fieldcat-fieldname   = 'ZSTAT'.
      wa_fieldcat-scrtext_m   = 'STATUS'.
      wa_fieldcat-col_pos     = 9.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR  wa_fieldcat.
    ENDFORM.                    " BUILD_FIELDCATALOG
    *&      Form  BUILD_LAYOUT
          Build layout for ALV grid report
    FORM build_layout.
    Set layout field for field attributes(i.e. input/output)
      gd_layout-stylefname = 'FIELD_STYLE'.
      gd_layout-zebra             = 'X'.
    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'
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
        EXPORTING
          i_callback_program = gd_repid
          is_layout_lvc      = gd_layout
          it_fieldcat_lvc    = it_fieldcat
          i_save             = 'X'
        TABLES
          t_outtab           = it_wi_zcust_master2
        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
          text
    -->  p1        text
    <--  p2        text
    FORM data_retrieval .
      DATA: ld_color(1) TYPE c.
      SELECT zcustid zcustname zaddr zcity zstate zcountry zphone zemail
    zfax zstat UP TO 10 ROWS FROM zcust_master2 INTO CORRESPONDING FIELDS OF
    TABLE it_wi_zcust_master2.
    ENDFORM.                    "data_retrieval
    *&      Form  set_specific_field_attributes
          populate FIELD_STYLE table with specific field attributes
    FORM set_specific_field_attributes .
      DATA ls_stylerow TYPE lvc_s_styl .
      DATA lt_styletab TYPE lvc_t_styl .
    Populate style variable (FIELD_STYLE) with style properties
    The following code sets it to be disabled(display only) if 'ZFAX'
    is NOT INITIAL.
      LOOP AT it_wi_zcust_master2 INTO  wa_zcust_master2.
        IF  wa_zcust_master2-zfax IS NOT INITIAL.
          ls_stylerow-fieldname = 'ZFAX' .
          ls_stylerow-style = cl_gui_alv_grid=>mc_style_disabled.
                                          "set field to disabled
          APPEND ls_stylerow  TO  wa_zcust_master2-field_style.
          MODIFY it_wi_zcust_master2  FROM  wa_zcust_master2.
        ENDIF.
      ENDLOOP.
    ENDFORM.                    "set_specific_field_attributes
    Regards,
    K.Tharani.

  • ABAP WD: TreeByKeyTableColumn in ALV table (SALV_WD_TABLE)

    Hello,
    is is possible to add a TreeByKeyTableColumn object to a ALV table created
    using the SALV_WD_TABLE interface?
    I know that this question has already been posted several times - but the general answer ("use hierarchy columns and set_display_type( ..)") is not satisfying, since I have got the following:
    The context node of cardinality 0..n which corresponds to the "column tree" to be displayed has got
    - one KEY attribute
    - one PARENT_KEY attribute
    - one NODE_TEXT attribute
    - several attributes which correspond to the table lines (respectively tree lines)
    Example:
    The context of cardinality 0..n has got six attributes:
    KEY, PARENT_KEY, NODE_TEXT, col1 col2 col3.
    During runtime, there are five "lines" in this node:
    KEY    PARENT_KEY    NODE_TEXT   col1 col2 col3
    1         (none)                 "node1"             a      a     a
    2         1                        "node2"             b      b     b
    3         2                        "node3"             c      c     c
    4         1                        "node4"             d      d     d
    5         (none)                 "node5"             e      e     e
    The result should be in this case as if I'd have
    - a table with the columns col1, col2, col3 and
    - a TreeByKeyTableColumn with
         -- ROW_KEY      bound to KEY
         -- PARENT_KEY bound to PARENT_KEY
         -- containing a TextView with TEXT bound to NODE_TEXT
    Result in Display:
    -> node1             a   a   a                 <= Top level node
        ---> node2        b   b   b                 <= child of node with text "node1"
    > node3   c   c   c                 <= child of node with text "node2"
        ---> node4        d   d   d                 <= child of node with text "node1"
    -> node5            e   e   e                 <= Top level node
    Can this be established with the built in hierarchy functionality of the SALV_WD_TABLE interface, too?
    When playing around with the hierarchy columns functionality of SALV_WD_TABLE, I always got extra lines for the tree nodes with empty cells to the right (which I definitly don't want), and I was not able to use the parent_key<->key information already contained in the context node attributes.
    But perhaps I have overlooked something?
    Or is it possible to get somehow, by wild navigation through the available objects/classes/interfaces of the SALV_WD_TABLE interface, a reference to the corresponding table UI element to be able to dynamically add a TreeByKeyTableColumn with the wanted bindings?
    Regards & thanks for your help
    --Ute

    Once you have created a boolean attribute 'DAYS_READONLY' in the node bound to the DATA node of ALV, you need to set this attribute to false (for that row)  if you want DAYS field to be editable when the user creates another row. In the method where you have populated the data which is being displayed make this attribute as true for those rows.
    After this where you have made the ALV config settings write the following code.
      DATA: lr_input_field TYPE REF TO cl_salv_wd_uie_input_field.
      lr_column = lr_column_settings->get_column( 'DAYS' ).
      CREATE OBJECT lr_input_field EXPORTING value_fieldname = 'DAYS'.
      lr_column->set_cell_editor( lr_input_field ).
      lr_input_field->set_read_only_fieldname( value = 'DAYS_READONLY' ).
      CALL METHOD lr_column_settings->delete_column
        EXPORTING
          id     = 'DAYS_READONLY'
    In this code you are creating input field as a cell editor and assigning it to DAYS column. After this you are setting the readonly property of the column DAYS to the value of the column 'DAYS_READONLY'. Since this column can have different values for each row, the column DAYS will be made readonly/editable accordingly. Finally you are deleting the column DAYS_READONLY from ALV output as we do not want to display its value to the user.
    For more info you can refer to thread: [ALV  List  in the same Column for the row  CELL  i need button or value;
    Edited by: Pooja Patodia on Mar 16, 2011 9:54 AM

  • Double click on cell in alv report

    Hi all,
    I want to show detail popup on cell of alv report. how to get the cell value.
    plz tell me the logic for getting cell value.
    thanks in advance.

    Hi,
    IF RS_SELFIELD-FIELDNAME = 'EBELN1'.
    * Read data table, using index of row user clicked on
    READ TABLE IT_EKKO INTO WA_EKKO INDEX RS_SELFIELD-TABINDEX.
    Please remember the field EBELN1 should be in IT_EKKO. after the read statement you can move which ever field you want to another for further processing
    like
    READ TABLE IT_EKKO INTO WA_EKKO INDEX RS_SELFIELD-TABINDEX.
    if sy-subrc eq 0.
      move it_ekkp-( your field name) to v_field
    endif.

Maybe you are looking for

  • File deployment error

    Hi As we are deploying a CRE application, the application is deployed successfully but it throws some warning. There are two application on one of the servers. I guess this might be because of the application on same server causing intervention betwe

  • Km development runtime error

    hi i am creating a simple km application to create a folder using km api when i run the application it is displaying runtime error in the portal any help on this here is the trace . EXCEPTION #1#com.sapportals.portal.prt.component.PortalComponentExce

  • Error 502 downloading one particular song in batch after purchase

    I've seen some other posts about this error, but not this particular instance. I purchased a batch of about 26 songs, all of which downloaded successfully except for this song: "Soul Man" by "Sam & Dave" from album "The Essentials: Sam & Dave" This i

  • Using iMac as a display.

    The new iMac is out - yeah!  I am curious about one thing - can I connect my MacPro to it using a thunderbolt cable, thereby using it as a monitor for the Pro.  Will functionality (keyboard, mouse) switch to those that are connected to the iMac?  I g

  • Number of (field)

    In the following I would like to have the number of PCMS_CHDOC_DATA.CH_DOC_ID found by the select, I tried to use the COUNT function but it gives 1 as a result: SELECT PCMS_CHDOC_DATA.CH_DOC_ID, PCMS_CHDOC_DATA.CH_UID, PCMS_CHDOC_DATA.CH_DOC_TYPE, PC