on 03-22-2011 2:11 PM
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.
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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.
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.
User | Count |
---|---|
86 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.