在CRM 2007的公用事业的ICWC的标识屏幕中,可以通过BP来搜索到技术主数据.同样,我们也可以通过技术主数据来搜索到对应的BP,他们之间的纽带就是IS-U合同.
Dear Customer,
one premise and confirms that premise. But then, since there
are two contracts, including one that has ended, related to this
premise, the application cannot automatically confirm the business
partner.
eliminate the contract which has ended from the query result - in some
case, your customer may be calling about a contract which has ended.
search of business partner (on the left side) instead. Then in this case the premise will be confirmed automatically once the business partner
is confirmed.
call method get_confirmed_entity
exporting
iv_entity_name = gc_crmpremise
receiving
rv_confirmed_entity = lr_premise.
check lr_premise is bound.
* determine confirmed account
call method get_confirmed_entity
exporting
iv_entity_name = gc_account
receiving
rv_confirmed_entity = lr_account.
if lr_account is bound.
* use confirmed account for navigation
create object lr_col
type
cl_crm_bol_bo_col.
lr_col->add( lr_account ).
else.
check get_auto_continue_state( ) = abap_true.
try.
* determine related PoD’s
call method lr_premise->get_related_entities
exporting
iv_relation_name = ‘PointOfDeliveryRel’ “#EC NOTEXT
receiving
rv_result = lr_col.
catch cx_crm_genil_model_error. “#EC NO_HANDLER
endtry.
* determine related contracts
if lr_col is bound.
lr_pod ?= lr_col->get_first( ).
while lr_pod is bound.
lr_contracts ?= cl_crm_iu_order_agent=>get_items_by_ref_entity( lr_pod ).
* 上面一个方法会把POD相关的所有合同都获取出来
if lr_collection is bound.
lr_collection->add_collection( lr_contracts ).
else.
create object lr_collection
type
cl_crm_bol_bo_col.
lr_collection->add_collection( lr_contracts ).
endif.
lr_pod ?= lr_col->get_next( ).
endwhile.
endif.
* determine related accounts
clear lr_col.
if lr_collection is bound.
lr_contract ?= lr_collection->get_first( ).
while lr_contract is bound.
*=================================================================
* 如果合同已经结束,不去查找相关的BP,以正确显示BP
* 修改人 :采小明
* 修改日期:20090504
clear lv_contend .
call method lr_contract->if_bol_bo_property_access~get_property_as_value
exporting
iv_attr_name = ‘CONTEND’
importing
ev_result = lv_contend. “#EC NOTEXT
if lv_contend <= sy-datum and lv_contend ne ‘00000000′.
lr_contract ?= lr_collection->get_next( ).
continue .
endif.
*=================================================================
try.
call method lr_contract->get_related_entity
exporting
iv_relation_name = ‘IsuOrderItemAccount’ “#EC NOTEXT
receiving
rv_result = lr_account.
catch cx_crm_genil_model_error. “#EC NO_HANDLER
endtry.
if lr_account is bound.
call method lr_account->if_bol_bo_property_access~get_property_as_value
exporting
iv_attr_name = ‘BP_NUMBER’
importing
ev_result = lv_account. “#EC NOTEXT
call function ‘CONVERSION_EXIT_ALPHA_INPUT’
exporting
input = lv_account
importing
output = lv_account.
if not lv_account is initial.
read table lt_account with key table_line = lv_account transporting no fields.
if sy-subrc <> 0.
append lv_account to lt_account.
if not lr_col is bound.
create object lr_col
type
cl_crm_bol_bo_col.
lr_col->add( lr_account ).
else.
lr_col->add( lr_account ).
endif.
endif.
endif.
endif.
lr_contract ?= lr_collection->get_next( ).
endwhile.
endif.
endif.
* confirm account
check lr_col is bound.
typed_context->builheader->set_collection( lr_col ).
if lr_col->size( ) = 1.
if get_auto_confirm_state( ) = abap_true.
confirm_account( ).
endif.