cancel
Showing results for 
Search instead for 
Did you mean: 

Creation of new view in ICWC

Former Member
0 Kudos

Hi All,

I have created the new view in my custom CRM_IC. Can I know what is the next step to do in order for the new view to show in ICWC - what is the inbound or outbound plug all about?

Appreciate if someone can list me all the steps. Thanks

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Objective

Calling a custom Simple View for the follow-up activity. Whenever, we click the link of a follow-up activity from the activity clipboard, the system leads us to “Simple Activity” view, where we can maintain the description and the status.

Note

This is just a guideline document to work with customer specific view sets for one case. While following this procedure for other cases, we may need to do further enhancements.

A. Primary Steps

Create Custom Package “Z_CONS_COOK1”

Create BSP application “Z_CRM_IC1” under package “Z_CONS_COOK1”.

B. Creating View Sets & Controllers

1. Through workbench transaction, Create New View Set: SimpleActivitySet

2. Specify view area name “main”.

3. All Controller & Model Classes are generated in the background.

4. Redefine method “GET_STATE_DESCRIPTION” of Controller Class “ZL_Z_CRM_IC_SIMPLEACTIVIT_IMPL” & populate with following source code:

METHOD IF_BSP_WD_HISTORY_STATE_DESCR~GET_STATE_DESCRIPTION.

*CALL METHOD SUPER->IF_BSP_WD_HISTORY_STATE_DESCR~GET_STATE_DESCRIPTION

    • EXPORTING

    • IV_CURRENT_DESCRIPTION =

  • RECEIVING

  • DESCRIPTION =

• .

DESCRIPTION = TEXT-001. " 'Simple Activity'

ENDMETHOD.

5. Corresponding BSP Page is generated with the following code:

%@page language="abap"%

<%@ extension name="htmlb" prefix="htmlb"%>

<%@ extension name="xhtmlb" prefix="xhtmlb"%>

<%@ extension name="crm_bsp_ic" prefix="crmic"%>

<%@ extension name="bsp" prefix="bsp"%>

<crmic:gridLayout cellSpacing="1" columnSize="1" height="100%"

rowSize="1" width="100%">

<crmic:gridLayoutCell colSpan="1" columnIndex="1"

rowIndex="1" rowSpan="1">

<bsp:call comp_id="<%=controller->GET_VIEWAREA_CONTENT_ID( 'main' )%>"

url="<%=controller->GET_VIEWAREA_CONTENT_URL( 'main' )%>"/>

</crmic:gridLayoutCell>

</crmic:gridLayout>

6. Activate all objects

C. Creating Views & Controllers

1. Create View using IC Web Client Workbench transaction. Give view name “SimpleActivity”.

In the wizard enter our view name, and specify all model nodes, model attributes and links to custom controllers.

Add Model Nodes:

Model Nodes BOL Entity High-level model node BOL Relation

GT_BTORDER BTOrder

GR_BTADMINH BTAdminH GT_BTORDER BTOrderHeader

GR_BTSTATUS BTStatusH GR_BTADMINH BTHeaderStatusSet

GR_BTSTATUSH BTStatus GR_BTSTATUS BTStatusHCurrent

Four nodes are the pointers to the similarly named BOL entities of the focus object. The focus object will be the Activity that the user clicked in the Activity Clipboard. Whenever this happens, an instance method of the controller is called. Method “IP_INBOUNDPLUGID” retrieves the BOL entities from the global memory and places them into these attributes. They can also be seen as buffers since they are used in multiple locations within the controller class.

Value node: Optional entry, keep it blank.

Add Model Attributes:

Model Attribute Model Node BOL Attribute

DESCRIPTION GR_BTADMINH DESCRIPTION

STATUS GR_BTSTATUSH STATUS

Create Links to Custom Controller

Context node: GT_BTORDER

BSP Application: CRM_IC

Custom Controller: CuCoBDC.do

Context node (Custom Controller): CURRENTINTERACTIONRECORD

Select View Type

Type: Form View

2. Restart the IC Web Client Workbench. We will observe, controller class is generated with methods. If we want to enhance these methods we should redefine them in the corresponding *_IMPL class.

3. Define the Inbound Plug.

This is the method that is called by the framework whenever we navigate to our view set. Define method “IP_INBOUNDPLUGID” and populate with following code:

Following attributes added to the controller class, as it was showing an error message:

GR_BTORDER TYPE REF TO CL_CRM_BOL_ENTITY

GR_BTADMINH TYPE REF TO CL_CRM_BOL_ENTITY

GR_BTSTATUSH TYPE REF TO CL_CRM_BOL_ENTITY

GR_BTSTATUS TYPE REF TO CL_CRM_BOL_ENTITY

METHOD IP_INBOUNDPLUGID.

data: lr_bdc type ref to cl_crm_ic_cucobdc_impl,

