Skip to Content
0
Former Member
Jun 30, 2007 at 10:25 AM

adding a node element violates cardinality

138 Views

I have the following component context structure (cardinality of each node is in brackets):

CONTEXT

BAPI_RESERVATION_CRE (1..1)

CHANGING (1..1)

RESERVATIONITEMS (0..n)

the context node RESERVATIONITEMS has a supply function called FILL_DATA that has the code below: I am getting an error "Number of Elements of the Collection of Node COMPONENTCONTROLLER.

1.BAPI_RESERVATION_CRE.1.CHANGING.1.RESERVATIONITEMS Violates the Cardinality". Can somebody help me?

method FILL_DATA .

DATA: node_level1 type ref to if_wd_context_node,

node_level2 type ref to if_wd_context_node,

node_items type ref to if_wd_context_node.

node_level1 = wd_context->get_child_node( name = 'BAPI_RESERVATION_CRE' ).

node_level2 = node_level1->get_child_node( name = 'CHANGING' ).

node_items = node_level2->get_child_node( name = 'RESERVATIONITEMS' ).

node_items->create_element( ).

endmethod.