Row data manipulation in WD SALV_WD_TABLE

Dear Gurus,
I have a requirement in which i am using the standard WD component SALV_WD_TABLE in my custom WD component. Here i need to disable the checkbox in the first column based on a certain vallue in another column. Ex: I have the ALV displaying check box as first column followed by Purchase Order details like PO number, status, cost center etc. If the status has the value "Ordered" the checkbox should be displayed.
I tried to set the check box with method set_read_only(abap_true). But this disables check boxes on all rows. How do i do this conditionally. I found threads to do something for all rows in a column like setting a particular colour.
Regards,
Manidipa

Hi
Take one attribute READONLY type String
Take antoher internal table and move the contents of internal table to another to do manipulation and last bind the copied internal table.
method WDDOINIT .
  data : lo_nd_spfli_node TYPE REF TO if_wd_context_node,
         lo_el_spfli_noed TYPE REF TO if_wd_context_element,
         lt_sflight TYPE if_main=>elements_spfli_node,
         lt_final TYPE if_main=>elements_spfli_node,
         ls_final TYPE if_main=>element_spfli_node,
         ls_flight TYPE if_main=>element_spfli_node.
      lo_nd_spfli_node = wd_context->get_child_node( 'SPFLI_NODE' ).
SELECT * FROM
  SFLIGHT INTO CORRESPONDING FIELDS OF
  TABLE LT_SFLIGHT UP TO 60 ROWS.
  LOOP at lt_sflight into ls_flight.
    MOVE ls_flight to ls_final.
    if ls_final-carrid EQ 'AA'.
        ls_final-readonly = abap_FALSE.
    ELSE.
       ls_final-readonly = ' '.
    ENDIF.
    APPEND ls_final to lt_final.
  lo_nd_spfli_node->bind_table( lt_final ).
  ENDLOOP.
  DATA: l_ref_cmp_usage TYPE REF TO if_wd_component_usage.
  l_ref_cmp_usage = wd_this->wd_cpuse_alv( ).
  IF l_ref_cmp_usage->has_active_component( ) IS INITIAL.
    l_ref_cmp_usage->create_component( ).
  ENDIF.
