cancel
Showing results for 
Search instead for 
Did you mean: 

Problem in triggering the Supply Function

Former Member
0 Kudos

Hi Experts,

I am developing one web dynpro application to display the records in MARA table.

I have created a radio button.Logic is if radio button is selected then displaying of the record should be done.

NODE_PARENT consists of NODE_CHILD ( which consists of fields to be displayed ) and key holder ( attribute which is used to check whether radio button selected or not ).

In radio button properties i used selected key as attribute of the node NODE_PARENT.

Now in supply function i am reading the parent element attributes i.e. radio button and checking if it is selected then read the data from MARA and bind it.

But i am getting the runtime error

" Context binding of property SELECTED_KEY cannot be resolved: Node MAIN.1.NODE_PARENT does not contain any elements "

what is the reason for this error.

Thanks in advance.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Thanks

Former Member
0 Kudos

seems to me that NODE_PARENT itself not having any elements. Probably this is to do with the cardinality of the node_parent being 0..n or 0..1.

You have first create this node with elements and then your supply function has to be be executed.

Former Member
0 Kudos

Hi Bhaskaran ,

NODE_PARENT is having the elements key holder as well as child node. This child node NODE_CHILD has three fields MATNR, ERSDA and ERNAM as elements.

NODE_PARENT cardinality is 0...n.So is there any problem here.

Former Member
0 Kudos

Hi,

Use Cardinality 0-1, and check. Can you kindly post your code?

Cheers,

Kris.

Former Member
0 Kudos

Then your error message is misleading here. I would suggest to debug and see where and when the error is occurring.

Former Member
0 Kudos

Hi Kissnas and other experts ,

Here is the code.

DATA lo_nd_node_parent TYPE REF TO if_wd_context_node.

DATA lo_el_node_parent TYPE REF TO if_wd_context_element.

DATA ls_node_parent TYPE wd_this->element_node_parent.

DATA lv_keyholder LIKE ls_node_parent-keyholder.

DATA itab TYPE TABLE OF mara.

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

lo_nd_node_parent = wd_context->get_child_node( name = wd_this->wdctx_node_parent ).

  • @TODO handle not set lead selection

IF lo_nd_node_parent IS INITIAL.

ENDIF.

  • get element via lead selection

lo_el_node_parent = lo_nd_node_parent->get_element( ).

  • @TODO handle not set lead selection

IF lo_el_node_parent IS INITIAL.

ENDIF.

  • alternative access via index

  • lo_el_node_parent = lo_nd_node_parent->get_element( index = 1 ).

  • @TODO handle non existant child

  • IF lo_el_node_parent IS INITIAL.

  • ENDIF.

  • get single attribute

lo_el_node_parent->get_attribute(

EXPORTING

name = `KEYHOLDER`

IMPORTING

value = lv_keyholder ).

IF ( lv_keyholder EQ 'X' ).

SELECT matnr ersda ernam FROM mara INTO CORRESPONDING FIELDS OF TABLE itab." WHERE mandt = sy-mandt.

ENDIF.

    • bind all the elements

node->bind_table( itab ).

*lt_node_table->bind_table( itab ).

I have written this code in supplyfunction GET_DATA.

Regards

Ravindranath CH

Former Member
0 Kudos

Hi ,

The problem is with the cardinality of the node 'NODE_PARENT'.

Make the cardinality of NODE_PARENT as 1:1 or 1:n.So that one element will be provided by default.

Thanks,

Aditya.

Former Member
0 Kudos

There are few things which are not clear and more confusing.

Your error is

" Context binding of property SELECTED_KEY cannot be resolved: Node MAIN.1.NODE_PARENT does not contain any elements "

I strongly suspect that it is coming because of the key attribute you binded to the UI element which is not available. I would suggest to correct this first.

Further ,in the supply function you have parent parameter, i do not understand why you have to write coding to get the parent node and lead selected element. This is not right.

Supply function would be called for every parent element and not just for one lead _selection.

Former Member
0 Kudos

Hi Aditya and others

Thanks I could get rid off the problem after changing the cardinalty to 1:n no other options are working.

Here my intention is to trigger the supply function by selecting the radio button which is attribute of the Node_parent.

Node_child consists of elements of the table.

Here after selecting the radio button nothing is happening like supply function is not triggering .What to do to trigger supply function other than reading the parent node elements.

@ Baskaran,,,,,,Thanks for the inputs .The code is taken from the code wizard.Any error in the code.