CRM Worklist: Advance with Dialog not Supported

Size: px
Start display at page:

Download "CRM Worklist: Advance with Dialog not Supported"

Transcription

1 CRM Worklist: Advance with Dialog not Supported Applies to: CRM 6.0 and CRM 7.0. For more information, visit the Customer Relationship Management homepage. Abstract It was possible via SAP Business workplace to directly jump to the next dialog step from the current dialog step by utilizing the concept of Advance with Dialog. This actually helps you to advance to next dialog step within the same SAP session as the agents for the work-item are expected to be the same. However when you start using the CRM Work-list for work-item processing, the concept of Advance with Dialog could not be utilized. This is because the CRM work-list ignores the concept of Advance with dialog and thus it doesn t advance to next step automatically. The purpose of this document is to realize the concept of Advance with Dialog within the CRM Work-list. However what s suggested here is not a generic solution to Advance with Dialog, but a specific one, it the solution would differ from case to case basis. Author: Anand Rangarajan Company: SAP Global Delivery, Bangalore Created on: 18 th August 2010 Author Bio Hi, Let me introduce myself as Anand working with SAP Global Delivery, Bangalore. I have been a part of SAP consulting for more than four years now and it has been an amazing journey so far. I have had privilege of working multiple SAP products including SAP Solution Manager, SAP CRM 5.0 & SAP CRM 7.0. I started my SAP journey with an ABAP certification in the year I have been for some quite some time working on WRICEF components of SAP (Workflows, Reports, Interfaces, Classes, Enhancements, and Forms). Then moved on SAP Solution Manager responsible for configuring Scenarios like Support Desk and Change Request Management. Quite recently i have been involved in CRM Technical Work on product version CRM 5.0 and CRM 7.0. I have also had the privilege to understand the New CRM 7.0 architecture and thus aware of CRM WebUI Enhancement framework. I am certified as a CRM consultant on CRM 6.0 platform with good amount of know-how on CRM Marketing. I had extensively worked on CRM Worklist( WebUI) which is similar to the SAP Business Workplace in GUI SAP AG 1

2 Table of Contents Summary... 3 Detailed Description... 4 Step 1:... 4 Step 2:... 4 Step 3:... 7 Step 4:... 9 Results Conclusions Related Content Copyright SAP AG 2

3 Summary Let s have a look at the few steps within work-flow definition below: As indicated above, the system should execute the decision (Reject) and once the step is executed, it should directly take the user to the Lead document directly as the advance with dialog step is checked for the step as shown below: However, if you execute the same work-item from the CRM work-list, then the system would not take the user directly to the lead after rejection which was the case with users used SAP business workplace for work-item processing. So when the users started using CRM work-list, there would be another work-item send to the user after he\she rejects the lead as the Advance with dialog functionality is not supported as illustrated below: 2010 SAP AG 3

4 Detailed Description The solution of this issue lies in performing some UI enhancements and some minor workflow adjustments. The UI enhancements which are to be performed basically deals with the navigation to the lead directly from the work-list. The navigation to the lead should only happen when the users select Decision option as Reject and subsequently the status of the lead is set to Rejected. Thus the UI enhancement is aimed at navigation to the lead directly from the CRM work-list only after the status of the lead is set to Rejected. This rejected status is set via a workflow background step. With regards to the UI enhancement, we do the following: Step 1: Identify the Decision Step and note down the Task-id: Here is TS Step 2: Enhance Component GSWIDET/btnDec and event handler EH_ONBTN_DECISION *Constants Declarations lc_task1 type SWW_TASK value 'TS ', Task id of the decision work-item found above. lc_rej_stat type crm_j_status value 'E0006', E0006 is technical Reject status lc_checked type boolean value 'X', lc_altkey type name_komp VALUE 'ALTKEY', lc_reject(8) type c value 'Reject'. * Variables Declarations DATA: ls_wi_attributes ls_bor_attributes ls_execobj_attributes ls_nav_params lrf_nav_descrpt_coll lref_decision lv_decision_key lref_wfi lref_wfi_copy lt_method_param ls_method_param lrf_bor_object lrf_bor_objects lv_flag_reject TYPE crmt_ct_inbox_wf_root_attrib, TYPE crmt_ct_inbox_wf_bor_attrib, TYPE crmt_ct_inbox_wf_execobj_attr, TYPE crmt_ct_ib_bor_to_ui_nav, TYPE REF TO if_bol_bo_col, TYPE REF TO if_bol_bo_property_access, TYPE swr_decikey, TYPE REF TO cl_crm_bol_entity, TYPE REF TO cl_crm_bol_entity, TYPE crmt_name_value_pair_tab, TYPE crmt_name_value_pair, TYPE REF TO cl_crm_bol_entity, TYPE REF TO if_bol_entity_col, type boolean, 2010 SAP AG 4