lr_btorder type ref to if_bol_bo_property_access.

*- Read Parameter

lr_bdc ?= get_custom_controller( 'CuCoBDC' ).

CALL METHOD lr_bdc->get_navigation_data

IMPORTING

ev_selected_object = lr_btorder.

*- Read Model

IF lr_btorder IS BOUND.

TRY.

gr_btorder ?= lr_btorder.

gr_btadminh = gr_btorder->get_related_entity(

iv_relation_name = 'BTOrderHeader' ).

gr_btstatush = gr_btadminh->get_related_entity(

iv_relation_name = 'BTHeaderStatusSet' ).

IF gr_btstatush IS NOT BOUND.

gr_btstatush = gr_btadminh->create_related_entity(

iv_relation_name = 'BTHeaderStatusSet' ).

ENDIF.

gr_btstatus = gr_btstatush->get_related_entity(

iv_relation_name = 'BTStatusHCurrent' ).

IF gr_btstatush IS NOT BOUND.

gr_btstatush = gr_btstatush->create_related_entity(

iv_relation_name = 'BTStatusHCurrent' ).

ENDIF.

CATCH cx_root.

ENDTRY.

ENDIF.

ENDMETHOD.

4. Confirm View Layout “SimpleActivity” consistency.

5. Two methods are responsible for the data transfer between the model/controller and the view and are created automatically by the wizard.

SET_MODELLS -- Sends data to the view (PBO)

DO_HANDLE_DATA -- Retrieves data from the HTTP request fields (PAI)

We can redefine these methods for further enhancements.

D. Adjusting IC Web Client Framework

After having defined the views, controllers and classes, we need to hook them up to the runtime profile of IC Web Client.

STEPS:

1. To prepare IC Web Client framework for custom-built view-sets, create a new runtime profile BSP application in the customer namespace.

Create BSP application “Z_CRM_IC_RT_REP” under package “Z_CONS_COOK1”.

Copy the file CRM_IC.xml from the BSP application CRM_IC_RT_REP to “Z_CRM_IC_RT_REP”.

2. Adjust the contents of file “CRM_IC.xml”, as under:

<%@page language="abap"%><?xml version="1.0"?>

<WebDynProDefinitions>

<Application id="CRM_IC">

<ViewSets>

<%@include file="../Z_CRM_IC_DT_REP/CRM_IC_All_Viewsets.xml" %>

</ViewSets>

<NavigationalLinks>

<%@include file="../Z_CRM_IC_DT_REP/CRM_IC_All_NavLinks.xml" %>

</NavigationalLinks>

</Application>

</WebDynProDefinitions>

3. Create BSP application Z_CRM_IC_DT_REP in package Z_CONS_COOK1.

4. Copy page fragment CRM_IC_All_Viewsets.xml of BSP application CRM_IC_DT_REP to Z_CRM_IC_DT_REP and replace the file contents with the following lines:

Page fragment: CRM_IC_All_Viewsets.xml

<%@page language="abap"%>

<%@include file="MainViewSet.xml" %>

<%@include file="../CRM_IC_DT_REP/BuPaViewSet.xml" %>

<%@include file="../CRM_IC_DT_REP/CRM_IC_All_Viewsets_wo_BUPA_and_Main.xml" %>

This definition still works with all standard view sets, but replaces the MainViewSet.xml with our own definition, since it is now loaded from Z_CRM_IC_DT_REP.

5. Copy page fragment MainViewSet.xml from BSP application CRM_IC_DT_REP to Z_CRM_IC_DT_REP.

6. Copy page fragment CRM_IC_All_NavLinks.xml of BSP application CRM_IC_DT_REP to Z_CRM_IC_DT_REP and replace the file contents with the following line:

<%@page language="abap" %>

<%@ include file="../CRM_IC_DT_REP/CRM_IC_All_NavLinks.xml" %>

This definition makes sure that standard navigational links still work and that we are able to add our own link definitions later.

7. Activate all objects.

8. Customize the IC Web Client Runtime Framework Profile in such a way that the new Source file is used with the following sample code:

Navigation: SPRO &#61664; CRM &#61664; Interaction Center Web Client &#61664; Customer-Specific System Modifications &#61664; Define IC Web Client Runtime Framework Profiles.

Provide new profile name “ZCUST_PROF” & populate it with following set of attributes:

Profile name: ZCUST_PROF

Component Set: ALL

Separate Display Model: Off

Application: IC_BASE

Viewset name: workViewSet

Runtime Rep.Type: BSP Application

Application: Z_CRM_IC_RT_REP

Page: CRM_IC.XML

E. Creating View Definitions for Design Time Repositories

1. Every new view set must be defined in Design Time Repository. For this purpose, create page fragment SimpleActivitySet.xml in BSP application Z_CRM_IC_DT_REP and maintain it as shown in the following sample code:

