cancel
Showing results for 
Search instead for 
Did you mean: 

drop down cardinality problem

Former Member
0 Kudos

Hi,

I have 2 views 'BUSINESS' and 'PROPERTY' ...Both the views contains one node each with cardinality 0:n, and both view contains drop down by key Ui element... coding i have done in 'wddoinit' method. the drop down coding is working fine for view 'property', but for view 'BUSINESS', its giving assert condition violated.....

plz help me to resolve this problem.... i need drop down for cardinality 0:n... is it possible..

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi,

I created another node with cardinality 1:1 for second view and set the values of selected row from 0:n cardinality node to 1:1 cardinality node and solved the problem..

Thanx for ur help.

gill367
Active Contributor
0 Kudos

That is fine ranjith,

But you should look why that problem was coming. Because i tried the same scenario and i haven't faced any dump.

my dropdown in the second view was bound to an attribute of the node having cardinality 0..N.

Thanks

sarbjeet singh

Former Member
0 Kudos

Hi sarbjeet,

surely I ll check it and tell u..

Former Member
0 Kudos

Hi sarbjeet ,

tat is working fine...but i dont need the new element for my node...here my scenario is if am selecting one row of a table, it should fetch the data from tat row and place it in another window and tat window only contains this view 'BUSINESS'.

now if am using

NODE_BUSINESS->bind_Structure( STRU_BUSINESS ).

then no data is fetched..

gill367
Active Contributor
0 Kudos

HI

SO you have one view with table and and when you select teh one row in the table.

you want to pass the data to the second window.

so do you want the value of the attributes from the currently selected element in the first view.

and then pass these values to the second window.

is this is the thing that you are trying to achieve.

That is simple just get the attribute of the selected element in the second window also by doing the context mapping

thanks

sarbjeet singh

Former Member
0 Kudos

Hi ,

I did tat only...first i got it when i didnt used drop down UI element...When i used the drop down UI element with node cardinality 0:n,it gives assert condition violated error because drop down works on 1:1 cardinality..

gill367
Active Contributor
0 Kudos

Ok i guess you can check the mapping once again whether it is done proeprly.

if your dropdown working on the 1..1 and not on 0..N it means there is no element in the node.

For this go to the context and see whether this noe is mapped to the first view through comp controller.

because if you are filling the elements in the first view it should come here also.

i guess mapping may be the problem or filling of the node.

can you paste the code where you are filling the node with elements.

thanks

sarbjee singh

Former Member
0 Kudos

Hi,

This is the coding where i fill the node with elements

DATA:

NODE_BUSINESS TYPE REF TO IF_WD_CONTEXT_NODE,

ELEM_BUSINESS TYPE REF TO IF_WD_CONTEXT_ELEMENT,

STRU_BUSINESS TYPE IF_MODIFICATION_PART1=>ELEMENT_BUSINESS .

DATA L1 TYPE WD_THIS->ELEMENTS_BUSINESS.

NODE_BUSINESS = WD_CONTEXT->GET_CHILD_NODE( NAME = `BUSINESS` ).

SELECT * FROM ZPRM_TBL_BUASSO INTO TABLE L1 WHERE BAID = ITEM_BAID.

CALL METHOD NODE_BUSINESS->BIND_TABLE

EXPORTING

NEW_ITEMS = L1 .

gill367
Active Contributor
0 Kudos

where are you are writing this particular code

Is it in the wddoinit of the first view and

have you checked the mapping.

Node business should be present in comp controller and both the views also

and both the view nodes should be mapped to comp controller node.

thanks

sarbjeet singh

Former Member
0 Kudos

Hi,

I have written this coding on action of a radio button..

The nodes are mapped from comp controller of both the views.

it is working fine when i use input field instead of drop down in the second view..

when am using drop down,the cardinality problem arises and gives runtime error( assert condition violated ),

its fetching the data correctly..

Former Member
0 Kudos

Ranjith,

