cancel
Showing results for 
Search instead for 
Did you mean: 

Error in INPUT_FIELD "INPUT_MEINH" of view "/SCF/DM_FORM_PATTERN.FORM_VIEW": Context binding of property VALUE cannot be resolved: The FORM_VIEW.1.ALTERNATE_UOM node does not contain any elements

Former Member
0 Kudos

I am enhancing standard screen in SNC module, for placing an input field with corresponding label, input field type is Unit of measure.so picked the current component and copied coding in wddomodify method and placed in over_write method by enhancing the view i have mentioned the code below , i am getting a dump with message mentioned in the subject.

method _OVR_4UJP0OLTWR4Q999ENNOK53YT0 . "Exit of WDDOMODIFYVIEW (in ZDEMO1 )
*  METHOD wddomodifyview .
   if sy-uname = 'LSAJWAN'.
     DATA:
           lo_current_controller   TYPE REF TO if_wd_controller,
           lo_message_manager      TYPE REF TO if_wd_message_manager.

     IF first_time = abap_true.

*   Get message manager
       lo_current_controller ?= wd_this->wd_get_api( ).
       lo_message_manager     = lo_current_controller->get_message_manager( ).

*   Initialize assistant class
       wd_assist->initialize(
         EXPORTING
           io_message_manager           = lo_message_manager
           io_wd_view                   = view
           io_wd_context_root_node      = wd_context ).

       IF wd_comp_controller->mv_no_initial_ui IS INITIAL.
         wd_assist->initialize_ui( ).
       ENDIF.

       IF wd_comp_controller->first_query EQ abap_true.
         wd_comp_controller->query( ).
       ENDIF.

       DATA : lo_nd_info_root TYPE REF TO if_wd_context_node_info,
              lo_nd_info_aluom  TYPE REF TO if_wd_context_node_info,
              lo_label TYPE REF TO cl_wd_label,
              lo_input TYPE REF TO cl_wd_input_field,
              lo_refinfo type WDR_CONTEXT_ATTRIBUTE_INFO,
              lo_ui_root TYPE REF TO if_wd_view_element,
              lo_container TYPE REF TO cl_wd_uielement_container,
              lo_ui_matrix_head_data TYPE REF TO cl_wd_matrix_head_data,
              lo_ui_matrix_data TYPE REF TO cl_wd_matrix_data.



       lo_nd_info_root  = wd_context->GET_NODE_INFO( ).
*      lo_nd_info_form_box = lo_nd_info_root->get_child_node( name = 'FORM_GROUP').
       lo_nd_info_root->add_new_child_node(
*                           static_element_type = 'MEINS'
                                   name  'ALTERNATE_UOM'
                                   is_mandatory = abap_false
                                   is_multiple  = abap_true
                         is_mandatory_selection = abap_false
                         is_multiple_selection  = abap_false
                                     is_static = abap_false ).

       lo_refinfo-name = 'ALTERNATE_UOM'.
       lo_refinfo-type_name = 'MEINS'.
       lo_refinfo-default_value = 'PC'.
       lo_refinfo-value_help_mode = '0'.

       lo_nd_info_aluom = lo_nd_info_root->get_child_node( 'ALTERNATE_UOM' ).
       lo_nd_info_aluom->add_attribute(
                         ATTRIBUTE_INFO = lo_refinfo ).

* to create input field getting root element.
       lo_ui_root = view->get_root_element( ).
       lo_container ?= lo_ui_root.

      cl_wd_matrix_layout=>new_matrix_layout(
                             container = lo_container ).
     lo_container->set_width( value = '100%' ).

* creating input field and label for attribute ALTERNATE_UOM.
       lo_input = cl_wd_input_field=>new_input_field(
                          bind_value = 'ALTERNATE_UOM.ALTERNATE_UOM'
                                  id = 'INPUT_MEINH').
       lo_label = cl_wd_label=>new_label(
                                 id  = 'LABEL_MEINH'
                          label_for  = lo_input->id ).
* set layout data for input field and label.
      lo_ui_matrix_head_data = cl_wd_matrix_head_data=>new_matrix_head_data(
                               element = lo_label ).
       lo_ui_matrix_data = cl_wd_matrix_data=>new_matrix_data(
                               element = lo_input ).
       lo_input->set_layout_data( lo_ui_matrix_data ).
       lo_label->set_layout_data( lo_ui_matrix_head_data ).
*add input field and label to ui heirarchy.

       lo_container->add_child( the_child = lo_label ).
       lo_container->add_child( the_child = lo_input ).

  ENDIF.

*ENDMETHOD.
   ENDIF.
endmethod.

Could someone please tell me why exactly this error is occurring?

Many regards,

Rajesh Pemmasani,

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Rajesh,

I think you have the cardinality as 0..1 for ALTERNATE_UOM node.

Change the cardinality to 1..1 and try to execute.

or

Check the method new_input_field. Fill the parameter is_multiple