Lead Select Context Element in WD ALV

Hi,
Can anyone tell me how to retrieve the lead select row( Context element) for an ALV Table.
Best Regards
Sid

Hi Sid,
You can use ON_LEAD_SELECT method of ALV to do this.
Go to the Methods tab of the view in which you have embeded your ALV.
give method name lead_Select, method type as Event Handler, in event select from F4
ON_LEAD_SELECT.
Hope this solves your problem.
Regards,
Ismail.

Similar Messages

  • TreeByNestingTableColumn - how to set lead selection?

    Hallo Guys!
    I am using TreeByNestingTableColumn in my project. I am searching for a way to select a certain context element inside of the tree shown in such a table. I actually know that setLeadSelection doesn’t work properly in such a case.
    I’ve already read this very helpful blog /people/valery.silaev/blog/2005/06/20/master-of-columns-part-ii searching for a solution, but its seemed not to be there.
    Valery had shown how to read the selected context element recursively, but there is nothing about to how to set the needed lead selection for a certain one.
    In my scenario, I am loading the whole table (10-15 elements) with only two levels of hierarchy. After the user clicks on a button I have to reload this table but keep the selection of the previously selected element.
    The try using getTreeSelection didn’t succeed either.
    Any ideas?
    Many Thanks
    Dimitri
    Edited by: Dmytro Lubenskyy on Apr 1, 2008 3:44 PM

    Hi,
    You can use the following methods to set the selection.
    IWDNodeElement nodeElement = wdContext.nodeOrders().getElementAt(2);
           wdContext.nodeOrders().setTreeSelection(nodeElement);
    Regards
    Ayyapparaj

  • Obtain a reference to the element at lead selection

    I am trying to obtain a reference to the element at lead selection of a context node (Node name is Person) of component controller, i had a method initPerson() to initialize the values, so when i am writting
    IPersonElement personEl = wdContext.nodePerson().currentPersonElement();
    to obtain a reference , at IPersonElement  it is giving me an error
    IPersonElement can not be ressolved or is not a type !
    can anyone help me on this
    Thanks in advance.
    Rashmi.
    Edited by: Rashmi Gupta on Nov 6, 2008 11:40 AM
    Edited by: Rashmi Gupta on Nov 6, 2008 11:41 AM

    Hi
    Usse
    view/controllerName.IPersonElement
    Just like given example below
    IPublicAllInOne.IFlight_List_1Element ELE = wdContext.nodeFlight_List_1().createFlight_List_1Element(new Bapisfldat());
    PS: Orgine the import files. by pressing control+Spece button at time
    or
    controlSpeceO
    Thanks

  • Reset lead selection after refresh in alv grid

    Hi experts,
    I've a problem with holding the lead selection in an alv grid table view in web dynpro.
    After changing an attribute the lead selection in the view gets lost, but is hold in the referenced context node.
    Is there a way to change the lead selection in alv by code?
    I've found the method "set_index()" in class CL_SALV_WD_TABLE_LEAD_SELECT, can I use that?
    Thanks a lot,
    Kai

    Hi Kai,
    I faced a similar problem earlier.
    Request you to elaborate about the  "attribute" you are changing.
    I was also facing a similar issue.
    It will be gr8 if I can help you.
    Please see the below thread for some reference.
    [Not able to select a row in ALV|Not able to select a row in ALV?;
    I hope it helps.
    Regards,
    Sumit Oberoi

  • Lead Selection does not work after setting filter for ALV.

    Hi, Can you please suggest on below scenario :
    I have a Node with a sub node in it .
    I am using the supply function on Sub Node to retrieve the date based on Parent Node.
    There are two ALV's to display parent and item data. The issue is when a filter(user defined filter) is done on Parent table, the supply function does not work. The value is that of the selected row before setting the filter. Even after removing the filter, the item data is stuck and does not change on Lead Selection.
    One thing I noticed is if the child table is a table UI, there is no issue. The only problem is when the second table is ALV
    Thanks In Advance

    Hi Prashanthi,
    Your issue can be resolved as below
    Create an event handler method 'set_alv_data'  for the event 'ON_LEAD_SELECT' of parent alv
    Write the below code inside the event handler method
    METHOD set_alv_data.
      DATA lo_node TYPE REF TO if_wd_context_node.
      DATA lv_path TYPE string.
      DATA lv_index TYPE string.
      lv_index = r_param->index.
      CONDENSE lv_index.
      CONCATENATE wd_this->wdctx_my_parent_node
      lv_index
      wd_this->wdctx_my_child_node
      INTO lv_path SEPARATED BY '.'.
      lo_node = wd_context->path_get_node(
          path                          = lv_path
      DATA lo_interface TYPE REF TO iwci_salv_wd_table.
      lo_interface = wd_this->wd_cpifc_alv_child( ). "get the ref of alv comp of child
      lo_interface->set_data(
        EXPORTING
    *    only_if_new_descr =
          r_node_data       = lo_node
    ENDMETHOD.
    The above code sets the data node of child alv based on lead selection of parent alv data.
    Note: Replace 'parent_node', 'child_node'  with your nodes & 'alv_child' with your alv component name of child alv.
    If you want to control the data of child alv on filter function, you can use the event ON_STD_FUNCTION_AFTE and once you define the filter you get the r_param->id = 'SALV_WD_FILTER_DEFINE'  & now you can clear data of child alv.
    Hope this helps you.
    Regards,
    Rama

  • Select Option's Context Element for the REPORT_ATTRIBUTE_ERROR_MESSAGE

    Hi,
    We're on 7.0 ehp1.
    I found a thread on same subject u201Cwdr:select_options and highlight Error Message with a Link to Inputfield u201C, Jul-23-2008, in which Thomas Jung gave an explanation of how to get the context element of the Select Options on a view.
    I tried to follow it, but Iu2019m still not getting it.  Please show how to get the context element of a Select Option for the u201CREPORT_ATTRIBUTE_ERROR_MESSAGEu201D .
       wd_comp_controller->go_message_manager->report_attribute_error_message(
             exporting
              message_text   = ls_messaga_text
                  element        = ?????
               attribute_name = ls_option_id
    Thomas' explanation:
    I gave you the code that gets you to the interface controller. From there you call the GET_API to get the component controller. After you have the component controller it is normal context coding to read the context of the Select-Options context. Run the debugger and use the Web Dynpro view to see what your context looks like at runtime. When I test this with one of my applications, the names of the context nodes that were dynamically generated was really straight forward - as it uses the names of the select-option itself. Nothing special once you reach this point - just normal context coding...."
    Kind regards,
    Huntr

    Hi ,
    Use the below approach to achieve this,
    data:
        lr_context_node       type ref to if_wd_context_node,
        lr_element            type ref to if_wd_context_element,
        message_text          type string.
      get the node and leadSelection of that field
        lr_context_node = get_node_of_sel_field( <field>-m_id ).
        lr_element = lr_context_node->get_lead_selection( ).
    case <field>-m_type.
    For Select option field
                when if_wd_select_options=>mc_sscreen_item_type_field.
                  m_message_manager->report_attribute_error_message(
                    element        = lr_element
                    attribute_name = 'LOW'
                    message_text   = message_text ).
    "For Parameter field
                when if_wd_select_options=>mc_sscreen_item_type_parameter.
                  m_message_manager->report_attribute_error_message(
                    element        = lr_element
                    attribute_name = 'VALUE'
                    message_text   = message_text ).
                when others.
              endcase.

  • Error "Lead selection not set for context node"

    Hi everyone,
    I've got a Tree control in WebDynpro ABAP and I've implemented an "expand all" button.
    Here's the coding:
    METHOD expand_node_rec.
      DATA lo_el_child TYPE REF TO if_wd_context_element.
      DATA lo_node_children TYPE  wdr_context_child_map.
      DATA wa_lo_node_children LIKE LINE OF lo_node_children.
      DATA lo_nd_child TYPE REF TO if_wd_context_node.
      DATA lo_kschl TYPE klschl.
      DATA lv_has_children TYPE boolean.
      lo_el_child = node->get_element( ).
      lo_node_children = node->get_child_nodes( ).
      node->get_attribute( EXPORTING name = 'KSCHL' IMPORTING value = lo_kschl ).
      node->get_attribute( EXPORTING name = 'HAS_CHILDREN' IMPORTING value = lv_has_children ).
      IF lv_has_children = abap_true.
        node->set_attribute( name = 'IS_EXPANDED' value = abap_true ).
      ENDIF.
      LOOP AT lo_node_children INTO wa_lo_node_children.
        lo_nd_child = wa_lo_node_children-node.
        me->expand_node_rec( node = lo_nd_child  ).
      ENDLOOP.
    ENDMETHOD.
    However I'm getting the error above: "Lead selection not set for context node".
    Any suggestions?
    Edited by: DEVELOPMENT THEMIS on Jul 7, 2011 6:34 PM

    hi developement Themis,
    I think u didn't diclare "node" as context node. So declare it as a context node before using as a context node..as below
    DATA node  TYPE REF TO if_wd_context_node.
    or u can use  "lo_nd_child " as ur context node in ur program in place of "node"
    then I think this error will be removed.
    thanks,
    simadri

  • How to develop ALV and select-option element in BSP? Help!

    Hi Experts,
    I have a requirement where I have a selection screen with 3 select-option elements and a search button. On clicking the search button an ALV table report has to be shown.
    The ALV table is used for new row/rows entry, delete row/rows and update row/rows data. This is something like table control in normal ABAP.
    Additionaly, I want the download to Excel, sorting, filtering, column swapping options in ALV.
    How can I achieve this in BSP?
    Is there any existing SElect-option and ALV component in BSP?
    Any code sample will be really helpfull.
    How much development time will it take?
    Please help!
    Thanks
    Gopal

    I think you will find that most of what you are looking for does NOT exist out of the box for BSP.  There is no delivered selection-option or value help.  I ended up creating my own over the years (You can find some versions online here in SDN in my weblogs - however a complete implementation of select-options was only delivered along with the Advanced BSP Programming book). 
    There is no ALV either.  However with the htmlb:tableView, you can acomplish quite a bit.  You may have to learn about table view iterators to get it all done.  Downloading to Excel also isn't delivered.  I developed a reusable BSP Extension element for this as well (can be found on SDN in my weblogs or with the Advanced BSP Programming book).
    If you plan to recreate all these elements by yourself, your project will take some time.  It took a while to build so many complex UI elements. 
    What release are you running on?  In Netweaver04S you have Web Dynpro ABAP.  WDA has delivered components for value help, select-options, and ALV.

  • How to display lead selection ONLY in the ALV

    HI All,
       User would like display the selected records in ALV . 
       i suggested that add two button - "Display ALL" & "Display Selected" .
       How can i only display the lead selection only in the ALV? or Hide un-selected records.
       Please help.
    Thank you so much
    Gordon

    Hi,
    Pelase have a look.. same requirement.
    get_selected_elements method for ALV
    Re: select rows in alv and show them in another alv in another view
    Web dynpro ALV table copy selected row
    cheers,
    Kris.

  • Web Dynpro ALV Lead Selection following filter

    Hi,
    How/Where can I set the lead selection on my ALV grid following the filter?  Thanks
    Samir

    Hi,
    Go through this link
    [ALV,Filters|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/e8a1d690-0201-0010-b7ad-d9719a415907?quicklink=index&overridelayout=true]
    cheers,
    Bhavana

  • How to keep lead selections in alv table...

    Hi experts.
    I made a alv.
    A logic  in wdmodifyview is following..
    METHOD wddomodifyview .
      IF first_time EQ abap_true.
        wd_comp_controller->set_alv_config( ).
      ENDIF.
      wd_this->set_maktx( ).  "<- for displaying maktx
    ENDMETHOD.
    When I want to select a line, do not selected.
    I know because of "wd_this->set_maktx( )." sentence.
    But I want to select multi lines in above condition...
    How to keep selected lines in alv?
    Help me please.
    Thanks.
    Regards.

    What logic is taking place in wd_this->set_maktx( )?  It is pretty difficult to say what is causing the issue without knowing what code you are executing?  If you are resetting the context bound to the ALV, that would explain why you are losing your selections.

  • Lead selection in ALV grid

    Hi.
    I am usinmg Set_table_for_first_display to display the ALV grid.
    In my ALV grid, I have a field as Flag which will show as a lead selection in the grid. Such that I have designed the field catelog and layout.
    When I select a row and click on DISPLAY button, it has to display the details.
    This I am able to do through GR_GRID->GET_SELECTED_ROWS() .
    But after displaying the data the cursor is not in the same row. Lead selection is cleared.
    I manually tied to set the FLag as X and updated the table. Even then Lead selection is not coming in the row.
    Suggestion  is very much helpul for this.
    Thanks,
    Sumithra

    DOne by using Set_selected_rows method

  • Getting the details of element in lead selection

    hi experts,
    please help me out with the following requirement.
    I have a table displayed in my table_view with 3 feilds.if i select a row in the table and click details, then it should get the details(ie all 8 fields) in the table_details view.
    I used the currentContextElement option but it gave me the details of the last row always..
    thanks in advance..
    jithin

    Hi,
    suppose if u have two node node1 and node2
    and u want to copy the selected element from node1 to node2,
    int lead=wdContext().nodeNode1.getLeadSelection();
    /////get attributes at lead selection
    IPrivateView.INode1Element elem1 = wdContext().nodeNode1().getInode1ElementAt(lead);
    String a =elem1.get<Attr1>();
    //////create an elemnt of the node2 and set the attributes
    IPrivateView.INode2Element elem2 = wdContext().nodeNode2().createNode2Element();
    wdContext().nodeNode2().bind(elem2);
    elem2.set<Attr1>(a);
    Regards,
    Satya.

  • Capture multiple rows on lead select in ALV Web dynpro

    Hi all,
    I am trying to capture the selected rows on lead select in ALV.
    I have tried with supply function and ON_LEAD_SELECT event of ALV.
    When I am trying this I am able to capture only one row but not multiple.
    I don't want use any extra actions or buttons to get the selected rows, it must be possible only through any ALV events or using supply function.
    BR,
    Eshwar

    Hi,
    You use this to set to on_select?
    DATA:
         lo_config_table        TYPE REF TO cl_salv_wd_config_table.
       lo_config_table->if_salv_wd_table_settings~set_on_select_enabled( ).
    And in the component controller create a new method for event_handler
    This method will executed
    Hope this works
    Maarten

  • How to get the context element of a F4 help of a column in ALV table?

    Hello!
    I know to get the context element of the current row normally through
    lo_el = WDEVENT->get_context_element( 'CONTEXT_ELEMENT' ).
    or: lo_el = lo_nd->get_element( index = r-parm->index ).
    But this time, I have a F4 help on the cell of a column. After clicking on the F4 help I need to get the current context element. Do you have any idea, to help me?
    Many thanks!
    regards
    Meer

    Hello,
    Kindly close the thread if your query is resolved now.
    Thanks
    Pradeep

Maybe you are looking for

  • Can't create pdf files

    I puchased a new computer with Windows 7 Home Premium 64-bit preinstalled.  I installed by Acrobat 8.0 Standard program and performed all of the updates for windows and acrobat and everything worked fine.  I could create pdfs from both the adobe pdf

  • White Balance color temperature for custom temperature shots

    Hello, I would like to understand why LR and Photoshop too are always show wrong color temperature "As Shot"? Let say I shoot with 6000K, set manually (Canon 40D, RAW) Canon itself says it's 6000K in the slide info, fine. Both Adobe apps says it's 57

  • Brazil vs Germany Live Streaming Fifa World Cup Semi Final 2014 Online Watch Espn

    http://www.boston.com/community/forums/sports/mixed-bag/general/brazil-vs-germany-live-streaming-fifa-world-cup-semi-final-2014-online-watch-espn/100/7232703 http://www.boston.com/community/forums/sports/mixed-bag/general/brazil-vs-germany-live-strea

  • Can we prepare drill down reports in Desktop Intelligence...........

    Hy, can we prepare drill down reports in Desktop Intelligence........... if we can prepare then how we can do ? please tell me  the steps to prepare drill down reports thanks ravi

  • I want to update my podcast feed url

    Hello to everybody. I have submit last day to itunes my podcast url from podomatic.com I want to ask how I can update my rss url in itunes, if I want to leave podomatic.com and go to another service? And last.. can you suggest me some other cool serv