CRM INBOX 结果增强功能
前段时间接到的需求:INBOX(ICCMP_INBOX)查询结果,多选后弹出选择用户的框,选择用户,带入到单据的PARTNER FUNC的工程师中,并修改单据状态。
其实标准的INBOX的ComponentUsages是有EMPLOYEE的,但是好像需要激活一些东西(SFW5),所以就自己把这个单独引入到INBOX中
增强ICCMP_INBOX/InboxItems 视图
给结果添加按钮:
METHOD if_bsp_wd_dyn_btn_control~get_local_toolbar_buttons.
DATA:gw_button TYPE crmt_thtmlb_button.
rt_result = super->if_bsp_wd_dyn_btn_control~get_local_toolbar_buttons( ).
READ TABLE rt_result INTO gw_button WITH KEY id = 'ASSIGN'.
IF sy-subrc <> .
gw_button-id = 'ASSIGN'.
gw_button-text = '分配'.
gw_button-on_click = 'SEL_ZHSI0ENG'."指定事件
gw_button-enabled = 'X'.
INSERT gw_button INTO rt_result INDEX .
ENDIF. ENDMETHOD.
创建事件Event Handler 并分配OUT BONUD:
METHOD eh_onsel_zhsi0eng.
* Added by wizard: Handler for event 'SEL_ZHSI0ENG'
OP_TOEMP( ).
ENDMETHOD.
METHOD op_toemp.
* Added by wizard: Outbound plug 'TOEMP'
DATA lv_title TYPE string. lv_title = cl_wd_utilities=>get_otr_text_by_alias( 'CRM_UIU_BT/EMPLOYEE_SEARCH' ).
bpsearch = comp_controller->window_manager->create_popup(
iv_interface_view_name = 'SearchHelpWindow' "#EC NOTEXT
iv_usage_name = 'BPEMPL'"gc_emp_resp_search_usage
iv_title = lv_title ). * set event
bpsearch->set_on_close_event( iv_view = me iv_event_name = 'BP_SELEND' ). * set display mode
bpsearch->set_display_mode( if_bsp_wd_popup=>c_display_mode_surrounded ). * Open the Popup
bpsearch->open( ). " iv_inbound_plug = 'CLEAR_ALL'
ENDMETHOD.
这时候页面上会显示按钮,并且可以弹窗,但是没有返回事件,所以选择后就会DUMP。
定义返回事件:(与上面对应)
METHOD eh_onbp_selend.
* Added by wizard: Handler for event 'BP_SELEND'
DATA:
lr_context_node TYPE REF TO cl_bsp_wd_context_node,
lr_current TYPE REF TO if_bol_bo_property_access,
lr_core TYPE REF TO cl_crm_bol_core,
lv_outbound_plug TYPE seocmpname.
DATA: lr_selected_entities TYPE REF TO cl_crm_bol_entity_col.
* Get query result context node
lr_context_node = bpsearch->get_context_node( iv_cnode_name = 'EMPLOYEE' ).
CHECK lr_context_node IS BOUND. lr_current = lr_context_node->collection_wrapper->get_current( ).
CHECK lr_current IS BOUND. DATA: l_bp TYPE bu_partner.
DATA: lr_entity TYPE REF TO if_bol_bo_property_access.
*
l_bp = lr_current->get_property_as_string( iv_attr_name = 'BP_NUMBER' ).
* lr_entity ?= me->typed_context->zcorder->collection_wrapper->get_current( ).
CHECK l_bp IS NOT INITIAL. TRY.
* Accept all selected items
lr_selected_entities ?= get_selected_entity_col( ).
CATCH cx_sy_move_cast_error.
RETURN.
ENDTRY. CHECK lr_selected_entities IS BOUND. DATA: lr_ex_internal_error TYPE REF TO cx_crm_ic_internal_error, "#EC NEEDED
lr_ex TYPE REF TO cx_root, "#EC NEEDED
lv_remark TYPE string, "#EC NEEDED
lv_msg_v1 TYPE symsgv,
lv_msg_v2 TYPE symsgv,
lv_text TYPE string,
lr_aui_oneorder TYPE REF TO cl_crm_aui_oneorder,
lr_mixed_ent TYPE REF TO cl_bsp_wd_mixed_node,
lr_msg_service TYPE REF TO cl_bsp_wd_message_service.
*
TRY.
* Accept all selected items
DATA: lr_selected_entity TYPE REF TO cl_crm_bol_entity.
lr_selected_entity ?= lr_selected_entities->if_bol_entity_col~get_first( ).
WHILE lr_selected_entity IS BOUND. * Delegate to inbox entity
DATA: lr_inbox_entity TYPE REF TO cl_crm_aui_entity,
lv_message TYPE crmst_aui_message,
lv_navlink TYPE string,
lt_groups TYPE hrobjbupat.
lr_inbox_entity ?= lr_selected_entity. * Get the underyling bol entity
DATA:lr_related_bol_entity TYPE REF TO cl_crm_bol_entity.
DATA:lr_root TYPE REF TO cl_crm_bol_entity.
DATA:lr_order_h TYPE REF TO cl_crm_bol_entity.
DATA:lr_partset TYPE REF TO cl_crm_bol_entity.
DATA:lr_stuset TYPE REF TO cl_crm_bol_entity.
DATA:lr_partall TYPE REF TO cl_crm_bol_entity.
DATA:lr_partbol TYPE REF TO if_bol_entity_col.
DATA:lr_stucurr TYPE REF TO cl_crm_bol_entity.
DATA:lr_part TYPE REF TO cl_crm_bol_entity.
DATA:ls_part TYPE crmst_partner_btil.
DATA:ls_stu TYPE crmst_status_btil.
DATA:gv_guid TYPE crmt_object_guid.
DATA:ls_key TYPE crmst_partner_logical_key.
DATA:lr_iter TYPE REF TO if_bol_entity_col_iterator.
DATA:gv_is_started TYPE abap_bool.
DATA:gv_c TYPE abap_bool.
DATA:lv_trans TYPE REF TO if_bol_transaction_context. lr_related_bol_entity ?= lr_inbox_entity->get_bol_entity( ).
IF lr_related_bol_entity IS INITIAL.
lv_remark = 'Inbox processing: Underlying bol entity not bound'. "#EC NOTEXT
RAISE EXCEPTION TYPE cx_crm_ic_internal_error
EXPORTING
remark = lv_remark.
ELSE.
lr_order_h = lr_related_bol_entity->get_related_entity( iv_relation_name = 'BTOrderHeader' ).
lr_order_h->if_bol_bo_property_access~get_property_as_value(
EXPORTING
iv_attr_name = 'GUID'
IMPORTING
ev_result = gv_guid ).
* "get instance
lr_core = cl_crm_bol_core=>get_instance( ).
* "check the bol instance is initial
gv_is_started = cl_crm_bol_core=>check_is_started( ).
* "if instance is not initial,get initial
IF gv_is_started EQ abap_false.
lr_core->start_up( 'BT' ).
ENDIF.
lr_core->load_component( iv_component_name = 'BT' ).
* "get root entity
CHECK lr_core IS BOUND.
lr_root = lr_core->get_root_entity( iv_object_name = 'BTOrder' iv_object_guid = gv_guid ).
lr_order_h = lr_root->get_related_entity( iv_relation_name = 'BTOrderHeader' ).
CHECK lr_order_h IS BOUND.
lr_partset = lr_order_h->get_related_entity( iv_relation_name = 'BTHeaderPartnerSet' ).
IF lr_partset IS BOUND.
lr_partbol = lr_partset->get_related_entities( iv_relation_name = 'BTPartnerAll' ).
lr_iter ?= lr_partbol->get_iterator( ).
lr_part ?= lr_iter->find_by_property( EXPORTING iv_attr_name = 'PARTNER_FCT' iv_value = 'ZHSI0ENG' ).
* IF lr_iter IS BOUND.
IF lr_part IS NOT BOUND.
lr_partall = lr_partbol->get_first( ).
IF lr_partall->is_changeable( ) = abap_true.
CLEAR:ls_part.
ls_part-partner_fct = 'ZHSI0ENG'.
ls_part-partner_no = l_bp.
lr_partall->if_bol_bo_property_access~set_properties( is_attributes = ls_part ).
ENDIF.
ELSE.
CLEAR:gv_c.
IF lr_part->is_changeable( ) = abap_false.
gv_c = lr_part->switch_to_change_mode( ).
ENDIF.
IF gv_c = 'X' OR lr_part->is_changeable( ) = abap_true.
lr_part->if_bol_bo_property_access~get_properties( IMPORTING es_attributes = ls_part ).
ls_part-partner_fct = 'ZHSI0ENG'.
ls_part-partner_no = l_bp.
lr_part->if_bol_bo_property_access~set_properties( is_attributes = ls_part ).
ENDIF.
ENDIF.
ENDIF.
lr_stuset = lr_order_h->get_related_entity( iv_relation_name = 'BTHeaderStatusSet' ).
IF lr_stuset IS BOUND.
lr_stucurr = lr_stuset->get_related_entity( iv_relation_name = 'BTStatusHCurrent' ).
IF lr_stucurr IS BOUND.
IF lr_stucurr->is_changeable( ) = abap_true.
CLEAR:ls_stu.
CLEAR:gv_c.
IF lr_stucurr->is_changeable( ) = abap_false.
gv_c = lr_stucurr->switch_to_change_mode( ).
ENDIF.
IF gv_c = 'X' OR lr_stucurr->is_changeable( ) = abap_true.
lr_stucurr->if_bol_bo_property_access~get_properties( IMPORTING es_attributes = ls_stu ).
ls_stu-status = 'E0003'.
ls_stu-act_status = 'E0003'.
ls_stu-active = 'X'.
lr_stucurr->if_bol_bo_property_access~set_properties( is_attributes = ls_stu ).
ENDIF.
ENDIF.
ENDIF.
ENDIF.
lr_core->modify( ).
lv_trans = lr_core->get_transaction( ).
lv_trans->save( ).
lv_trans->commit( ).
ENDIF. * lr_related_bol_entity->reread( ). lr_selected_entity ?= lr_selected_entities->if_bol_entity_col~get_next( ).
CHECK: lr_selected_entity IS BOUND. ENDWHILE. * Error handling
CATCH cx_root.
* Display error message
lr_msg_service = cl_bsp_wd_message_service=>get_instance( ). lv_text = lr_inbox_entity->get_property_as_string( 'MAIN_CAT' ). CONCATENATE '"' lv_text '"' INTO lv_msg_v1. "#EC_NOTEXT
lv_text = lr_inbox_entity->get_property_as_string( 'DESCRIPTION' ). CONCATENATE '"' lv_text '"' INTO lv_msg_v2. "#EC_NOTEXT CALL METHOD lr_msg_service->add_message
EXPORTING
iv_msg_type = if_genil_message_container=>mt_error
iv_msg_id = 'CRM_IC_AUI'
iv_msg_number = ''
iv_msg_v1 = lv_msg_v1
iv_msg_v2 = lv_msg_v2.
ENDTRY.
ENDMETHOD.
CRM INBOX 结果增强功能的更多相关文章
- virtualbox安装增强功能时【未能加载虚拟光盘】
virtualbox安装增强功能时[未能加载虚拟光盘] 今天在使用Virtualbox中的Ubuntu虚拟机,想安装增强功能来实现更改分辨率,但是在安装时出错:未能加载虚拟光驱 VBoxsGuestA ...
- virtualbox安装增强功能(centos6.5)
vitualbox安装增强功能(centos 6.5) 1. 安装依赖包 #yum install kernel-headers-$(uname -r) #yum install kernel-dev ...
- VirtualBox-Linux系统安装增强功能
我们在安装之前,必须得先安装好它所需要的依赖包,不然安装过程必定会出现错误! 一.安装依赖包 #yum install kernel-headers #yum install kernel-devel ...
- 安装Virtual Box增强功能 - Ubuntu
一.开发环境 操作系统:Windows 7Virtual Box 版本: 5.0.10 虚拟机系统: Ubuntu 12.04 LTS 二.问题 进入Ubuntu图形界面后,选择“设备” --> ...
- VirtualBox CentOS安装增强功能与设置共享文件夹
如果安装的是CentOS minimal版无网络的可以看这篇文章. 一.安装依赖环境 依次执行如下命令 yum install update yum install kernel-headers yu ...
- Graphtree--zabbix增强功能(一屏展示所有内容)
Graphtree--zabbix增强功能 Graphtree由OneOaaS开发并开源出来. 功能 集中展示所有分组设备 集中展示一个分组图像 集中展示一个设备图像 展示设备下的Applicatio ...
- 为VirtualBox里的Linux系统安装增强功能
先说下为什么要安装增强功能, 很重要的原因是分辨率,没有安装增强功能的虚拟机里的系统往往不能全屏的,屏幕显示的内容没有充满整个屏幕. 还有主机和客户机之间共享文件夹也需要客户机的系统安装了增强功能. ...
- WPF4.5 中的新增功能和增强功能的信息
本主题包含有关 Windows Presentation Foundation (WPF) 版本 4.5 中的新增功能和增强功能的信息. 本主题包含以下各节: 功能区控件 改善性能,当显示大时设置分组 ...
- Debian 7 安装使用 Virtualbox及增强功能
一.安装virtualbox 可以从源里安装 sudo apt-get install virtualbox 也可以下载最新版安装 https://www.virtualbox.org/wiki/Do ...
随机推荐
- array 和 alloc init 以及 new 区别
当你使用new.alloc或copy方法创建一个对象时,该对象的引用计数器值为1.当不再使用该对象时,你要负责向该对象发送一条release或autorelease消息.这样,该对象将在其使用寿命结束 ...
- (转)Linux vi 命令大全
进入vi的命令 vi filename :打开或新建文件,并将光标置于第一行首 vi +n filename :打开文件,并将光标置于第n行首 vi + filename :打开文件,并将光标置于最后 ...
- 经典的PHPer为什么被认为是草根?
PHPer是草根吗? 从PHP诞生之日起,PHP就开始在Web应用方面为广大的程序员服务.同时,作为针对Web开发量身定制的脚本语言,PHP一直秉承简单.开源的思想,这也使得PHP得以快速的发展,并且 ...
- [js]js代码执行顺序/全局&私有变量/作用域链/闭包
js代码执行顺序/全局&私有变量/作用域链 <script> /* 浏览器提供全局作用域(js执行环境)(栈内存) --> 1,预解释(仅带var的可以): 声明+定义 1. ...
- JMeter-标的上架调整与完成
问题:利随本青,按日的返回的参数不正确 各种计息方式的上标,新做产品的上架 散标各种计息方式的上架,新做产品的上架 修改后B环境上架 修改后C环境上架 [制作提案(担保机构)-提交18] loan.d ...
- 2018-2019-1 20189203 《Linux内核原理与分析》第七周作业
第一部分 实验 增加fork命令,运行MenuOS 如下: 设置断点: 跟踪调试过程: 停在的do_fork()的位置上 停在copy_process 停在dup_task_struct 停在copy ...
- 基于容器与微服务架构的Web应用示例eShopOnContainers
简介 微软官方提供了一个基于Docker和微服务的示例应用eShopOnContainers:它使用了面向服务的架构并且从服务端到客户端都是跨平台的:该架构使用通过http作为客户端与服务端直接的通信 ...
- 使用msf对tomcat测试
1.1 使用nmap命令对目标主机进行扫描.单击桌面空白处,右键菜单选择"在终端中打开". 1.2 在终端中输入命令"nmap –sV 192.168.1.3" ...
- 《linux就该这么学》第六节,计划任务和用户身份管理!
课本笔记: case条件测试语句 4.4:计划任务服务 at 设置一次性计划任务 at 时间 //设置执行的任务 a ...
- linux下sublime输入中文
title: linux下sublime输入中文 date: 2017-11-09 20:54:43 tags: sublime categories: 开发工具 archlinux系统 下载文件 g ...