crm worklist: advance with dialog not supported worklist...crm worklist: advance with dialog not...

13
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com © 2010 SAP AG 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 2006. 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.

Upload: others

Post on 27-Jan-2020

27 views

Category:

Documents


0 download

TRANSCRIPT

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com

© 2010 SAP AG 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: 18th 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 2006. 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.

CRM Worklist: Advance with Dialog not Supported

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com

© 2010 SAP AG 2

Table of Contents

Summary............................................................................................................................................................. 3

Detailed Description ........................................................................................................................................ 4 Step 1: ......................................................................................................................................................................... 4

Step 2: ......................................................................................................................................................................... 4

Step 3: ......................................................................................................................................................................... 7

Step 4: ......................................................................................................................................................................... 9

Results. ............................................................................................................................................................. 10

Conclusions ...................................................................................................................................................... 11

Related Content ................................................................................................................................................ 12

Copyright........................................................................................................................................................... 13

CRM Worklist: Advance with Dialog not Supported

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com

© 2010 SAP AG 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:

CRM Worklist: Advance with Dialog not Supported

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com

© 2010 SAP AG 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 TS95808159

Step 2:

Enhance Component GSWIDET/btnDec and event handler EH_ONBTN_DECISION

*Constants Declarations

lc_task1 type SWW_TASK value 'TS95508159',“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 TYPE crmt_ct_inbox_wf_root_attrib,

ls_bor_attributes TYPE crmt_ct_inbox_wf_bor_attrib,

ls_execobj_attributes TYPE crmt_ct_inbox_wf_execobj_attr,

ls_nav_params TYPE crmt_ct_ib_bor_to_ui_nav,

lrf_nav_descrpt_coll TYPE REF TO if_bol_bo_col,

lref_decision TYPE REF TO if_bol_bo_property_access,

lv_decision_key TYPE swr_decikey,

lref_wfi TYPE REF TO cl_crm_bol_entity,

lref_wfi_copy TYPE REF TO cl_crm_bol_entity,

lt_method_param TYPE crmt_name_value_pair_tab,

ls_method_param TYPE crmt_name_value_pair,

lrf_bor_object TYPE REF TO cl_crm_bol_entity,

lrf_bor_objects TYPE REF TO if_bol_entity_col,

lv_flag_reject type boolean,

CRM Worklist: Advance with Dialog not Supported

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com

© 2010 SAP AG 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

CRM Worklist: Advance with Dialog not Supported

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com

© 2010 SAP AG 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.

CRM Worklist: Advance with Dialog not Supported

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com

© 2010 SAP AG 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 TYPE string,

lv_ui_object TYPE bsp_dlc_object_type,

lv_ui_action TYPE crmt_ui_actions.

* Structures, Tables

DATA: lt_parameters TYPE crmt_name_value_pair_tab,

ls_wi_attributes TYPE crmt_ct_inbox_wf_root_attrib.

* References

DATA: lrf_current_wi TYPE REF TO cl_crm_bol_entity,

lrf_nav_descr TYPE REF TO if_bol_bo_property_access,

lrf_nav_descr_obj TYPE REF TO if_crm_ui_descriptor_object,

lrf_nav_service TYPE REF TO if_crm_ui_navigation_service,

lrf_cuco_wi TYPE REF TO cl_gs_wli_widata_impl,

lrf_msg_service TYPE REF TO cl_bsp_wd_message_service.

DATA: lrf_bor_object TYPE REF TO cl_crm_bol_entity,

lrf_bor_objects TYPE REF TO if_bol_entity_col,

lv_flag_reject type boolean,

lv_guid type crmt_object_guid,

lv_flag type boolean,

ls_crm_jest type crm_jest.

DATA ls_bor_attributes TYPE crmt_ct_inbox_wf_bor_attrib.

CONSTANTS: lc_task2 type SWW_TASK value 'TS95808159'” 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.

CRM Worklist: Advance with Dialog not Supported

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com

© 2010 SAP AG 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 ).

CRM Worklist: Advance with Dialog not Supported

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com

© 2010 SAP AG 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.

CRM Worklist: Advance with Dialog not Supported

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com

© 2010 SAP AG 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:

CRM Worklist: Advance with Dialog not Supported

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com

© 2010 SAP AG 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.

CRM Worklist: Advance with Dialog not Supported

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com

© 2010 SAP AG 12

Related Content

My Project experience

For more information, visit the Customer Relationship Management homepage.

CRM Worklist: Advance with Dialog not Supported

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com

© 2010 SAP AG 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.