If you are working with Node, why do you use DDBK , DropDownByIndex is appropriate to use.

In your business view, which attribute of your node is binded to the DDBK ?

gill367
Active Contributor
0 Kudos

1. You said when you change the cardinality to 1..1 then it is wokring fine. if that is the case then could you please

tell me where you change the cardinality. is it in comp controller or view.

if the nodes are mapped then you can change the cardinality in the comp controller only.

and if you change it there and then it will be changed inteh first view also.

then when you are adding elements to node if number of elements are more than one. it will not allow to add and will provide error.

so, in that case 1..1 case should also throw the error.

so i guess mapping is the problem.

2. when you are filling the value set in the wddoinit of business view.

there do one thing.

check the size of the node (number of elements.)

data size type i.

NODE_BUSINESS = WD_CONTEXT->GET_CHILD_NODE( NAME = `DEALER1` ).

size = node_business->GET_ELEMENT_COUNT( ).

then put a break point and check the value of size.

thanks

sarbjeet singh

Former Member
0 Kudos

Hi,

I didnt tried with 1:1 cardinality as i need table display in one view....I told it is working fine when am not using 'drop down' UI element.

gill367
Active Contributor
0 Kudos

Try the second thing that i suggested you of checking the number of elements in debuggin mode.

thanks

sarbjeet singh

Former Member
0 Kudos

Hi ,

Am using different nodes in both the views....The nodes cardinality is 0:n.... My coding is,it is written in wddoinit.

DATA:

NODE_BUSINESS TYPE REF TO IF_WD_CONTEXT_NODE,

ELEM_BUSINESS TYPE REF TO IF_WD_CONTEXT_ELEMENT,

STRU_BUSINESS TYPE IF_MOD_BUSINESS=>ELEMENT_BUSINESS ,

ITEM_CITYID LIKE STRU_BUSINESS-CITYID.

  • navigate from <CONTEXT> to <BUSINESS> via lead selection

NODE_BUSINESS = WD_CONTEXT->GET_CHILD_NODE( NAME = `BUSINESS` ).

DATA LCO TYPE REF TO IF_WD_CONTEXT_NODE_INFO.

CALL METHOD NODE_BUSINESS->GET_NODE_INFO

RECEIVING

NODE_INFO = LCO.

DATA L1 TYPE TABLE OF WDR_CONTEXT_ATTR_VALUE.

DATA W1 TYPE WDR_CONTEXT_ATTR_VALUE.

DATA L2 TYPE STANDARD TABLE OF ZPRM_TBL_CITY.

DATA W2 TYPE ZPRM_TBL_CITY.

SELECT * FROM ZPRM_TBL_CITY INTO TABLE L2.

SORT L2 BY CITYID.

DELETE ADJACENT DUPLICATES FROM L2 COMPARING CITYID.

LOOP AT L2 INTO W2.

W1-TEXT = W2-CITY_NAM.

W1-VALUE = W2-CITYID.

APPEND W1 TO L1.

ENDLOOP.

CALL METHOD LCO->SET_ATTRIBUTE_VALUE_SET

EXPORTING

NAME = 'CITYID'

VALUE_SET = L1.

gill367
Active Contributor
0 Kudos

NODE_BUSINESS->bind_Structure( STRU_BUSINESS ).

add this line and try again.

it will add one element to your node.

thanks

sarbjeet singh

Former Member
0 Kudos

Hi Ranjith ,

If you are using the same dropdown ( as in same context node ) in both your views ,

Please cosider it creating it in your component contoller and then map the context to both your views.

Advantage would be , populating the node once would be enough(either in a supply function or WDDOINIT of comp controller).

Thanks,

Aditya.

gill367
Active Contributor
0 Kudos

HI

Are you binding the elements to the node in the second view also.

there should be atleast one element in the node to make the dropdown by key to work.

and by the way go to ST22 and check the source code extract of the dump to find out where are you getting assert condition

failed.

paste that code here.

thanks

sarbjeet singh