Setting new cell variant for an alv table column

Hi,
I want to set a new cell variant for a column. Therefore I did the following steps:
1. Create an object of CL_SALV_WD_CV_STANDARD
2. SET_KEY( 'CELLVAR1 )
3. set_cell_design([..]-goodvalue_medium )
4. SET_EDITOR( lr_alv_input_field )
After that I added the cell variant to the column by using the method "add_cell_variant".
The last step is to call method SET_SELECTED_CELL_VARIANT.
I checked my program by using get_selected_cell_variant( ) and the return string was okay.
But when the table is displayed, the new cell variant isn't working. I defined an input field as the cell editor for my new cell variant but when the table is shown, it is just text - no input possible. In addition to that the selected cell design (goodvalue_medium , step 3) isn't working. So I think the cell variant is not used.
Can you help me?
Thanks & Regards,
Hendrik

Hi
I wonder if you can help me please, I too am having issues implementing ALV cell changes in WDA?
I am basically trying to dynamically change the individual color of a cell (not the entire column or row) dependant on certain criteria. I apologies but find that you are the closest resource for any potential information. Please see screen shot below.
Currently my code is as follows:
see: www.picasaweb.google.co.uk/dave.alexander69/Pictures#5244416971466907938
data: lr_cv TYPE REF TO cl_salv_wd_cv_standard.
loop at table 1 row data
        loop at table columns
          for the date columns only...
          IF <fs_column>-id(4) = 'CELL'.
           get and set column header dates from select option user input - done
            loop at table 2 row data (table 2 contains date ranges for row concerned)
              MOVE: ls_zdata-variance TO lv_variance.
              method 1 - as in sap press WD4A -:
              lr_cv = cl_wd_table_standard_cell=>new_table_standard_cell(
                                                 view        = view
                                                variant_key = lv_variance ).
             as mentioned...
              CREATE OBJECT lr_cv.
              lr_cv->set_key( 'VARIANCE' ).
              lr_cv->set_cell_design( '09' ).
              lr_cv->set_editor( lr_input_field ).
              lr_column->add_cell_variant( lr_cv ).
              lr_column->set_cell_editor( lr_input_field ).
              lr_column->set_sel_cell_variant_fieldname( 'VARIANCE' ).
              lr_column->set_cell_design_fieldname( value = 'COLOR_CELL' ).
              lr_field = lr_table->if_salv_wd_field_settings~get_field( <fs_column>-id ).
              lr_field->if_salv_wd_sort~set_sort_allowed( abap_false ).
              the only way I get cell coloring to work - but this is for entire column?
              ls_zdata-color_cell = cl_wd_table_standard_cell=>e_cell_design-one.
              MODIFY lt_zdata FROM ls_zdata..
            ENDLOOP.
          ENDIF.
          IF <fs_column>-id = 'COLOR_CELL'.
            CALL METHOD lr_column->set_visible( EXPORTING value = '00' ).
          ENDIF.
        ENDLOOP
      ENDLOOP.
As you see I am in the dark a bit regarding cell variants and wonder if you can point me in a better direction.
Many thanks for any help,
Dave Alexander

Similar Messages

  • Use of Cell Variant for a normal table

    Hi Experts,
    I have a requirement in a normal table where a row is first in read-only mode, then on click of edit button (given on that row),
    the row should become editable and also edit button should become invisible and two more buttons update/cancel have to be visible. How to achieve this using a cell variant for this normal table.
    A detailed reply would be appreciated.
    Thanks in Advance,
    Mirza Hyder.

    Hi Mirza,
    Cell variant property is used to chenge the cell property not for other.That means in one cell you want checkbox and in other cell you want textview like this you can change the property of cell as you want.
    Test this standard program WDR_TEST_TABLE in that test view cell varint for your understanding.
    Coming to your requirement.You can do in this way.
    Check in the below thread in that i gave code to make the entire row is editable when you click on the lead selection of row.I gave code for ALV.I hope that code is use ful for you.
    How to make all columns of alv editable
    To make tool bar buttons disable and enable:Write your logic in method handler of lead selection event like change the visible property of button to none.
    Note: In the event handler method you dont get reference of view.You only get reference of view in WDDOMODIFYVIEW only so take a global variable of type ref to if_wd_view and populate that global variable in method WDODIFYVIEW.So that you can access any view element in any method.
    For cell variant in ALV check this Article written by me.
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f0e7461d-5e6c-2b10-dda9-9e99df4d136d

  • How to set title/text for ALV table column header in WD ABAP

    Hello,
    I am working in WDA using SALV_WD_Table to display data in table. I need to change the column header text, the obvious way is to get the column header and call the method SET_TEXT to set new text / title. However, this method does NOT work, it does not change the column header text. I also tried the SET_TOOLTIP, this one works, but SET_TEXT does not work. Anyone has idea why this not working and do you find any go-around solution?
    My version is NW 7.0
    Thank
    Jayson

    Hi jason ,
    For setting Heder text for your ALV table
    ip_confing type ref to CL_SALV_WD_CONFIG_TABLE.
    "set alv table header
      ip_config->if_salv_wd_table_settings~r_header->set_text( 'Test ALV Header functionality' ).
    first you have to hide the DDIC text and then try to set your own text .
    "modify columns
      LOOP AT lt_columns INTO ls_column.
        lr_column = ls_column-r_column.
        CASE ls_column-id.
          WHEN 'MANDT'.
            "hide this field
            lr_column->set_visible( cl_wd_abstr_table_column=>e_visible-none ).
           WHEN 'SEQNR'.
            "set header to different string
            lr_column->r_header->set_ddic_binding_field( if_salv_wd_c_column_settings=>ddic_bind_none )." use this line to hide ddic text
            lr_column->r_header->set_text( 'Position' ).     
        endcase.
      endloop.
    Regards
    Chinnaiya P

  • How do I set a BG Image for a specific Table Cell?

    Hello...
    How do I set a Background Image for a specific table cell
    without it affecting the main page background image?
    thanks
    J

    Use CSS -
    td.special { background-image:url(foo.gif); }
    will style this table cell only -
    <td class="special">
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "JSloanSDRE" <[email protected]> wrote in
    message
    news:g2dl7n$pf5$[email protected]..
    > Hello...
    >
    > How do I set a Background Image for a specific table
    cell without it
    > affecting the main page background image?
    >
    > thanks
    > J

  • How to set up Dynamic Variants for job which is based on Pay Period

    Hi,
    We need to set up dynamic variant for payroll interface.  This interface is based on Pay periods and that is why we need to use different variant for each month.  Letus know how to set up dynamic variant which will take care of Pay Periods

    Hi,  Thnx for reply.
    We are not changing the control records, current period will be some old period in system. 
    payroll is not processed in SAP,

  • 1 custom field not showing up for modification in new List Variant for KS12

    Dear SAP Experts,
    I need some help regarding list variants using custom fields.  I made a new List Variant for transaction KS12 using a few custom and standard fields.  The custom fields are in CI_CSKS structure. I did all this according to not 95080 using option two (Adjust screen 1399 in function group KMA1).  I got the header to display the name of the fields in SE51.  The strange things is that after I start KS12 with the new list variant one of the custom fields doesn't show up for modification if there is no value in it where this is not the case with the others.  That is if there is no value in it already (even on character) I can't enter new values in to it, which beats the purpose.  I checked the attributes of the the custom fields and they are all the same, unless I missed something.
    Does anyone have an idea why this could be?

    Hi Michael - I too have exactly the same problem in Lion. It seems to be a bug.
    A minor one, given all the other much larger issues I have with Lion.
    I'm living with it in the expectation that someone will fix it. I notified it ages ago - long before the recent Lion update.
    I am mainly using Snow Leopard. This problem doesn't happen in Snow.

  • JTree: How to set different cell editor for different tree Nodes.

    I have a JTree and I want to set different cell editors for different node depending on some condition. E.g. I want to set ComboBox as editor for leaf node but each leaf node will have its own set of data.
    Any help or pointer?
    Thanks in advance
    Sachin

    take there:
    http://www.mutualinstrument.com/Easy/FAQ/Tree/tree.html

  • How to set a Default variant for VL06O (Outbound Delivery Monitor)?

    Hi All,
    I want to set a DEFAULT VARIANT for  VL06O (Outbound Delivery Monitor) selection screen with "For Picking", "For Confirmation", "For Goods Issue" and "List of Outbound Deliveries" button option.
    I have already created a variant with those 4 buttons. But I cant find a way to set it as DEFAULT.
    Appreciate your help on this.
    Please note I'm using SAP ERP 6.0 Ehp 4.
    Thanks & best regards,
    Anupa

    Hi Indranil,
    Superb !
    This is what I was searching for.
    That works really fine. Thanks a lot!
    Best regards,
    Anupa

  • How to set a change pointer for a perticular table?

    Hi,
    Please let me know how to set a change pointer for a perticular table.

    what do you mean by 'change pointer'? normally this idiom is used for sending ÍDOCs from one system/client/org-unit to another ...
    do you generally want to record changes to a specific table? then set parameter rec/client using RZ10 for your instance profiles and restart the instances in order for the parameter to take effect.
    set the table to 'record all changes' using SE11.
    you might re-consider if the table has a lot of  data and is accessed very often for performance-resons.
    change protocols can be evaluated using tx, SCU3.

  • Setting a cell renderer for a Cell?

    Hi everybody,
    I'm sitting here with a problem: I'm trying to set a Cell renderer for a cell.
    The problem is in all of the examples that i saw till now this was made only with columns.
    Is it possible to set different CellRenderer foor different cells in the same column?

    Hi,
    if you implement your cellRenderer you return the Object you get for all columns but the one you want to be handled im a special way. As you know the row as well you can return sth different for each row.
    Phil

  • Setting a Primary Key for a newly added Column

    Is it possible for setting a primary key for a newly added column in a table having records?

    Hi,
    km**** wrote:
    oh if the table has records then it is not possible ah...No, the table can have rows at the time you add the Primary Key constraint. Solomon was just saying that the column(s) that you are making into the Primary Key must already have unique values. A Primary Key can not be NULL, so you must do the steps in this order:
    (1) ALTER TABLE to add the column(s) (if this hasn't been done already)
    (2) UPDATE the table, to put unique values in all rows for the Primary Key column(s)
    (3) Add the PRIMARY KEY constraint
    You need to do step (2) before you do step (3)

  • In webdynpro for ABAP  alv table issue

    hello gurus,
                      i am new for webdynpro for ABAP.i strucked at one point at designing time.anybody  could you suggest me on this.
    thanks in advance.
    let me explain my scenario first.
    in my webdynpro for ABAP developement i have one alv table having ten fields.i am featching the data for eight fields from one Ztabale and updating , for rest of two fields we need to fill after displaying output using the respective F4 help. Right now these two fields are in input editable mode.now i am getting the values successfully from F4 help and at the same time it is allowing MANUAL ENTRIES also but as per my requirement it  should not allow  any manual entries . for this i have made these two fields are in readonly mode as like as rest of fields to avoid the MANUAL ENTRIES  but at this time i didnot get any F4 helpfor those two fields.
    so how can i achive my goal in this thing could any one suggest me.
    my final conclusion is we need to get only F4 help values into those two fields . it should not allow any manual values at any point of time.
    best regards,
    babu

    ya hi  harshit,
          my self also used same code in my action part . here i have one table with four fields  carrid , connid , fldate , price.
    for carrid i have created freely programmed search help.but if it is in display mode there is no F4 help in enable mode.
    in context for attribute carrid
    DATA lo_nd_flight TYPE REF TO if_wd_context_node.
      DATA lo_el_flight TYPE REF TO if_wd_context_element.
      DATA ls_flight TYPE wd_this->element_flight.
      DATA lt_flight TYPE wd_this->elements_flight.
    navigate from <CONTEXT> to <FLIGHT> via lead selection
      lo_nd_flight = wd_context->get_child_node( name = wd_this->wdctx_flight ).
      select connid fldate price from sflight into CORRESPONDING FIELDS OF TABLE
        lt_flight UP TO 20 ROWS.
    @TODO handle non existant child
    IF lo_nd_flight IS INITIAL.
    ENDIF.
    get element via lead selection
    lo_el_flight = lo_nd_flight->get_element( ).
    alternative access  via index
    lo_el_flight = lo_nd_flight->get_element( index = 1 ).
    @TODO handle not set lead selection
    IF lo_el_flight IS INITIAL.
    ENDIF.
    get all declared attributes
    lo_el_flight->get_static_attributes(
       IMPORTING
         static_attributes = ls_flight ).
    CALL METHOD lo_nd_flight->bind_table
      EXPORTING
        new_items            = lt_flight
       set_initial_elements = ABAP_TRUE
       index                =
    DATA: lo_cmp_usage TYPE REF TO if_wd_component_usage.
    DATA: lo_interfacecontroller TYPE REF TO iwci_salv_wd_table.
        instantiate ALV component usage if necessary
      lo_cmp_usage = wd_this->wd_cpuse_alv( ).
      IF lo_cmp_usage->has_active_component( ) IS INITIAL.
        lo_cmp_usage->create_component( ).
      ENDIF.
        pass reference to data node to instance of ALV usage
      lo_interfacecontroller = wd_this->wd_cpifc_alv( ).
      lo_interfacecontroller->set_data( r_node_data = lo_nd_flight ).
    Configure ALV
      DATA lr_config TYPE REF TO cl_salv_wd_config_table.
      lr_config = lo_interfacecontroller->get_model( ).
    **declerations
      DATA: lt_columns TYPE salv_wd_t_column_ref,
            ls_columns TYPE salv_wd_s_column_ref,
            lr_input TYPE REF TO cl_salv_wd_uie_input_field,
            name TYPE string,
            lt_node_info TYPE wdr_context_attr_info_map,
            ls_node_info TYPE wdr_context_attribute_info,
            lv_tabix TYPE sy-tabix,
            lr_info TYPE REF TO if_wd_context_node_info.
      TYPES: BEGIN OF ty_name,
              name TYPE string,
             END OF ty_name.
      DATA: lt_name TYPE TABLE OF ty_name,
            ls_name TYPE ty_name.
    **for getting node info
    *Get the context node information
      lr_info = lo_nd_flight->get_node_info( ).
      lt_node_info = lr_info->get_attributes( ).
      LOOP AT lt_node_info INTO ls_node_info.
        CASE ls_node_info-name.
          WHEN 'CARRID'.
            ls_name-name = ls_node_info-name.
            APPEND ls_name TO lt_name.
         WHEN 'REGIONALOFFICER'.
           ls_name-name = ls_node_info-name.
           APPEND ls_name TO lt_name.
         WHEN 'INSPECTORNAME'.
           ls_name-name = ls_node_info-name.
           APPEND ls_name TO lt_name.
        ENDCASE.
      ENDLOOP.
    *Logic for  Table Horizontal Scrolling
      lr_config->if_salv_wd_table_settings~set_visible_row_count( 13 ).
      "  lr_config->if_salv_wd_table_settings~set_width( '1085' ).
      lr_config->if_salv_wd_table_settings~set_width( '100%' ).
      lr_config->if_salv_wd_table_settings~set_scrollable_col_count( 8 ).
      "  lr_config->if_salv_wd_table_settings~set_fixed_table_layout( abap_true ).
      lr_config->if_salv_wd_table_settings~set_first_visible_scroll_col( 'CARRID' ).
      lr_config->if_salv_wd_table_settings~set_cell_action_event_enabled( abap_true ).
    Set the table editable .
      DATA: lr_table_settings TYPE REF TO if_salv_wd_table_settings.
      lr_table_settings ?= lr_config.
      lr_table_settings->set_read_only( abap_false ).
      lr_table_settings->set_read_only( abap_true ).
      DATA: lr_column_settings TYPE REF TO if_salv_wd_column_settings,
            lr_column TYPE REF TO cl_salv_wd_column.
    DATA: lt_string TYPE STANDARD TABLE OF string,
            ld_string TYPE string,
            ld_int TYPE i,
            lv_index TYPE i.
    Make few columns editable and attach inputfield, if permitted.
        DATA lr_input_field TYPE REF TO cl_salv_wd_uie_input_field.
        CLEAR lt_string.
        APPEND 'CARRID' TO lt_string.
        LOOP AT lt_string INTO ld_string.
          lr_column_settings ?= lr_config.
          lr_column = lr_column_settings->get_column( ld_string ).
          CREATE OBJECT lr_input_field
            EXPORTING
              value_fieldname = ld_string.
          lr_input_field->set_read_only( abap_true ).
          lr_column->set_cell_editor( lr_input_field ).
        ENDLOOP.
        CLEAR lt_string.

  • List UIBB - Access to cell editor for a certain table line possible

    Hi,
    I am looking for a way to access the cell editor of the last table line as I want to mark it as a special - summary - line.
    I intend a similar approach like in WebDynrpo ABAP when accessing the node info and modifying the "CELL DESIGN" attribute like in the following code (copied from WD Comp WDR_TEST_TABLE, View CELL DESIGN, method FILL_CELL_DESIGNS) :
      data tab type IF_CELL_DESIGN=>Elements_Cell_Designs.
      data line type IF_CELL_DESIGN=>Element_Cell_Designs.
      data node_info type ref to if_wd_context_node_info.
      data attribute_info type wdr_context_attribute_info.
      data attr_value type WDR_CONTEXT_ATTR_VALUE.
      node_info = node->get_node_info( ).
      attribute_info = node_info->get_attribute( 'CELL_DESIGN' ).
      line-is_expanded = abap_true.
      line-is_leaf     = abap_false.
      line-key         = 'FIRST'.
      loop at attribute_info-value_set into attr_value.
        line-text = sy-tabix.
        concatenate 'Text #' line-text into line-text. "#EC NOTEXT
        line-cell_design = attr_value-value.
        insert line into table tab.
        line-is_leaf = abap_true.
        line-key = attr_value-value.
        line-parent_key = 'FIRST'.
      endloop.
      node->bind_table( tab ).
    I suspect the method IF_FPM_GUIBB_LISTGET_DATA (or IF_FPM_GUIBB_LISTGET_DEFINITION) of my feeder class to be the right access point.
    But unfortunately, I have not yet found out how to change the cell design for specific lines, only for whole columns.
    Can anyone give me a hint here?
    BTW: The "summary" line is not a sum of the lines above, but determined by backend logic, so not ALV-summary line for me.
    Kind Regards

    Hi,
    A short update for all interested:
    My current work around is to always set the lead selection to the summary line. It does in a kind "mark" that line as special as long as I cannot mark it using a different cell design.
    How do I assure this?
    I have implemented the following code in a redefinition of the method ADJUST_SELECTION:
    *- alter selection
      DATA:
       ls_size TYPE rstabix.
      "get index of summary line
      ls_size-tabix = mo_collection->size( ).
      "change only if there are any cash conc. proposals
      IF ls_size-tabix > 0.
        "do FPM selection
        CLEAR: ev_lead_index, et_selection.
        ev_lead_index = ls_size-tabix.
        APPEND ls_size TO et_selection.
        "do BOL selection
        mo_collection->if_bol_bo_col_multi_sel~unmark_all( ).
        mo_collection->if_bol_bo_col_multi_sel~mark( iv_index = ls_size-tabix ).
      ENDIF.
    The general downside is, that no other selection is possible!
    The selection is always reset to the summary line with each roundtrip.
    Waiting for a better solution...
    Kind Regards,
    Robert

  • Problem with same layout (variant) for two ALV Grid and ALV Tree

    Hello!
    I have two docking containers on the screen. On the left i have cl_gui_alv_tree, on the right cl_salv_table.
    When a user set a default layout for ALV Grid (or ALV Tree), raport starts and sets this layout in both objects (tree and grid).
    How to avoid this?

    Hi,
    Take Two radio buttons.
    First radion button display the two containers in grid format,
    second radio button display the two containers in tree format base on user selection.
    CREATE OBJECT G_DOCING_CONTAINER
        EXPORTING PARENT = G_CUSTOM_CONTAINER."G_CONTAINER.
    DISPLAY THE DATA IN GRID FORMATA
    CREATE OBJECT r_grid
        EXPORTING
          i_parent          = G_DOCING_CONTAINER
    CALL METHOD g_docing_container->set_width
          EXPORTING
            width      = 1300.
    DISPLAY THE GRID DATA IN SECOND CONTAINER
    CREATE OBJECT r_grid1
        EXPORTING
          i_parent          = G_DOCING_CONTAINER
    CALL METHOD g_docing_container->set_width
          EXPORTING
            width      = 1300.
    OTHERWISE WE CAN DISPLAY THE TWO CONTAINERS DATA IN A GRID FORMAT
    CREATE OBJECT g_tree
        EXPORTING
          parent                = g_docing_container"g_custom_container
    IF R1 = 'X'.  "FOR GRID DISPLAY
    CALL METHOD r_grid1->set_table_for_first_display
    CALL METHOD r_grid2->set_table_for_first_display
    ELSE.
    ************TREE DISPLAY
    ENDIF.
    regards,
    muralii

  • Set new Required Field for MD14 and MD15 for conver from Planned order to P

    Dear all,
    I would like to set new required field (Purchasing Organization)  in T-CODE MD14 and MD15 for convert from Planned Order to PR. What's should I do?
    Please help, I 'm new for MRP.
    Best Regards,
    Kate

    Hi Kate,
    You are not on the right track; MD14 and 15 will choose the PLANNED ORDER population for the conversion. In planned orders there's NO PURCHASING ORGANIZATION DATA (normally)!
    So even if you managed to put the field on the screen, it will not do anything that makes sense.

Maybe you are looking for