Set ALV Cell visibility property

Hi,
I would have 2 tables for ALV. One table consists of the data to be bound to the ALV. The other table would have the read only property(boolean) filled for each of the ALV cells.
I would want to set the property of each ALV cell using the second table. How do i do that?
Currently i am just testing it for few attributes statically using the below code.
DATA lo_nd_date_table TYPE REF TO if_wd_context_node.
DATA lo_el_date_table TYPE REF TO if_wd_context_element.
DATA: lt_ele_set TYPE wdr_context_element_set.
navigate from <CONTEXT> to <DATE_TABLE> via lead selection
  lo_nd_date_table = wd_context->get_child_node( name = wd_this->wdctx_date_table ).
lt_ele_set = lo_nd_date_table->get_elements( ).
  LOOP AT lt_ele_set INTO lo_el_date_table.
      lo_el_date_table->set_attribute_property(
           attribute_name = 'WK02'                                 -
> Attribute Name (Column Name)
           property       = if_wd_context_element=>e_property-read_only
           value          =  'X' ).
<< Similarly for other attributes>>
ENDLOOP.
I have inserted this code at the end. Initially few other properties were set to the cells.
This seems to be not working.
Regards,
Rekha
Edited by: Rekha Gopinath on Sep 8, 2009 10:40 AM

Hi Lekha,
In my case, the columns represents dates. The rows represent projects. So, only those row cells are editable where the project is valid.
1. I have created READ_ONLY attribute for the date node (table).
2. I am filling the READ_ONLY to abap_true or abap_false based on the following condition.
   Even if one of the projects is not valid for a date, then READ_ONLY = ABAP_TRUE. This means, even if one cell is set to abap_true, then READ_ONLY is set to abap_true.
3. I modify the date node and bind it with the READ_ONLY set row wise.
Loop at the data and set read only
  navigate from <CONTEXT> to <DATE_TABLE> via lead selection
  lo_nd_date_table = wd_context->get_child_node( name = wd_this->wdctx_date_table ).
  CALL METHOD lo_nd_date_table->get_static_attributes_table
    IMPORTING
      table  = lt_date_table    .
  LOOP AT lt_date_table INTO ls_date_table.
    lv_tabix = sy-tabix.
      READ TABLE wd_this->gt_prop INTO ls_prop INDEX lv_tabix.
      IF sy-subrc EQ 0.
        IF ls_prop-wk01 = abap_true OR         
          ls_prop-wk02 = abap_true OR
          ls_prop-wk03 = abap_true OR
          ls_prop-wk04 = abap_true OR
          ls_prop-wk05 = abap_true OR
          ls_prop-wk06 = abap_true OR
          ls_prop-wk07 = abap_true OR
          ls_prop-wk08 = abap_true OR
          ls_prop-wk09 = abap_true OR
          ls_prop-wk10 = abap_true OR
          ls_prop-wk11 = abap_true OR
          ls_prop-wk12 = abap_true OR
          ls_prop-wk13 = abap_true OR
          ls_prop-wk14 = abap_true OR
          ls_prop-wk15 = abap_true.
          ls_date_table-read_only = abap_true.
        ELSE.
          ls_date_table-read_only = abap_false.
        ENDIF.
      ENDIF.
    MODIFY lt_date_table FROM ls_date_table INDEX lv_tabix TRANSPORTING read_only.
  ENDLOOP.
  CALL METHOD lo_nd_date_table->bind_table
    EXPORTING
      new_items            = lt_date_table
      set_initial_elements = abap_true.
4. I loop through the column reference and use the code mentioned earlier.
          CREATE OBJECT lr_input
            EXPORTING
              value_fieldname = lv_id.
          lo_column->set_cell_editor( value  = lr_input ).
          lr_input->set_read_only_fieldname( value = 'READ_ONLY' ).
The expected output is different from the input i had mentioned earlier for Row 1, row 2, Row 3 and row 4. Here, i would get all the rows as non editable except for Row 3.
I would want to set all columns based on condition.
Regards,
Rekha

