on 02-04-2010 7:06 AM
Hi,
I am using a OVS search help in my application. When I run the application and click on the search help the help opens up , but when I select a value from the search help , I get the following dump:
Type conflict with ASSIGN in program /1BCWDY/7B6BPXV7BTHYS9IXPRJJ==CP .
The code that I am writing is :
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
FIELD1 TYPE STRING,
END OF LTY_STRU_INPUT.
TYPES:
BEGIN OF LTY_STRU_LIST,
add fields for the selection list here
COLUMN1 TYPE STRING,
END OF LTY_STRU_LIST.
DATA: L_material_NODE TYPE REF TO IF_WD_CONTEXT_NODE,
L_ELEMENT TYPE REF TO IF_WD_CONTEXT_ELEMENT,
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,
lv_short TYPE string.
FIELD-SYMBOLS: <LS_QUERY_PARAMS> TYPE LTY_STRU_INPUT,
<LS_SELECTION> TYPE STRING.
<LS_SELECTION> TYPE LTY_STRU_LIST.
L_material_NODE = WD_CONTEXT->GET_CHILD_NODE( 'N_MATERIAL' ).
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 = `FIELD1`. "must match a field name of search
LS_TEXT-VALUE = `Material code`. "wd_assist->get_text( `001` ).
INSERT LS_TEXT INTO TABLE LT_LABEL_TEXTS.
LS_TEXT-NAME = `COLUMN1`. "must match a field in list structure
LS_TEXT-VALUE = `Material Description`. "wd_assist->get_text( `002` ).
INSERT LS_TEXT INTO TABLE LT_COLUMN_TEXTS.
lv_window_title = wd_assist->get_text( `003` ).
lv_group_header = wd_assist->get_text( `004` ).
lv_table_header = wd_assist->get_text( `005` ).
OVS_CALLBACK_OBJECT->SET_CONFIGURATION(
LABEL_TEXTS = LT_LABEL_TEXTS
COLUMN_TEXTS = LT_COLUMN_TEXTS
GROUP_HEADER = LV_GROUP_HEADER
WINDOW_TITLE = LV_WINDOW_TITLE
TABLE_HEADER = LV_TABLE_HEADER
COL_COUNT = 2
ROW_COUNT = 20 ).
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.
TYPES : BEGIN OF STR_MARA,
MATNR TYPE MARA-MATNR,
END OF STR_MARA.
DATA : IT_MARA TYPE STANDARD TABLE OF STR_MARA INITIAL SIZE 0,
WA_MARA TYPE STR_MARA.
*
TYPES : BEGIN OF STR_MAKT,
MATNR TYPE MAKT-MATNR,
MAKTX TYPE MAKT-MAKTX,
END OF STR_MAKT.
DATA : IT_MAKT TYPE STANDARD TABLE OF STR_MAKT INITIAL SIZE 0,
WA_MAKT TYPE STR_MAKT.
SELECT MATNR
FROM MARA
INTO TABLE IT_MARA
WHERE MTART = 'FERT'.
IF SY-SUBRC EQ 0 AND IT_MARA IS NOT INITIAL.
SELECT MAKTX MATNR FROM MAKT INTO TABLE IT_MAKT
FOR ALL ENTRIES IN IT_MARA
WHERE MATNR = IT_MARA-MATNR.
ENDIF.
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.
lv_short = <ls_query_params>-COLUMN1.
call business logic for a table of possible values
lt_select_list = ???
OVS_CALLBACK_OBJECT->SET_OUTPUT_TABLE( OUTPUT = IT_MAKT ).
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>.
IF <LS_SELECTION> IS ASSIGNED.
L_ELEMENT = L_material_NODE->GET_ELEMENT( ).
L_ELEMENT->SET_ATTRIBUTE( NAME = 'MATERIAL'
VALUE = <LS_SELECTION> ).
*
ovs_callback_object->context_element->set_attribute(
name = `MATERIAL`
value = <ls_selection>-column1 ).
or
ovs_callback_object->context_element->set_static_attributes(
static_attributes = <ls_selection> ).
ENDIF.
ENDCASE.
Please suggest how to correct the problem. Any pointers would be really helpful.
ASSIGN OVS_CALLBACK_OBJECT->SELECTION->* TO <LS_SELECTION>.
IF <LS_SELECTION> IS ASSIGNED.
OVS_CALLBACK_OBJECT->CONTEXT_ELEMENT->SET_ATTRIBUTE(
NAME = `MATERIAL`
VALUE = <LS_SELECTION>-COLUMN1 ).
ENDIF.
I get the dump in the above code.
I have tried everything but not able to understand. Please suggest how do I assign the value. Looking for some pointers urgently.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What I could understand is, may be what you have defined in type lty_stru_list is not consisten with the data type of context attribute for which you created OVS.
Your type lty_stru_list contains one attribute COLUMN1 of type string , where as if you are creating an OVS for material then it has to be the same data element as of material.
That's why may be you got a type assignment error.
Just check on this.
Regards
Manas Dua
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
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.