Вы находитесь на странице: 1из 8

Requirement : Enhancement in which Actions are needed to build in Interaction record in UTIL_IC agent.

Design :
UI Component : GSACTIONS

View : GSACTIONS/Actions
Enhance this view in your enhancement set. redefine the method set_view_group_context and add the code

IF IV_PARENT_CONTEXT IS INITIAL.
CREATE OBJECT ME->VIEW_GROUP_CONTEXT TYPE CL_BSP_WD_VIEW_GROUP_CONTEXT.
VIEW_GROUP_CONTEXT->SET_VIEW_EDITABLE( ME ).
ELSE.
ME->VIEW_GROUP_CONTEXT = IV_PARENT_CONTEXT.
ENDIF.
now got to component ICCMP_BT_ACT.
create a component usage for the GSACTIONS/Actions. Please note standard have already exposed the required
view in GSACTIONS. once you have created the component usage go to component structure browser and create an
overview page. I created an overpage because action AB contains some important fields in it view and all ae required
to be visible completely on view. Adding it in ICCMP_BT_ACT/ActViewSet would have added it to the

area between notes and notes log which would have not displayed all fields.
So create an overview page. Assign the ICCMP_BT_ACT/ActViewSet and component usage view
Now build one custom controller with model nodes for BTadmiH and ACIActionContext and
bind the first one with component controller.
Create the ON_NEW_FOCUS for ACIACTIONCONTEXT and add the code

entity ?= focus_bo.
TRY.
lv_collection = entity->get_related_entities(
iv_relation_name = 'BTHeaderAction' ).
CATCH cx_crm_genil_model_error.
should never happen
EXIT.
CATCH cx_sy_ref_is_initial.
ENDTRY.
me->collection_wrapper->set_collection( lv_collection ).
BTHeaderAction relation is used to get the object id.
*

Now go to your component controller and redefine it and in wd_usage_initialize bind the
nodes with usage name with the code
WHEN 'ScheduledActions'.
IV_USAGE->BIND_CONTEXT_NODE(
IV_CONTROLLER_TYPE

= CL_BSP_WD_CONTROLLER=>CO_TYPE_CUSTOM
IV_TARGET_NODE_NAME = 'ACIACTIONCONTEXT' "#EC NOTEXT

IV_NAME

= '/PES/ICCMP_BT_ACT/CuActionCuco' "#EC

IV_NODE_2_BIND

= 'ACTIONCONTEXT' ). "#EC NOTEXT

NOTEXT
IV_USAGE->BIND_CONTEXT_NODE(
IV_CONTROLLER_TYPE

= CL_BSP_WD_CONTROLLER=>CO_TYPE_CUSTOM
IV_TARGET_NODE_NAME = 'BTADMINH'
"#EC NOTEXT
IV_NAME
= '/PES/ICCMP_BT_ACT/CuActionCuco' "#EC

NOTEXT

IV_NODE_2_BIND
= 'PARENTNODE' ). "#EC NOTEXT
here we need to understand that we are taking into consideration custom controller so for
GSACTIONS also we have to take the same. once nodes are bound,
in connect_nodes of CTXT class , create the handler fro focus_bo.
COLL_WRAPPER = ME->BTADMINH->GET_COLLECTION_WRAPPER( ).
SET HANDLER ME->ACIACTIONCONTEXT->ON_NEW_FOCUS
FOR COLL_WRAPPER ACTIVATION IV_ACTIVATE.
After this in order to rename your overview page add the code :
LR_ENTITY = ME->TYPED_CONTEXT->BTADMINH->COLLECTION_WRAPPER->GET_CURRENT( ).
CHECK LR_ENTITY IS BOUND.
OBJECT_ID = LR_ENTITY->GET_PROPERTY_AS_STRING( IV_ATTR_NAME = 'OBJECT_ID').
PROCESS_TYPE = LR_ENTITY>GET_PROPERTY_AS_STRING( IV_ATTR_NAME ='PROC_TYPE_DESCR').
CONCATENATE PROCESS_TYPE ':' OBJECT_ID INTO TITLE.
IF OBJECT_ID IS INITIAL.
DESCRIPTION = CL_CRM_UIU_BT_TOOLS=>GET_TITLE_HEADER( LR_ENTITY ).
ELSE.
DESCRIPTION = TITLE.
ENDIF.
You will be getting your desired result as shown below :

Recently I worked on a requirement where we were needed to build marketing attributes and identification
assignment block in IC business partner view.

Scenraio : when a user in UTIL_IC busineess role, search a BP , he gets an option MORE FIELD. when he clicks on
it he gets something shown in screenshot below

Here as per the requirement, along with telephone, fax and email, Marketing attribute and identification tab was also
required.

