cancel
Showing results for 
Search instead for 
Did you mean: 

Cardinality Voilates

Former Member
0 Kudos

hi all,

i am getting the errror

  • Number of Elements of the Collection of Node FORMVIEW.1.EMPLOYEEDATA Violates the Cardinality.
  • in my app i have created a structure from an internal custom ztable in which two other attributes are also used

don't know why it is showing this error although each parameter set by me is right

Cardinality for view and component controller is 1.1

pls see screenshot and help in this

Regards,

Manu

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

@all Thanks,

i solved this query by myself long days back..it was cardinality issue which is 0:n

thanks everyone for suggestions.

Former Member
0 Kudos

Hi Manu,

If you are using table UI element on your layout screen then create the binding node with 0:N cardinality.

If you are using form or multiple input elements then use 0:1 cardinality.

Please let us know what type of UI element you are using.

Regards,

Mahidhar.

Former Member
0 Kudos

i m using inputtextfields and textviews

all are within same structure

please refer above all screenshots.

also, those editable are inputtextfields and others are noneditable textview

this is the screen which i have created.

Former Member
0 Kudos

Hi Manu,

I am not sure if still you are facing the error or not as the question was posted almost 2 months back.

Looking into the screenshots given by you and the code you have written it seems that you are trying to display employee details in a form fetching from a table.

Please try to set the cardinality of your context node as 1.1 as you are displaying one employee record at a time and not displaying multiple records in a table and keep the Initialization lead selection property as checked.

Then in you WDDOINIT after selecting one record from the table read in a work area(structure) and set it in the context node using set_static_attributes method of the lead selected element.

Hope this helps.

Thanks,

Sonia

Former Member
0 Kudos

Thanks for responding but its already done.Sonia

i have set the cardinality to 0:n & voila..

Regards,

Manu

Former Member
0 Kudos

Hi Manu,  Please close the question by selecting the answer which has helped you in solving the problem.  Thanks  Vijay

Former Member
0 Kudos

Hi Manu,

Have you tried 0:1 cardinality?

Regards,

Mahidhar.

Former Member
0 Kudos

hi Mahinder,

on cardinality=0.1 & selection=0.1 for view,controller&window

the following error is displayed

  • Adapter error in &VIEW_ELEMENT_TYPE& "EMPNO" of view "ZWA_MYPROJECT1.FORMVIEW": Context binding of property ? cannot be resolved: Node FORMVIEW.1.EMPLOYEEDATA does not contain any elements

on cardinality 1.1

above error is displaying

Former Member
0 Kudos

hi manu anand,

Are u trying to bind the elements for a table in a view???

Thanks and regards

Vijay Vikram

Former Member
0 Kudos

yes

everytime i change the cardinality a new error message is being displayed

Former Member
0 Kudos

Then you should change the cardinality to 0:N and selection is 0:1.  You please try this.

thanks and Regards,

Vijay Vikram

Former Member
0 Kudos

Hi manu,

Remove the checkbox on "Initialise Lead selection".

Thanks

vijay vikram

Former Member
0 Kudos

done with both

still error

Former Member
0 Kudos

can you add screen shots of your node property and code you have written in wddoinit.

Former Member
0 Kudos

method WDDOINIT .

*   *data declaration

  data: Node_emp   type REF TO IF_WD_CONTEXT_NODE,

        Itab_emp   type standard table of ZZZ_EMP,

      lo_el_context TYPE REF TO if_wd_context_element,

      ls_context TYPE wd_this->element_context,

      lv_lv_user LIKE ls_context-lv_user.

*    get element via lead selection

      lo_el_context = wd_context->get_element).

*    get single attribute

      lo_el_context->get_attribute(

        EXPORTING

          name `LV_USER`

        IMPORTING

          value = lv_lv_user ).

* get data from table SFLIGHT

   select * from ZZZ_EMP into table Itab_emp WHERE Empno = lv_lv_user.

* navigate from <CONTEXT> to <ZZZ_EMP> via lead selection

   Node_emp = wd_Context->get_Child_Node( Name = `EMPLOYEEDATA` ).

* bind internal table to context node <SFLIGHT>

   Node_emp->Bind_Table( Itab_emp ).

endmethod.

Former Member
0 Kudos

pls see method and attached screenshots

Former Member
0 Kudos

you are binding a table in context node with cardinality 1:1.

if your cardinality is 1:1 means there can only be one instance can be bind.

solution: use select

select single * from ZZZ_EMP into table Itab_emp WHERE Empno = lv_lv_user.

or you can change caridnality to 0:n.

for more cardinality info go through below link.

http://help.sap.com/saphelp_erp2005/helpdata/EN/7a/787e40417c6d1de10000000a1550b0/content.htm

reward if helpful

Former Member
0 Kudos
  • Adapter error in &VIEW_ELEMENT_TYPE& "EMPNO" of view "ZWA_MYPROJECT1.FORMVIEW": Context binding of property ? cannot be resolved: Node FORMVIEW.1.EMPLOYEEDATA does not contain any elements