UI基础二:下拉,F4,OP等

时间:2024-10-06 08:03:37

常用的搜索帮助有SE11的SH,域,值列表,组件等。。。下面介绍一下经常用的:

一:下拉

dropdown是最经常用的,也是最简单的一种。

不管是查询条件,还是结果清单,还是明细界面,下拉都是一样的

1.设置字段属性为下拉。(界面查询组件,视图,字段,使用F2)

T-code:BSP_WD_CMPWB进入组件界面,输入组件

选择左侧对应的视图双击:

UI基础二:下拉,F4,OP等

展开CONTEXT节点,选择对应的context node,点开属性

UI基础二:下拉,F4,OP等UI基础二:下拉,F4,OP等

设置GET_P:字段属性

  CASE iv_property.
WHEN if_bsp_wd_model_setter_getter=>fp_fieldtype.
rv_value = cl_bsp_dlc_view_descriptor=>field_type_picklist. WHEN if_bsp_wd_model_setter_getter=>fp_server_event .
rv_value = 'ZSTAT'. ENDCASE.

然后设置GET_V:VALUE

LR_CURRENT = ME->COLLECTION_WRAPPER->GET_CURRENT( ).
CHECK LR_CURRENT IS BOUND.
LR_CURRENT->GET_PROPERTIES( IMPORTING ES_ATTRIBUTES = LS_CURRENT ).
CHECK LS_CURRENT-PROCESS_TYPE = 'ZWO3'. DATA:lt_ddlb TYPE bsp_wd_dropdown_table.
DATA:ls_ddlb TYPE LINE OF bsp_wd_dropdown_table. DATA gr_ddlb_msale_gb TYPE REF TO cl_crm_uiu_ddlb. CREATE OBJECT gr_ddlb_msale_gb
EXPORTING
iv_source_type = 'T'. DATA:lt_tj30t TYPE TABLE OF tj30t,
ls_tj30t TYPE tj30t. SELECT *
INTO TABLE lt_tj30t
FROM tj30t
WHERE STSMA = 'ZHIC_002'
AND spras = sy-langu. LOOP AT lt_tj30t INTO ls_tj30t.
ls_ddlb-key = ls_tj30t-estat.
ls_ddlb-value = ls_tj30t-txt30.
INSERT ls_ddlb INTO TABLE lt_ddlb. CLEAR: ls_tj30t,ls_ddlb.
ENDLOOP. INSERT INITIAL LINE INTO lt_ddlb INDEX .
IF sy-subrc = .
gr_ddlb_msale_gb->set_selection_table( it_selection_table = lt_ddlb ).
ENDIF. rv_valuehelp_descriptor = gr_ddlb_msale_gb.

二:F4

直接使用有搜索帮助或者有域的数据元素,或者手动给字段添加搜索帮助

设置GET_V(map字段一定要对好,inmap是输入字段,这里使用ZZZSYMPTOMSGROUP对应到搜索帮助的CODEGRUPPE  ZZSECTIONCODE 对应 CODE

OUT 对应输出字段,对应到界面字段,如果没有默认值和搜索项之类的,可以只使用outmap)

  DATA:
ls_map TYPE if_bsp_wd_valuehelp_f4descr=>gtype_param_mapping,
lt_inmap TYPE if_bsp_wd_valuehelp_f4descr=>gtype_param_mapping_tab,
lt_outmap TYPE if_bsp_wd_valuehelp_f4descr=>gtype_param_mapping_tab,
lr_entity TYPE REF TO cl_crm_bol_entity. ls_map-context_attr = 'STRUCT.ZZZSYMPTOMSGROUP'.
ls_map-f4_attr = 'CODEGRUPPE'.
APPEND ls_map TO: lt_inmap.
ls_map-context_attr = 'EXT.ZZSECTIONCODE'.
ls_map-f4_attr = 'CODE'.
APPEND ls_map TO: lt_inmap. ls_map-context_attr = 'EXT.ZZSECTIONCODE'.
ls_map-f4_attr = 'CODE'.
APPEND ls_map TO lt_outmap.
ls_map-context_attr = 'ZSEC_DESC'.
ls_map-f4_attr = ' KURZTEXT'.
APPEND ls_map TO lt_outmap. lr_entity ?= me->collection_wrapper->get_current( ).
CREATE OBJECT rv_valuehelp_descriptor
TYPE
cl_bsp_wd_valuehelp_f4descr
EXPORTING
iv_help_id = 'ZPQCODE_Z6'
iv_help_id_kind = if_bsp_wd_valuehelp_f4descr=>help_id_kind_name
iv_input_mapping = lt_inmap
iv_output_mapping = lt_outmap
iv_trigger_submit = abap_true
iv_object_ref = lr_entity.

三:组件搜索帮助:一般顾问就喜欢用标准的BP的那个搜索帮助,所以很多项目中只要是BP的字段,都会要求用那个搜索帮助。

添加组件为搜索帮助

