cancel
Showing results for 
Search instead for 
Did you mean: 

dump error in OVS help

Former Member
0 Kudos

Dear friends

i am getting dump  when i tried to use OVS help on input field,

  You attempted to assign a field to a typed field symbol,   but the field does not have the required type.

check my below code

declare data structures for the fields to be displayed and
* for the table columns of the selection list, if necessary
  types:
  begin of lty_stru_input,
* add fields for the display of your search input here
  job_id type string,
  job_desc type string,
  end of lty_stru_input.

  types:
  begin of lty_stru_list,
* add fields for the selection list here
  short type short_d,
  stext type stext,
  end of lty_stru_list.
  data: ls_search_input type lty_stru_input,
  lt_select_list type standard table of lty_stru_list,
  ls_text type wdr_name_value,
  lt_label_texts type wdr_name_value_list,
  lt_column_texts type wdr_name_value_list,
  lv_window_title type string,
  lv_group_header type string,
  lv_table_header type string.
  field-symbols: <ls_query_params> type lty_stru_input,
  <ls_selection> type lty_stru_list.
  DATA : lv_short TYPE string,
  lv_stext TYPE string.
  case ovs_callback_object->phase_indicator.
  when if_wd_ovs=>co_phase_0. "configuration phase, may be omitted
* in this phase you have the possibility to define the texts,
* if you do not want to use the defaults (DDIC-texts)
  ls_text-name = `JOB_ID`. "must match a field name of search
  ls_text-value = `Job Abbr`.
  INSERT ls_text INTO TABLE lt_label_texts.
  ls_text-name = `JOB_DESC`. "must match a field name of search
  ls_text-value = `Job Description`.
  INSERT ls_text INTO TABLE lt_label_texts.
  ls_text-name = `SHORT`.
  ls_text-value = `Job Abbr`.
  INSERT ls_text INTO TABLE lt_column_texts.
  ls_text-name = `STEXT`.
  ls_text-value = `Job Description`.
  INSERT ls_text INTO TABLE lt_column_texts.
  ovs_callback_object->set_configuration(
  label_texts = lt_label_texts
  column_texts = lt_column_texts
  group_header = 'Job Abbreviation'
  col_count = 2
  row_count = 10 ).
  when if_wd_ovs=>co_phase_1. "set search structure and defaults
* In this phase you can set the structure and default values
* of the search structure. If this phase is omitted, the search
* fields will not be displayed, but the selection table is
* displayed directly.
* Read values of the original context (not necessary, but you
* may set these as the defaults). A reference to the context
* element is available in the callback object.
  ovs_callback_object->context_element->get_static_attributes(
  importing static_attributes = ls_search_input ).
* pass the values to the OVS component
  ovs_callback_object->set_input_structure(
  input = ls_search_input ).
  when if_wd_ovs=>co_phase_2.
* If phase 1 is implemented, use the field input for the
* selection of the table.
* If phase 1 is omitted, use values from your own context.
  if ovs_callback_object->query_parameters is not bound.
******** TODO exception handling
  endif.
  assign ovs_callback_object->query_parameters->*
  to <ls_query_params>.
  if not <ls_query_params> is assigned.
******** TODO exception handling
  endif.
* call business logic for a table of possible values
* lt_select_list = ???
  lv_short = <ls_query_params>-job_id.
  lv_stext = <ls_query_params>-job_desc.
  REPLACE ALL OCCURRENCES OF '*' IN lv_short WITH '%' .
  REPLACE ALL OCCURRENCES OF '*' IN lv_stext WITH '%' .
  IF lv_short NE ' ' AND lv_stext NE ' '.
  SELECT short stext FROM hrp1000 INTO TABLE lt_select_list
  WHERE plvar = '01' AND otype = 'C' AND langu = 'EN' AND
  endda GE sy-datum AND ( short LIKE lv_short AND
  stext LIKE lv_stext )
  ORDER BY short ASCENDING.
  ELSEIF lv_short EQ ' ' AND lv_stext NE ' '.
  SELECT short stext FROM hrp1000 INTO TABLE lt_select_list
  WHERE plvar = '01' AND otype = 'C' AND langu = 'EN' AND
  endda GE sy-datum AND stext LIKE lv_stext
  ORDER BY short ASCENDING.
  ELSEIF lv_short NE ' ' AND lv_stext EQ ' '.
  SELECT short stext FROM hrp1000 INTO TABLE lt_select_list
  WHERE plvar = '01' AND otype = 'C' AND langu = 'EN' AND
  endda GE sy-datum AND short LIKE lv_short
  ORDER BY short ASCENDING.
  ENDIF.
  ovs_callback_object->set_output_table( output = lt_select_list ).
  when if_wd_ovs=>co_phase_3.
* apply result
  if ovs_callback_object->selection is not bound.
******** TODO exception handling
  endif.
  assign ovs_callback_object->selection->* to <ls_selection>. " getting dump at this point
  if <ls_selection> is assigned.
  ovs_callback_object->context_element->set_attribute(
  name = `JOB_ID`
  value = <ls_selection>-short ).
  ovs_callback_object->context_element->set_attribute(
  name = `JOB_DESC`
  value = <ls_selection>-stext ).
  endif.
  endcase.
endmethod.

please any any let me know whats the reason i am getting error

Thanks

Vijaya

Accepted Solutions (1)

Accepted Solutions (1)

ramakrishnappa
Active Contributor
0 Kudos

Hi Vijaya Laxmi,

I have just tested your code in my system.. it works perfect.

Could you please set a break point at line

assign ovs_callback_object->selection->* to <ls_selection>.

Check the values of ovs_callback_object->selection->*, so that you can get to know what is the exact type its having

I think there is some type mismatch with the target field symbol ( its working fine here ).

Hope this helps you.

Regards,

Rama

Answers (0)