Upload
chuckyez
View
402
Download
17
Embed Size (px)
Citation preview
8/20/2019 Case Management With ArchiveLink Integration CRM WebUI
1/39
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 1
Case Management withArchiveLink Integration in CRMWeb UI
Applies to:
SAP CRM 7.0. For more information, visit the Customer Relationship Management homepage.
Summary
This document is about how documents stored using ArchiveLink interface can be integrated into CRM WebClient UI by making use of Case Management. The scenario explained here highlights the use of RecordsManagement feature of Case to view and access the documents from CRM Web UI.
Author: Shyamnath Janardhanan
Company: SAP Global Delivery
Created on: 14 July 2011
Author Bio
Shyamnath Janardhanan is a Senior Consultant at SAP Global Delivery, India. He has got 12 plus years ofexperience handling multiple SAP implementations and upgrade projects across different industries and SAPsolutions, focusing primarily on ABAP.
https://www.sdn.sap.com/irj/sdn/bpx-crmhttps://www.sdn.sap.com/irj/sdn/bpx-crmhttps://www.sdn.sap.com/irj/sdn/bpx-crmhttps://www.sdn.sap.com/irj/sdn/bpx-crm
8/20/2019 Case Management With ArchiveLink Integration CRM WebUI
2/39
Case Management with ArchiveLink Integration in CRM Web UI
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 2
Table of Contents
Introduction ......................................................................................................................................................... 3
Audience ............................................................................................................................................................. 3
Purpose ............................................................................................................................................................... 3
Document Structure ............................................................................................................................................ 3
Issue in CRM Web UI ......................................................................................................................................... 4
CRM Case Creation ........................................................................................................................................ 4
Attaching Documents to Case ........................................................................................................................ 5
View Document Link and Display from Case Management ............................................................................ 7
View Document Link and Display from Case Management ............................................................................ 8
How to Fix the Issue ........................................................................................................................................... 9
Implicit Enhancement – One ........................................................................................................................... 9
Implicit Enhancement – Two ......................................................................................................................... 10
Implicit Enhancement – Three ...................................................................................................................... 11
Modification in BSP Component Workbench ................................................................................................ 13
Result – Case from CRM Web UI ..................................................................................................................... 16
Appendix ........................................................................................................................................................... 17
Configuration of ArchiveLink ......................................................................................................................... 17
Configuration of ArchiveLink Element Type .................................................................................................. 18
Configuration of Record Model for Case ....................................................................................................... 20
Configuration for Record Model Element Type ............................................................................................. 27
Link Record Model to Case Type .................................................................................................................. 30
Activating the Trigger for the ASSIGNED Event ........................................................................................... 31
Setting Up the Event-Receiver Linkage ........................................................................................................ 32
Related Content ................................................................................................................................................ 38
Copyright........................................................................................................................................................... 39
8/20/2019 Case Management With ArchiveLink Integration CRM WebUI
3/39
Case Management with ArchiveLink Integration in CRM Web UI
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 3
Introduction
NetWeaver AS supports integration of documents generated in SAP to external archives using ArchiveLinkinterface and also to store the link as an electronic record in Case Management for later retrieval and review.In CRM scenarios end users would only have access to Web UI for viewing the archived documents. So thebad news is that Case Management with ArchiveLink integration is not supported in CRM Web UI, eventhough the same is supported in SAP Basis Case Management (backend). This document explains on whatdevelopment enhancements you need to take care of for bridging this gap in Case Management for CRM
Web UI.
Audience
Target group intended:
Project Team members who want to know about implementing document storage requirements in CRM andhow they can be linked to CRM Web UI.
A background on the following is desired:
1. Basics of NetWeaver components: ArchiveLink, Case Management and Record Models
2. CRM UI Basics
3. ABAP fundamentals
Purpose
Documents stored via ArchiveLink interface can be viewed from the CRM Case Management in SAPgui byclicking on the document link in Case. But there is an issue; the same Case when viewed from CRM Web UIwill not show the document link as SAP does not support the same for CRM Web UI. With a few lines ofcode in certain implicit enhancements you could achieve this.
Document Structure
The document is structured into four sections. The first section shows you what the actual problem is givingyou details on what gap we are talking about. The second section focuses on what implicit enhancementsyou need to take care of to close the gaps. The third section is to show you the result of these steps. The
fourth section is Appendix to give some background information on how to set up the CRM environment.
8/20/2019 Case Management With ArchiveLink Integration CRM WebUI
4/39
Case Management with ArchiveLink Integration in CRM Web UI
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 4
Issue in CRM Web UI
To show the issue, first we‟ll create a Case in CRM system. After that a document will be attached to theCase record model from SAPgui and then the document will be viewed from the Case in SAPgui. Finally we‟ll take a look at the same Case in CRM Web UI where you will see what the issue is.
Note: There are certain prerequisites to be met for simulating the steps below like configuration for Case type andRecord models etc. If you are not familiar with these then you can refer to the appendix for details on how to
complete the configuration part.
CRM Case Creation
Case can be created via transaction SCASE. Navigate to the folder path shown below and click on „Create‟in the context menu to create a new Case.
On the next screen choose any Case type which is already configured. In this case we are selecting the pre-configured Case type ZCRM.
You will see the newly created Case in edit mode in the right navigation panel. Here you should click on savebutton and then click on the button for „Linked Objects‟ to view the record model structure with the placeholders for documents. Here you can see that there are four different documents configured in the recordmodel and none of them are having documents currently assigned to it.
8/20/2019 Case Management With ArchiveLink Integration CRM WebUI
5/39
Case Management with ArchiveLink Integration in CRM Web UI
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 5
Result
You have create a new Case 25036978 of type ZCRM with basic information and has a record model called„Loan Documents‟ linked to it where it has got 4 nodes/place holders for holding 4 different types ofdocuments.
Attaching Documents to Case
Go to transaction OAAD and click on button „Store and Assign‟ to create archivelink documents for the Case.
8/20/2019 Case Management With ArchiveLink Integration CRM WebUI
6/39
Case Management with ArchiveLink Integration in CRM Web UI
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 6
Give the business object as BUS20900 (business object for Case) and choose a document typecorresponding to the one available in the record model for Case. Here we have chosen ZFS3083 whichcorresponds to „Supplementary Statement of Disclosure‟ in the Case record model.
Click on „Create‟ button which would then prompt to enter the Case ID. Here give the Case I D for the Casecreated in step 1.1 above. You could get the guid for the Case from table SCMG_T_CASE_ATTR.
On continuing you will get the popup to select the document to be attached. Here we are selecting thedocument „F3083 Supplementary statement of disclosure‟.
After storing the document successfully you will get the following screen with details on the storedparameters under the section „Link entry‟. Here the object key is the unique guid for the Case created above.
8/20/2019 Case Management With ArchiveLink Integration CRM WebUI
7/39
Case Management with ArchiveLink Integration in CRM Web UI
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 7
An entry is created in table TOA01 for every document stored using ArchiveLink services. So the above linkentry can be verified in the table TOA01 for the key fields returned by transaction OAAD.
Since the system is configured to raise the ASSIGNED event for every document stored using ArchiveLinkservices for business object BUS20900, a workflow event will be triggered which can be verified usingtransaction SWEL (event trace). Here you can note that the status in green which means that the receiverfunction module ZZCRM_ALINK_RECMODEL_INS was called and executed successfully.
View Document Link and Display from Case Management
You can check the Case in transaction SCASE to view the Case 25036978 (created in step 1.1 above). Clickon the linked objects button to view the record model. Expand the node for loan documents and you can seethat the document link is store under the configured model node in the record model. Similarly you could addmore documents in transaction OAAD for other document types and verify here.
Double click on the document record to view the document content.
8/20/2019 Case Management With ArchiveLink Integration CRM WebUI
8/39
Case Management with ArchiveLink Integration in CRM Web UI
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 8
View Document Link and Display from Case Management
Now let‟s view the same Case from CRM Web UI. You need to log into the CRM Web UI first and search forthe Case. The Case will be displayed in the result list.
8/20/2019 Case Management With ArchiveLink Integration CRM WebUI
9/39
Case Management with ArchiveLink Integration in CRM Web UI
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 9
Case details are displayed where the record model can be seen. The issue here is that there are nodocument links found under the node for „Supplementary Statement of Disclosure‟. The same node showsthe document link when viewed from SAPgui as you can see in 1.3 above.
How to Fix the Issue
Implicit Enhancement – One
In SE24 display the class CL_CRM_CMG_API and navigate to the method GET_RECORD_HIERARCHY.
Go the line where the class method cl_crm_cmg_util=>get_srm_sps is called. Double click and go inside thismethod.
8/20/2019 Case Management With ArchiveLink Integration CRM WebUI
10/39
Case Management with ArchiveLink Integration in CRM Web UI
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 10
Get to the implicit enhancement just before method ends and implement a new enhancement to add thefollowing lines of code, as you can see in the screenshot. Once this is done get back to the methodGET_RECORD_HIERARCHY.
DATA: lv_rmodel_flg TYPE c VALUE 'X'.
EXPORT rmodel_flg FROM lv_rmodel_flg TO MEMORY ID 'RMODEL'.
es_spsde-spid = 'SCMG_SP_BOR'.
Implicit Enhancement – Two
Go to the line where the method lr_poid->get_sp_poid( ) is called and double click to go inside the method.
Switch to enhancement mode, find the implicit enhancement just before ENDMETHOD and implement theimplicit enhancement to add the following lines of code. Once completed come out to get back to the methodGET_RECORD_HIERARCHY.
8/20/2019 Case Management With ArchiveLink Integration CRM WebUI
11/39
Case Management with ArchiveLink Integration in CRM Web UI
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 11
DATA: ls_sp_poid TYPE srmpoid,
lv_rmodel_flg TYPE c.
IMPORT rmodel_flg TO lv_rmodel_flg FROM MEMORY ID 'RMODEL'.
IF lv_rmodel_flg = 'X'.
ls_sp_poid-id = 'BOR_OBJECT_ID'.
ls_sp_poid-value = '4D8816829DDE07F0E10080000A78382D'.
* Only add an entry if it does not already exist
READ TABLE re_sp_poid WITH KEY id = 'BOR_OBJECT_ID' TRANSPORTING NO FIELDS.
IF sy-subrc 0.
INSERT ls_sp_poid INTO TABLE re_sp_poid.
ENDIF.
ENDIF.
DELETE FROM MEMORY ID 'RMODEL'.
Implicit Enhancement – Three
Switch to enhancement mode while in GET_RECORD_HIERARCHY method and implement the implicitenhancement just before the ENDMETHOD line to insert the below lines of code. Activate the enhancementand return.
TYPES: BEGIN OF ty_model_id,
id TYPE char100,
END OF ty_model_id.
DATA: ls_elem_attributes TYPE srmxmlar,
lv_crep_id TYPE char2,
lv_doc_class TYPE char20,
8/20/2019 Case Management With ArchiveLink Integration CRM WebUI
12/39
Case Management with ArchiveLink Integration in CRM Web UI
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 12
lv_doc_id TYPE char40,
lv_doc_desc TYPE char50,
lv_lastmoduser TYPE char20,
lv_deal_type TYPE zz_deal_type,
lv_lastmoddate TYPE char10,
lv_lastmodtime TYPE char8,
lv_case_ref TYPE REF TO if_scmg_case_api.
LOOP AT et_all_fields ASSIGNING
WHERE sp_id = 'SCMG_SP_AL_DOCUMENT'.
LOOP AT -elem_attributes INTO ls_elem_attributes.
CASE ls_elem_attributes-name.
WHEN 'lastModUser'.
lv_lastmoduser = ls_elem_attributes-val.
WHEN 'lastModDate'.
lv_lastmoddate = ls_elem_attributes-val.
WHEN 'lastModTime'.
lv_lastmodtime = ls_elem_attributes-val.
WHEN 'CREP_ID'.
lv_crep_id = ls_elem_attributes-val.
WHEN 'ANCHOR'.
lv_doc_class = ls_elem_attributes-val.
WHEN 'DOC_ID'.lv_doc_id = ls_elem_attributes-val.
WHEN 'DOC_DESC'.
lv_doc_desc = ls_elem_attributes-val.
ENDCASE.
ENDLOOP.
-shorttext = 'Document'.
* Assigning the case guid
-bor_key = -object_key(32).
* Clearing the default value in this field
CLEAR -field2.
* Description for the document newly inserted
-field1 = lv_doc_desc.
* Update details on last modified user, date and time
-field4 = lv_lastmoduser.
CONCATENATE lv_lastmoddate lv_lastmodtime INTO -field5
SEPARATED BY space.
* Info fields are updated with Content rep ID, Document class and Archive doc ID
* This will be later used in the event for displaying archive doc in a pop-up
-info1 = lv_crep_id.
-info2 = lv_doc_class.
-info3 = lv_doc_id.
ENDLOOP.
CLEAR et_tech_fields.
LOOP AT et_all_fields ASSIGNING .
MOVE-CORRESPONDING TO ls_tech_fields.
APPEND ls_tech_fields TO et_tech_fields.
ENDLOOP.
8/20/2019 Case Management With ArchiveLink Integration CRM WebUI
13/39
Case Management with ArchiveLink Integration in CRM Web UI
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 13
Modification in BSP Component Workbench
Access the BSP component workbench to make modification to the custom enhancement set created forcomponent CRMCMP_CMG. This custom enhancement set would already be available or you would havealready created this as part of CRM Web UI configuration for Case display. Here as an example we areshowing the enhancement set ZZZZCS.
Expand the node for „Views‟.
Select the view „CRMCMP_CMG/RecordTree‟ to display the hierarchy on the right section. On the rightsection expand the nodes highlighted in yellow.
8/20/2019 Case Management With ArchiveLink Integration CRM WebUI
14/39
Case Management with ArchiveLink Integration in CRM Web UI
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 14
Continued from above screenshot; finally arrive at the attribute FIELD1 where you will have to re-define themethod GET_P_FIELD1 by selecting redefine from the context menu.
Method GET_P_FIELD1 should be redefined and the following lines of code should be added to theredefined method. This would ensure that the URL would open up in a new browser window to display thedocument.
CONSTANTS: lc_info1 TYPE name_komp VALUE 'INFO1',
lc_info3 TYPE name_komp VALUE 'INFO3',
lc_x TYPE char1 VALUE 'X',
lc_f TYPE char1 VALUE 'F'.
DATA: lr_entity TYPE REF TO if_bol_bo_property_access,lv_info1 TYPE string,
lv_info3 TYPE string,
lv_url TYPE saeuri,
lv_crep_id TYPE saearchivi,
lv_arcdoc_id TYPE saeardoid.
lr_entity ?= me->bo.
CHECK lr_entity IS BOUND.
* Get property INFO1 - which is content rep ID e.g. 'ZB'
CALL METHOD lr_entity->get_property_as_string
EXPORTING
iv_attr_name = lc_info1
RECEIVING
rv_result = lv_info1.
* Get property INFO3 - which is the archive doc ID
CALL METHOD lr_entity->get_property_as_string
EXPORTING
iv_attr_name = lc_info3
RECEIVING
8/20/2019 Case Management With ArchiveLink Integration CRM WebUI
15/39
Case Management with ArchiveLink Integration in CRM Web UI
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 15
rv_result = lv_info3.
lv_crep_id = lv_info1.
lv_arcdoc_id = lv_info3.
CLEAR lv_url.
* Get URL for ArchiveLink document
CALL FUNCTION 'SCMS_AO_URL_READ'
EXPORTING
arc_id = lv_crep_id
doc_id = lv_arcdoc_id
http_url_only = lc_x
loc_info = lc_f
IMPORTING
url = lv_url
EXCEPTIONS
error = 1
OTHERS = 2.
CASE iv_property.
WHEN if_bsp_wd_model_setter_getter=>fp_fieldtype.* Assign property of FIELD1 as hyperlink
rv_value = cl_bsp_dlc_view_descriptor=>field_type_link.
WHEN if_bsp_wd_model_setter_getter=>fp_onclick.
* Assign URL to the hyperlink field FIELD1
rv_value = lv_url.
ENDCASE.
8/20/2019 Case Management With ArchiveLink Integration CRM WebUI
16/39
Case Management with ArchiveLink Integration in CRM Web UI
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 16
Result – Case from CRM Web UI
After ensuring that the above modifications and enhancements are made, rerun the Case from CRM Web UIto see the results. Go the same steps as in 1.4 above to view the record model for Case. Here you can seethat the document is found under the node this time.
On clicking the hyperlink in description 1, you will see the document display in a separate browser window asshown below.
8/20/2019 Case Management With ArchiveLink Integration CRM WebUI
17/39
Case Management with ArchiveLink Integration in CRM Web UI
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 17
Appendix
The steps shown below indicate the configurations and settings required for getting started with the Casecreation in CRM system.
Configuration of ArchiveLink
ArchiveLink is a service integrated in the SAP Web Application Server for linking archived documents andthe application documents entered in the SAP system. Basic ArchiveLink settings can be done in SPRO inthe path shown below. The three main steps are highlighted which are the required steps.
Define a content repository ZB which is a HTTP content server that points to a third party physical directory.The highlighted fields below are specific to the destination server which you need to know while configuringthe content repository.
8/20/2019 Case Management With ArchiveLink Integration CRM WebUI
18/39
Case Management with ArchiveLink Integration in CRM Web UI
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 18
Define new document types for each document that are going to be generated from SAP and which are to bestored into external archive. In this example we are considering 4 document types which are newly createdas shown below. Select the new entries button and add the following entries. The document class is currentlyentered as „*‟ as it indicates that the document can be of any type, PDF, DOC, XLS etc.
Define linkages in the next step. Here we link the business object for Case (BUS20900) with the newdocument types defined in the step above, specify to which content repository the document should be sentto and also the table for relationship storage (TOA01). For any other new document types for the BPbusiness object you just need to keep copying any of these entries and keep changing only the documenttypes.
Result
You have created a new content repository ZB, new document types and linked them to business objectBUS20900 and have assigned table TOA01 to store the linkage.
Configuration of ArchiveLink Element Type
It is in the Registry where you define the ArchiveLink element type, which is to define on how the linkingshould work to the external archive for a Case. In transaction SRMREGEDIT, under the area S_AREA_CMGexpand the node for service provider SCMG_SP_AL_DOCUMENT. Right click on the element typeSCMG_SPS_AL_DOCUMENT and select copy from the context menu to create a new element typeZZCRM_SPS_AL_DOCUMENT and save the entry.
8/20/2019 Case Management With ArchiveLink Integration CRM WebUI
19/39
Case Management with ArchiveLink Integration in CRM Web UI
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 19
This creates a new entry for element type in the hierarchy. Double click on this new element type to editfurther.
On the classification tab, get into change mode and create a new entry for parameter id for RMS_ID byclicking the „Create‟ button. Choose the RMS_ID (Record Management System ID) parameter value asCRM_CMG_DATA since we will be using CRM_CMG_DATA for our Case scenario. Make sure that youremove any other parameter value for RMS_ID which was defaulted by system while this element type wascreated.
8/20/2019 Case Management With ArchiveLink Integration CRM WebUI
20/39
Case Management with ArchiveLink Integration in CRM Web UI
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 20
The element type would then be updated with the new values for parameter id RMS_ID as follows
Result
You have created a new ArchiveLink element type ZZCRM_SPS_AL_DOCUMENT.
Configuration of Record Model for Case
To model the structure of the case content you should create a Record Model for case. For this go totransaction SCASE. Make sure you are in the Record Model System CRM_CMG_DATA by clicking on thechange RMS button as shown below and entering CRM_CMG_DATA.
8/20/2019 Case Management With ArchiveLink Integration CRM WebUI
21/39
Case Management with ArchiveLink Integration in CRM Web UI
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 21
Now you are in the records management system for CRM Case. On the left panel navigate to the node asshown below to create a new record model for case.
This would create a default structure with two nodes “Worklist” which is a structure node and “WorklistElement” which is a model node. The attributes of these nodes can be edited by double clicking on thenodes. This would show the attribute editing screen on the right window panel.
8/20/2019 Case Management With ArchiveLink Integration CRM WebUI
22/39
Case Management with ArchiveLink Integration in CRM Web UI
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 22
Change the description of the structure node to „Loan Documents‟ by changing the description and clickingthe enter button. The description would then get updated in the model structure. The node type can be keptas structure node. Leave other parameter values as is.
Now for the model node the following changes have to be made.
Description - update as „Supplementary Statement of Disclosure‟
Element type - there is a drop down menu to select the element type. Here expand the node for archiveddocuments and select the element type „ZZCRM_SPS_AL_DOCUMENT‟ created in the previous step 4.2.
8/20/2019 Case Management With ArchiveLink Integration CRM WebUI
23/39
Case Management with ArchiveLink Integration in CRM Web UI
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 23
Relationship - from the drop down menu for available relations select „Document‟.
Attribute for Anchor - update the attribute for ANCHOR as the document type defined about for thisparticular document, ZFS3083, defined in step 4.1 above.
After these updates are done select the enter button to update these attributes to the model node. On thetoolbar for the record model, select the icon to save the record model.
8/20/2019 Case Management With ArchiveLink Integration CRM WebUI
24/39
Case Management with ArchiveLink Integration in CRM Web UI
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 24
At this moment you will be prompted to enter the description and unique ID. Give short description as „Loans‟which will be the name of your record model. For unique ID, click the drop down menu and system willautomatically generate a 32 character guid for you. Continue by choosing enter button.
Now the model will look shown below. Notice that the status icon has now moved to green.
8/20/2019 Case Management With ArchiveLink Integration CRM WebUI
25/39
Case Management with ArchiveLink Integration in CRM Web UI
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 25
Similarly create new model nodes for other documents that are required to be stored in this record model.For this, select the last node and go to the toolbar menu path to create a new node after the current node onthe same level.
In this example we have created four model nodes in total using the same steps shown above. Note thedocument descriptions and the related anchor attributes which reflects the document types for the respectivedocuments which are defined in step 4.1 above.
Also note in the above screen shot that the current status of the record model is „Initial‟. To make it ready forusage in Cases, it should be in „Released‟ status. To change the status select the menu as shown below andcontinue after selecting the „Status Released‟ radio button.
8/20/2019 Case Management With ArchiveLink Integration CRM WebUI
26/39
Case Management with ArchiveLink Integration in CRM Web UI
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 26
You would now see the status as released in the status of the record model. At this stage you could lockthe record model into a transport request by choosing the menu Model Administration Transportentry. This will then prompt for entering the transport request.
Once saved into a transport request the record model will be locked for any further changes. You willhave to release the transport request before making any changes to the record model.
The next step is to note the document ID of the record model for updating configuration for Case at alater stage. Go to the history panel on the left side whether the created record model will be seen. Selectthe record model „Loans‟, right click to get the context menu and click „Information‟ to get the informationpop-up where you‟ll have to take note of the document ID.
In this case the value is:
Document ID SRM_MOD02 4DDFFFBBB68F0D20E10080000A78382D
Result
You have created a new Record Model for Case called Loans.
8/20/2019 Case Management With ArchiveLink Integration CRM WebUI
27/39
Case Management with ArchiveLink Integration in CRM Web UI
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 27
Configuration for Record Model Element Type
New element type for Case Records should be created in transaction SRMREGEDIT. Go to the node forservice provider SCMG_SP_CASE_RECORD and copy the element type SCMG_SPS_CASE_RECORD tocreate a new element type ZZCRM_SPS_CASE_RECORD by choosing the copy functionality from thecontext menu.
8/20/2019 Case Management With ArchiveLink Integration CRM WebUI
28/39
Case Management with ArchiveLink Integration in CRM Web UI
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 28
The new element type will be copied over and created where you can update the name and description.Click on save to create the new element type.
Get into the edit mode of this newly created element type; go to tab „Connection Parameter Values‟ toredefine the values for parameter MODEL_ID. MODEL_ID is the actual record model created in step 4.3above. Choose the parameter MODEL_ID and click change button to enter the record model id. On the pop-up select the area parameter value CRM_CMG_DATA and proceed ahead.
8/20/2019 Case Management With ArchiveLink Integration CRM WebUI
29/39
Case Management with ArchiveLink Integration in CRM Web UI
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 29
In this pop-up enter the document ID of the record model noted in step 4.3 above and continue.
The element type with the updated values will look like below.
Result
You have created a new record model element type ZZCRM_SPS_CASE_RECORD and have assignedthe newly record model „Loans‟ to it.
8/20/2019 Case Management With ArchiveLink Integration CRM WebUI
30/39
Case Management with ArchiveLink Integration in CRM Web UI
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 30
Link Record Model to Case Type
The record model created in step above should now be linked to a Case Type. Navigate to the node belowfrom SPRO.
Create a new case type ZCRM with the essential values highlighted as shown below. Take special note ofthe parameters below:
Case Rec. Model - should be updated with the Document ID of the record model created instep 4.3.
Element Type ID (Rec.) - should be updated with the element type for record model in step 4.4.
The other parameters should be as seen below. If not creating a new one from scratch, you could copy and
create from the existing case type DEMO which is a standard case type for demo purpose and makechanges to the highlighted fields below to reflect the newly defined values.
8/20/2019 Case Management With ArchiveLink Integration CRM WebUI
31/39
Case Management with ArchiveLink Integration in CRM Web UI
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 31
Result
You have created a new Case type ZCRM and have assigned the record model „Loans‟ to it.
Activating the Trigger for the ASSIGNED Event
In the ArchiveLink Customizing settings in transaction OAG1 (in the Implementation Guide (IMG), chooseSAP Web Application Server → ArchiveLink → Customizing Enhancements → Maintain All Basic Settings),activate the trigger of the ASSIGNED event.
8/20/2019 Case Management With ArchiveLink Integration CRM WebUI
32/39
Case Management with ArchiveLink Integration in CRM Web UI
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 32
Setting Up the Event-Receiver Linkage
When you link an event and a receiver, you specify which event causes a reaction for which business object.You link events and receivers in transaction SWETYPV (from the SAP Easy Access screen, choose Tools →Business Workflow → Development → Definition Tools → Events → Event Linkages → Type Linkages.
Make the following entries:
Object Type BUS20900Event ASSIGNED
Receiver call Function module
Receiver Function Module Name of a function module that executes the reaction to the eventThe receiver function module must be created as a copy of thetemplate function module SWE_TEMPLATE_REC_FB. Thisfunction module is included in the function groupSWE_TEMPLATE.
The interface is described in the documentation about thetemplate function module. The Remote-Enabled Module flag mustbe set in the attributes of the receiver function module.
Check Function Module (Optional) Name of a function module that you need to develop. You enter acheck function module to decide whether the receiver functionmodule needs to be called. You can make use of the data in theevent container. If an exception is triggered when a check functionmodule is executed, then the event is not linked to the receiver,and the receiver function module is not executed.
The check function module must be created as a copy of thetemplate function module SWE_TEMPLATE_CHECK_FB. Thisfunction module is included in the function groupSWE_TEMPLATE.
The interface is described in the documentation about thetemplate function module.
Linkage Activated Activate the Flag
The configuration will look like below once the entries are made.
8/20/2019 Case Management With ArchiveLink Integration CRM WebUI
33/39
Case Management with ArchiveLink Integration in CRM Web UI
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 33
The custom logic to be written inside the function module is attached below. The custom function modulereceives the event, gets the record model for the BP for which the event is raised, creates a record entry intothe record model for the ArchiveLink entry and saves the record model. Refer to the sample code below forthe receiver function module.
Sample Code:
FUNCTION zzcrm_alink_recmodel_ins.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" VALUE(EVENT) LIKE SWETYPECOU-EVENT
*" VALUE(RECTYPE) LIKE SWETYPECOU-RECTYPE
*" VALUE(OBJTYPE) LIKE SWETYPECOU-OBJTYPE
*" VALUE(OBJKEY) LIKE SWEINSTCOU-OBJKEY
*" VALUE(EXCEPTIONS_ALLOWED) LIKE SWEFLAGS-EXC_OK DEFAULT SPACE
*" EXPORTING
*" VALUE(REC_ID) LIKE SWELOG-RECID
*" TABLES
*" EVENT_CONTAINER STRUCTURE SWCONT
*" EXCEPTIONS
*" TEMP_ERROR
*" ANY_ERROR
*"----------------------------------------------------------------------
* INCLUDE .
DATA: c_documentclass TYPE bapidclass VALUE 'SCMG01',
c_archive_sps_id TYPE bapisrmrec-spsid VALUE 'ZZCRM_SPS_AL_DOCUMENT'.
DATA: lt_property_selection TYPE TABLE OF bapipropqy,
lt_resulting_list TYPE TABLE OF bapidoctab,
lt_element_sp_poid TYPE TABLE OF bapiproptb,lt_element_properties TYPE TABLE OF bapiproptb,
ls_element_properties TYPE bapiproptb,
lwa_property_selection TYPE bapipropqy,
lwa_resulting_list TYPE bapidoctab,
lwa_element_sp_poid TYPE bapiproptb,
lv_case_guid TYPE scmg_case_guid,
lv_record_pdir TYPE scmg_record_pdir_id,
lv_anchor TYPE bapisrmrec-anchor,
lv_crep_id TYPE bapipropva,
lv_doc_class TYPE bapipropva,
lv_doc_id TYPE bapipropva,lv_doc_desc TYPE bapipropva,
lv_return TYPE bapiret2,
lv_objecttext TYPE bapiedescr,
lv_rtime01 TYPE i,
lv_rtime02 TYPE i,
lv_rtime_diff TYPE i.
* Get case type and physical dir id for the case
8/20/2019 Case Management With ArchiveLink Integration CRM WebUI
34/39
Case Management with ArchiveLink Integration in CRM Web UI
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 34
lv_case_guid = objkey.
SELECT SINGLE b~record_pdir INTO lv_record_pdir
FROM scmg_t_case_attr AS a
JOIN scmg_t_case AS b
ON b~case_guid = a~case_guid
WHERE a~case_guid = lv_case_guid.
* Set property table
lwa_property_selection-propname = 'SRM_POID_ID'.
lwa_property_selection-sign = 'I'.
lwa_property_selection-option = 'EQ'.
lwa_property_selection-propval_lo = lv_record_pdir.
APPEND lwa_property_selection TO lt_property_selection.
* Retrieve correct record model for BP
CALL FUNCTION 'BAPI_RECORD_GETLIST'
EXPORTING
rms_id = 'CRM_CMG_DATA'
sps_id = 'ZZCRM_SPS_CASE_RECORD'
IMPORTING
return = lv_return
TABLESproperty_selection = lt_property_selection
resulting_list = lt_resulting_list.
* Get the data from event container
LOOP AT event_container.
CASE event_container-element.
WHEN 'DOCUMENTTYPE'.
lv_anchor = event_container-value.
WHEN 'ARCHIVEID'.
lv_crep_id = event_container-value.
WHEN 'DOCCLASS'.
lv_doc_class = event_container-value.
WHEN 'ARCHIVEDOCUMENTID'.lv_doc_id = event_container-value.
ENDCASE.
ENDLOOP.
* Set sp poid of ArchiveLink document
READ TABLE lt_resulting_list INTO lwa_resulting_list INDEX 1.
lwa_element_sp_poid-name = 'CREP_ID'.
lwa_element_sp_poid-value = lv_crep_id.
APPEND lwa_element_sp_poid TO lt_element_sp_poid.
lwa_element_sp_poid-name = 'DOC_CLASS'.
lwa_element_sp_poid-value = lv_doc_class.
APPEND lwa_element_sp_poid TO lt_element_sp_poid.
lwa_element_sp_poid-name = 'DOC_ID'.
lwa_element_sp_poid-value = lv_doc_id.
APPEND lwa_element_sp_poid TO lt_element_sp_poid.
* Get the description for the document type, which is defined as in trn OAC2
SELECT SINGLE objecttext
INTO lv_objecttext
8/20/2019 Case Management With ArchiveLink Integration CRM WebUI
35/39
Case Management with ArchiveLink Integration in CRM Web UI
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 35
FROM toasp
WHERE ar_object = lv_anchor
AND language = sy-langu.
* Insert document in record
GET RUN TIME FIELD lv_rtime01.
*---------------------------------------------------------------------*
* Add PDF document to the record model. The DO loop is to attempt
* multiple times, up to a max of 1 minute, because the Case might be
* locked by another process/user.
*---------------------------------------------------------------------*
DO.
* If the Case is locked out for more than a minute then exit this loop
GET RUN TIME FIELD lv_rtime02.
lv_rtime_diff = ( lv_rtime02 - lv_rtime01 ) / 1000000.
IF lv_rtime_diff >= 60.
*---------------------------------------------------------------------*
* When the Case is locked for more than a minute - The call to FM is
* scheduled in background task to monitor the LUW in SM58
*---------------------------------------------------------------------*
CALL FUNCTION 'SRM_RECORD_ADDELEMENT'
IN BACKGROUND TASKEXPORTING
objectid = lwa_resulting_list-objectid
documentclass = c_documentclass
sps_id = c_archive_sps_id
anchor = lv_anchor "document type for e.g. ZFS3083
description = lv_objecttext
TABLES
element_sp_poid = lt_element_sp_poid
element_properties = lt_element_properties
EXCEPTIONS
anchor_not_found = 1
not_authorized = 2
parameter_error = 3container_not_found = 4
container_is_locked = 5
max_number_of_elements = 6
poid_is_wrong = 7
internal_error = 8
record_is_frozen = 9
OTHERS = 10.
EXIT.
ENDIF.
* Fill element properties table
ls_element_properties-name = 'CREP_ID'.
ls_element_properties-value = lv_crep_id.
APPEND ls_element_properties TO lt_element_properties.
CLEAR ls_element_properties.
ls_element_properties-name = 'DOC_ID'.
ls_element_properties-value = lv_doc_id.
APPEND ls_element_properties TO lt_element_properties.
CLEAR ls_element_properties.
8/20/2019 Case Management With ArchiveLink Integration CRM WebUI
36/39
Case Management with ArchiveLink Integration in CRM Web UI
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 36
PERFORM get_doc_description USING lv_anchor
CHANGING lv_doc_desc.
ls_element_properties-name = 'DOC_DESC'.
ls_element_properties-value = lv_doc_desc.
APPEND ls_element_properties TO lt_element_properties.
CLEAR ls_element_properties.
CALL FUNCTION 'SRM_RECORD_ADDELEMENT'
EXPORTING
objectid = lwa_resulting_list-objectid
documentclass = c_documentclass
sps_id = c_archive_sps_id
anchor = lv_anchor "document type for e.g. ZFS3083
description = lv_objecttext
IMPORTING
return = lv_return
TABLES
element_sp_poid = lt_element_sp_poid
element_properties = lt_element_properties
EXCEPTIONS
anchor_not_found = 1
not_authorized = 2parameter_error = 3
container_not_found = 4
container_is_locked = 5
max_number_of_elements = 6
poid_is_wrong = 7
internal_error = 8
record_is_frozen = 9
OTHERS = 10.
IF sy-subrc 0
AND sy-subrc 5.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4RAISING any_error.
ELSEIF sy-subrc 5.
EXIT.
ENDIF.
ENDDO.
COMMIT WORK.
ENDFUNCTION.
*&---------------------------------------------------------------------*
*& Form GET_DOC_DESCRIPTION
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_LV_DOC_CLASS text
*
8/20/2019 Case Management With ArchiveLink Integration CRM WebUI
37/39
Case Management with ArchiveLink Integration in CRM Web UI
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 37
DATA: lt_arobj TYPE TABLE OF toasp,
ls_arobj TYPE toasp.
ls_arobj-ar_object = ip_v_anchor.
SELECT * FROM toasp INTO TABLE lt_arobj
WHERE ar_object = ls_arobj-ar_object.
READ TABLE lt_arobj INDEX 1 INTO ls_arobj.
IF sy-subrc 0.
CLEAR ls_arobj-ar_object.
ELSE.
cp_v_doc_desc = ls_arobj-objecttext.
ENDIF.
ENDFORM. " GET_DOC_DESCRIPTION
Event type linkage overview screen after the new entry is made.
Result
You have activated an event receiver linkage for event BUS20900.ASSIGNED.
8/20/2019 Case Management With ArchiveLink Integration CRM WebUI
38/39
Case Management with ArchiveLink Integration in CRM Web UI
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
© 2011 SAP AG 38
Related Content
SDN - Implement Document Storage Using Records Management
SAP Online Help - CRM UI Configuration Tool
SAP Online Help - SAP Records Management
SAP Online Help - ArchiveLink
For more information, visit the Customer Relationship Management homepage
http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/30e9198d-f976-2e10-d787-bef33cc1fec1http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/30e9198d-f976-2e10-d787-bef33cc1fec1http://help.sap.com/saphelp_crm70/helpdata/en/0a/cc2d5ce997406b9a17141fadde7e93/frameset.htmhttp://help.sap.com/saphelp_crm70/helpdata/en/0a/cc2d5ce997406b9a17141fadde7e93/frameset.htmhttp://help.sap.com/saphelp_nw04/helpdata/en/f5/18fc39eb31a700e10000000a11402f/frameset.htmhttp://help.sap.com/saphelp_nw04/helpdata/en/f5/18fc39eb31a700e10000000a11402f/frameset.htmhttp://help.sap.com/saphelp_nw70/helpdata/en/5e/566039b85f9443e10000000a114084/frameset.htmhttp://help.sap.com/saphelp_nw70/helpdata/en/5e/566039b85f9443e10000000a114084/frameset.htmhttps://www.sdn.sap.com/irj/sdn/bpx-crmhttps://www.sdn.sap.com/irj/sdn/bpx-crmhttps://www.sdn.sap.com/irj/sdn/bpx-crmhttps://www.sdn.sap.com/irj/sdn/bpx-crmhttp://help.sap.com/saphelp_nw70/helpdata/en/5e/566039b85f9443e10000000a114084/frameset.htmhttp://help.sap.com/saphelp_nw04/helpdata/en/f5/18fc39eb31a700e10000000a11402f/frameset.htmhttp://help.sap.com/saphelp_crm70/helpdata/en/0a/cc2d5ce997406b9a17141fadde7e93/frameset.htmhttp://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/30e9198d-f976-2e10-d787-bef33cc1fec1
8/20/2019 Case Management With ArchiveLink Integration CRM WebUI
39/39
Case Management with ArchiveLink Integration in CRM Web UI
Copyright
© Copyright 2011 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 SystemsIncorporated 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 ofCitrix 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 Oracle Corporation.
JavaScript is a registered trademark of Oracle Corporation, 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 mentionedherein 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, andother Business Objects products and services mentioned herein as well as their respective logos are trademarks or registeredtrademarks 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 documentserves 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 ("SAPGroup") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors oromissions 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 anadditional warranty.