5 lv_guid type crmt_object_guid, lv_flag type boolean, ls_crm_jest type crm_jest, ls_status_wrk type CRMT_STATUS_WRK, lrf_attachments type ref to if_bol_entity_col, lrf_attachment type ref to cl_crm_bol_entity, ls_attachment_attributes type CRMT_CT_INBOX_WF_ATTACHED_ATR, lv_flag_attachment_found type boolean, lv_msg_txt TYPE string. lref_decision = me->typed_context->ddlbdeckey->collection_wrapper->get_current( ). CALL METHOD lref_decision->get_property_as_value EXPORTING iv_attr_name = lc_altkey IMPORTING ev_result = lv_decision_key. lv_decision_key is the key to understand which decision the user clicked at runtime lref_wfi?= me->typed_context->wfidet->collection_wrapper->get_current( ). CHECK lref_wfi IS BOUND. lrf_bor_objects = lref_wfi- >get_related_entities( iv_relation_name = if_crm_wf_gc=>c_wf_rel_root_bor ). * Get Workitem Attributes for checking the task id lref_wfi->get_properties( IMPORTING es_attributes = ls_wi_attributes ). case ls_wi_attributes-wi_rh_task. when lc_task5." lead Rejection Issue. if lv_decision_key = '0002'. " Rejected ls_method_param-name = lc_altkey. ls_method_param-value = lv_decision_key. APPEND ls_method_param TO lt_method_param. * Decision Execute TRY. * Execute Decision lref_wfi->execute( iv_method_name = if_crm_wf_gc=>c_wi_meth_decision it_param = lt_method_param ). " deletion of WI takes place here CATCH cx_crm_genil_model_error. * Shouldn't happen... RETURN. CATCH cx_crm_bol_meth_exec_failed. * Coludn't execute Workitem RETURN. ENDTRY. * op_back_to_embeddingcmp( ). " instead of navigating back, navigate to Lead directly * code for navigation * Get (Navigation) Decsriptor for Navigation lrf_bor_objects = lref_wfi- >get_related_entities( iv_relation_name = if_crm_wf_gc=>c_wf_rel_root_bor ). CHECK lrf_bor_objects IS BOUND. * First entity from the collection is expected to lead obj type 2010 SAP AG 5

6 lrf_bor_object = lrf_bor_objects->get_first( ). if lrf_bor_object IS BOUND. lrf_bor_object- >get_properties( IMPORTING es_attributes = ls_bor_attributes ). endif. check ls_bor_attributes is not initial. lv_guid = ls_bor_attributes-objkey. " lead Guid MOVE-CORRESPONDING ls_bor_attributes TO ls_nav_params. ls_nav_params-wi_id = ls_wi_attributes-wi_id. CALL METHOD CL_CRM_UIU_CT_IB_UI_TOOLS=>GET_NAV_DESCRPT_FRM_BOR EXPORTING IS_BOR_PARAMS = ls_nav_params IV_UI_ACTION = IF_CRM_WF_UI_GC=>C_UI_ACTION_EDIT RECEIVING RV_NAV_DESCRPT_COLL = lrf_nav_descrpt_coll EXCEPTIONS NAVIGATION_NOT_POSSIBLE = 1 others = 2. IF SY-SUBRC <> 0. * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO * WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. ENDIF. * Check whether the status has already been set to Rejected or not, only after checki ng, navigate Clear lv_flag_reject. while lv_flag_reject is initial. SELECT SINGLE * FROM CRM_JEST INTO ls_crm_jest where objnr = lv_guid and stat = lc_rej_stat. if sy-subrc = 0. lv_flag_reject = lc_checked. endif. endwhile. IF SY-SUBRC <> 0. * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO * WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. ENDIF. op_wi_execute( iv_data_collection = lrf_nav_descrpt_coll ). else. CALL METHOD SUPER->EH_ONBTN_DECISION EXPORTING HTMLB_EVENT = htmlb_event HTMLB_EVENT_EX = htmlb_event_ex. endif SAP AG 6

