Breifly xplain  wht lead selection ,cardinality &singleton&supply function

Hi Friends ...
             Let plz xpalin in breif   wht is lead selection ,cardinality &singleton&supply function and how these all helpfull whtz the relation ship between while creating a table...
itz bit urgent for me am working with dynamic tables and am in confuse...plz make it out this query...

Lead selection
     Leadselection is the property which is used to get the index of the selected row of the table
"OnLeadSelect" is the method used to fire an action when a row is selected
     The Method wdContext.<node>().getLeadSelection() can be used to
find out the index of the selected element.
Cardinality
Any node or attribute that has the context root node as its immediate parent, is known as an independent node or attribute.
Any node or attribute that has some other node as its immediate parent, is known as a dependent node or attribute.
All context nodes are collections.
A node collection is composed of elements, where an element is an aggregation of the node’s immediate children (attributes and/or other nodes).
The cardinality property controls the number of elements a node collection may hold at runtime.
Every context node has a property called Cardinality. This property is composed of two values that
taken together, describe the maximum and minimum number of elements the node collection may hold
at runtime.
Cardinality Minimum: 0 or 1
Cardinality Maximum: 1 or n
Therefore, there are four possible cardinality values (specified as <Min>..<Max>)
0..1 Zero or one elements permitted
0..n Zero or more elements permitted
1..1 One and only one element permitted
1..n One or more elements permitted
Singleton
All independent nodes are forced to be singletons. This is because the context root node has one and only one element.
Singleton is  boolean
TRUE : One instance will be created for all te nodes
FALSE : Every Element in the parent node collection,there will be a distinct instance of the child node.
Why Singleton
     -Efficiency
     -Less Memory
     -Lazy Data Access(Creates instance only when needed,till then it will remain unprocessed)
Supply functions
     Supply functions are the mechanism to repopulate child nodes when the lead selection in the parent node
changes. When a singleton child node is declared, you must also write an accompanying supply function.
The Web Dynpro Framework will then automatically call your supply function when the lead selection
in the parent node changes.
Regards
Chaitanya.A

