LinkToAction in Table

Hi,
I am creating a Table similar to Who's Who in ESS. The first column of my table is Employee Code which is a LinkToAction. So when my user clicks on the Employee code, application should take the user to anther view which shows employee details. There is no selection for the table. How do I capture which employee code has been selected by the user in my first column.
There is a method associated to the LinkToAction. Here I can pass the Employee Code and fire the Plug. But the problem is how do I get the employee code selected by the user.
Sugestions are welcome.
Regards,
Murali

Hi Muralidaran.
You can get the element (employee) from the event which is passed to the
action handler method (linktoaction).
just call wdevent->get_context_element( 'CONTEXT_ELEMENT' ).
You also could add this as parameter to the parameter list of the action method.
context_element type ref to if_wd_context_element.
The system should pass the element in which the link was clicked via this parameter then.
Hope this helps.
Cheers,
Sascha

Similar Messages

  • ABAP Webdynpro Linktoaction in table

    Hi,
    In my webdynro view i have a table with some fields as linktoaction.
    In the context for table following attributes are set:
    Initialize Lead Selection = 'X'
    Singleton = 'X'
    How can I get the row where the linktoaction is clicked on in the corresponding methods.
    I added following code but in stru_sales_order i always get the data of index 1.
    DATA:
        node_z_dws_get_salesorder   TYPE REF TO if_wd_context_node.
    DATA:
        node_changing   TYPE REF TO if_wd_context_node.
    DATA:
        node_e_sales_orders   TYPE REF TO if_wd_context_node.
    DATA:
        stru_sales_order            TYPE   ig_componentcontroller=>element_e_sales_orders.
    node_z_dws_get_salesorder = wd_context->get_child_node( `Z_DWS_GET_SALESORDER` ).
      node_changing = node_z_dws_get_salesorder->get_child_node( `CHANGING` ).
      node_e_sales_orders = node_changing->get_child_node( `E_SALES_ORDERS` ).
      node_e_sales_orders->get_static_attributes(
                   IMPORTING static_attributes = stru_sales_order ).
    Kind regards,
    Vincent.

    OK  I have no idea what you said since I am new to this WDA, but I did get someone to help with this.
    I had to change the table configuration to selectionMode Single and create an event for onLeadSelect.
    in the onLeadSelect code I have the following:
      LR_NODE = WD_CONTEXT->GET_CHILD_NODE( 'PARKED_TRANSACTIONS' ).
      LR_ELEMENT = LR_NODE->GET_LEAD_SELECTION( ).
    Thanks for the help all!

  • How to use linktoaction in table

    Hi,
    How can I use linktoaction in a table for each row where I need to give a remove option with linktoaction each row by clicking the linktoaction  that row should delete from table.
    Thanks in advance
    Regards
    Raj

    Dear Raj,
    After creating your table UI, right click and select Create Binding.
    After Selecting your node and attributes in the pop- up, select the Cell Editor of the Table Column as LinkToAction.
    Then go to  this Table Cell and provide the action for the LinkToAction UI say OnActionRemove.
    Now,  double click on OnActionRemove and write the following code.
    * Local Data
      DATA: lfd_clicked_index TYPE i.
      DATA: lfd_xfeld         TYPE xfeld.
    * Get the clicked index
      lfd_clicked_index = context_element->get_index( ).
    * Read the row on which the LinkToAction to Remove clicked
      DATA lo_nd_your_node TYPE REF TO if_wd_context_node.
      DATA lo_el_your_node TYPE REF TO if_wd_context_element.
    * navigate from <CONTEXT> to <YOUR_NODE> via lead selection
      lo_nd_your_node = wd_context->get_child_node( name = wd_this->wdctx_your_node ).
    * alternative access  via index
      lo_el_your_node = lo_nd_your_node->get_element( index = lfd_clicked_index ).
    * Remove the row.
      lfd_xfeld = lo_nd_your_node->remove_element( element = lo_el_your_node ).
    CHECK lfd_xfeld = abap_true.
    * Give successful removal message
    * get message manager
      DATA lo_api_controller  TYPE REF TO if_wd_controller.
      DATA lo_message_manager TYPE REF TO if_wd_message_manager.
      lo_api_controller ?= wd_this->wd_get_api( ).
      CALL METHOD lo_api_controller->get_message_manager
        RECEIVING
          message_manager = lo_message_manager.
    * Report message
      CALL METHOD lo_message_manager->report_success
        EXPORTING
          message_text = 'row removed successfully.'.
    Please note that you have to provide
    CONTEXT_ELEMENT     Importing          IF_WD_CONTEXT_ELEMENT,  as action parameter.
    Hope it helps!.
    Warm regards,
    Upendra Agrawal

  • LinkToAction in Table Header ?

    hi experts!
    Please tell me how we can change Table Header (Caption) to LinkToAction ?
    thanks in advance
    nikhiL

    Hi,
    By default its not possible.
    May be you can try by removing all headers of the existing table and create a seperate table with Link to Action and place this above the existing one.
    Or
    Place a table tool bar and add link to action to it.
    Regards
    Ayyapparaj

  • LinkToAction in a Table Element

    Hello everybody,
    how can i determine the row in a table for which the respective LinkToAction Element fired the event onAction?
    Regards,
    Markus

    Markus,
    Lead selection occurs before onAction -- so you may refer wdContext.nodeYourTableNode().currentYourTableNodeElement() inside action handler.
    For more advanced options read https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/c092333b-0601-0010-e7af-8c227fb6d052
    Valery Silaev
    EPAM System
    http://www.NetWeaverTeam.com

  • LinkToAction in a Table

    Hi,
    I have a report shown in a view in form of a table. Suppose the report shows: Purchase order number, Currency and Total Amount. These information comes from a BAPI in SAP.
    Now when user clicks on the Purchase order number, a view with Purchase order header details should be shown.
    When user clicks on the total amount, a view with purchase order line item details should be shown.
    I am planning to use LinkToAction for both the columns.
    My Question is:
    1. If user clicks on a purchase order number on any row, how do I get the purchase order number?
    2. If user clicks on the total amount on any row, then how do I get the corresponding purchase order number?
    Thanks in advance.
    Regards,
    Suresh.

    Suresh,
    If you left Table "selectionMode" as auto, or anything else except none, then the following sequence of events occurs when user clicks Link2Action:
    1. First, row is selected
    2. Second, action event fired.
    So you may refer wdContext.node<YourTblNode>().current<YorblNode>Element() in action handler (and get necessary fields as element attributes)
    VS

  • WD ABAP Table, LinkToAction

    Hello,
    I have added a LinkToAction into a cell of a wd table column. To call the correct action in the event handler I need to know the selected row and column. How can I receive this necessary information?
    Thanks in advance and kind regards,
    Dagmar

    Hi,
    in the wdevent parameter  of your linktoaction u will a parameter name 'CONTEXT_ELEMENT' which is of type if_WD_CONTEXT_ELEMENT from which u can get the index of the element in the talbe .using this u will know on which row the action is performed . for column u can use the ID parameter means the ID of the ELEMENT i.e ur link which column link is clicked.
    set a debug point in ur action and analyse the event parameter of it. under that object see the paramters list . u will get ur required things.
    Regards
    Yashpal

  • Determining Selected LinkToAction element in a Table

    Hi!
    I'm working on a WD Project where I have a table with LinkToAction elements. My problem is that I need to get the data of the row where the LinkToAction element was pressed. The Table does not allow selection (via the squares), and has to rely on the LinkToAction onAction event.
    Does anyone know how to do this without relying on LeadSelection (since LeadSelection refers to the selected row, but this Table doesn't allow selection)?
    Would really appreciate an input or two on this. Thanks a lot!

    Hi,
    int n = wdContext.nodeProducts().size();
         int leadSelected = wdContext.nodeProducts().getLeadSelection();
         for (int i = 0; i < n; i++)
                    if (leadSelected == i) {
         IProductElement ele =
                                  wdContext.nodeProduct().getProductElementAt(i);
    Date datesec = ele.getMyDate();
    String ele222= ele.getName();
    ele contains all the values u want
    Check this code. Whether it will help u or not
    Regards,
    H.V.Swathi
    Edited by: H.V Swathi on Jan 28, 2009 5:48 AM

  • Table with Linktoaction cell editor VS ALV with Link to action cell editor

    Hi,
    i am replacing table UI with ALV, i am encountering series of problems one of them is below.
    when i click on linktoaction cell in table i can see wdevent has context_element which is element reference, which is being used in action handler to perform some logic...
    however when i replace with alv where i displayed one column with link to action cells using CL_SALV_WD_UIE_LINK_TO_ACTION class, however when i click on any particular cell i only get information related to that cell like column name, attribute name, value and position.
    however as i said i need context element reference to work with which is not coming with alv.
    please suggest.

    yes, that is right, you have to get the context element from the node based on the Index you get.

  • How to show icon in a column of a table?

    How to display an icon in a column of a table UI element and this icon is to be displayed based on values in the table row?

    I normally use a calculated attribute inside the table's data source node for this.
    Add an attribute "Icon", type=string, calculated=true, read-only=true, under the data source node.
    (If the data source node uses structure binding and does not allow to add an attribute, add a helper value node instead, cardinality=1:1, selection=1:1, and add the attribute to this node.)
    In the get-method for the calculated attribute, you get the node element corresponding to the table row as parameter. Depending on other attributes in this node element, select an icon URL and return it.
    If you put your icons inside the src/mimes/<component> folder, you can simply return the file name of the icon.
    Don't use a Button as table cell editor but rather an Image or LinkToAction.
    Armin

  • Problem with LinkToURL in a table column

    Hi,
    let's say we have a LinkToURL element with a text and an image. Then a click on the text OR a click on the image navigates to the given URL.
    This behaviour changes if you put the LinkToURL element in a table column. In that case the link is executed only if you click on the text, nothing happens if you click on the image (I assume this is a bug, of have I missed a detail?). If you have a LinkToURL element without a text and with an image only, this becomes a problem.
    One column of my table contains a single image, and a click on that image shall open a link. Is there another way to do this except using a LinkToURL element?
    Thanks,
    Karsten

    Hi Valery,
    yes, this hint is exactly what I needed. I just changed the LinkToURL to a LinkToAction, and this can be activated by clicking the text OR the image.
    The necessary coding in the action handler would then look like this:
    WDWindow wnd = wdComponentAPI.getWindowManager()
         .createExternalWindow("http://www.sap.com",
         "SAP Global", false);
    wnd.open();
    Thank you very much,
    Karsten

  • How to do lead select and double click on a row of table simultaniously ?

    Hello All,
    I am creating a freely programmed search help to search Material Number.
    i am displaying the values in normal table ( Not ALV ) on the search help popup.
    My requirement is
    when I select a row and click on OK button the Material number in that row is getting captured ( This is working fine for me)
    At the same time I also want to capture the value when user double cluck on the particular row.
    I am not able to do both on action methods simultaneously as I am getting syntactic error.
    i.e. When I create action method on the event "on_lead_select" and the event "On select"  and try to save Check & activate it throws error.
    Please find the screen shot below.
    Standard webdynpro component WDR_F4_ELEMENTARY was able to achieve this functionality some how, I have debugged it but didn't get the solution

    Hi,
    There is no double click provision. In the table you could change the cell editor of column to LinktoAction UI, then onclick of that you can set the selected value.  And in the component WDR_F4_ELEMENTARY its not a normal table UI but its a CTable UI, you can try creating a CTable and create an Action for onSelect.
    Regards,
    Kiran

  • Can we have more than 1 UI element in a single table column?

    Hi All,
    For example, I want to have IMAGE, ProgressIndicator and LinkToAction together as a template in a table column.
    I already tried without success. I could only add single UI elements. After that, tools won't let me do it.
    Any help or suggestion will be appreciated.
    Sub

    Hi
    You can have at one time only one UI element in the table.
    if you want to have more than one type of editors in the table then you can use table cell editors as suggested above.
    but i guess you are referring here to grouping more than one UI element in one editor or one column.
    i think that is not possible as such.
    How ever what you can do is, make use of the TABLECOLUMNGROUP.
    instead of adding column directly to the table use TABLECOLUMNGROUP and add columns to this.
    create three table column for three UI elements you are reffering here and put them in this one TABLECOLUMNGROUP.
    and add rest of the column straight to the table.
    thanks
    sarbjeet

  • Clickable UI element in a table tree as a child

    Hi experts,
    I haev created a tree in a table column. And in a treebykeytable coumn of a table, what type of cell editor can be included so that we can capture a event on a click of it.
    I.e once a child is clicked- I want to caoture the value of child clicked and navigate further.
    I dont want to use linktoaction UI element and moreover table need initialze lead selection and on using linktoaction, for clicking any child it capture only root value i.e lead selected by default.
    Thanks
    Depesh

    https://www.sdn.sap.com/irj/sdn/nw-70
    would help you
    regards
    nag

  • Error while working with POP-IN object for Table UI

    Hi Expert,
    I am creating a pop-in for one column of table UI. I have a LinkToAction object to open pop-in. i have some lable and input fields in pop-in. I dont know the flow to display the pop-in and where should i assign data to pop-in fields. how system will know which row i am clicking? Please help to know all details. I have a lots of questions.
    I am able to create link on the column and when i am clicking on link i am getting below error.
    "Node VIEW_VAL.1.POP_IN does not contain any elements" but i have attributes in node POP-_N.
    Please help me.
    Thanks and Regards,
    Anil
    Details from ST22----
    An exception occurred which is explained in detail below.
    The exception, which is assigned to class 'CX_WDR_ADAPTER_EXCEPTION', was not
    caught and
    therefore caused a runtime error.
    The reason for the exception is:
    Adapterfehler im  INPUT_FIELD "INPUT_FIELD01" des Views
    "Z_BP_GENERAL.VIEW_VAL": Context-Bindung des Properties VALUE kann nicht
    aufgelöst werden: Node VIEW_VAL.1.POP_IN does not contain any elements
    The occurrence of the exception is closely related to the occurrence of
    a previous exception "CX_WD_CONTEXT", which was raised in the program
    "CL_WDR_CONTEXT_NODE===========CP",
    specifically in line 9 of the (include) program
    "CL_WDR_CONTEXT_NODE===========CM00R".
    The cause of the exception was:
    Node VIEW_VAL.1.POP_IN does not contain any elements

    hi,
    Use this code in OnAction of LinktoAction UI element.
    This code will give you index of the row from which Link to Action is Triggered.
    <cn_popin> is my node binded to Table.
    data: lr_element type ref to if_wd_context_element.
    DATA ls_cn_popin TYPE wd_this->element_cn_popin.
    lr_element = wdevent->get_context_element( 'CONTEXT_ELEMENT' ).
    get all declared attributes
      lr_element->get_static_attributes(
        IMPORTING
          static_attributes = ls_cn_popin ).
    data lv type I.
    lv = lr_element->GET_INDEX( ).
    Finally you have the index in varialbe lv.

Maybe you are looking for

  • Why my iPhone 5S taking pictures upside down?

    I have iOS 8.1 installed in my iPhone. While taking the picture sometimes it displays the camera screen in upside down direction and pictures taken also in upside down direction but sometimes it works fine. Also I have encountered that while taking f

  • BAPI_PO_CREATE1 extension for scheduling

    Hi Ssn, I got a new requirment where i need to add one custom field in EKET table. When ever the Purchase Orde  is creating from SRM BAPI_PO_CREATE1 is geting caled fromECC. EKET is related to Scheduling related table. Can any one explain me how we c

  • I want to open a PDF file and i can't? any advice?

    I want to open a PDF file and i can't? any advice?

  • HP 630 laptop recovery

    Hello! I deleted the recovery partition for getting more hard disk space... now I want it back. Is there any way? Maybe there's recovery DVD, but I've seen only 620 recovery DVD. Can I get help in a hp service center? Please help

  • Po notes print

    Hi experts I hope to query how to print out some notes on PO output? Now we hope for one comany code and purchase org , it need print certain Text. What's the better way to config it ? User don't want to input such notes on po every time, but if we m