Solution :
1. go to the component ICCMP_BP_DETAIL , enhance it , add component usage BP_DATA for these two views are
there in this standard component.( BP_DATA/MarketingAttributesEOVP and BP_DATA/AccountIDNumberList ).
2. Now in ICCMP_BP_DETAIL, under ViewSet ICCMP_BP_DETAIL/CommunicationVS in runtime rep add this
component usage along with the view.
3.now go to the BP_DATA component and enhance both the view. after enhancing, redefine the
set_view_group_context. now here view group context need to be set as you will not get the parent entity initially. add
these code of lines :

IF IV_PARENT_CONTEXT IS INITIAL.
CREATE OBJECT ME->VIEW_GROUP_CONTEXT TYPE CL_BSP_WD_VIEW_GROUP_CONTEXT.

view_group_context->set_view_editable( me ).
ELSE.
ME->VIEW_GROUP_CONTEXT = IV_PARENT_CONTEXT.
ENDIF..

view is also set editable here with the same view_group_context attribute .
This will be triggering on click of the edit button on IC agent. locking is
being takn care in insert event code so u need not to worry on that part.
4.then go to .htm page and make the noHeader = "FALSE" , personalizable =
'TRUE' ( if u need personalizable icon too ) that you can get the header with
button inseta and personalizable icon

5. do the binding in component controller of iccmp component with follwoing


code

CASE IV_USAGE->USAGE_NAME.
WHEN 'BP_DATA'.
IV_USAGE>BIND_CONTEXT_NODE( IV_CONTROLLER_TYPE =CL_BSP_WD_CONTROLLER=>CO_TYPE_COMPONE
NT
IV_TARGET_NODE_NAME = 'CUSTOMER'
IV_NODE_2_BIND
= 'PARTNER' ).

activate your code and test

you will get the resiult as stated below.

Hope this helps you all.

This document describes how to add additional fields to Business Agreements (BUAG) in releases SAP
CRM 2007 and SAP CRM 7.0 (i.e. Customer-specific fields).

2. Prerequisites
SAP CRM 2007 or SAP CRM 7.0
For release SAP IS-U 4.72 or lower: Implementation of SAP note 718234
Implementation of SAP note 1280914
3. InstructionsIn order to store additional fields in the database, its recommended to use the
append technique (two alternatives).If one way doesnt work for you, try another one.
There are two alternatives:A) Append a field to table CRMM_BUAG_H (special data of business
agreements)
Fields of the same name and in the same sequence (very important!) has to be appended to each of
the following structures:
BAPIBUS1006130_SPEC_DATA
BAPIBUS1006130_SPEC_DATA_EXP
BAPIBUS1006130_SPEC_DATA_X
CRMT_BUAGS_EI_SPEC_DATA_X (both in SAP CRM and in R/3 or ERP (Plug-In))
BAPI_TE_FKKVKP (in R73 or ERP (Plug-In))

For the fields to be added to structures BAPIBUS1006130_SPEC_DATA_X and


CRMT_BUAGS_EI_SPEC_DATA_X, choose field type BAPIUPDATE. B) Append a field to table
CRMM_BABR_H (general data of business agreements)Fields ofthe same name and in the same
sequence (very important!) has to be appended to each of the following structures:
BAPIBUS1006130_GNRL_DATA
BAPIBUS1006130_GNRL_DATA_EXP
BAPIBUS1006130_GNRL_DATA_X
CRMT_BUAGS_EI_GNRL_DATA (both in CRM and in R/3 or ERP (Plug-In))
CRMT_BUAGS_EI_GNRL_DATA_X (both in CRM and in R/3 or ERP (Plug-In))

For the field to be added to structures BAPIBUS1006130_GNRL_DATA_X and


CRMT_BUAGS_EI_GNRL_DATA_X, choose field type BAPIUPDATE.

4. Validations
If necessary, for the BAPI, use method DATA_CHECK_BAPI of business add-in CRM_MDBP_BUAG.

5. IC-Webclient UI enhancements
New fields are automatically available at BOL (Business Object Layer) level.
You need just add them to existing nodes and view configuration tab.
Use transaction BSP_WD_CMPWB (BSP WD Workbench) and enhancement sets to maintain the
enhancement of views.
Otherwise, in WEB UI you can use AET (Application Enhancement tool) for the same purpose.

If you want to show new fields (by BSP WD Workbench or AET in WEB UI) then the following views are
relevant (views that show some information about object Business Agreement):

Context

Component

View

IC Agent

BUAG_DETAIL

BUAG_DETAIL/BuAgCorr
BUAG_DETAIL/BuAgDetails
BUAG_DETAIL/BuAgDunning

BUAG_DETAIL/BuAgInvoice
BUAG_DETAIL/BuAgMoreFields
BUAG_DETAIL/BuAgPayments
BUAG_DETAIL/BuAgRefunds
BUAG_DETAIL/BuAgTax
BUAG_QUERY

BUAG_QUERY/BuAgDynBuAgList
BUAG_QUERY/BuAgList
BUAG_QUERY/BuAgListEdit

Utilities Sales

IUBUAG

IUBUAG/Details
IUBUAGS/ResultList

IUBUAGS

Вам также может понравиться