DATA lo_interfacecontroller TYPE REF TO iwci_salv_wd_table .
lo_interfacecontroller =   wd_this->wd_cpifc_alv( ).
  DATA lv_value TYPE REF TO cl_salv_wd_config_table.
  lv_value = lo_interfacecontroller->get_model(
CALL METHOD lv_value->if_salv_wd_table_settings~set_read_only
  EXPORTING
    value  = ABAP_FALSE
DATA:
lr_input_field TYPE REF TO cl_salv_wd_uie_input_field,
lr_column TYPE REF TO cl_salv_wd_column,
lr_cb TYPE REF TO CL_SALV_WD_UIE_CHECKBOX,
lr_column1 TYPE REF TO cl_salv_wd_column.
lr_column1 = lv_value->if_salv_wd_column_settings~get_column( 'READONLY' ).
CREATE OBJECT lr_cb
EXPORTING
CHECKED_FIELDNAME = 'READONLY'.
lr_column = lv_value->if_salv_wd_column_settings~get_column( 'CARRID' ).
CREATE OBJECT lr_input_field EXPORTING value_fieldname = 'CARRID'.
lr_column1->set_cell_editor( lr_cb ).
lr_column->set_cell_editor( lr_input_field ).
lr_cb->set_read_only_fieldname( value = 'READONLY' ).
check with above code it works for your requirement
Thanks,
Tulasi Palnati

Similar Messages

  • In SAPUI5, Passing Table Row Data  Selected in one xml view to another xml view and display in the second View

    Dear Friends,
    Please provide the solution for the following scenario:
    In the first view(xml)  I have a table with the fields QuotationNo,plant name, material no...etc, where I am displaying the data fetched using Odata model. The table is enable with Single line selection mode. My requirement is to Carry the selected row data to another view(xml) and display there.
    Please give your valuable inputs.

    Hi Rinku,
    depending on how you do the navigation, you might find the information here: OpenUI5 SDK - Demo Kit helpful.
    Regards Frank

  • How to Plot number and string in one row (data logger counter) ?

    hi all i made data log quantity using Digital Counter via modbus to monitoring quantity and reject that has and Name Operator, Machine and Part Number.
    i have problem about plot the number & string in one row, as shown on the picture below :
    how to move that string on one row ? i attach my vi.
    Thanks~
    Attachments:
    MODBUS LIB Counter.vi ‏39 KB

    Duplicate and answered - http://forums.ni.com/t5/LabVIEW/How-to-Plot-number-and-string-in-one-row-data-logger-counter-via/m-p...

  • TO Display the row data as column in ALV

    Hi experts ,
    Need to display the row data in ALV as column.
    The column of an ALV has the fieldnames of a table , this needs to be displayed as row data , that is as single row.
    How can this can be achieved?

    Hi,
    Actually it is not possible to disaply in multiple lines.
    https://www.sdn.sap.com/sdn/collaboration.sdn?contenttype=url&content=https%3A//forums.sdn.sap.com/thread.jspa%3FforumID%3D50%26threadID%3D49517%26messageID%3D506378%23506378
    https://www.sdn.sap.com/sdn/collaboration.sdn?contenttype=url&content=https%3A//forums.sdn.sap.com/thread.jspa%3FforumID%3D50%26threadID%3D41133%26messageID%3D403371%23403371
    This problem was discussed many times in this forum, u can search for more results.

  • Need Date manipulation in BI Publisher report template

    Hi All,
    I need date manipulation in BI Publisher report template for e.g sysdate+4 this means i need 4 days after todays sysdate.
    That menas if today date(sysdate) is 09/01/2008 then i need (sysdate+4) i.e 13/01/2008.
    Please help me.
    Thanks
    Edited by: user562690 on Jan 9, 2009 3:21 PM

    Hi M14,
    I have doubt on similar type.I have AgreementStartDate as
    <AgreementStartDate>12/03/2008 07:24:10</AgreementStartDate> in XML format.
    I am not able to apply same formula for thsi date format in similar manipulation.
    Please help me.
    TIA
    skr

  • How to get current row data in table control

    Hi , expert ,
       I am professional in oracle ,  but  now I am a new guy in SAP ABAP .
    I  have a question in UI
    How to get current row data and click pushbutton  in table control  to open next screen ?
    I want to get the current data and open next screen to carry out detail detail .
    Thansk for all your suggestion .

    GET CURSOR LINE SY-CUROW .
      READ TABLE internal_table index SY-CUROW.

  • GeoMap Point Theme: how to get row data in a click listener?

    How can I get data (short of latitude, longitude, label and value) for a clicked FOI point from an iterator in a point theme click listener?
    In a bar/pie theme I can set location column to be the primary key column, and then in a listener do something like
    public void myClickListener(MapClickActionEvent mapClickActionEvent) {
        DataContent data = mapClickActionEvent.getDataContent();
        GeoRowObject row = data.getGeoRowObject();
        GeoObject key = row.getKey();
        Integer ID = Integer.valueOf(key.getLocation());
        // Use our ID to get data from an iterator
    But there's no such thing as a location column in the mapPointTheme.

    sorry ..I am using Jde11g
    and the reason i am using trinidad is ,I want checkbox option to select ,unselect multiple row .
    Even i also tried by adding one column with checkbox in ADF table but no success regarding same i also post question on thread but no any positive reply
    Problem with af:selectBooleanCheckbox added in ADf table's Column
    Edited by: JaydeepJ on Aug 12, 2009 3:06 AM

  • How to get selected row data of an ADF table in HashMap?

    Hi,
    Can anyone please tell me how to selected row data of an ADF table in HashMap like :
    Object obj = pageTable.getSelectedRowData();
    JUCtrlHierNodeBinding rowData = (JUCtrlHierNodeBinding)obj;
    Now in above code I want the convert rowData in HashMap.
    Can anyone please tell me how to do that? Its urgent.
    Thanks,
    Vik

    Vik,
    No need to ask the same question 3 times...
    In [url http://forums.oracle.com/forums/message.jspa?messageID=4590586]this post, Nick showed you how to get the Row.
    If it were so urgent, you could have done a little reading of the javadocs to come up with code like this (not tested, up to you to do that)
    HashMap m = new HashMap();
    Row r = get it like Nick showed you to;
    Object values[]=r.getAttributeValues();
    String names[]=r.getAttributeNames();
    for (int i=0; i<r.getAttributeCount(); i++)
    m.put(names, values[i]);

  • How to retrieve row data from a  table

    Hey,
    Have a table with data and each row has one column which is a button. How do I retrieve the corresponding data of the row in which the button was clicked. Meaning what do I need to do differently in the table and what type of javascript on an onclick event etc would I need to get the data. If there is a better or simpler approach im open to any suggestions.
    Thanks in advance for your assistance
    e.g.
    <table>
    <tr>
    <td>column1 data</td><td>column 2 data</td><<input type="button" value="select" onclick="?????"/>
    </tr>
    </table>

    In the onclick event submit the jsp with query string.
    <onclick="process.do?rowId=<%=column1 data%>">
    have column 1 data as a unique identifier. Using request.getParameter get the column1 data value and query the db again to fetch the whole row data. I guess, it will work.

  • How to display different icon within WDA alv table base on row data ?

    Hi,
    is that possible to display different icon for every row within ALV table depending on the row data ?
    for instance if the status 'S' display ~Icon/SuccessMessage and 'E' display ~Icon/ErrorMessage ?
    because base on this code below i only can set 1 icon for the whole row data.
    LOOP AT lt_columns ASSIGNING <fs_column>.
        CASE <fs_column>-id.
          WHEN 'ICO'.
            CREATE OBJECT lr_caption.
               lr_caption->set_image_source( value = '~Icon/SuccessMessage').
               <fs_column>-r_column->set_cell_editor( lr_caption ).
        ENDCASE.
      ENDLOOP.
    Thank you in advance.
    Fernand

    Hello,
    Yes it is possible to display different images based on data.
    For that what you can do is create one attribute 'STATUS' of type string in context node which you are mapping to ALV.
    And fill that attribute with the path to image based on your requirement like for status 'S' set the attribute to ~Icon/SuccessMessage and if status is 'E', set it to ~Icon/ErrorMessage at runtime.
    Now in the settings for ALV use the following code:
    * Display icon in column seatsocc
      DATA: lr_column TYPE REF TO cl_salv_wd_column,
            lr_image TYPE REF TO cl_salv_wd_uie_image,
            lv_icon TYPE string.
      lr_column = lv_model->if_salv_wd_column_settings~get_column( 'SEATSOCC' ).
      CREATE OBJECT lr_image.
      lr_image->SET_SOURCE_FIELDNAME( 'STATUS' ).
      lr_column->set_cell_editor( lr_image ).
    in the above code, column 'SEATSOCC' will be displayed as an icon.
    Sample code to fill the attribute 'STATUS'
    LOOP AT lt_flights INTO ls_flight.
        lv_seatsfree = ls_flight-seatsmax - ls_flight-seatsocc.
        IF lv_seatsfree = 0.
          ls_flight-status = 'ICON_RED_LIGHT'.
        ELSEIF lv_seatsfree <= 50.
          ls_flight-status = 'ICON_YELLOW_LIGHT'.
        ELSE.
          ls_flight-status = 'ICON_GREEN_LIGHT'.
        ENDIF.
        MODIFY lt_flights FROM ls_flight.
      ENDLOOP.
    Hope this helps!
    Regards,
    Srilatha
    Edited by: Srilatha M on Jun 25, 2010 12:02 PM

  • How to pass the selected table row data from popup to source view

    Hi ,
    I have requirement of passing the data from popup view to source. , searching some data in  popup view and displaying in table,
    Like i am passing some input and click search button will display the data in table, when select any of the row in the table and click on the another button , i should be able to pass the select row to the source view and also should close the popup.
    When i implement , In the popup windiw, when i enter the customer no, and click on search button, it is closing the popup itslef. not able to see the data in popup.
    Can u tell me what is that soultion.
    Regards
    Vijay

    Hi Harsimran
    Thanks for the reply,
    1) Source view
    In  "Source View" i have input field called Customer_no. But,  the end user will not have any idea , what customer no to enter. so i am searching the customer no in the popup view.
    1) Customer_no( This is an inputfiled , to get the customer no from the popup view)
    2) Get Customer NO( This is a button to call the popup view)
    "Get Customer NO" This button action will open the popup view.
    In this popup, i have
    1) Input field (To enter the search term)
    2) Search (To seach the customer no based on the search term)
    3) Table ( To display the search data)
    4) Button in Table tool bar called "Select" .( To close the popup view after selected the required data in the table to pass it back to the source view).
    so in the popup view what happening is, when i click on the search button itself , it is closing the popupview  by transfering the first row of the tbale ,with out select the required row in the table.
    i need to close the window after click on the "Select" button in the toolbar , after selected the required row data to trasfer in the table.
    Can u pelase tell me what are the modifcations i need to do it.
    Regards
    Vijay

  • Best Practice for Package Implementation of Data Manipulation

    Hi,
    Would like to ask which is better implementation for data manipulation (insert, update, delete) stored procedure for a single table.
    To create a single procedure with input parameter for the action such as 1 for insert, 2 for update and so on
    or
    to create separate procedures for each like procedure pInsData for insert, pUpdData for update...

    Hi,
    Whenever you create a procedure it resides as a seperate object in database.
    In my opinion its better to create a single procedure which takes care of all DML concern to a table, rather than creating different procedures for each DML.
    If your number of DML are more and interrelated then its better to create a package and put all related DML procedures in the package concern to one transaction or table. This is because whenever you will call a package entire package will be placed in the memory for a particular session. So if you create different procedures for DML then you need to call the procedures each time you want it to be executed.
    Twinkle

  • ADF TreeTable One row data to create a master-detail parent-child relation

    I want to display an editable detail table on a page. The problem is the detail table has many fields so that the screen scrolls horizontally. I need my page to just fit on one page without scrolling.
    now my idea is to use a TreeTable. A lot of fields on the detail table will act as children of the main node so I can fit the table onto one screen without scrolling.
    So there is really no master detail relationship because Im referring to the same row data.
    Not the usual use case of using a Tree Table but just wondering if this is possible. I posted this hoping that anyone could shed a light on this.
    regards,
    Anton

    You can do that like in this example:
    http://apex.oracle.com/pls/apex/f?p=31517:278
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.apress.com/9781430235125
    http://apex.oracle.com/pls/apex/f?p=31517:1
    http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
    -------------------------------------------------------------------

  • How to obtain the row data in the component datatable?

    if I want to edit a row data, and then know which row is edited in the component datatable, and how to do?
    How to obtain the row data in the component datatable, and update it to database, not simplely edit a simple table
    Any ideas? Thanks

    Thank you very much for your help Alexander !
    It's quite confusing when you leave Struts and try to adapt your projects for JSF for the first time...
    I wanted to click on a row with a "onMouseClick" on the TR tag like I used to do in Struts/JSTL. But it seems to be impossible in a dataTable.
    Ok then. I've added a column at the end of the row with an icon.
    But eventually I didn't need to declare link parameters.
    In my BackingBean I did like this :
    public String selectEventForUpdate() throws IllegalAccessException, InvocationTargetException {
            PortletAgenda event = (PortletAgenda) JSFUtils.getInRequestMap("event");
            BeanUtils.copyProperties(this, event);
            return null;
       }JSFUtils.getInRequestMap(...) is a method I wrote in a util object :
    public static Object getInRequestMap(String name) {
            Object res = null;
            Map requestMap=FacesContext.getCurrentInstance().getExternalContext().getRequestMap();
            if (requestMap!=null) {
                res=requestMap.get(name);
            return res;
    }  " event " is the name of the item in my dataTable list.
    My backingBean has the same attributes as "event".
    So when the page is reloaded I have a backingBean full with the selected properties to edit/update.
    Thanks to your reply I realized that putting this form in the middle of the dataTable seems to be impossible.
    So I put this form in a floating DIV in front of the table with a shadow.
    It works :o) !
    But I'm a little bit disapointed to be honest...
    I used to build my web applications with Struts and JSTL and doing this kind of interface was really easy.
    I've decided 3 days ago to convert into JSF because the "GUI Layer" seemed to be improved.
    But now I realize that I cannot put a onMouseOver and onMouseClick on a row and I cannot display a different row in the middle of a table....
    I think it's a shame because there is a facet for header and footer.
    And it would be great if we could create our own personal facet that appears only if a condition is true.
    For exemple " if the current item id is the same as the request parameter id then display the following facet content ....... (with a panel group and a form inside to update the row) "
    It's easy to do that with JSTL thanks to c:forEach and c:if but it seems to be impossible to use JSTL tags like this during the dataTable iteration.
    And JSF tags seems to have no logical tags like " if " or loops that can be nested in dataTable.
    I really need to realize this interface (you click on a row then an edit form appears where you clicked).
    Do I have to write a component myself that extends dataTable?
    Do you know if writing such a component is hard to do for a beginner like me?
    (I've juste discovered JSF 3 days ago and I've used Struts/JSTL for 2 years til now)
    I'd be glad to have much advices from you about that.
    Regards

  • How to retrieve the multiple rows data on PDF form in a web service method using WSDL DataConnection

    How to retrieve the multiple rows data on PDF form in a web service method using WSDL DataConnection.
    I have a multiple rows on PDF form. All rows have 4 textfields. I want to submit the multiple rows data to a method defiened in webservice.
    Unable to retrieve the data in multiple rows within webservice method.

    Hi Paul,
    I'm now able to save the retrieved xml in a hidden text field and create dynamic table, and I'm able to fill this table from the XML, but the problem is that I could not find the correct way to loop on the xml, what I'm trying to say, the table will have number of rows with the data of the first row only, so can you tell me the right way to loop on the xml!
    this is my code
    TextField1.rawValue=xmlData.document.rawValue;
    xfa.datasets.data.loadXML(TextField1.rawValue, true, false);
    for(var i=0; i<count; i++)
    xfa.form.resolveNode("form1.P1.Table1.Row1["+i+"].Num").rawValue = xfa.datasets.data.record.num.value;
    xfa.form.resolveNode("form1.P1.Table1.Row1["+i+"].Name").rawValue = xfa.datasets.data.record.name.value;
    Table1.Row1.instanceManager.addInstance(true);
    Thanks
    Hussam