UI基础二:下拉,F4,OP等

METHOD BP_ACCOUNT_SEARCH.
* only used for account search - Employee and Contact have separate search DATA : LV_TITLE TYPE STRING,
LV_EVENTNAME TYPE STRING,
LR_QS TYPE REF TO CL_CRM_BOL_DQUERY_SERVICE,
LR_CURRENT TYPE REF TO CL_CRM_BOL_ENTITY,
LR_COL TYPE REF TO IF_BOL_BO_COL,
LR_CONTEXT TYPE REF TO CL_BSP_WD_CONTEXT_NODE,
LV_EMPRESP TYPE STRING,
LV_COLLECTION TYPE REF TO IF_BOL_BO_COL,
LR_BTPARTNERSET TYPE REF TO CL_CRM_BOL_ENTITY,
LR_BTPARTNER TYPE REF TO CL_CRM_BOL_ENTITY,
LR_PARTNERSET_CTXT TYPE REF TO CL_CRM_UIU_BTPARTNERSET_CN.
DATA: LV_LOW TYPE STRING.
DATA: LS_SELECTION TYPE GENILT_SELECTION_PARAMETER,
LR_VALUENODE TYPE REF TO CL_BSP_WD_VALUE_NODE,
LR_REF_ANY TYPE REF TO DATA. FIELD-SYMBOLS: <LV_CONTEXT_NODE> TYPE ANY,
<LV_PARTNERSET_CONTEXT_NODE> TYPE ANY.
DATA: LR_PARAM TYPE REF TO IF_BOL_BO_PROPERTY_ACCESS,
LR_ITERATOR TYPE REF TO IF_BOL_BO_COL_ITERATOR,
LT_PARAMS TYPE GENILT_SELECTION_PARAMETER_TAB.
DATA: LS_GENERAL TYPE ZCORDER_GENERAL. DATA LV_SALES_ORG TYPE CRMT_SALES_ORG.
DATA LV_LAND TYPE LAND1."当前账号所属国家
CALL FUNCTION 'Z_GET_SALESORG_BY_USER'
EXPORTING
IV_USER = SY-UNAME
IMPORTING
EV_COUNTRY = LV_LAND. LR_CURRENT ?= ME->TYPED_CONTEXT->ZCORDER->COLLECTION_WRAPPER->GET_CURRENT( ).
LR_CURRENT->GET_PROPERTIES( IMPORTING ES_ATTRIBUTES = LS_GENERAL ). IF LS_GENERAL-COUNTRY EQ 'JP' AND ( IV_ROLE = 'ZHSI0CNN' OR IV_ROLE = 'RELAIER' ).
ZCL_CRM_BUFFER=>GV_JP_FLAG = 'X'.
ELSE.
CLEAR ZCL_CRM_BUFFER=>GV_JP_FLAG.
ENDIF. CASE IV_ROLE.
WHEN 'SOLDTO'.
LV_TITLE = CL_WD_UTILITIES=>GET_OTR_TEXT_BY_ALIAS( 'CRM_UIU_BT/PARTNER_SEARCH' ).
IF BPSEARCH_ACCOUNT_POPUP IS NOT BOUND.
BPSEARCH_ACCOUNT_POPUP = COMP_CONTROLLER->WINDOW_MANAGER->CREATE_POPUP(
IV_INTERFACE_VIEW_NAME = 'SearchHelpWindow' "#EC NOTEXT
IV_USAGE_NAME = 'CUBPSearchAccount'
IV_TITLE = LV_TITLE ).
ENDIF. * set display mode
BPSEARCH_ACCOUNT_POPUP->SET_DISPLAY_MODE( IF_BSP_WD_POPUP=>C_DISPLAY_MODE_SURROUNDED ).
* Open the Popup
BPSEARCH_ACCOUNT_POPUP->OPEN( IV_INBOUND_PLUG = 'CLEAR_ALL' ). * Role dependand Event
CONCATENATE 'SEL' IV_ROLE INTO LV_EVENTNAME.
BPSEARCH_ACCOUNT_POPUP->SET_ON_CLOSE_EVENT( IV_VIEW = ME IV_EVENT_NAME = LV_EVENTNAME ).
* Get Query Context node
LR_CONTEXT = BPSEARCH_ACCOUNT_POPUP->GET_CONTEXT_NODE( 'SEARCH' ).
CHECK LR_CONTEXT IS BOUND.
* Get DQuery object to add search parameter
LR_QS ?= LR_CONTEXT->COLLECTION_WRAPPER->GET_CURRENT( ).
CHECK LR_QS IS BOUND.
LR_COL = LR_QS->GET_SELECTION_PARAMS( ).
IF IV_ROLE = 'SERPR' OR IV_ROLE = 'RELAIER' OR IV_ROLE = 'SOLDTO'.
CASE IV_ROLE.
WHEN 'SERPR'.
LV_LOW = 'Z003'.
LS_SELECTION-ATTR_NAME = 'ZBP_GROUP'.
LS_SELECTION-SIGN = 'I'.
LS_SELECTION-OPTION = 'EQ'.
LS_SELECTION-LOW = LV_LOW .
GET REFERENCE OF LS_SELECTION INTO LR_REF_ANY.
CREATE OBJECT LR_VALUENODE
TYPE
CL_BSP_WD_VALUE_NODE
EXPORTING
IV_DATA_REF = LR_REF_ANY.
LR_COL->ADD( LR_VALUENODE ).
WHEN 'RELAIER'.
LV_LOW = 'Z005'.
LS_SELECTION-ATTR_NAME = 'ZBP_GROUP'.
LS_SELECTION-SIGN = 'I'.
LS_SELECTION-OPTION = 'EQ'.
LS_SELECTION-LOW = LV_LOW .
GET REFERENCE OF LS_SELECTION INTO LR_REF_ANY.
CREATE OBJECT LR_VALUENODE
TYPE
CL_BSP_WD_VALUE_NODE
EXPORTING
IV_DATA_REF = LR_REF_ANY.
LR_COL->ADD( LR_VALUENODE ).
WHEN 'SOLDTO'.
IF SY-LANGU = 'J'."ADD BY LY 20170328
LR_QS->ADD_SELECTION_PARAM( IV_ATTR_NAME = 'COUNTRY'
IV_SIGN = 'I'
IV_OPTION = 'EQ'
IV_LOW = 'JP' ).
ENDIF. ENDCASE.
ENDIF.
IF ZCL_CRM_BUFFER=>GV_UI_LOGIN_ORG = 'O 50000297'.
LV_LOW = LS_GENERAL-SALES_ORG.
LR_QS->ADD_SELECTION_PARAM( IV_ATTR_NAME = 'CATEGORY'
IV_SIGN = 'I'
IV_OPTION = 'EQ'
IV_LOW = '' ).
LR_QS->ADD_SELECTION_PARAM( IV_ATTR_NAME = 'ZSALES_ORG'
IV_SIGN = 'I'
IV_OPTION = 'EQ'
IV_LOW = LV_LOW ). LR_QS->ADD_SELECTION_PARAM( IV_ATTR_NAME = 'ZBP_GROUP'
IV_SIGN = 'I'
IV_OPTION = 'EQ'
IV_LOW = 'Z005' ).
LR_QS->ADD_SELECTION_PARAM( IV_ATTR_NAME = 'ZBP_GROUP'
IV_SIGN = 'I'
IV_OPTION = 'EQ'
IV_LOW = 'Z006' ).
LR_QS->ADD_SELECTION_PARAM( IV_ATTR_NAME = 'ZBP_GROUP'
IV_SIGN = 'I'
IV_OPTION = 'EQ'
IV_LOW = 'Z021' ).
ENDIF. LR_COL = LR_QS->GET_SELECTION_PARAMS( ).
LR_ITERATOR = LR_COL->GET_ITERATOR( ).
LR_PARAM = LR_ITERATOR->GET_FIRST( ).
WHILE LR_PARAM IS BOUND.
LR_PARAM->GET_PROPERTIES( IMPORTING ES_ATTRIBUTES = LS_SELECTION ).
IF ls_selection-attr_name = 'ZBP_GROUP' AND ls_selection-low IS INITIAL AND ZCL_CRM_BUFFER=>GV_UI_LOGIN_ORG = 'O 50000297'..
lr_col->remove( lr_param ).
lr_param = lr_iterator->get_current( ).
CONTINUE.
* EXIT.
ENDIF.
IF ls_selection-attr_name = 'ZSALES_ORG' AND ls_selection-low IS INITIAL AND ZCL_CRM_BUFFER=>GV_UI_LOGIN_ORG = 'O 50000297'..
lr_col->remove( lr_param ).
lr_param = lr_iterator->get_current( ).
CONTINUE.
* EXIT.
ENDIF.
IF LS_GENERAL-COUNTRY EQ 'JP' AND LS_SELECTION-ATTR_NAME = 'COUNTRY' AND LS_SELECTION-LOW IS INITIAL.
LR_COL->REMOVE( LR_PARAM ).
LR_PARAM = LR_ITERATOR->GET_CURRENT( ).
CONTINUE.
* EXIT.
ENDIF.
LR_PARAM = LR_ITERATOR->GET_NEXT( ).
ENDWHILE. BPSEARCH_ACCOUNT_POPUP->OPEN( IV_INBOUND_PLUG = 'CLEAR_ALL'
IV_COLLECTION = LR_COL ).
WHEN 'SERPR'. LV_TITLE = CL_WD_UTILITIES=>GET_OTR_TEXT_BY_ALIAS( 'CRM_UIU_BT/PARTNER_SEARCH' ).
IF BPSEARCH_ACCOUNT_POPUP1 IS NOT BOUND.
BPSEARCH_ACCOUNT_POPUP1 = COMP_CONTROLLER->WINDOW_MANAGER->CREATE_POPUP(
IV_INTERFACE_VIEW_NAME = 'SearchHelpWindow' "#EC NOTEXT
IV_USAGE_NAME = 'CUBPSearchAccount'
IV_TITLE = LV_TITLE ).
ENDIF. * set display mode
BPSEARCH_ACCOUNT_POPUP1->SET_DISPLAY_MODE( IF_BSP_WD_POPUP=>C_DISPLAY_MODE_SURROUNDED ).
* Open the Popup
BPSEARCH_ACCOUNT_POPUP1->OPEN( IV_INBOUND_PLUG = 'CLEAR_ALL' ). * Role dependand Event
CONCATENATE 'SEL' IV_ROLE INTO LV_EVENTNAME.
BPSEARCH_ACCOUNT_POPUP1->SET_ON_CLOSE_EVENT( IV_VIEW = ME IV_EVENT_NAME = LV_EVENTNAME ).
* Get Query Context node
LR_CONTEXT = BPSEARCH_ACCOUNT_POPUP1->GET_CONTEXT_NODE( 'SEARCH' ).
CHECK LR_CONTEXT IS BOUND.
* Get DQuery object to add search parameter
LR_QS ?= LR_CONTEXT->COLLECTION_WRAPPER->GET_CURRENT( ).
CHECK LR_QS IS BOUND.
LR_CURRENT ?= ME->TYPED_CONTEXT->ZCORDER->COLLECTION_WRAPPER->GET_CURRENT( ).
LR_CURRENT->GET_PROPERTIES( IMPORTING ES_ATTRIBUTES = LS_GENERAL ).
LV_LOW = LS_GENERAL-SALES_ORG.
LR_QS->ADD_SELECTION_PARAM( IV_ATTR_NAME = 'ZSALES_ORG'
IV_SIGN = 'I'
IV_OPTION = 'EQ'
IV_LOW = LV_LOW ). LR_QS->ADD_SELECTION_PARAM( IV_ATTR_NAME = 'ZBP_GROUP'
IV_SIGN = 'I'
IV_OPTION = 'EQ'
IV_LOW = 'Z003' ). IF SY-LANGU = 'J'.
LR_QS->ADD_SELECTION_PARAM( IV_ATTR_NAME = 'COUNTRY'
IV_SIGN = 'I'
IV_OPTION = 'EQ'
IV_LOW = 'JP' ).
ENDIF. LR_COL = LR_QS->GET_SELECTION_PARAMS( ).
LR_ITERATOR = LR_COL->GET_ITERATOR( ).
LR_PARAM = LR_ITERATOR->GET_FIRST( ).
WHILE LR_PARAM IS BOUND.
LR_PARAM->GET_PROPERTIES( IMPORTING ES_ATTRIBUTES = LS_SELECTION ).
IF LS_SELECTION-ATTR_NAME = 'ZBP_GROUP' AND LS_SELECTION-LOW IS INITIAL.
LR_COL->REMOVE( LR_PARAM ).
LR_PARAM = LR_ITERATOR->GET_CURRENT( ).
CONTINUE.
* EXIT.
ENDIF.
IF LS_GENERAL-COUNTRY EQ 'JP' AND LS_SELECTION-ATTR_NAME = 'COUNTRY' AND LS_SELECTION-LOW IS INITIAL.
LR_COL->REMOVE( LR_PARAM ).
LR_PARAM = LR_ITERATOR->GET_CURRENT( ).
CONTINUE.
* EXIT.
ENDIF.
LR_PARAM = LR_ITERATOR->GET_NEXT( ).
ENDWHILE.
LR_PARAM = LR_ITERATOR->GET_FIRST( ).
WHILE LR_PARAM IS BOUND.
LR_PARAM->GET_PROPERTIES( IMPORTING ES_ATTRIBUTES = LS_SELECTION ).
IF LS_SELECTION-ATTR_NAME = 'ZSALES_ORG' AND LS_SELECTION-LOW IS INITIAL.
LR_COL->REMOVE( LR_PARAM ).
EXIT.
ENDIF.
LR_PARAM = LR_ITERATOR->GET_NEXT( ).
ENDWHILE. BPSEARCH_ACCOUNT_POPUP1->OPEN( IV_INBOUND_PLUG = 'CLEAR_ALL'
IV_COLLECTION = LR_COL ).
WHEN 'RELAIER' OR 'CONSIGNOR'.
LV_TITLE = CL_WD_UTILITIES=>GET_OTR_TEXT_BY_ALIAS( 'CRM_UIU_BT/PARTNER_SEARCH' ).
IF BPSEARCH_ACCOUNT_POPUP2 IS NOT BOUND.
BPSEARCH_ACCOUNT_POPUP2 = COMP_CONTROLLER->WINDOW_MANAGER->CREATE_POPUP(
IV_INTERFACE_VIEW_NAME = 'SearchHelpWindow' "#EC NOTEXT
IV_USAGE_NAME = 'CUBPSearchAccount'
IV_TITLE = LV_TITLE ).
ENDIF. * set display mode
BPSEARCH_ACCOUNT_POPUP2->SET_DISPLAY_MODE( IF_BSP_WD_POPUP=>C_DISPLAY_MODE_SURROUNDED ).
* Open the Popup
BPSEARCH_ACCOUNT_POPUP2->OPEN( IV_INBOUND_PLUG = 'CLEAR_ALL' ).
* Role dependand Event
CONCATENATE 'SEL' IV_ROLE INTO LV_EVENTNAME.
BPSEARCH_ACCOUNT_POPUP2->SET_ON_CLOSE_EVENT( IV_VIEW = ME IV_EVENT_NAME = LV_EVENTNAME ).
* Get Query Context node
LR_CONTEXT = BPSEARCH_ACCOUNT_POPUP2->GET_CONTEXT_NODE( 'SEARCH' ).
CHECK LR_CONTEXT IS BOUND.
* Get DQuery object to add search parameter
LR_QS ?= LR_CONTEXT->COLLECTION_WRAPPER->GET_CURRENT( ).
CHECK LR_QS IS BOUND. *********add by dq-yuw 南非retailer 分组为z006
IF LV_LAND EQ 'ZA' OR LS_GENERAL-COUNTRY EQ 'ZA'..
* lr_qs->add_selection_param( iv_attr_name = 'ZBP_GROUP'
* iv_sign = 'I'
* iv_option = 'EQ'
* iv_low = 'Z006' ). LR_QS->ADD_SELECTION_PARAM( IV_ATTR_NAME = 'PARTNER'
IV_SIGN = 'I'
IV_OPTION = 'SW'
IV_LOW = '' ).
ELSE.
LR_QS->ADD_SELECTION_PARAM( IV_ATTR_NAME = 'ZBP_GROUP'
IV_SIGN = 'I'
IV_OPTION = 'EQ'
IV_LOW = 'Z005' ).
IF IV_ROLE = 'CONSIGNOR'.
LR_QS->ADD_SELECTION_PARAM( IV_ATTR_NAME = 'ZBP_GROUP'
IV_SIGN = 'I'
IV_OPTION = 'EQ'
IV_LOW = 'Z006' ).
ENDIF.
IF IV_ROLE = 'RELAIER'.
IF LV_LAND EQ 'FR' OR ZCL_CRM_BUFFER=>GV_UI_LOGIN_ORG = 'O 50000297'...
LR_QS->ADD_SELECTION_PARAM( IV_ATTR_NAME = 'ZBP_GROUP'
IV_SIGN = 'I'
IV_OPTION = 'EQ'
IV_LOW = 'Z006' ).
ENDIF.
ENDIF. ENDIF. IF LS_GENERAL-COUNTRY EQ 'JP'.
IF IV_ROLE <> 'CONSIGNOR'.
LR_QS->ADD_SELECTION_PARAM( IV_ATTR_NAME = 'ZBP_GROUP'
IV_SIGN = 'I'
IV_OPTION = 'EQ'
IV_LOW = 'Z006' ).
ENDIF. LR_QS->ADD_SELECTION_PARAM( IV_ATTR_NAME = 'ZBP_GROUP'
IV_SIGN = 'I'
IV_OPTION = 'EQ'
IV_LOW = 'Z010' ).
ENDIF.
****************end add
IF SY-LANGU = 'J'."ADD BY LY 20170328
LR_QS->ADD_SELECTION_PARAM( IV_ATTR_NAME = 'COUNTRY'
IV_SIGN = 'I'
IV_OPTION = 'EQ'
IV_LOW = 'JP' ).
ENDIF. LR_CURRENT ?= ME->TYPED_CONTEXT->ZCORDER->COLLECTION_WRAPPER->GET_CURRENT( ).
LR_CURRENT->GET_PROPERTIES( IMPORTING ES_ATTRIBUTES = LS_GENERAL ).
LV_LOW = LS_GENERAL-SALES_ORG.
LR_QS->ADD_SELECTION_PARAM( IV_ATTR_NAME = 'ZSALES_ORG'
IV_SIGN = 'I'
IV_OPTION = 'EQ'
IV_LOW = LV_LOW ).
LR_COL = LR_QS->GET_SELECTION_PARAMS( ).
LR_ITERATOR = LR_COL->GET_ITERATOR( ).
LR_PARAM = LR_ITERATOR->GET_FIRST( ).
WHILE LR_PARAM IS BOUND.
LR_PARAM->GET_PROPERTIES( IMPORTING ES_ATTRIBUTES = LS_SELECTION ).
IF LS_SELECTION-ATTR_NAME = 'ZBP_GROUP' AND LS_SELECTION-LOW IS INITIAL.
LR_COL->REMOVE( LR_PARAM ).
LR_PARAM = LR_ITERATOR->GET_CURRENT( ).
CONTINUE.
* EXIT.
ENDIF.
IF LS_GENERAL-COUNTRY EQ 'JP' AND LS_SELECTION-ATTR_NAME = 'COUNTRY' AND LS_SELECTION-LOW IS INITIAL.
LR_COL->REMOVE( LR_PARAM ).
LR_PARAM = LR_ITERATOR->GET_CURRENT( ).
CONTINUE.
* EXIT.
ENDIF.
LR_PARAM = LR_ITERATOR->GET_NEXT( ).
ENDWHILE.
LR_PARAM = LR_ITERATOR->GET_FIRST( ).
WHILE LR_PARAM IS BOUND.
LR_PARAM->GET_PROPERTIES( IMPORTING ES_ATTRIBUTES = LS_SELECTION ).
IF LS_SELECTION-ATTR_NAME = 'ZSALES_ORG' AND LS_SELECTION-LOW IS INITIAL.
LR_COL->REMOVE( LR_PARAM ).
EXIT.
ENDIF.
LR_PARAM = LR_ITERATOR->GET_NEXT( ).
ENDWHILE. BPSEARCH_ACCOUNT_POPUP2->OPEN( IV_INBOUND_PLUG = 'CLEAR_ALL'
IV_COLLECTION = LR_COL ). WHEN 'NETWORK' OR 'ZHSI0CNN'.
LV_TITLE = CL_WD_UTILITIES=>GET_OTR_TEXT_BY_ALIAS( 'CRM_UIU_BT/PARTNER_SEARCH' ).
IF BPSEARCH_ACCOUNT_POPUP2 IS NOT BOUND.
BPSEARCH_ACCOUNT_POPUP2 = COMP_CONTROLLER->WINDOW_MANAGER->CREATE_POPUP(
IV_INTERFACE_VIEW_NAME = 'SearchHelpWindow' "#EC NOTEXT
IV_USAGE_NAME = 'CUBPSearchAccount'
IV_TITLE = LV_TITLE ).
ENDIF. * set display mode
BPSEARCH_ACCOUNT_POPUP2->SET_DISPLAY_MODE( IF_BSP_WD_POPUP=>C_DISPLAY_MODE_SURROUNDED ).
* Open the Popup
BPSEARCH_ACCOUNT_POPUP2->OPEN( IV_INBOUND_PLUG = 'CLEAR_ALL' ).
* Role dependand Event
CONCATENATE 'SEL' IV_ROLE INTO LV_EVENTNAME.
BPSEARCH_ACCOUNT_POPUP2->SET_ON_CLOSE_EVENT( IV_VIEW = ME IV_EVENT_NAME = LV_EVENTNAME ).
* Get Query Context node
LR_CONTEXT = BPSEARCH_ACCOUNT_POPUP2->GET_CONTEXT_NODE( 'SEARCH' ).
CHECK LR_CONTEXT IS BOUND.
* Get DQuery object to add search parameter
LR_QS ?= LR_CONTEXT->COLLECTION_WRAPPER->GET_CURRENT( ).
CHECK LR_QS IS BOUND.
IF SY-LANGU = 'J'."ADD BY LY 20170328
LR_QS->ADD_SELECTION_PARAM( IV_ATTR_NAME = 'COUNTRY'
IV_SIGN = 'I'
IV_OPTION = 'EQ'
IV_LOW = 'JP' ).
ENDIF. LR_QS->ADD_SELECTION_PARAM( IV_ATTR_NAME = 'ZBP_GROUP'
IV_SIGN = 'I'
IV_OPTION = 'EQ'
IV_LOW = 'Z010' ). IF LS_GENERAL-COUNTRY EQ 'JP'.
LR_QS->ADD_SELECTION_PARAM( IV_ATTR_NAME = 'ZBP_GROUP'
IV_SIGN = 'I'
IV_OPTION = 'EQ'
IV_LOW = 'Z006' ).
ENDIF. * lr_current ?= me->typed_context->zcorder->collection_wrapper->get_current( ).
* lr_current->get_properties( IMPORTING es_attributes = ls_general ).
* lv_low = ls_general-sales_org.
* lr_qs->add_selection_param( iv_attr_name = 'ZSALES_ORG'
* iv_sign = 'I'
* iv_option = 'EQ'
* iv_low = lv_low ).
LR_COL = LR_QS->GET_SELECTION_PARAMS( ).
LR_ITERATOR = LR_COL->GET_ITERATOR( ).
LR_PARAM = LR_ITERATOR->GET_FIRST( ).
WHILE LR_PARAM IS BOUND.
LR_PARAM->GET_PROPERTIES( IMPORTING ES_ATTRIBUTES = LS_SELECTION ).
IF LS_SELECTION-ATTR_NAME = 'ZBP_GROUP' AND LS_SELECTION-LOW IS INITIAL.
LR_COL->REMOVE( LR_PARAM ).
LR_PARAM = LR_ITERATOR->GET_CURRENT( ).
CONTINUE.
ENDIF.
IF LS_GENERAL-COUNTRY EQ 'JP' AND LS_SELECTION-ATTR_NAME = 'COUNTRY' AND LS_SELECTION-LOW IS INITIAL.
LR_COL->REMOVE( LR_PARAM ).
LR_PARAM = LR_ITERATOR->GET_CURRENT( ).
CONTINUE.
ENDIF.
LR_PARAM = LR_ITERATOR->GET_NEXT( ).
ENDWHILE. BPSEARCH_ACCOUNT_POPUP2->OPEN( IV_INBOUND_PLUG = 'CLEAR_ALL'
IV_COLLECTION = LR_COL ).
WHEN 'LOGICAL'.
LV_TITLE = CL_WD_UTILITIES=>GET_OTR_TEXT_BY_ALIAS( 'CRM_UIU_BT/PARTNER_SEARCH' ).
IF BPSEARCH_ACCOUNT_POPUP IS NOT BOUND.
BPSEARCH_ACCOUNT_POPUP = COMP_CONTROLLER->WINDOW_MANAGER->CREATE_POPUP(
IV_INTERFACE_VIEW_NAME = 'SearchHelpWindow' "#EC NOTEXT
IV_USAGE_NAME = 'CUBPSearchAccount'
IV_TITLE = LV_TITLE ).
ENDIF. * set display mode
BPSEARCH_ACCOUNT_POPUP->SET_DISPLAY_MODE( IF_BSP_WD_POPUP=>C_DISPLAY_MODE_SURROUNDED ).
* Open the Popup
BPSEARCH_ACCOUNT_POPUP->OPEN( IV_INBOUND_PLUG = 'CLEAR_ALL' ).
* Role dependand Event
CONCATENATE 'SEL' IV_ROLE INTO LV_EVENTNAME.
BPSEARCH_ACCOUNT_POPUP->SET_ON_CLOSE_EVENT( IV_VIEW = ME IV_EVENT_NAME = LV_EVENTNAME ).
* Get Query Context node
LR_CONTEXT = BPSEARCH_ACCOUNT_POPUP->GET_CONTEXT_NODE( 'SEARCH' ).
CHECK LR_CONTEXT IS BOUND.
* Get DQuery object to add search parameter
LR_QS ?= LR_CONTEXT->COLLECTION_WRAPPER->GET_CURRENT( ).
CHECK LR_QS IS BOUND.
* IF SY-LANGU = 'J'.
* lr_qs->add_selection_param( iv_attr_name = 'COUNTRY'
* iv_sign = 'I'
* iv_option = 'EQ'
* iv_low = 'JP' ).
* ENDIF. LR_QS->ADD_SELECTION_PARAM( IV_ATTR_NAME = 'ZBP_GROUP'
IV_SIGN = 'I'
IV_OPTION = 'EQ'
IV_LOW = 'Z003' ).
LR_CURRENT ?= ME->TYPED_CONTEXT->ZCORDER->COLLECTION_WRAPPER->GET_CURRENT( ).
LR_CURRENT->GET_PROPERTIES( IMPORTING ES_ATTRIBUTES = LS_GENERAL ).
LV_LOW = LS_GENERAL-SALES_ORG.
IF LV_LOW IS NOT INITIAL.
LR_QS->ADD_SELECTION_PARAM( IV_ATTR_NAME = 'ZSALES_ORG'
IV_SIGN = 'I'
IV_OPTION = 'EQ'
IV_LOW = LV_LOW ).
ENDIF. LV_LOW = LS_GENERAL-COUNTRY.
IF LV_LOW IS NOT INITIAL.
LR_QS->ADD_SELECTION_PARAM( IV_ATTR_NAME = 'COUNTRY'
IV_SIGN = 'I'
IV_OPTION = 'EQ'
IV_LOW = LV_LOW ).
ENDIF. LR_COL = LR_QS->GET_SELECTION_PARAMS( ).
LR_ITERATOR = LR_COL->GET_ITERATOR( ).
LR_PARAM = LR_ITERATOR->GET_FIRST( ).
WHILE LR_PARAM IS BOUND.
LR_PARAM->GET_PROPERTIES( IMPORTING ES_ATTRIBUTES = LS_SELECTION ).
IF LS_SELECTION-ATTR_NAME = 'ZBP_GROUP' AND LS_SELECTION-LOW IS INITIAL.
LR_COL->REMOVE( LR_PARAM ).
LR_PARAM = LR_ITERATOR->GET_CURRENT( ).
CONTINUE.
ENDIF.
IF LS_GENERAL-COUNTRY EQ 'JP' AND LS_SELECTION-ATTR_NAME = 'COUNTRY' AND LS_SELECTION-LOW IS INITIAL.
LR_COL->REMOVE( LR_PARAM ).
LR_PARAM = LR_ITERATOR->GET_CURRENT( ).
CONTINUE.
ENDIF.
LR_PARAM = LR_ITERATOR->GET_NEXT( ).
ENDWHILE. WHEN 'ZHSI0DEL'.
LV_TITLE = CL_WD_UTILITIES=>GET_OTR_TEXT_BY_ALIAS( 'CRM_UIU_BT/PARTNER_SEARCH' ).
IF BPSEARCH_ACCOUNT_POPUP2 IS NOT BOUND.
BPSEARCH_ACCOUNT_POPUP2 = COMP_CONTROLLER->WINDOW_MANAGER->CREATE_POPUP(
IV_INTERFACE_VIEW_NAME = 'SearchHelpWindow' "#EC NOTEXT
IV_USAGE_NAME = 'CUBPSearchAccount'
IV_TITLE = LV_TITLE ).
ENDIF. * set display mode
BPSEARCH_ACCOUNT_POPUP2->SET_DISPLAY_MODE( IF_BSP_WD_POPUP=>C_DISPLAY_MODE_SURROUNDED ).
* Open the Popup
BPSEARCH_ACCOUNT_POPUP2->OPEN( IV_INBOUND_PLUG = 'CLEAR_ALL' ).
* Role dependand Event
CONCATENATE 'SEL' IV_ROLE INTO LV_EVENTNAME.
BPSEARCH_ACCOUNT_POPUP2->SET_ON_CLOSE_EVENT( IV_VIEW = ME IV_EVENT_NAME = LV_EVENTNAME ).
* Get Query Context node
LR_CONTEXT = BPSEARCH_ACCOUNT_POPUP2->GET_CONTEXT_NODE( 'SEARCH' ).
CHECK LR_CONTEXT IS BOUND.
* Get DQuery object to add search parameter
LR_QS ?= LR_CONTEXT->COLLECTION_WRAPPER->GET_CURRENT( ).
CHECK LR_QS IS BOUND.
IF SY-LANGU = 'J'."ADD BY LY 20170328
LR_QS->ADD_SELECTION_PARAM( IV_ATTR_NAME = 'COUNTRY'
IV_SIGN = 'I'
IV_OPTION = 'EQ'
IV_LOW = 'JP' ).
ENDIF. LR_QS->ADD_SELECTION_PARAM( IV_ATTR_NAME = 'ZBP_GROUP'
IV_SIGN = 'I'
IV_OPTION = 'EQ'
IV_LOW = 'Z010' ). LR_QS->ADD_SELECTION_PARAM( IV_ATTR_NAME = 'ZBP_GROUP'
IV_SIGN = 'I'
IV_OPTION = 'EQ'
IV_LOW = 'Z006' ).
LR_QS->ADD_SELECTION_PARAM( IV_ATTR_NAME = 'ZBP_GROUP'
IV_SIGN = 'I'
IV_OPTION = 'EQ'
IV_LOW = 'Z003' ). * lr_current ?= me->typed_context->zcorder->collection_wrapper->get_current( ).
* lr_current->get_properties( IMPORTING es_attributes = ls_general ).
* lv_low = ls_general-sales_org.
* lr_qs->add_selection_param( iv_attr_name = 'ZSALES_ORG'
* iv_sign = 'I'
* iv_option = 'EQ'
* iv_low = lv_low ).
LR_COL = LR_QS->GET_SELECTION_PARAMS( ).
LR_ITERATOR = LR_COL->GET_ITERATOR( ).
LR_PARAM = LR_ITERATOR->GET_FIRST( ).
WHILE LR_PARAM IS BOUND.
LR_PARAM->GET_PROPERTIES( IMPORTING ES_ATTRIBUTES = LS_SELECTION ).
IF LS_SELECTION-ATTR_NAME = 'ZBP_GROUP' AND LS_SELECTION-LOW IS INITIAL.
LR_COL->REMOVE( LR_PARAM ).
LR_PARAM = LR_ITERATOR->GET_CURRENT( ).
CONTINUE.
ENDIF.
IF LS_GENERAL-COUNTRY EQ 'JP' AND LS_SELECTION-ATTR_NAME = 'COUNTRY' AND LS_SELECTION-LOW IS INITIAL.
LR_COL->REMOVE( LR_PARAM ).
LR_PARAM = LR_ITERATOR->GET_CURRENT( ).
CONTINUE.
ENDIF.
LR_PARAM = LR_ITERATOR->GET_NEXT( ).
ENDWHILE. BPSEARCH_ACCOUNT_POPUP2->OPEN( IV_INBOUND_PLUG = 'CLEAR_ALL'
IV_COLLECTION = LR_COL ).
ENDCASE. ENDMETHOD.
  METHOD op_zhsi0cnn.
* Added by wizard: Outbound plug 'ZHSI0CNN'
bp_account_search( iv_role = 'ZHSI0CNN' ).
ENDMETHOD.

太懒了,不想说废话,直接代码吧。。。不懂的就算了