0 évaluation0% ont trouvé ce document utile (0 vote)
11 vues2 pages
Declare data structures for the fields to be displayed and for the table columns of the selection list, if necessary. Add fields for the display of your search input here saknr, END OF lty_stru_list.
Declare data structures for the fields to be displayed and for the table columns of the selection list, if necessary. Add fields for the display of your search input here saknr, END OF lty_stru_list.
Declare data structures for the fields to be displayed and for the table columns of the selection list, if necessary. Add fields for the display of your search input here saknr, END OF lty_stru_list.
* 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 saknr TYPE saknr, END OF lty_stru_input. TYPES: BEGIN OF lty_stru_list, * add fields for the selection list here saknr TYPE saknr, 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_table_header TYPE string. FIELD-SYMBOLS: <ls_query_params> TYPE lty_stru_input, <ls_selection> TYPE lty_stru_list. CASE i_ovs_data-m_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 = `MYTEXT`. "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 = `MYTEXT2`. "wd_assist->get_text( `002` ). INSERT ls_text INTO TABLE lt_column_texts. * lv_window_title = wd_assist->get_text( `003` ). * lv_table_header = wd_assist->get_text( `004` ). i_ovs_data-m_ovs_callback_object->set_configuration( label_texts = lt_label_texts column_texts = lt_column_texts window_title = lv_window_title table_header = lv_table_header ). 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. i_ovs_data-m_ovs_callback_object->context_element->get_static_attributes( IMPORTING static_attributes = ls_search_input ). * pass the values to the OVS component i_ovs_data-m_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 i_ovs_data-m_ovs_callback_object->query_parameters IS NOT BOUND. ********* TODO exception handling * ENDIF. ASSIGN i_ovs_data-m_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 = ??? DATA lv_skanr TYPE SAKNR. CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT' EXPORTING input = '1000' IMPORTING OUTPUT = lv_skanr . SELECT saknr ernam FROM ska1 INTO CORRESPONDING FIELDS OF TABLE lt_select_ list WHERE saknr = lv_skanr. i_ovs_data-m_ovs_callback_object->set_output_table( output = lt_select_lis t ). WHEN if_wd_ovs=>co_phase_3. * apply result FIELD-SYMBOLS <lt_sel_opt_result> TYPE STANDARD TABLE. IF i_ovs_data-m_ovs_callback_object->selection IS NOT BOUND. ******** TODO exception handling ENDIF. ASSIGN i_ovs_data-m_ovs_callback_object->selection->* TO <ls_selection>. IF <ls_selection> IS ASSIGNED. * i_ovs_data-m_ovs_callback_object->context_element->set_attribute( * name = `COLUMN1` * value = <ls_selection>-column1 ). ASSIGN i_ovs_data-mt_selected_values->* TO <lt_sel_opt_result>. INSERT <ls_selection>-saknr INTO TABLE <lt_sel_opt_result>. * or * i_ovs_data-m_ovs_callback_object->context_element->set_static_attribute s( * static_attributes = <ls_selection> ). ENDIF. ENDCASE. ENDMETHOD.