Regarding Selection of a row in Tree By Nesting UI Element

Hi
I have a table containing 2 columns mapped to a context node. Also a TreeByNestingUIElement is also there.
I wished to implement OnLeadSelect() for the table. I mean when i select a row, the value of the first column of that row gets populated in another context attribute "selectedValue"
It would be great if anyone tell me how to implement the code
Regards
Sreekar

Sreekar,
If you are using NW04 SP13+ version or NW04s, then add "nodeElement" parameter mapping for onLeadSelect action handler as described here:
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/c092333b-0601-0010-e7af-8c227fb6d052
/people/bertram.ganz/blog/2005/09/13/new-web-dynpro-sample-available--enhancing-table-performance
Otherwise follow guidelines described in my blog:
/people/valery.silaev/blog/2005/06/20/master-of-columns-part-ii
Valery Silaev
EPAM Systems
http://www.NetWeaverTeam.com

Similar Messages

  • Regarding selection of row?

    Hi All,
    I have a table in my view.
    i want to select the entire row when i click anywhere on the table.
    i am using 
    event_element = wdevent->get_context_element( 'CONTEXT_ELEMENT' ) to get the particular row.but i am getting ' Access via 'NULL' object reference not possible'.
    Could anyone pls give me the exact code ..how to proceed for this? where shall i write the code in select event handler or onleadselection event handler method?
    Regards,
    Lakshmi.

    Hi,
    DATA:lv_outputelement       TYPE REF TO     if_wd_view_element,
           lr_table               TYPE REF TO     cl_wd_table,
           lt_el_userenty         TYPE            wdr_context_element_set,
           lt_el_user             TYPE            wdr_context_element_set.
      DATA lo_nd_userenty         TYPE REF TO     if_wd_context_node.
      DATA lo_el_userenty         TYPE REF TO     if_wd_context_element.
      DATA ls_userenty            TYPE            wd_this->element_userenty.
      DATA lo_el_user             TYPE REF TO     if_wd_context_element.
      clear lt_el_user[].
      CASE iv_ui_element_name.
        WHEN 'TABLE'.
          navigate from <CONTEXT> to <USERENTY> via lead selection
          lo_nd_userenty = wd_context->get_child_node( name = wd_this->wdctx_userenty ).
          CALL METHOD lo_nd_userenty->get_elements
            RECEIVING
              set = lt_el_userenty.
          lt_el_user = lt_el_userenty.
      endcase.
      LOOP AT lt_el_user INTO lo_el_user.
        CALL METHOD lo_el_user->set_selected
          EXPORTING
            flag = abap_true.
      ENDLOOP.

  • Regarding select single and select upto 1 rows

    hi experts,
                 plz let me know about difference between select single and select upto 1 rows with small eg...
    thnx in advance.

    Hi Ravi,
    According to SAP Performance course the SELECT UP TO 1 ROWS is faster than SELECT SINGLE because you are not using all the primary key fields.
    select single is a construct designed to read database records with primary key. In the absence of the primary key, it might end up doing a sequential search, whereas the select up to 1 rows may assume that there is no primary key supplied and will try to find most suitable index.
    The best way to find out is through sql trace or runtime analysis.
    Use "select up to 1 rows" only if you are sure that all the records returned will have the same value for the field(s) you are interested in. If not, you will be reading only the first record which matches the criteria, but may be the second or the third record has the value you are looking for.
    The System test result showed that the variant Single * takes less time than Up to 1 rows as there is an additional level for COUNT STOP KEY for SELECT ENDSELECT UP TO 1 ROWS.
    The 'SELECT SINGLE' statement selects the first row in the database that it finds that fulfils the 'WHERE' clause If this results in multiple records then only the first one will be returned and therefore may not be unique.
    Mainly: to read data from
    The 'SELECT .... UP TO 1 ROWS' statement is subtly different. The database selects all of the relevant records that are defined by the WHERE clause, applies any aggregate, ordering or grouping functions to them and then returns the first record of the result set.
    Mainly: to check if entries exist.
    Select Single is the best one compared to UPto one rows.
    Select Single will get the first record from the table which satisfies the given condition.So it will interact once with the database.
    UTO 1 rows will get the list of the records for the given match and iwll show the first record from the list.So it will take time to get the record.
    SELECT SINGLE VBELN from VBAK
    where MATNR = '1M20'.
    ---Thjis will get the first matched record and will display the record
    SELECT VBELN from VBAK
    where MATNR = '1M20' upto 1 rows.
    ---Thjis will get the list of matched records and will display the first record
    The Major difference between Select Single and Select UPTO 1 rows is The Usage Of Buffer for each.
    Select Single will search for all the satisfied data and bring all that data into Buffer and later it will give to that data to the program.
    Select UPTO 1 Rows will end the search after getting the 1st satisfied record and gives that record to the program.
    Thus Select Single will take much processing time when compare with Select UPTO 1 rows.
    Also
    check these threads..
    Difference between Select Single and Selct upto 1 row
    Difference between Select Single and Select upto 1 row
    Thanks,
    Reward If Helpful.

  • How to define 'First Vsible row'  for Tree table in Web Dynpro

    Hi,
    I am using a table with a treebykeytablecolumn. The user can change the selected
    line from another view and then I change the selected line within the tree according to his choice. This works fine.
    Unfortunatelly, I did not succeed to change the displayed page in the tree, so the user has to scroll up or down to see the selected data, if it is not on the current page.
    I try to bind the 'FirstVisibleRow', using the index of the selected element, but this
    index does not fit. The page changes, but as the index is somehow 'wrong', it is not
    the expected page that is shown.
    Looping at the node, my selected element get index 30, but the selected line is the 8th one (regarding what is current ly open or not in the tree) and the 14th if we expand all nodes above.
    So, is there a way to specify which line to be the 1st visible one when there is a tree column?
    thanks a lot for your help.
    reagrds,
    barbara

    Follow these steps,
    1- Create an attribute with char1 in the view context e.g first_vis_row
    2- go to the table properties in view and bind the property first_visible_row to this attribute.
    3- NOw go to the wddoinit method of the view...
    4- read the internal table and find out the index of the row which you want to set as first row. As in ur case you want a specific date in first row. So read the internal table and findout the index.
    5- now write this code, say your attribute name is first row inside node flag1...(you can change it for yoru requirement)
    DATA lo_nd_flag1 TYPE REF TO if_wd_context_node.
      DATA lo_el_flag1 TYPE REF TO if_wd_context_element.
      DATA ls_flag1 TYPE wd_this->element_flag1.
      DATA lv_first_row LIKE ls_flag1-first_row.
    * navigate from <CONTEXT> to <FLAG1> via lead selection
      lo_nd_flag1 = wd_context->get_child_node( name = wd_this->wdctx_flag1 ).
    * get element via lead selection
      lo_el_flag1 = lo_nd_flag1->get_element(  ).
    * get single attribute
      lo_el_flag1->get_attribute(
        EXPORTING
          name =  `FIRST_ROW`
        IMPORTING
          value = lv_first_row ).
    here change the lv_first_row to the index which you got after raeading the internal table.
    suppose it's
    lv_first_row = 4.
      lo_el_flag1->set_attribute(
        EXPORTING
          name =  `FIRST_ROW`
          value = lv_first_row ).
    Hope it works.

  • Selecting only one row at a time

    Hi experts,
    i have following doubt regarding selecting rows from a db:
    Is there any way of selecting only one row AT A TIME from a dabase just to collect the data in rows instead of in a unique document containing all the rows?
    I would like you to ellaborate on this as i need to send only one row to the IE, and then other row, and so on... without throwing any error!
    I have seen that there are SELECT SINGLE and SELECT UP TO 1 ROW, but these two methods are only useful when retrieving only one row, and that does not match my requirements. I need to process all the rows but one by one..
    I know that we can use the receiver jdbc adapter as if it was a sender by means of its specific datatype, but how to do it row by row??
    Hope i had explained well..
    Thanks in advance and best regards,
    David

    Hi kiran,
    Yes, my table has 5 not null fields but i am selecting and updating fixes values so i think that I will definetely go for the next solution:
    SELECT * FROM t1 WHERE status='0' and ROWNUM<2;
    UPDATE t1 SET status='1' WHERE status='0' and ROWNUM<2;
    My only concern is if the update will take the same row that the select.... BTW, I think it will
    ..What do you guys think?
    I ve been trying to operate with your proposed queries but i received some errors. Your queries are very interesting but i think that with the above ones i meet my requirements as the status field will be 0 for not processed rows and 1 for precessed ones (and the update will look for the row that meets the same 'where' clause than the select, and then, and only then, it will set status='1').
    The only thing i have to care about is what i questioned before.
    Thanks a lot and best regards,
    David

  • Selecting an entire row with the help of Checkbox

    Hi and Evening to Everybody,
    I have a Scenario where i need to select an entire row using the check box. Let me first define the Situation. I created a Simple Sql-report where the first column is a Simple Checkbox and the second column is a display only name and followed by the rest 5 columns as a checkbox.
    my table structure is :
    **create table satt (SELECT_ALL VARCHAR2(10), Name VARCHAR2(50), Object1 VARCHAR2(10), Object2 VARCHAR2(10), Object3 VARCHAR2(10), Object4 VARCHAR2(10), Object5 VARCHAR2(10));**
    Now i had a requirement where i need to Check All or Uncheck All Checkbox by clicking SELECT_ALL column header and i made it using
    simple java-script :
    "<input type="Checkbox" onclick="$f_CheckFirstColumn(this)">"
    Now i need to Check all checkbox in a row by clicking any of the SELECT_ALL check boxes. (Say i have 5 checkboxes in SELECT_ALL column and if i click 3rd checkbox... i need the entire 3rd row checkbox to be checked on click of that 3rd check box).
    I hope i was clear with my question. i did my best. Please help me out with this... Im eagerly lookin for the solutions.
    Thanks & Regards,
    - The Beginner.
    Edited by: 854477 on Jul 13, 2011 4:57 AM
    Edited by: 854477 on Jul 13, 2011 5:01 AM

    Solomon Yakobson wrote:
    There is no row order in relational tables unless ORDER BY is used, so there is no way to decide if 3 Mathematics belongs to 100 or to 200.
    SY.That's not how I interpretted it. I thought he was saying that in the first row column B has the value:
    '1 Physics'||chr(10)||'2 Chemistry'||chr(10)||'3 Mathematics'
    in which case something like this would work
    select a,replace(b,chr(10),chr(10)||a||' ') from table;

  • How to restrict the default selection of first row in ALV  in Webdynpro

    Hi Experts,
    In webdynpro i used ALV to display the bulk amount of datas under a view container. While running it ll cme by default selection on first row. how to restrict that.....

    Hi Vimal,
    Whenever we create nodes then by default the Initialization lead selection property of  node is always checked. That why in the alv by default the first row is selected.
    To restrict this default selection just unchecked the Initialization lead selection property of your node.
    Regard
    Manoj Kumar

  • Select 2 records (rows) in the results.

    I am using Oracle R12- Forms.
    After searched for all orders for a specific Customer, on the Results, I need to select 2 different rows.
    Also tried ft object,but failed.
    If manual, I use Keep holding the Ctrl Key, and Click for the first row, and Click 2nd row.
    In OATS, I could not do this with the code below:
    int rone=2;
    int rtwo=5
    Robot robot = new Robot();
    robot.delay(5000);
    // press and hold CONTROL key
    robot.keyPress(KeyEvent.VK_CONTROL);      
    forms.textField("//forms:textField[(@name='MY_ORDER_NUM_"+rone+"')]").click();          
    forms.textField("//forms:textField[(@name='MY_ORDER_NUM_"+rtwo+"')]").click();
    robot.keyRelease(KeyEvent.VK_CONTROL);
    Any help is greatly appreciated.
    Thanks,

    What you need is a tree.
    See Tomahawk (www.myfaces.org)

  • Select Single * and Select upto one row

    Hi all,
    Can anybody tell me what is difference between Select single * and select upto one row?
    And which one is better?
    Thanks in advance.......

    According to SAP Performance course the SELECT UP TO 1 ROWS is faster than SELECT SINGLE because you are not using all the primary key fields.
    select single is a construct designed to read database records with primary key. In the absence of the primary key, it might end up doing a sequential search, whereas the select up to 1 rows may assume that there is no primary key supplied and will try to find most suitable index.
    The best way to find out is through sql trace or runtime analysis.
    Use "select up to 1 rows" only if you are sure that all the records returned will have the same value for the field(s) you are interested in. If not, you will be reading only the first record which matches the criteria, but may be the second or the third record has the value you are looking for.
    The System test result showed that the variant Single * takes less time than Up to 1 rows as there is an additional level for COUNT STOP KEY for SELECT ENDSELECT UP TO 1 ROWS.
    The 'SELECT SINGLE' statement selects the first row in the database that it finds that fulfils the 'WHERE' clause If this results in multiple records then only the first one will be returned and therefore may not be unique.
    Mainly: to read data from
    The 'SELECT .... UP TO 1 ROWS' statement is subtly different. The database selects all of the relevant records that are defined by the WHERE clause, applies any aggregate, ordering or grouping functions to them and then returns the first record of the result set.
    Mainly: to check if entries exist.
    Select Single is the best one compared to UPto one rows.
    Select Single will get the first record from the table which satisfies the given condition.So it will interact once with the database.
    UTO 1 rows will get the list of the records for the given match and iwll show the first record from the list.So it will take time to get the record.
    SELECT SINGLE VBELN from VBAK
    where MATNR = '1M20'.
    ---Thjis will get the first matched record and will display the record
    SELECT VBELN from VBAK
    where MATNR = '1M20' upto 1 rows.
    ---Thjis will get the list of matched records and will display the first record
    The Major difference between Select Single and Select UPTO 1 rows is The Usage Of Buffer for each.
    Select Single will search for all the satisfied data and bring all that data into Buffer and later it will give to that data to the program.
    Select UPTO 1 Rows will end the search after getting the 1st satisfied record and gives that record to the program.
    Thus Select Single will take much processing time when compare with Select UPTO 1 rows.
    Also
    check these threads..
    Difference between Select Single and Selct upto 1 row
    Difference between Select Single and Select upto 1 row
    Difference between select single and select upto one row
    Difference between 'select single *' and 'select upto 1 rows'
    difference between select single and select up to 1 rows
    regards,
    srinivas
    <b>*reward for useful answers*</b>

  • Select single and select upto 1 rows

    Hi
    What is the difference between select single and select upto 1 rows
    Performance wise which one is the best
    Regards,
    Maya

    Hi,
    Difference Between Select Single and Select UpTo One Rows
    According to SAP Performance course the SELECT UP TO 1 ROWS is faster than SELECT SINGLE because you are not using all the primary key fields.
    select single is a construct designed to read database records with primary key. In the absence of the primary key, it might end up doing a sequential search, whereas the select up to 1 rows may assume that there is no primary key supplied and will try to find most suitable index.
    The best way to find out is through sql trace or runtime analysis.
    Use "select up to 1 rows" only if you are sure that all the records returned will have the same value for the field(s) you are interested in. If not, you will be reading only the first record which matches the criteria, but may be the second or the third record has the value you are looking for.
    The System test result showed that the variant Single * takes less time than Up to 1 rows as there is an additional level for COUNT STOP KEY for SELECT ENDSELECT UP TO 1 ROWS.
    The 'SELECT SINGLE' statement selects the first row in the database that it finds that fulfils the 'WHERE' clause If this results in multiple records then only the first one will be returned and therefore may not be unique.
    Mainly: to read data from
    The 'SELECT .... UP TO 1 ROWS' statement is subtly different. The database selects all of the relevant records that are defined by the WHERE clause, applies any aggregate, ordering or grouping functions to them and then returns the first record of the result set.
    Mainly: to check if entries exist.
    reward points if useful
    regards,
    ANJI

  • Regarding selection of value

    hi,
    i have two table controls in my view.but i can able to select valu from both of them.which i should not do,that why i hav a button in the same view to clear the row which one i want,tell me how to know whether i hav selected both the rows of the table controls or not.and if the user is selecting both then i have to raise an error msg.
    regards,
    tania

    hi tania,
    just check in onselect event of one table abd check the other table is initial or not,
    DATA LO_ND_TABLE TYPE REF TO IF_WD_CONTEXT_NODE.
    DATA LO_EL_TABLE TYPE REF TO IF_WD_CONTEXT_ELEMENT.
    DATA LS_TABLE TYPE WD_THIS->ELEMENT_TABLE.
    navigate from <CONTEXT> to <TABLE> via lead selection
    LO_ND_TABLE = WD_CONTEXT->GET_CHILD_NODE( NAME = WD_THIS->WDCTX_TABLE ).
    @TODO handle not set lead selection
    IF LO_ND_TABLE IS INITIAL.
    ENDIF.
    get element via lead selection
    LO_EL_TABLE = LO_ND_TABLE->GET_ELEMENT( ).
    @TODO handle not set lead selection
    IF LO_EL_TABLE IS INITIAL.
    ELSE.
    *Raise the error message
    ENDIF.
    Yogesh N

  • How to select a particular row in grid?

    I am trying to generate a user defined CFL form which should work exactly as system CFL. Using Matrix takes minutes to load the query's output so I m using grid instead and passing the query as a parameter to datatable. is there any way to select a particular row in grid through SDK ? for matrix , it cud be written like 'matrix.selectrow(). doesn't seem to have such property for grid. Any help on this will be appreciated.
    Thank you..

    hi
    oGrid.SelectionMode = SAPbouiCOM.BoMatrixSelect.ms_Single;
                        oGrid.Rows.SelectedRows.Add(pVal.Row);
    i think that will help you
    Regards,
    Rajesh Saini

  • Disable Lead selection for table row cloumn

    HI Team,
    I have table with multiple rows and multiple columns.
    Based on the lead selection of the row we are displaying the some form.
    But in table row there are some columns like enter date, when the user is trying to enter the date, it displaying the form because of lead selection and it is not allowing the user to enter the date.
    So, I want disable the lead selection for some columns.
    How can I do this?
    Regards,
    BAla

    Hi
    I think that you can get  the UI Table in the wdDoModifyView method, and then the UI Column and play with his values, is something like this:
    IWDTable table =(IWDTable)view.getElement( ");
    And then play with the "column" methods.
    Josué Cruz

  • Select the created Row

    Hello,
    I have a big problem, I hope someone can help me.
    I create a new Row with the code
    Row r = myVo.createRow(); And set values with
    r.setAttribute("attr", attrValue);How can I select the current row in this view Object ??
    Thanks in advance

    Dear Rahul,
    Also if you are getting the PDF from the attachments from the services for object, then you can use the below class and FM
    cl_binary_relation=>read_links             "<----Get the attachemnts
    SO_OBJECT_READ                              "<----Get details about attachments
    SO_DOCUMENTS_MANAGER              "<----Display the attachment
    Hope this helps you.
    Regards,
    Sachinkumar Mehta

  • Diffrence b/w select single & select upto one row

    hi
       wat is the diffrence b/w select single & select upto one row?
    deepak

    Hi,
    Select single has to be used with a where condition that has all the key fields:
    It will always return a unique record(If a match is found).
    Select upto 1 rows would get your the first record if multiple matches are found.
    and select up to has to be end with endselect statements.
    According to SAP Performance course the SELECT UP TO 1 ROWS is faster than SELECT SINGLE because you are not using all the primary key fields.
    select single is a construct designed to read database records with primary key. In the absence of the primary key, it might end up doing a sequential search, whereas the select up to 1 rows may assume that there is no primary key supplied and will try to find most suitable index.
    The best way to find out is through sql trace or runtime analysis.
    Use "select up to 1 rows" only if you are sure that all the records returned will have the same value for the field(s) you are interested in. If not, you will be reading only the first record which matches the criteria, but may be the second or the third record has the value you are looking for.
    The System test result showed that the variant Single * takes less time than Up to 1 rows as there is an additional level for COUNT STOP KEY for SELECT ENDSELECT UP TO 1 ROWS.
    The 'SELECT SINGLE' statement selects the first row in the database that it finds that fulfils the 'WHERE' clause If this results in multiple records then only the first one will be returned and therefore may not be unique.
    Mainly: to read data from
    The 'SELECT .... UP TO 1 ROWS' statement is subtly different. The database selects all of the relevant records that are defined by the WHERE clause, applies any aggregate, ordering or grouping functions to them and then returns the first record of the result set.
    Mainly: to check if entries exist.
    When you say SELECT SINGLE, it means that you are expecting only one row to be present in the database for the condition you're going to specify in the WHERE clause. so that means, you will have to specify the primary key in your WHERE clause. Otherwise you get a warning.
    SELECT UP TO 1 ROWS is used in cases where you just want to make sure that there is at least one entry in the database table which satisfies your WHERE clause. Generally, it is meant to be used for existence-check.
    You may not want to really use the values returned by the SELECT statement in this case (thought this may not necessarily be so).And in each case the database optimizer may choose a different strategy to retrieve the data.
    Knowing when to use SELECT SINGLE or SELECT ... UP TO 1 ROWS
    A lot of people use the SELECT SINGLE statement to check for the existence of a value in a database. Other people prefer to use the 'UP TO 1 ROWS' variant of the SELECT statement.
    So what's the difference between using 'SELECT SINGLE' statement as against a 'SELECT .... UP TO 1 ROWS' statement ?
    If you're considering the statements
    SELECT SINGLE field INTO w_field FROM table.
    and
    SELECT field INTO w_field FROM table UP TO 1 ROWS. ENDSELECT.
    then looking at the result, not much apart from the extra ENDSELECT statement. Look at the run time and memory usage and they may be worlds apart.
    Why is this ?? The answer is simple.
    The 'SELECT SINGLE' statement selects the first row in the database that it finds that fulfils the 'WHERE' clause If this results in multiple records then only the first one will be returned and therefore may not be unique.
    The 'SELECT .... UP TO 1 ROWS' statement is subtly different. The database selects all of the relevant records that are defined by the WHERE clause, applies any aggregate, ordering or grouping functions to them and then returns the first record of the result set.
    According to SAP Performance course the SELECT UP TO 1 ROWS is faster than SELECT SINGLE because you are not using all the primary key fields.
    http://sap-img.com/abap/difference-between-select-single-and-select-upto-one-rows.htm
    Check these links -
    The specified item was not found.
    diff between select single and up to one row
    diff b/w SECELT SINGLE *   AND SELECT UPTO ONE ROW
    Regards,
    Priyanka.

Maybe you are looking for