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

Similar Messages

  • 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

  • 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

  • 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 provide Link to Column in  the Table

    Hi
    please let me know how to provide link to one column in the table.
    i have two views
    in one view i will dispaly emp id and emp dept in a table
    i have to provide link to the emp id column table
    when i click emp id column then it will fire other view and display remaining details of emp.
    so please let me know how to provide link to column in the table.
    Solution is urgent
    regards
    mmukesh

    Hi Mukesh,
       You can insert LinkToAction column in table.you can have two cattributes in Valuenode one is of type boolean and other is of type string(empno)
    you can create eventhander in that you can fire plug to seconf view where you can displays the emp details
    With Regards
    Naidu

  • Display UTC-Timestamp in timezone of user/server

    Hello,
    the view of my WD Component displays UTC-Timestamps in a table (Cell Editor LinkToAction).
    The user has the possibility to alter the timestamps by providing date and time.
    The controller converts date and time to a UTC-timestamp by using ABAP-Statement CONVERT with timezone of server (sy-zonlo).
    The timezone is CET (UTC1). Therefore the fields to enter the time is displayed in UTC1 but the  timestamp is displayed as UTC. The user might be confused, because when entering a time in the inputfield, the timestamp will be displayed 1 hour in the past.
    The domain of the timestamp is TZNTSTMPS. I also tried to convert the timestamp into a field with domain TZNTSTMPSL, but with the same effect.
    Is there a possibility to display the timestamp in the timezone of the server (sy-zonlo) or in the timezone of the user?
    Thanks in advance
    Patrick

    Thank you Phil,
    I already use both commands.
    The user can enter a date and time which is already displayed in his timezone (use of command CONVERT TIMESTAMP ... and later when user saves his settings use of command CONVERT DATE lv_date TIME lv_time ...).
    The date and time that user has given should be displayed as a timestamp later(LinkToAction in a table column).
    Hope I made the problem clear. The date and time that the user can enter is already displayed in his timezone. It's just about the timestamp which is displayed after user has given date and time. That timestamp should be also displayed in the timezone of the user and not in UTC.
    Thanks for your help so far.
    Patrick

  • Selection tablerow cursor

    Hi,
    When selecting another row, there is a delay on the selection.
    The program is putting the cursor in the selected row, before you can enter a value
    Any idea to solve it that the user can just enter a value without waiting for the cursor.

    hi Tim,
    as already specified please do parameter mapping for the table , then you will get the current element , like in
    wdModifyview method of the view in which this table is present add this code ....
    IWDLinkToAction indTransLevelLink = (IWDLinkToAction) view.getElement("LinkToAction");             
       indTransLevelLink.mappingOfOnAction().addSourceMapping("nodeElement","selectedElement");
    here LinkToAction is the id of the linktoaction in the table if present , and then you have an action
    onActionBBB(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent, com.sap.tc.webdynpro.progmodel.api.IWDNodeElement selectedElement
    IPrivate*******View.ITableNodeElement element = (IPrivate*******View.ITableNodeElement)selectedElement;
    element.getafb (); -- //this will give you the current elements afb details , this afb is reference to above //table shown by you
    here wdEvent is by default available and you have to create parameter selectedElement for this action  ,
    so any action you have where you are refering the current element just use the above code .
    for better understanding read links below
    http://help.sap.com/saphelp_dm40/helpdata/en/60/1f1f056f057d4d962375efd3c92ed0/content.htm
    Please close the thread if your problem is solved.
    Regards
    Govardan

  • 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!

  • 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

  • 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 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

  • 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

  • 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

Maybe you are looking for

  • Material Master Replication from R/3 to CRM 7.0

    Hi , I am trying to replicate the Material maintained in R/3 to SAP CRM 7.0. Here is, what i have done up till now... I have downloaded Object DNL_CUST_BASIS Object DNL_CUST_PROD0 Object DNL_CUST_PROD1 using tcode : r3as & all have been downloaded su

  • An error has occurred. Message on launch of FB4.5

    I own a license for FB 4 Standard and I own CS5 Production Premium. I did an upgrade to Web Premium 5.5 to get FB 4.5 Premium. I'm on a Mac Intel i7 with 10.6.7. I'm able to install all the software, but when I launch FB 4.5 I get "An error has occur

  • Why can't I download anything or update

    Why can't I download anything or update

  • HP PSC 1350 and mac mini

    Hi, I installed the latest drivers from HP for my PSC 1350 all in one printer and scanner. Ok what im facing is that i am unableto use the scanner to scan anything. As matter of fact when i click on the print & fax in the system preference then click

  • Captivate 6, audio on slides randomly doesn't play

    Hi, I am working in Captivate 6 adding closed captioning to files originally created in Captivate 5.5 by someone else. The audio will randomly not work on a slide or 2 in preview mode and when published (though it worked perfectly before from 5.5, bu