Similar Messages

  • Empty table & lead selection

    Hi folks,
    We are having a small problem with our new web dynpro application. Basically we have table, which is populated when the application is started. Under the table we have "detail area", and it shows more detailed information about the selected element in the table. This works basically without problems.
    The problems appear when the table happens to be empty. In that situation we got a runtime error saying "Context binding for property VALUE of <attribute name> cannot be resolved: Node <context node> does not contain any elements".
    We have also functionality to delete elements in the table, and this causes the same problem. Even if the table contains elements, but we delete those, then when the last element gets deleted, we got the runtime error.
    How to handle this kind of situation? My guess is that the lead selection functionality is causing the problem. If the table is empty, no element can be set as selected.
    The cardinality of the relevant context node is 0...n, and selection 0...1.
    Regards,
    Karri

    Hi Niraja,
    I am displaying data from 2 tables VBAK & VBAP. Depending up on the lead selection in VBAK am filling the data in VBAP. I can delete all the records from first table & still not end up in any error. I will try explain my procedure to you.
    Below are the properties for my 2 context nodes:
    VBAK:
    Cardinality : 0..n
    Selection  : 0..n
    Initialization Lead Selection: Unchecked
    Singleton:   No
    VBAP:
    Cardinality : 0..n
    Selection  : 0..1
    Initialization Lead Selection: Checked
    Singleton:   Yes
    Supply Function: SUPPLY_FETCH_VBAP_DATA
    The 2 tables have the following properties set:
    selectionChangeBehaviour : Auto
    selectionMode: Auto
    As you can see by default the leadSelection isn't set for the 1st table. But as soon as the user selects any record the leadSelection is set & the corresponding data is fetched into the 2nd table element.
    METHOD supply_fetch_vbap_data .
      DATA: ls_vbak TYPE ig_componentcontroller=>element_vbak,
            lt_vbap TYPE ig_componentcontroller=>elements_vbap.
      CALL METHOD parent_element->get_static_attributes
        IMPORTING
          static_attributes = ls_vbak.
      SELECT * FROM vbap INTO TABLE lt_vbap WHERE vbeln = ls_vbak-vbeln.
      node->bind_table( new_items = lt_vbap ).
    ENDMETHOD.
    The user first enters a customer number & the corresponding orders are fetched from VBAK & bound to the first table. Below is the coding for the buttons action handler:
    METHOD onactionfetch .
      DATA : wd_node   TYPE REF TO if_wd_context_node,
             it_vbak  TYPE ig_componentcontroller=>elements_vbak,
             lv_kunnr TYPE ig_componentcontroller=>element_vbak-kunnr.
      wd_node = wd_context->get_child_node( name = 'PARENT1' ).
      CALL METHOD wd_node->get_attribute
        EXPORTING
          name  = 'KUNNR'
        IMPORTING
          value = lv_kunnr.
      wd_node = wd_context->get_child_node( name = 'VBAK' ).
      SELECT * FROM vbak INTO TABLE it_vbak WHERE kunnr = lv_kunnr.
      IF sy-subrc EQ 0.
        wd_node->bind_table( new_items = it_vbak ).
      ELSE.
      ENDIF.
    ENDMETHOD.
    Regards,
    Uday

  • Specialty of supply function and  how can we use it efficiently?

    Hi Experts,
    I have one question.
    What exactly the function of “Supply function” for a node.
    Some says when ever lead change happens the “Supply function” triggers.
    I put a break point in Supply function say “ZSupply” written code to populate the table.
    It triggered only once to populate the table. If this is the functionality then I can write code in method and call it in modify view my checking it for first time why “supply function”.   I want to know what is its specialty, how can we use it efficiently?
    Thanks
    Gopal

    Hi Gopal,
    You are correct even without supply function you can achieve the same functionality i.e when ever there is a change in HEADER the corresponding ITEM for the HEADER can be displayed.
    But the idea of using SUPPLY Function is - the code written in the node i.e assume HEADER and ITEM relation gets executed as and when the node is instantiated in the run time where in there is no need us to handle it explicitly.
    If not used SUPPLY Function then we need to handle the complete HEADER and ITEM relation explicitly.
    Regards,
    Mohammed

  • Explain Cardinality,Singleton Property & Lead selection

    Hi All,
    Please explain me in detail the concepts of Cardinality,Singleton Property & Lead selection.
    I had already gone through enough documents and  have very vague idea.
    Regards,
    Venkat.

    Hi Venkat,
    Please check the [document|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/a048387a-0901-0010-13ac-87f9eb649381?quicklink=index&overridelayout=true]
    Hope that will helps you.
    Thanks
    Arun

  • Cardinality - Singleton - Selection

    Hi All,
    Can anyone explain me detaily about these -
    1.what is cardinality,Singleton and selection.
    Regards,
    Karthick

    Hi Karthick,
    Please find the answers below:
    Cardinality: The cardinality defines how often a node is to be instantiated at runtime u2013
    that is, how many elements of this node are available at runtime.
    u25CF 1u20261
    Only one element is instantiated.
    u25CF 0u20261
    At runtime, no more than one element is instantiated, but it is also possible that no
    element is instantiated.
    u25CF 1u2026n
    n elements can be instantiated, but at least one element must be instantiated.
    u25CF 0u2026n
    The number of instantiated elements of the context node can vary.
    Example:
    The context node "Vehicle" is used to describe the fleet of a car rental company. It has the
    cardinality 1u2026n and is filled from a database table. A number of attributes of this node have a
    specific value for each vehicle.
    The database table indicates that the company owns three vehicles, each with unique
    registration dates and unique license plate numbers. Thus, to display this table in the Web
    Dynpro application, 3 elements of the context node Vehicle must be instantiated; the
    cardinality of the node must therefore be 0u2026n or 1u2026n. (If the Vehicle node is to be filled with
    values in the context of another function u2013 for example, from a table of all currently available
    cars u2013 the cardinality 0u2026n should be used since this table could very easily be empty u2013 that
    is, if all cars are rented out.)
    *The u201CSingletonu201D Property:*
    For each customer of a car rental company, the two attributes u201Crented fromu201D and u201Crented tillu201D
    are listed in the context. At runtime, the context then contains the additional relevant values:
    If each customer has multiple addresses, it may be necessary to include a child node for the
    addresses below the Customer child node. In this manner, the data content of a root node
    can rapidly become very large if, at runtime, all customers are displayed with all their
    addresses for each vehicle of the of the car rental company. _*To limit the content of a context*_
    _*node at runtime, the context node can be assigned the u201Csingletonu201D property*. As a result, the_
    _elements of the relevant node are instantiated for only one element of the parent node._
    _In other words:_Unlike the cardinality of a node, which describes the number of possible elements within the
    node, the u201Csingletonu201D property determines whether or not these elements are set for all
    elements of the parent node (non-singleton) or for exactly one element of the parent node
    (singleton).
    The elements of the child node Customer are only available to one element of the parent
    node Vehicle and not to all other elements. However, if you want to instantiate the elements
    of the Customer node for all vehicles, you must remove the singleton property for the
    Customer node.
    *Lead Selection*:
    At runtime, every child node set as a singleton contains the elements for exactly one element
    of the parent node. For this purpose, one element from the set of possible elements of the
    parent node must be highlighted. This is achieved by initializing lead selection. For each
    newly created context node, lead selection is initialized automatically, but this setting can also
    be deactivated. However, lead selection must generally be initialized for every context node.
    u25CF Using the preset automatic initialization of lead selection:
    In this case, the first element of a node is always assigned the lead selection
    property.
    u25CF Manual initialization of lead selection:
    If the automatic initialization was deactivated, the lead selection must be programmed
    manually. However, in this case it is possible to assign this property to an element
    other than the first element of a node.
    For the above example, this means:
    The singleton property of the context node Customer specifies that the elements of this node
    are only instantiated for one of the three vehicles at runtime u2013 that is, the element that bears
    the lead selection. Since the lead selection was initialized automatically, this is the first
    element of the Vehicle node, which in this case is the element Red Car. However, it would
    also have been possible to manually set lead selection for one of the other two elements (for
    example, using an index).
    Edited by: Vinay Kumar Amruth on Jun 26, 2009 8:00 AM

  • Use Of SUPPLY Function & Singletone Class?

    Hi,
    What is the Use of Supply Function & What is Sigletone Class?
    Thanks
    Ranveer

    Hi Ranveer,
    Each context node of a controller can be assigned a supply function. This supply
    function is called by the runtime when the data of the context node is used. This is the case
    when a UI element is to be displayed for the first time with the data of the corresponding
    context.
    In general, the supply function is called when one or more elements of a context node are
    accessed and when
    &#9679; the context node is not filled yet or is initial, or
    &#9679; the context node has been invalidated in a previous step.
    Supply Functions of Singleton Nodes
    The supply function is especially useful in combination with singleton nodes.The
    values of subnode elements of the type Singleton depend on the element of the parent node
    to which the lead selection is currently assigned. If the lead selection is changed by the user,
    the supply function can access the new lead selection element and recalculate the values of
    the subnode elements accordingly.
    You can only create such a view when the lead selection element of the node
    CARRIER_NODE is read in the supply function of the node CONNECTION_NODE:
    For eg:
    method GET_CONNECTIONS .
    data: CARR_ATTR type IF_MAINVIEW=>ELEMENT_CARRIER_NODE,
    FLIGHTS type SPFLI_TAB.
    get filled structure for parent node
    PARENT_ELEMENT->GET_STATIC_ATTRIBUTES( importing
    STATIC_ATTRIBUTES = CARR_ATTR ).
    get connections from help class
    FLIGHTS = CL_WD_GET_SPFLI=>GET_FLIGHTS_BY_CARRID(
    CARRID = CARR_ATTR-CARRID ).
    NODE->BIND_ELEMENTS( FLIGHTS ).
    endmethod.
    Explanation:
    An internal variable of the type of a context element of the parent node
    CARRIER_NODE and another internal variable of the Dictionary type SPFLI_TAB are
    declared.
    &#9679; The attribute values of the lead selection element of the parent node CARRIER_NODE
    are then passed to the internal variable CARR_ATTR.
    For this transfer, each supply function uses the parameter
    PARENT_ELEMENT of the reference type IF_WD_CONTEXT_ELEMENT.
    PARENT_ELEMENT is a reference to the lead selection element of the parent node of
    the current node. The parameter is automatically displayed in the signature of the
    supply function.
    Each time the user selects another table element as the lead selection in the table Carrier,
    the value of the parameter PARENT_ELEMENT changes. The supply function of the context
    node CONNECTION_NODE is called and the values of its attributes are newly filled
    according to the selected table line in the table Carrier.
    Supply functions can only access context data that
    &#9632; is contained in the corresponding parent node or
    &#9632; is contained in another node that is on a next-highest level compared to
    the node filled by the corresponding supply function.
    Cheers,
    Mary

  • Concept behind Cardinality, Singleton property?

    hi,
          will anyone explain me the concept of cardinality, singleton & Initialize lead selection properties of noce. by example... when i need to set singleton /Initialize lead selection  property true / fasle for perticular node...
    suppose i am having node structure like this ..
                     CLAIM                                   Node1
                            CLAIMITEM                    Node2
                                     EXPENSETYPE    Node3 ...  Comes under node2
                                          key      
                                          value
                                    Claimid                attribute.. Comes under node2
                                    Description          attribute.. Comes under node2
                                    Amount               attribute.. Comes under node2
    if Node CLAIMITEM is bind to table on view....having 4 column ,
    first as dropdown by index bind to EXPENSETYPE value...
    second as inputfield bind to Claimid....
    third as inputfield bind to Description....
    fourth as inputfield bind to Amount....
    table is having multiple rows so Node CLAIMITEM must have cardinality 0...N
    what abt others...
    please dont give me any link which is alreay on sdn...
    jst try to explain me how does it go and why if possible ..
    thanks
    saurin shah

    Hi Saurin,
    Please check this Article which explains in detail about Context,cardinality and singleton properties with examples.I hope it will help you.
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/60730016-dbba-2a10-8f96-9754a865b814

  • Cardinality & singleton

    HI Friends
    Can anyone explain me regarding "cardinality&Singleton"
    with a small example
    I have gone through some of the blogs but I am not getting that much clarity regarding these terms
    Thanks in advance

    Hi,
    The cardinality property
    The cardinality property is composed of a pair of values that control the maximum and minimum number of elements may contain at runtime.
    The cardinality property may have four possible values:
    •     0..1     Zero or one
    •     0..n     Zero or more
    •     1..1     One and only one
    •     1..n     One or more
    The first part of the cardinality describes the minimum number of element ’s element collection may contain.  This value is either zero or one, and is stored as a Boolean value.  This value can be obtained at runtime by calling the method node.getNodeInfo().isMandatory().
    The second part of the cardinality describes the maximum number of elements ’s element collection may contain.  This value is either a 1 or an n (meaning many) and is stored as a Boolean value (false = 1, true = n).  This value can be obtained at runtime by calling method node.getNodeInfo().isMultiple().
    If has a cardinality of 1..<something>, then it can be assumed that after the context has been initialised, there will be at least one element present in the node collection.  This element is known as the default element and cannot be deleted!
    If you attempt to perform some action on a node that would violate the constraints of the cardinality, then you will get a runtime exception in the context.  E.G., trying to add a second element to a node of cardinality 0..1, or trying to delete the last element from a node of cardinality 1..n.
    The singleton property
    The singleton property critically affects the relationship between the child node and its parent node .
    If is declared at design time, then the generated interface for this node will vary depending on whether it is a singleton or non-singleton node.
    Important:
    •     All non-singleton child nodes are associated with their parent node on a per parent element basis
    There is a one-to-one relationship between each element in the parent node’s element collection and the corresponding child node.
    If has n elements in its element collection, then you will have n distinct instances of the non-singleton child node .
    Non-singleton child nodes can be created by their respective parent element.
    •     Singleton child nodes however, are associated with their parent node on a per node basis.
    Irrespective of the number of elements in the parent node’s element collection, there will only ever be one instance of the singleton child node .
    The singleton child node holds the data relevant for the element at the lead selection in the parent node’s element collection.
    Singleton child nodes must be created by their parent node.  Since there can only ever be one instance of a singleton child node, it is impossible for an element in a parent node collection to create a singleton child node.
    From Inside Webdynro For Java
    Regards
    Ayyapparaj

  • 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

  • Problem with table cell editors - Dropdown by Index, getting lead selection

    Hi experts,
    I have a table editor with 5 columns
    1st column is a Drop Down byIndex.
    My contex looks like this
    AS_DATA(Parent Node cardinality 1.1, selection 0-1)
          HEADER (NODE)
          DETAILS(NODE cardinality 0..n, selection 0-1)
             ACTIVITY_TYPES (NODE cardinality 0..n selection 0-1 ) "node for drop down
             description - attribute
             unit
             quantity
    i have bound details node to table data source.
    i have a tool bar button 'Add Line item' which will add a new line item to the table.
    (i am adding a blank line to the table that is bound to table )
    Its working fine. but when ever i add more than one row, the selection made in the previous rows drop down is lost.
    its initializing. where could be the problem.
    My code
    data LO_ND_INV_TYPE type ref to IF_WD_CONTEXT_NODE.
      data LO_EL_INV_TYPE type ref to IF_WD_CONTEXT_ELEMENT.
      data LS_INV_TYPE type WD_THIS->ELEMENT_INV_TYPE.
      data LV_INV_TYPE type WD_THIS->ELEMENT_INV_TYPE-INV_TYPE.
      data LO_ND_DETAILS type ref to IF_WD_CONTEXT_NODE.
      data LT_DETAILS type WD_THIS->ELEMENTS_DETAILS.
      data LS_DETAILS like line of LT_DETAILS.
      data:  WD_NODE type ref to IF_WD_CONTEXT_NODE,
            LR_ELEMENT type ref to IF_WD_CONTEXT_ELEMENT.
      data LO_ND_INV_PATTERN type ref to IF_WD_CONTEXT_NODE.
      data LO_EL_INV_PATTERN type ref to IF_WD_CONTEXT_ELEMENT.
      data LS_INV_PATTERN type WD_THIS->ELEMENT_INV_PATTERN.
      data LV_INV_PAT type WD_THIS->ELEMENT_INV_PATTERN-INV_TYPE.
      data LO_ND_ACTIVITY_TYPES type ref to IF_WD_CONTEXT_NODE.
      data LT_ACTIVITY_TYPES type WD_THIS->ELEMENTS_ACTIVITY_TYPES.
      data LW_ACTIVITY_TYPES type WD_THIS->ELEMENT_ACTIVITY_TYPES.
        data LO_EL_ACTIVITY_TYPES type ref to IF_WD_CONTEXT_ELEMENT.
    *     navigate from <CONTEXT> to <DETAILS> via lead selection
        LO_ND_DETAILS = WD_CONTEXT->PATH_GET_NODE( PATH = `AS_DATA.DETAILS` ).
        LO_ND_DETAILS->GET_STATIC_ATTRIBUTES_TABLE(
          importing TABLE = LT_DETAILS ).
    * Append an empty row to lt_details
        append LS_DETAILS to LT_DETAILS.
        LO_ND_DETAILS->BIND_TABLE(
        NEW_ITEMS = LT_DETAILS ).
    * Get values for dropdown
    call method WD_ASSIST->GET_ACTIVITY_TYPE
          exporting
            I_INV_CAT_ID     = LV_INV_PAT
          importing
            ET_ACTIVITY_TYPE = LT_ACTIVITY_TYPES.
        LW_ACTIVITY_TYPES-ID = 'Select a Activity type'.
        LW_ACTIVITY_TYPES-TEXT = 'Select a Activity type'.
        insert LW_ACTIVITY_TYPES into LT_ACTIVITY_TYPES index 1.
        loop at LT_DETAILS into LS_DETAILS.
          LV_TABIX = SY-TABIX.
          LR_ELEMENT = LO_ND_DETAILS->GET_ELEMENT( LV_TABIX ).
          WD_NODE = LR_ELEMENT->GET_CHILD_NODE( 'ACTIVITY_TYPES' ).
    *lv_index = wd_node->get_lead_selection_index( ). " it is dumping at this statement when i try to get lead selection
          WD_NODE->BIND_TABLE( NEW_ITEMS =  LT_ACTIVITY_TYPES ). " data for dropdown
        endloop.
    any clue on what am i missing will be appreciated.
    I am getting dump when i try to get the lead selection
    Ajay

    You only have only one option in the DDI to display in the example. when you have multiple values
    i assume that by adding an empty row like this will lose the SELECTION MADE in DDI. (Correct me If i am wrong)
    somehow i believe that we need to bind the DD values using  SET LEAD SELECTION INDEX METHOD FOR THE DDI when they are already selected and trying to BIND.
    *LO_ND_DETAILS->GET_STATIC_ATTRIBUTES_TABLE(*
          *importing TABLE = LT_DETAILS ).*
    ** Append an empty row to lt_details*
        *append LS_DETAILS to LT_DETAILS.*
        *LO_ND_DETAILS->BIND_TABLE(*
        *NEW_ITEMS = LT_DETAILS ).*
    even though the above code will have the selected value, the SELECTIONS MADE will be initialize.
    you need to bind it explicitly.
    you have to create an element and bind the DDI values for adding an row as SARAVANAN said.
    or i guess you can continue with you code but need to use SET LEAD to display the correct SELECTIONS MADE
    loop at LT_DETAILS into LS_DETAILS.
          LV_TABIX = SY-TABIX.
          LR_ELEMENT = LO_ND_DETAILS->GET_ELEMENT( LV_TABIX ).
          WD_NODE = LR_ELEMENT->GET_CHILD_NODE( 'ACTIVITY_TYPES' ).
          WD_NODE->BIND_TABLE( NEW_ITEMS =  LT_ACTIVITY_TYPES ). " data for dropdown
    *" try to set the desired value in the DDI when you have multiple values using SET LEAD*
        endloop.

  • Regarding lead selection?

    i m getting this error when i clivk on one button.
    how can i resolve this
    Error when processing your request
    Note
    The following error text was processed in the system CGD : The lead selection has not been set. NURSING
    The error occurred on the application server cgslsvr3_CGD_20 and in the work process 0 .
    The termination type was: RABAX_STATE
    The ABAP call stack was:
    Method: RAISEELEMENT_NOT_FOUND of program CL_WDR_CONTEXT_NODE===========CP
    Method: PATH_TABLE_GET_ELEMENT2 of program CL_WDR_CONTEXT_NODE===========CP
    Method: GET_BOUND_ELEMENT of program CL_WDR_VIEW_ELEMENT_ADAPTER===CP

    there can be many possibilities for this, without knowing what you have done it is difficult to answer
    There are no Elements in the Context node, change the cardinality of your context node to 1..1 or 1..n
    Abhi

  • Lead selection Issue

    Hi all,
      I am having dropdown by index as a table column. I am filling the node by supply function.
    IPublicTests.ITabNode node = testController.wdGetContext().nodeTab();
    int size = srcNode.size();
    for (int i = 0; i< size; i++)
    IPublicTests.ITabElement srcElement = srcNode.getTabElementAt(i);
    com.sap.wdp.IPrivateView.IActionElement element = node.createActionElement();
      element.setActioncode(srcElement.getid() + "   " + srcElement.getDes());
    node.addElement(element);
    My dropdown is filling correctly.
    But i want to display different values to be selected initially based on some condition ,in each rows dropdown.
    How to set different lead values for each rows initially..
    Plz its urgent...
    Thanks&Regards
    Karthik.

    Hi Karthikeyan,
    Let your Value node corresponding to your table be 'Tab'
    and your this tabnode's subnode(for dropdown by index) be 'Action'.
    And this  'Action' node's value attribute(for dropdown by index element) be 'ActionCode'.
    Then take the propety of 'ActionCode' attribute.
    set 'Calculated' as true.
    Then goto implementation. there will be 2 methods(getter and setter methods for the attribute
    In the getter method set value to Action Code for a condition.
    If it is not working, try the same  with dropdown by Key. Surely it will work, for this
    'tab' be ur table node, and its attribute 'ActionCode' be your attribute for 'dropdown by key. Implement EVS to populate values to dropdown.
    Set its  'Calculated=true'.
    Then in Gettermethod,
    public java.lang.String getTabActionCode(IPrivateTestCompView.ITabElement element)
        //@@begin getTabActionCode(IPrivateTestCompView.ITabElement)
        //element refers to a table's row.'val' be another coumn attribute
        String actioncode="";
        if(element.getVal().equals("V1"))
               actioncode="T1"; //t1 be the key for dropdown.
               element.setActionCode(actioncode);
        return actioncode;
        //@@end
    Hope it will work
    thanks
    SMitha

  • Dropdown by Index: Initial lead selection

    All,
    <b>This is my requirement:</b> I have a dropdown (By Index), By default I wanted to have blank as selected value.
    If user selected any of the value, it has to be seleted value.
    <b>What i did so far is:</b>
    I set selection of node to 0..1, cardinality as 0;n and set initializeLeadSelection to false
    <b>The problem:</b> I have is, by default im getting the blank space in dropdown, no issue here.
    but when user selects any value from drop down, it always showing the space. not the selected value.
    Thanks ...
    BM

    You might try this:
    Create a context value node "Items", cardinality 0:N, selection 0:1 with a supply function "supplyItems".
    In the supply function, create the node elements that should appear in the dropdown-list.
    void supplyItems(IItemsNode node, ...)
      for (int i = 0; i < wdContext.nodeR().size(); ++i)
        IRElement e = wdContext.nodeR().getRElementAt(i);
        IItemsElement item = node.createItemsElement();
        node.addElement(item);
        item.setRD(e.getRid());
        item.setOrg(getOrgUnitName(e.getOrgunitid()));
      node.setLeadSelection(IWDNode.NO_SELECTION);
    At the event handler that calls the BAPI and changes the model node content, just call wdContext.nodeItems().invalidate() to trigger the supply function and will the items with the updated values from the model.
    (You might also give your context nodes and attributes more useful names)
    Armin

  • How to tackle the error - " The Lead Selection has not been set in view "?

    Hi Guys,
    I'm getting this error " The Lead Selection has not been set in view " . If any one has faced the same problem , then please guide me . I am new to WD ABAP so finding it difficult to track the reason.
    TIA,
    Vishesh

    Hi Pradeep,
    I have already checked  "Initialisation Lead Selection" property . I have faced the same problem in another view also there it got solved by changing the cardinality.  In this case, I had tried both cardinality and Lead selection property  but nothing  is working.
    Thanx.

  • Getting "The Lead selection has not been set in view"Error during runtime

    Hi Guys,
    I'm getting  this error " The Lead Selection has not been set in view " . If any one has  faced the same problem , then please guide me .  I am new to WD ABAP so finding it difficult to track the reason.
    TIA
    Moderator Message: Please search the forum before posting basic messages. Thread locked
    Edited by: Neil Gardiner on Oct 1, 2010 3:48 PM

    Hi Pradeep,
    I have already checked  "Initialisation Lead Selection" property . I have faced the same problem in another view also there it got solved by changing the cardinality.  In this case, I had tried both cardinality and Lead selection property  but nothing  is working.
    Thanx.

Maybe you are looking for

  • Can i move songs from my iPod to my new matchbook air?

    I bought a brand new mackbook air and i had trouble on the migration assisstant because the verification window wouldnt show up on my old dell. I would now like to know if i am able to move songs from my ipod to my new mac without having to use migra

  • Daughter's MacBook Pro Hard Drive Full

    My daughter's MacBook Pro running Snow Leopard 250GB hard drive is full. I emptied the trash which made 7 GB available. I bought a 1TB external to move files to. I cannot get anything to move. Cannot drag. Cannot copy and paste. Need help quick pleas

  • Old computer account into new computer,

    I have used migration assistant to move my daughter's account from a shared family mac to a new ibook. I was the administrator on the family mac but she had admin rights as well. On the new ibook she is the only account. Now I find that most of the s

  • HT5622 itunes stopped working

    I can no longer open itunes. It says to re-install itunes but it wont let me do that either! what can I do

  • Cfform validation issue

    I have a cfform with 5 tabs. I have input boxes and submit forms on each tab for processing different data. The problem is when I'm on any of the tabs and hit the submit button, the client side validation pops up telling me that "ALL" the fields on e