Maybe you are looking for

  • Changing the internal domain to a subdomain -- Help!

    Hello, so I have a huge project coming up and i was wondering if someone had some experience on this that could give me some advice. So,  started working on this company that has an internal domain called.. lets say abc.com  and external alphabetagha

  • IPad Air to projector cord choice-sound airport Express?

    Ok so I'm looking to use my ipad to play movies in the back yard for the kiddos. The projector I am going to order has VGA and HDMI ports. I am looking to project the movie to the screen/projector through one of these ports and then stream the sound

  • Prepping for Aperture 3. What do I do with iPhoto Library?

    OK, gang, I’m getting ready for Aperture 3 and could use some friendly advice so that I don’t run off the road and into the ditch as I wend my way down the Aperture highway. Here’s the background story. In 2007 I bought a 20” iMac and commenced short

  • Cross-Client (HR Related)

    Hi we are using the ECC 6 with teh following patch level ABAP / BASIS        11 PI_BASIS            11 SAP_HR              14 SAP_APPL            09 This is Quality system where users are testing the scenario, i have protected the client. I have comp

  • Waiting for App Store to download Mac OS X Server Add On.

    Hi there, I am trying to upgrade Mac OS X Server to Mac Lion Server. I get this message when i try to install the OS X Lion Waiting for App Store to download Mac OS X Server Add On. Please help.