Similar Messages

  • How to set the disable,visible property in declarative components.

    We have used one declarative component. It consists of 5 buttons (add,delete,save,delete,print). In all of our pages, this declarative component is used. We could bind methods and was able to use each pages seperately (by linking the methods in the backing bean)
    But for implementing the DISABLE,VISIBLE properties, we have added the attributes for this and refered this to the corresponding disable and visible property of the button. In the page all these properties where reflected. But at the runtime these buttons are not coming.
    Can anyone advise how can we set the disable,visible property in declarative components.

    Hi vikram ,
    i hvnt initialized the properties ,
    in my declarative component i have one button say Save button and i want to config 2 properties Disable and Visible
    i added two attributes ( java.lang.Boolean ) say disablr_btn ,*visible_btn* and mapped wth the Save button Properties Disabled and Visible using expressions
    Now the button is invisible while running the page.
    if i remove the mapping from properties Disable and visible , the button is visible
    should i init the properties in faces config , i dnt knw hw to init the properties
    pls advice

  • Set ALV cell, use of event DATA_CHANGED

    Hi experts,
    I want to set some ALV input fields using abap.
    That's easy, I can modify the table as I need and call the refresh of the ALV table ( refresh_table_display).
    But how can I "fill" the fields that the event DATA_CHANGED is called?
    When I fill manually in ALV, this event is raised...I need the event also when filling with ABAP...
    Thanks in advance
    Michael

    Hello Michael,
    This link shows you the right way to do:
    Get Changed Value In ALV Grid Dynamically - ABAP Development - SCN Wiki
    Inside HANDLE_DATA_CHANGED method, you can change the value of a cell in this way:
    CALL METHOD PR_DATA_CHANGED->MODIFY_CELL
        EXPORTING
          I_ROW_ID    = IT_TABLE-ROW_ID
          I_FIELDNAME = 'FIELD'
          I_VALUE     = IT_FLIGHT-FIELD.
    I hope you help.

  • Set alv cells Obligatory

    Hi All,
    I created an ALV GRID with editable cells but i'm not finding how to make thows cells obligatory.
    Help me please !!!!
    Regards.
    iMedix

    hi,
        Check the final internal table once user does action on grid eg: save or update and throw error( if desired fields left blank) of mandatory fields..
    Thanks,
    Gaurav.

  • How to set the read only property for dynamic ALV column

    Hi All,
    I have built one dynamiv ALV and I have one name column inside that ALV for which I have to set read only property based on two column fields that exist in the same ALV,say IS_SP and IS_CORP of type boolean.
    If any one of the flag is 'X',i have to make that name column as display only and
    If both flag are not set,it should be displayed as ediatable column.
    I have written one method as INIT_ALV which gets called when ALV is loaded.
    Code is as  follows:
      lr_column_settings ?= wd_this->alv_all_roles.
      lt_columns = lr_column_settings->get_columns( ).
    LOOP AT lt_columns INTO ls_column.
    CASE ls_column-id.
       WHEN <NAMECOLUMN>. "name column which should be editable/display
    Create Input Field
            CREATE OBJECT lr_uie_input_field_ro
              EXPORTING
                value_fieldname = ls_column-id.
         ls_column-r_column->set_cell_editor( lr_uie_input_field_ro ).
        After this,I have to set the read only property based on IS_SP and IS_CORP values,
              CALL METHOD lr_uie_input_field_ro->set_read_only_fieldname
              EXPORTING
                *value = 'IS_SP' or 'IS_CORP'
    ENDLOOP.
    I dont want to use cell variants also.
    Help me to achieve this.
    Thanks and Regards,
    Divya

    Divya - I have done it in the past following these documents. Please read it and try it it will work.
    Please read it in the following order since both are a continuation documents for the same purpose (it also contains how to change colors of row dynamically but I didnt do that part I just did the read_only part as your requirement) 
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f0625002-596c-2b10-46af-91cb31b71393
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/d0155eb5-b6ce-2b10-3195-d9704982d69b?quicklink=index&overridelayout=true
    thanks!
    Jason PV

  • Listbox set to NOT editable cells; EditRow property seems to override

    Hi All,
    I have several listboxes that I programmatically set to Editable Cells or not, depending on the runtime status. When I have it turned OFF, I do not want the user to be able to edit the text values in the cells.
    However, I have a RTM for the listbox with an "Edit" option. That menu item sets the EditRow property (after setting Key Focus) to the selected row. This makes the text editable, even if I have it turned OFF!!
    This is not the behaviour I expected. Is this a bug?

    Could you provide the code that you are seeing this occur in? Its almost impossible to see if this is a bug without some example. The simpler the example the better.
     It is possible that it is a bug, but it's also possible that you are setting the cell to edit mode after you set it to lock. I am wondering why you are doing that? Its most likely that you want to edit some cells but keep others locked from editing, and I do not think that is a bug, however, it might be a good product suggestion to keep certain cells permanently locked from the user, which is probably not the case with the lock function you are using (which most likely can be over ridden by other property nodes).
    Regards,
    Andrew
    National Instruments
    RIO Embedded Hardware PSE
    CompactRIO Developers Guide

  • 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

  • How to set visible property to href link

    Hi All,
    I want to open the new jsp page in the new tab when will we click on the link in my ADF application.So i tried like this.
    <af:column id="pt_c115" >
    <a id="JspLink" href="AuditLogInfo.jspx" target="_blank">JspLink</a>
    </af:column>
    Im able to view my new jsp page when im click on JspLink link.But here my problem is i have nee to set the visible condition if the 'status' field of adf table is succes only i want to view the link other wise no need to visible my link.
    visible="#{row.bindings.Status.inputValue=='SUCCESS'}" is working for commandbutton.But i'm not able to see any visible property in <a id="JspLink" href="AuditLogInfo.jspx" target="_blank">JspLink</a> .How can i set this condition?Please help me.I'm using JDeveloper 11.1.1.5 version.
    Thanks in Advance!
    Edited by: 851924 on Apr 5, 2012 11:22 PM
    Edited by: 851924 on Apr 5, 2012 11:23 PM

    Instead of using a jsplink you should use an af:goLink which is the adf equivalent and has all the needed properties.
    Timo

  • Set visibility property for items depending on other items

    Hello,
    I want to set the visibility setting for an item that I have, the steps should be as the following,
    for example
    if I have an item that asked,
    do you have children ?
    if the answer is Yes,
    the next item should be visible which let's say, number of  them
    if no,
    the next item should be not visible
    I tried to set a trigger for the item I am controlling its visibility which is
    pre-text-item and wrote
    if 'CHEQUE_TABLE.CHEQUE_RECIEVED'='yes'
      then
      set_item_property(:SYSTEM.CURRENT_ITEM,visible,property_true) ;
    else
      set_item_property(:SYSTEM.CURRENT_ITEM,visible,property_false) ;
      end if;
    but it doesn't seem to be right, ,,,
    thank you

    I can see two potential problems.  The first:
    if 'CHEQUE_TABLE.CHEQUE_RECIEVED'='yes'
    Does CHEQUE_TABLE.CHEQUE_RECEIVED refer to a Data Block and Item?  If yes, then you are trying to tell Forms to look at the value of the string 'CHEQUE_TABLE.CHEQUE_RECEIVED' when you should be refering to the value of the Block.Item through direct reference, eg:
    IF :CHEQUE_TABLE.CHEQUE_RECEIVED = 'yes'
    How is the value of CHEQUE_RECIEVED set?  Does the user select the YES value from a List of Value (LOV) or from a Poplist or do they enter the value by typing it in?  If your code is looking at the string 'yes' and comparing it to the value of the Block Item which is in upper or mixed case, then 'yes' = 'Yes' or 'yes' = 'YES' will evaluate to FALSE instead of TRUE.
    It is always a good idea to use a Poplist or a List of Values when you are expecting specific values to be entered by the user; this enables you to force the value to be entered the same by everyone.  If the user CAN type the value in, then at least set the Case Restriction property to UPPER or LOWER so regardless of how the user enteres the value, it will be stored in the corrected case.
    Craig...

  • Non-Script Way of Setting Visible Property

    Why hello there!
    I am looking to set the "visible" property of a movie clip in
    the Flash CS3 designer, as opposed to using AS3.
    In my movie, I set a movieclip to invisible in code
    immediately. However, I sometimes see the artefact of the image for
    a split-second on running the swf in my browser. I would therefore
    like to set the property in the designer.
    I am guessing that there is not a way of doing it. Are there
    any suggestions?
    I'm now considering setting the alpha value to 0 in designer,
    and then setting the alpha value to 1 in code when I need to be
    able to see the mc.
    Raffi.

    Hey kglad,
    I appreciate the prompt response. Sorry I wasn't clear enough
    in my initial message.
    I am simply looking to be able to set, say, a rectangle
    primitive to invisible without having to set in the code. At the
    moment, I am setting the visible property to false in the first
    frame in the code. However, as a result, I sometimes (not
    frequently) see artefacting when I run my movie. The rectangle very
    momentarily appears before disappearing.
    Raffi.

  • Af:column visible property

    Hi,
    I am using JDeveloper 11.1.1.4 and ADF-BC in my application.
    I want to pragmatically control the visible property of the af:column inside the table.
    I have the following code for af:column.
    <af:column sortable="false" headerText="Impact Cat New" id="c7" visible="#{row.bindings.Selected.inputValue}">
    </af:column>
    Initially, the value of 'Selected' will be false when the table is first displayed and hence it should NOT be displayed.
    In the table selection listener,I set the property 'Selected' to true for the selected row and refresh the table[AdfFacesContext.getCurrentInstance().addPartialTarget(tblEmp)].
    But Even after refresh the table is never showing the column for which visible is set as true.
    The table is inside a panelCollection.
    Please advice.
    Regards,
    Praveen

    This won't work, as the column is the container for all rows and the row attribute is only available when the table rows arr stamped. I don't understand your use case. You want to show a column if one row gets selected? Sounds odd to me.
    If you really want to do this, you have to set an attribute outside the table and use the selection listener to switch this attrbute. Then use the new attribute in the columns visible property.
    Timo

  • XY Graph-Setting Y-Scale visible to False still Shows Corresponding Y scale Max and Min

    Hi Guys,
    I use XY graph to display the data with 3 Y-scales.
    When I set any Y scale Visiblity property to False,its still display the Y scale Max and Min range Lines in plot area of the  Graph and making cross line or extra parralel line with other visible scales.
    Attached the screen shot  for ref.
    And I know the cross line may be due to different Y scales range setting.But XY graph should not display the invisible Y scales and its property  as well.
    please provide your suggestions to avoid that.
    Solved!
    Go to Solution.

    The scales and the lines associated with those scales are separate properties. I have never tried it, and right now I am not at a computer, but there should be properties for setting the grid line colors. Set them to transparent.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • Tracking the visible property of a movie clip

    Hello,
    I am trying to track the visible property of a movie clip as
    I need to perform a function when visible = true and another when
    visible =false
    I have tried to use a listener object but I can’t get
    it to work. Can you attach a listener object to listen for the
    visible property?
    I have also tried an IF statement inside the move clip but
    this only knows the state of the ._visible when it first runs.
    I have got it to work with an onEnterFrame function on a
    movie clip inside the one I want to know the property of but I
    don’t like using the onEnterFrame as it uses a lot or
    processor speed
    Is there an easy way to track the visible property of a
    movieclip???
    Thanks
    Sam.

    > thanks for the help but the watch() method doesn't work
    for getter/setter
    > properties. is ._visible a getter/setter property?
    I was afraid of that. Yes, _visible is a getter/setter, most
    properties are. Basically watch() only works on read-only
    properties and custom variables, which is a shame.
    So I don't know of any more elegant way than constantly
    checking to see if the value changed. Centralize it and maybe
    package it in a nice class and you might feel a little better about
    it...

  • Visible Property of lable in Webdynpro

    Hi all,
    I have a lable and a inputfield which are hide. I want that when a select something in my dropdownbykey, this two objects get visible.
    How can i do that?
    Regards,
    Nirali

    Hi,
    Please look this code
    1.Create one Droupdownkey UI element in your firstView (Droupdown by key is bind to the one value attribute i.e MonthName)along this u can take 2 lable. For 2 lables you can set Visibility (com.sap.ide.webdynpro.uielementdefinitions.Visibility) property.
    2. in wdinit() method you can write this code
    ISimpleTypeModifiable myType=wdThis.wdGetAPI().getContext().getModifiableTypeOf("MonthName"); 
    IModifiableSimpleValueSet values =myType.getSVServices().getModifiableSimpleValueSet();
    values.put("Vijay","Vijay");
    values.put("Kalluri","Kalluri"); 
    wdContext.currentContextElement().setMonthName("Vijay");
    wdContext.currentContextElement().setKalluri(WDVisibility.NONE); 
    wdContext.currentContextElement().setVijay(WDVisibility.NONE);
    3.in Droupdownby key having OnSelect event in that place you can create on method. Under method you can write this code.
    String firstName = wdContext.currentContextElement().getMonthName();
    wdComponentAPI.getMessageManager().reportSuccess("First Name:"+firstName);
    String lastName = wdContext.currentContextElement().getMonthName();
    wdComponentAPI.getMessageManager().reportSuccess("Last Name:"+lastName);
    if(firstName.equalsIgnoreCase("Vijay"))
    wdContext.currentContextElement().setKalluri(WDVisibility.VISIBLE); 
    wdContext.currentContextElement().setVijay(WDVisibility.NONE);
    else
    wdContext.currentContextElement().setVijay(WDVisibility.VISIBLE);
    wdContext.currentContextElement().setKalluri(WDVisibility.NONE);
    Hope this helps u.
    Best Regards
    Vijay K
    Edited by: VijaySAPEP on Jan 4, 2012 4:47 PM
    Edited by: VijaySAPEP on Jan 4, 2012 7:32 PM

  • Visible property

    If I have 20 items in a listbox, each item corresponds to a control cluster. The cluster appears according to the item in the list that the user push while the other ones disappear. This is all in a While loop until the user hit OKAY. Is there a quicker way to set the visible property because the way that I have in mind right now is a case structure that make one visible and the other 19 invisible. This is very tedious because that means that I have to do the same for all 20 cases. Thanks.

    I suspect that vk1 & Veeru are the same person
    Have you started implementing code and need a solution for it?  If so, please post the code so that we can prepare an adequate example.
    R