7 Step 3: Enhance Component GS_WLI, and enhance window controller s outbound plug OP_WI_EXECUTE, this is done as GS_WLI is the parent component of the GSWIDET. Hence the navigation to lead is eventually controlled from this component: * Fields DATA: lv_msg_txt lv_ui_object lv_ui_action * Structures, Tables DATA: lt_parameters ls_wi_attributes * References DATA: lrf_current_wi lrf_nav_descr lrf_nav_descr_obj lrf_nav_service lrf_cuco_wi lrf_msg_service DATA: lrf_bor_object lrf_bor_objects lv_flag_reject lv_guid lv_flag ls_crm_jest DATA ls_bor_attributes TYPE string, TYPE bsp_dlc_object_type, TYPE crmt_ui_actions. TYPE crmt_name_value_pair_tab, TYPE crmt_ct_inbox_wf_root_attrib. TYPE REF TO cl_crm_bol_entity, TYPE REF TO if_bol_bo_property_access, TYPE REF TO if_crm_ui_descriptor_object, TYPE REF TO if_crm_ui_navigation_service, TYPE REF TO cl_gs_wli_widata_impl, TYPE REF TO cl_bsp_wd_message_service. TYPE REF TO cl_crm_bol_entity, TYPE REF TO if_bol_entity_col, type boolean, type crmt_object_guid, type boolean, type crm_jest. TYPE crmt_ct_inbox_wf_bor_attrib. CONSTANTS: lc_task2 type SWW_TASK value 'TS ' Task found in Step 2) lc_rej_stat type crm_j_status value 'E0006', lc_checked type boolean value 'X', lc_sec type I value 10. CHECK iv_data_collection IS BOUND. * Get NavDescriptor lrf_nav_descr?= iv_data_collection->get_first( ). CHECK lrf_nav_descr IS BOUND. TRY. lrf_nav_descr_obj?= lrf_nav_descr. CATCH cx_sy_move_cast_error. ENDTRY. * Check with NavService lrf_nav_service = cl_crm_ui_navigation_service=>get_instance( me ). IF lrf_nav_service- >is_dynamic_nav_supported( ir_descriptor_object = lrf_nav_descr ) = abap_false. * Set Error Message lrf_msg_service = view_manager->get_message_service( ). lrf_nav_descr_obj?= lrf_nav_descr SAP AG 7

8 lv_ui_object = lrf_nav_descr_obj->get_ui_object_type( ). lv_ui_action = lrf_nav_descr_obj->get_ui_object_action( ). MESSAGE e000(crm_uiu_ct_ib_ui) WITH lv_ui_object lv_ui_action INTO lv_msg_txt. lrf_msg_service->add_message( iv_msg_type = sy-msgty iv_msg_id = sy-msgid iv_msg_number = sy-msgno iv_msg_v1 = sy-msgv1 iv_msg_v2 = sy-msgv2 ). RETURN. ENDIF. lrf_cuco_wi?= get_custom_controller( 'GS_WLI/WiData' ). "#EC NOTEXT lrf_current_wi?= lrf_cuco_wi->typed_context->widet->collection_wrapper- >get_current( ). CHECK lrf_current_wi IS BOUND. * Get Workitem Attributes for checking the task id lrf_current_wi->get_properties( IMPORTING es_attributes = ls_wi_attributes ). CASE ls_wi_attributes-wi_rh_task. WHEN lc_task2." lead Rejection Issue. lrf_bor_objects = lrf_current_wi- >get_related_entities( iv_relation_name = if_crm_wf_gc=>c_wf_rel_root_bor ). CHECK lrf_bor_objects IS BOUND. * First entity from the collection is expected to lead obj type lrf_bor_object = lrf_bor_objects->get_first( ). if lrf_bor_object IS BOUND. lrf_bor_object- >get_properties( IMPORTING es_attributes = ls_bor_attributes ). endif. check ls_bor_attributes is not initial. lv_guid = ls_bor_attributes-objkey. " lead Guid * Check whether the status has already been set to Rejected or not, only after checki ng, navigate Clear lv_flag_reject. while lv_flag_reject is initial. SELECT SINGLE * FROM CRM_JEST INTO ls_crm_jest where objnr = lv_guid and stat = lc_rej_stat. if sy-subrc = 0. lv_flag_reject = lc_checked. endif. endwhile. IF cl_crm_ct_inbox_wf_genil=>is_wi_valid( is_wi_root_attributes = ls_wi_attribu tes iv_no_msg = abap_true ) = abap_false. lrf_current_wi->delete( ). ENDIF. WAIT UP TO lc_sec SECONDS. * Trigger Navigation op_uiu_application( iv_data_collection = iv_data_collection ) SAP AG 8

