on 03-13-2009 11:29 AM
Hi Expert,
I encounter an error :
"Field OVS_CALLBACK_OBJECT is unknown. It is neither in one of the specified tables nor definied by a Data statement"
Please give me some advise.
Code Below:
-
method ON_OVS .
TYPES:
BEGIN OF ty_selfields, "Selection fields
pernr TYPE pa0001-pernr,
btrtl TYPE pa0001-btrtl,
werks TYPE pa0001-werks,
END OF ty_selfields,
BEGIN OF ty_sflight, "Columns in the results table
pernr TYPE pa0001-pernr,
btrtl TYPE pa0001-btrtl,
werks TYPE pa0001-werks,
END OF ty_sflight.
DATA:
lt_text TYPE wdr_name_value_list, "Label texts
ls_text LIKE LINE OF lt_text, "Label texts
ls_selfields TYPE ty_selfields, "Selection fields
cond(72) TYPE c, "for one where clause
itab_where LIKE TABLE OF cond, "dyn. where clause tabl
lt_sflight TYPE TABLE OF ty_sflight, "Results table
node_position1 TYPE REF TO if_wd_context_node, "Reference to context n
elem_position1 TYPE REF TO if_wd_context_element. "Reference to context n
FIELD-SYMBOLS:
<query_params> TYPE ty_selfields,
<selection> TYPE ty_sflight.
CASE ovs_callback_object->phase_indicator.
WHEN ovs_callback_object->co_phase_0.
create texts for labels
ls_text-name = 'PERNR'.
ls_text-value = 'Personnel Number'.
INSERT ls_text INTO TABLE lt_text.
ls_text-name = 'BTRTL'.
ls_text-value = 'Personnel Subarea'.
INSERT ls_text INTO TABLE lt_text.
ls_text-name = 'WERKS'.
ls_text-value = 'Personnel Area'.
INSERT ls_text INTO TABLE lt_text.
set text for window, group, labels and table header
ovs_callback_object->set_configuration(
label_texts = lt_text
group_header = 'Search for a Position'
window_title = 'Value Help'
table_header = 'Position' ).
WHEN ovs_callback_object->co_phase_1.
navigate from <CONTEXT> to <FLIGHTINFO> via lead selection
node_position1 = wd_context->get_child_node( name = `POSITION1` ).
get element via lead selection
elem_position1 = node_flightinfo->get_element( ).
get attributes
elem_position1->get_static_attributes( IMPORTING static_attributes = ls_selfields ).
IF ls_selfields IS INITIAL.
ls_selfields-pernr = '152'.
ENDIF.
set selection fields
ovs_callback_object->set_input_structure( input = ls_selfields ).
WHEN ovs_callback_object->co_phase_2.
IF ovs_callback_object->query_parameters IS NOT BOUND.
exception handling
ENDIF.
get query parameters
ASSIGN ovs_callback_object->query_parameters->* TO <query_params>.
create where condition
IF NOT <query_params>-carrid EQ ''.
CONCATENATE 'PERNR = ''' <query_params>-pernr '''' INTO cond.
APPEND cond TO itab_where.
ENDIF.
IF NOT <query_params>-connid EQ '0000'.
CONCATENATE 'BTRTL = ''' <query_params>-btrtl '''' INTO cond.
IF <query_params>-btrtl NE ''.
CONCATENATE 'AND' cond INTO cond SEPARATED BY space.
ENDIF.
APPEND cond TO itab_where.
ENDIF.
IF NOT <query_params>-werks IS INITIAL.
CONCATENATE 'WERKS = ''' <query_params>-werks '''' INTO cond.
IF NOT itab_where IS INITIAL.
CONCATENATE 'AND' cond INTO cond SEPARATED BY space.
ENDIF.
APPEND cond TO itab_where.
ENDIF.
get results table
IF itab_where IS NOT INITIAL.
SELECT PERNR WERKS BTRTL FROM PA0001
INTO CORRESPONDING FIELDS OF TABLE lt_sflight
WHERE (itab_where).
ELSE.
SELECT PERNR WERKS BTRTL FROM PA0001
INTO CORRESPONDING FIELDS OF TABLE lt_sflight.
ENDIF.
set results table
ovs_callback_object->set_output_table( output = lt_sflight ).
WHEN ovs_callback_object->co_phase_3.
IF ovs_callback_object->selection IS NOT BOUND.
TODO exception
ENDIF.
get selection
ASSIGN ovs_callback_object->selection->* TO <selection>.
IF <selection> IS ASSIGNED.
navigate from <CONTEXT> to <FLIGHTINFO> via lead selection
node_position1 = wd_context->get_child_node( name = `POSITION1` ).
get element via lead selection
elem_position1 = node_position1->get_element( ).
move selection to context attribute FLDATE
elem_position1->set_static_attributes(
static_attributes = <selection> ).
ENDIF.
ENDCASE.
endmethod.
Thanks,
Kelvin
Solved.
Points awarded.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Kelvin,
OVS_CALLBACK_OBJECT is an importing parameter which is generated automatically. I think you have missed to enter the OVS event in your ON_OVS method. Create ON_OVS method as event handler and then press F4 in the event column and select the OVS event. OVS_CALLBACK_OBJECT will be created automatically.
I hope it helps.
Regards
Arjun
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
ON_OVS method how did you created this method?
You have to assign the OVS Event to the Event handler method. Say F4 on the fourth column in the Methods Tab
Abhi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.