cancel
Showing results for 
Search instead for 
Did you mean: 

typeconflict

Former Member
0 Kudos

Hi,

I get the following error message:

typeconflict at ASSIGN in the Program /1BCWDY/5PPS4JYUPDC7M1SY1DLY==CP .

because

ASSIGN lr_value->* to <wa_numeric>.

method ONACTIONBUTTONPRESS .


  DATA lo_nd_calculator TYPE REF TO if_wd_context_node.
  DATA lo_el_calculator TYPE REF TO if_wd_context_element.
  data lr_value type ref to data.
  data l_string type c LENGTH 60.
  data: val type string.



  lo_nd_calculator = wd_context->get_child_node( name = wd_this->wdctx_calculator ).
  lo_el_calculator = lo_nd_calculator->get_element( ).


  lr_value = lo_el_calculator->get_attribute_ref( WD_COMP_CONTROLLER->value_help_listener->f4_attribute_info-name ).
  FIELD-SYMBOLS <wa_numeric> type numeric.
  ASSIGN lr_value->* to <wa_numeric>.
  val = wdevent->GET_string( 'ID' ).

  CASE val.
    WHEN 'BTN_7'.
      move <wa_numeric> to l_string.
      CONCATENATE l_string `7` into l_string. CONDENSE l_string NO-GAPS.
      <wa_numeric> = l_string.
      lo_el_calculator->set_attribute(
        EXPORTING
          value = <wa_numeric>
          name  = WD_COMP_CONTROLLER->value_help_listener->f4_attribute_info-name ).

  ENDCASE.
endmethod.

Do you have an idea why ?

Please note there isn' t any element under the node CALCULATOR in my context.

Is it OK ? If NOT please tell me what kind of element do I need need ?

Regards

ertas

Accepted Solutions (1)

Accepted Solutions (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

You are getting a data reference to the source context attribute that triggered the value help. It is then being downcast into a field of type NUMERIC. This is a generic type, but still one that restricts what it accepts to being of base type numeric. Since you are getting a type conflict, I would have to assume that the source attribute of your value help is not numeric. Is it perhaps a character or string based attribute? Check to make sure that you are working one of the numeric types.

Answers (0)