cancel
Showing results for 
Search instead for 
Did you mean: 

The lead selection has not been set error pls help...

Former Member
0 Kudos

Hi friends,

I am getting The lead selection has not been set error when i have empty table with no records.

I have a node A, binded to a table.. i have sub node B binded to an another table.

For every record of A, there are distinct records of B's table.

if A has data, it is working fine. i have cardinality 0..n, singleton -..n, lead selection checked, singleton unchecked.

when i dont have data in table A, this is giving dump :The lead selection has not been set..

pls help me..... kindly respond.. its ugent..

thanks in advance,

Niraja

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Uncheck the Lead Selection. As you marked initalized lead selection, system tries to set the lead selection. With no data in table, system is unable to set the lead selection hence a dump is generated.

Regards

Rohit Chowdhary

Former Member
0 Kudos

Rohit,

i tried it with cardinality 0..n, selection 0..n, lead selection unchekec.. singleton unchecked.. for node A.

and for node B, cardinality 0..n, selection 0..n, lead selection checked.. singleton unchecked..

but its giving the same error..

kindly could u pls give any other options..

thanks again

Niraja

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

If you have a subnode it is dependent upon the parent node. You can't have/access data in the subnode without having data in the parent node. If the parent node really can be empty and the child node still has data then you don't have a valid relationship. Why structure the nodes as parent/child? Restructure your node hierarchy so that they are both siblings.

Former Member
0 Kudos

Thomas,

If parent node A doenst have any data, then child node B too donest have data. both tables will be blank.

THere is no case where A has no data and B has data.. No its not this case.

I tried scenario, A has data, and B is blank. it is working.

But My problem is when i dont have data in A , it is giving dump..

Niraja..

Former Member
0 Kudos

Try to uncheck the lead selection of Sub Node B.

Regards

Rohit Chowdhary

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

At what point is it giving a dump? Do you have some code that is trying to access node B? As long as the cardinality is 0:x on both nodes, I wouldn't think this would be a problem unless you try to ready past Node A to Node B when A is initial.

Former Member
0 Kudos

I tried to debug .. in method PATH_TABLE_GET_ELEMENT2.

Here there is a loop for the nodes.. and when it is in loop for node A..

this statement is giving empty result.

node = A. here..

element ?= node->if_wd_context_node~get_element( <path_part>-element_index ).

Here <path_part>-element_index = -1.

So if element is initial.

me->_raise_element_not_found( <path_part>-element_index ).

endif.

this is what the code giving dump...

can u give some more thoughts. p;ls....

Niraja

uday_gubbala2
Active Contributor
0 Kudos

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

Former Member
0 Kudos

hi uday..

wtith the cardinality u mentioned i tried it, but in my case i have parent node A vbak, and child node B vbap.

in my case, if i dont have data in NOde A,its giving problem, if node B doenst have any data, its showing up empty table.

does the parent and node make a difference/

but my design is like that, and i cant change it now.

im binding the tbales in wddoinit.

shall i dont bind table if i dont have the data???

or shall i always bind the table /

Niraja

uday_gubbala2
Active Contributor
0 Kudos

Hi Niraja,

I have sent you the snapshots of my application so that you can try going through. As how you can see the application is fine even when the 1st table is not having any data. Try not initializing your leadSelection in 1st table & check if its working that way. ( Let the "Initialization Lead Selection" checkbox be unchecked for the node which you are binding to your first table)

Regards,

Uday

Former Member
0 Kudos

I tried unchecking that checkbox Uday for node A, VBAK, but still it is givnig the same dump..

can u give any other way areound..

pls

Niraja

uday_gubbala2
Active Contributor
0 Kudos

Hi Niraja,

At what point do you actually get that error. You mean to say like initially the application runs fine but when you select all the rows in 1s table & delete them then the application goes for a dump? Or is it like the application does straightaway go to a dump at startup?

Uday

UPDATE: Hi Niraja are you filling up your 2nd table with corresponding values based on the change in lead selection of 1st table or are you directly filling up both your tables completely in WDDOINIT itself? You seem to be doing the latter. The example I had sent you is for filling the 2nd table with data based on the value selected by the user in 1st table. It would work out if you design your application that way.

Edited by: Uday Gubbala on Dec 3, 2008 11:49 AM

Former Member
0 Kudos

Yes UDAY, i am initially filling up the data in both the tables in wddoinit.

Basically i have a internal table which has got the data for these 2 Nodes.

If this internal table is blank( fetching records from backedn to display iin both the tables), then before my application loads it is dumping.

I am using bind_table for both the tables in wddoinit only.

can u give some help on this pls...

Niraja

Answers (1)

Answers (1)

Former Member
0 Kudos

Please try this...

Before removing the last element of Node A please clear the selection using if_wd_context_node->clear_selection( ) of Node B.

Thanks,

Rahul