9 WHEN OTHERS. CALL METHOD SUPER->OP_WI_EXECUTE EXPORTING IV_DATA_COLLECTION = IV_DATA_COLLECTION. ENDCASE. Step 4: Minor adjustments to workflow definitions: Ensure that the soon after the Decision step, there is no dialog step (as the navigation is now handled via the UI enhancements). Note: this piece of code couldn t be used as it is for any similar issues, this solution address only a specific problem and cannot be treated as general solution for the Advance with Dialog Issue SAP AG 9

10 Results Once the UI enhancements and minor workflow adjustments are made, it s now possible to navigate to the lead directly once the lead is rejected. Below is the decision work-item to accept or reject the lead, on rejection the user is directly navigated to the lead transaction from the CRM work-list: 2010 SAP AG 10

11 Thus it s possible to navigate to the lead directly from the CRM work-list even if the Advance with Dialog is not supported. However, this solution cannot be generic and is to be handled in a case to case basis. Conclusions By performing some UI enhancements and minor workflow definition adjustments, it s still possible to realize the concept of Advance with Dialog even though it s not originally supported within the CRM work-list. However, this cannot be a generic solution and is to be done and is to be handled on a case to case basis SAP AG 11

12 Related Content My Project experience For more information, visit the Customer Relationship Management homepage SAP AG 12

13 Copyright Copyright 2010 SAP AG. All rights reserved. No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG. The information contained herein may be changed without prior notice. Some software products marketed by SAP AG and its distributors contain proprietary software components of other software vendors. Microsoft, Windows, Excel, Outlook, and PowerPoint are registered trademarks of Microsoft Corporation. IBM, DB2, DB2 Universal Database, System i, System i5, System p, System p5, System x, System z, System z10, System z9, z10, z9, iseries, pseries, xseries, zseries, eserver, z/vm, z/os, i5/os, S/390, OS/390, OS/400, AS/400, S/390 Parallel Enterprise Server, PowerVM, Power Architecture, POWER6+, POWER6, POWER5+, POWER5, POWER, OpenPower, PowerPC, BatchPipes, BladeCenter, System Storage, GPFS, HACMP, RETAIN, DB2 Connect, RACF, Redbooks, OS/2, Parallel Sysplex, MVS/ESA, AIX, Intelligent Miner, WebSphere, Netfinity, Tivoli and Informix are trademarks or registered trademarks of IBM Corporation. Linux is the registered trademark of Linus Torvalds in the U.S. and other countries. Adobe, the Adobe logo, Acrobat, PostScript, and Reader are either trademarks or registered trademarks of Adobe Systems Incorporated in the United States and/or other countries. Oracle is a registered trademark of Oracle Corporation. UNIX, X/Open, OSF/1, and Motif are registered trademarks of the Open Group. Citrix, ICA, Program Neighborhood, MetaFrame, WinFrame, VideoFrame, and MultiWin are trademarks or registered trademarks of Citrix Systems, Inc. HTML, XML, XHTML and W3C are trademarks or registered trademarks of W3C, World Wide Web Consortium, Massachusetts Institute of Technology. Java is a registered trademark of Sun Microsystems, Inc. JavaScript is a registered trademark of Sun Microsystems, Inc., used under license for technology invented and implemented by Netscape. SAP, R/3, SAP NetWeaver, Duet, PartnerEdge, ByDesign, SAP Business ByDesign, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and other countries. Business Objects and the Business Objects logo, BusinessObjects, Crystal Reports, Crystal Decisions, Web Intelligence, Xcelsius, and other Business Objects products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of Business Objects S.A. in the United States and in other countries. Business Objects is an SAP company. All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary. These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty SAP AG 13