Maybe you are looking for

  • Can i install snow leopard on Macbook without using Time Machine?

    Hi, I've backed up my files using SuperDuper and made 2 copies of my data on 2 usb sticks. Do I also need to use Time Machine to back up my files aswell, in order to update osx and install snow leopard?? If I've already got my 2 copies of my files on

  • Report - Return days since LAST activity

    Hi, I need a report that returns "All open SRs with the amount of days since the LAST completed activity of type X" (so we can see when the activity needs to happen again) I have managed to create a report that brings back "all open SRs with the amou

  • Utilities Consumption Reports

    Dear Experts, Is there any provision to gather reports for UTILITIES consumption (either daily wise or monthly) like water consumption , Air consumption, Energy consumption etc. How to map the above requirement in SAP ?? Any standard report is possib

  • Link to other sites

    Endomondo asks for friend requests from facebook when I sign into facebook it has 2 tick boxes skip amd allow I select allow but nothing happens eventually it throws me out stating cannot connect even when I have full internet connection and phone co

  • Artworks does not appear in List and Grid view, but in Cover Flow

    Since a few days the Artwork does neither appear in the List and the Grid View nor in the Genius Mix. When I change to Cover Flow, I can see all Artwork. I see all Artwork also in the information tabs. I already upgraded to the last iTunes version 9.