這裏是使用FPM Workbench自動生成的,沒有去SE80建立WDA程序。html
1.使用事務代碼:FPM_WB。打開工做臺。app
2.點擊Wizard for Creating Empty FPM Applications建立applicationpost
輸入application名稱和描述,選擇FPM配置類型。這裏選的是OIF。測試
點擊下一步。選擇包和請求,保存。ui
3.完成後會返回到配置界面:url
選擇編輯配置。spa
選擇組件:3d
4.選擇UIBB行,點擊code
保存。選擇包,保存。彈出填寫feeder class對話框。htm
5.建立Feeder class
se24
添加接口類:IF_FPM_GUIBB,IF_FPM_GUIBB_SEARCH
6.定義全局結果
DATA gt_table TYPE TABLE OF ZHSB_ORDER_INDEX.(public section)
GW_TABLE Instance Attribute Public Type ZHSB_ORDER_INDEX(attribute)
MO_CATALOG Instance Attribute Public Type Ref To CL_ABAP_STRUCTDESCR(attribute)
重定義GET_DEFINITION方法
method IF_FPM_GUIBB_SEARCH~GET_DEFINITION. DATA:gt_data TYPE TABLE OF zhsb_order_index. DATA:ls_desc LIKE LINE OF et_field_description_attr. eo_field_catalog_attr ?= cl_abap_structdescr=>describe_by_data( gw_table ). mo_catalog = eo_field_catalog_attr. eo_field_catalog_result ?= cl_abap_tabledescr=>describe_by_data( gt_data ). endmethod.
重定義GET_DATA方法:
METHOD if_fpm_guibb_search~get_data. et_result_list = gt_table. ENDMETHOD.
重定義查詢處理:PROCESS_EVENT
method IF_FPM_GUIBB_SEARCH~PROCESS_EVENT. DATA:lt_where TYPE rsds_where_tab. DATA:lt_order TYPE TABLE OF zhsb_order_index, ls_order TYPE zhsb_order_index. DATA:lc_para TYPE REF TO cl_fpm_parameter. DATA:ls_value TYPE string. DATA:ls_result TYPE zhsb_order_index. IF io_event->mv_event_id = if_fpm_guibb_search=>fpm_execute_search. TRY . CALL METHOD cl_fpm_guibb_search_conversion=>to_abap_select_where_tab EXPORTING it_fpm_search_criteria = it_fpm_search_criteria iv_table_name = 'ZHSB_ORDER_INDEX' io_field_catalog = mo_catalog IMPORTING et_abap_select_table = lt_where. CATCH cx_fpmgb. ENDTRY. SELECT * FROM zhsb_order_index INTO TABLE lt_order UP TO iv_max_num_results ROWS WHERE (lt_where). IF sy-subrc = 0. LOOP AT lt_order INTO ls_order. MOVE-CORRESPONDING ls_order TO ls_result. APPEND ls_result TO gt_table. ENDLOOP. ev_result = 'OK'. ENDIF. ENDIF. endmethod.
保存方法
回到配置頁面,輸入feeder class:
添加查詢條件字段:
添加結果字段,以下:
、
保存,而後測試。
我的參數中可設置查詢默認條目,查詢結果條目等。
feeder class繼承的每一個方法都須要點進去激活,不然可能會有錯誤。