cancel
Showing results for 
Search instead for 
Did you mean: 

onLeadSelect for Table

Former Member
0 Kudos

Hi,

I have 4 views:MAIN,SEARCH,DISPLAY and SELECTED. I am getting the records in Table in DISPLAY view. If I select a record in Table, that record should be displayed in a Form in SELECTED view. I have created onLeadSelect for Table in DISPLAY view. But,It is showing the error "Adapter error in INPUT_FIELD "MATNR" of view "ZBK_CONTEXTUAL_PANEL1.SELECTED": Context binding of property VALUE cannot be resolved: Node SELECTED.1.MARA does not contain any elements" 

method ONACTIONSELECTEDRECORD .
     DATA lo_nd_mara TYPE REF TO if_wd_context_node.

     DATA lo_el_mara TYPE REF TO if_wd_context_element.
     DATA ls_mara TYPE wd_this->Element_mara.

*   navigate from <CONTEXT> to <MARA> via lead selection
     lo_nd_mara = wd_context->get_child_node( name = wd_this->wdctx_mara ).

*   @TODO handle non existant child
*   IF lo_nd_mara IS INITIAL.
*   ENDIF.

*   get element via lead selection
     lo_el_mara = lo_nd_mara->get_element( ).
*   alternative access  via index
*   lo_el_mara = lo_nd_mara->get_element( index = 1 ).
*   @TODO handle not set lead selection
     IF lo_el_mara IS INITIAL.
     ENDIF.

*   get all declared attributes
     lo_el_mara->get_static_attributes(
       IMPORTING
         static_attributes = ls_mara ).
endmethod.


Please help me..

Thanks,

Venkata.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Venkat,

This kind of error you get because of CARDINALITY check the cardinality of the node

and check ur select query whether data is begin populated in your internal table or not.

Can you say me when ur getting this error on lead select of record or before loading of display view.

if there is no data in your SELECT query Internal table u'll get this kind of error's check it properly.

Hope this help you .

Thanks

Madhukiran.

Former Member
0 Kudos

Hi Madhukiran,

cardinality is 0..n. If I test the Component without SELECTED view the data is displaying in Table in DISPLAY view. Now I have added SELECTED view with a Form by binding with Node MARA. I am getting the error before loading of display view.

Thanks,

Venkata.

Former Member
0 Kudos

Hi Venkata.,

Cardinality of FORM should be 1:1 or 1:n

if cardinality of MARA in 0:n change to 1:n and check.

And also check ur query once again.

Thanks

Madhukiran.

Former Member
0 Kudos

Hi Madhukiran,

Thanks for the reply. Change of Cardinality to 1..n solves the problem.

Thanks,

Venkata.

Answers (0)