Page fragment “SimpleActivitySet.xml”

<%@page language="abap"%>

<ViewSet id="Z_CRM_IC1 /SimpleActivitySet">

<ViewArea id="main" views="Z_CRM_IC1 /SimpleActivity"/>

</ViewSet>

2. Include file “SimpleActivitySet.xml" into page CRM_IC_All_Viewsets.xml of BSP application Z_CRM_IC_DT_REP.

Page “CRM_IC_All_Viewsets.xml” after modification:

<%@page language="abap"%>

<%@include file="MainViewSet.xml" %>

<%@include file="../CRM_IC_DT_REP/BuPaViewSet.xml" %>

<%@include file="../CRM_IC_DT_REP/CRM_IC_All_Viewsets_wo_BUPA_and_Main.xml" %>

<%@ include file="SimpleActivitySet.xml" %>

3. Activate all objects.

F. Creating Navigational Link Definitions for Design Time Repositories

To provide a navigational link for the activity clipboard, define this link.

1. Create Page fragment “SimpleActivityNavLinks.xml” in BSP Application “Z_CRM_IC_DT_REP” and maintain layout with following code:

<NavigationalLink name="SimpleActivity">

<Source viewRef="IRecActivitiesClipboard"

outboundPlugRef="default"/>

<Targets>

<Target viewRef=" Z_CRM_IC1/SimpleActivity"

inboundPlugRef="inboundplugid"/>

</Targets>

</NavigationalLink>

2. Similar to the view definition, also the Navigational Link must be included into the framework.

Add the following line

<%@ include file="SimpleActivityNavLinks.xml" %> to the file

CRM_IC_ALL_NavLinks.xml in the BSP application “Z_CRM_IC_DT_REP”.

Page fragment “CRM_IC_All_NavLinks.xml” – source code

<%@page language="abap" %>

<%@ include file="../CRM_IC_DT_REP/CRM_IC_All_NavLinks.xml" %>

<%@ include file="SimpleActivityNavLinks.xml" %>

3. Activate all objects.

G. Placing View Sets into Controller Hierarchies

1. Adjust the file MainViewSet.xml in BSP application Z_CRM_IC_DT_REP.

Add the reference to our view set and activate the file as shown in the following sample code:

Page fragment: MainViewSet.xml

<%@page language="abap"%>

<ViewSet id="IC_BASE/ICAPPMainViewSet">

<ViewArea id="navigationArea" views="IC_BASE/navigationViewSet"/>

<ViewArea id="workArea" views="IC_BASE/workViewSet"/>

<ViewArea id="contextArea" views="IC_BASE/contextAreaView"/>

<ViewArea id="breadCrumbsArea" views="IC_BASE/BreadCrumbsView"/>

<ViewArea id="globalSearchArea" views="HistoryView"/>

<ViewArea id="helpArea" views="Help"/>

<ViewArea id="statusArea" views="StatusView"/>

<ViewArea id="errorArea" views="IC_BASE/ErrorViewSet"/>

</ViewSet>

<ViewSet id="IC_BASE/navigationViewSet">

<ViewArea id="navigationViewSetArea" views="IC_BASE/NavBarView"/>

</ViewSet>

<ViewSet id="IC_BASE/workViewSet">

<ViewArea id="workViewSetArea"

views="<%@include file="../CRM_IC_DT_REP/StdWorkareaOccupation.xml" %>

Z_CRM_IC1/SimpleActivitySet "/>

</ViewSet>

H. Customize Activity Clipboard

To make activity clipboard call our new view set, change it’s customizing.

1. Create Activity Clipboard profile called “ZCUST_PROF”.

Navigation: SPRO &#61664; CRM &#61664; IC Web Client &#61664; Basic Functions &#61664; Define Activity Clipboard Profiles.

Profile name: ZCUST_PROF (copy all entries)

Keep Technical Profile name: DEFAULT

2. Assign this profile to IC Web Client profile.

3. Create a new entry for the object BTOrder and wrapped object type BUS2000126 by copying the existing entry BTORDERBUS2000126.

Activity Clipboard Entry ID: ZBTORDERBUS2000126

BOL Type: BTOrder

NavigationLink: SimpleActivity

4. Go back to your profile and select Assign Entries to Profile. Replace the original Entry ID BTORDERBUS2000126 with your new entry ZBTORDERBUS2000126.

5. Activate your changes and test the IC WebClient (application CRM_IC)

P000636
Active Contributor
0 Kudos

Hi FSCHU,

You should continue with the steps of the Webclient Cookbook, 2.4.2 Creating Views and Controllers.

The next step should be define the inbound plug if you send data of other iview. Redefine the method IP_INBOUNDPLUGID in your Z* cotroller class.

Regards.

Manuel