Web
Ui Architecture
The
different software layers are completely separated from each other. The
separation allows the connection of any business application via the BOL(
Business Object Layer) layer, GenIL( Generic interaction Layer) layer to the
presentation layer.
Presentation
Layer:
The
Presentation layer of CRM Webclient UI is based on the CRM User Interface
Framework, which is the basis for the HTML pages running in the browser.
Business Layer:
The
business layer of CRM Webclient UI consists of the following software layers:
- Business object layer ( BOL)
The
business object layer saves the business object data, for example of sales
orders, at runtime of SAP CRM session. This layer guarantees the separation of
CRM Webclient UI and the underlying business logic
- Generic interaction layer (GenIL)
The
generic interaction layer handles the data transfer from the business object
layer to the application programming interfaces ( APIs) of the underlying
business engine. It is the connection between the business object layer and the
underlying business engine.
Business Application:
The
business application contains the business logic and the database tables.
Getter and Setter methods:
Get_attr: get the data from the bol and shown on the
screen.
Set_attr: sets the data which is given on the screen on
to the Bol.
Get_i_attr: to enable or disable codes
have to write in this method.
Get_p_attr: to write code for check
box, radio buttons, pick lists, value search f4.
Get_v_attr: without get p method there
is no get v method.
Use this to give values
for attributes.
To give values to the pick
list use get p and get v together.
Every attribute have this
getter and setter methods.
Get_m_attr: this method changes the
metadata.
Whenever you’re changing
the tables then only it is use full.
If you
don’t have the get and set methods then we can say that values stored in the
database.
Context
node class generated methods for attributes.
EEWB & AET
Both
EEWB (Easy Enhancement Workbench) and AET (Application Enhancement Tools) tools
are used to add custom fields to any CRM object. Going back to history, EEWB
was provided by SAP from CRM 4.0 (I only started working from CRM 4, not sure
if it existed before) and was very handy tool to add new fields on CRM 4,
5. EEWB was mainly used by developers as it still required some
technical knowledge for adding fields. AET has taken the wizard to next
level by enabling to directly add fields on CRM UI. AET is quite easy to use
and was mainly designed with the idea to simplify adding of custom fields to
any CRM object. Any person with fair amount of CRM knowledge can use AET to add
custom fields.
I like
both of these tools and worked extensively of EEWB. Using EEWB, I added fields.
Then I created tables, tabstrips and included those custom fields on the
Additional Data tab in CRMD_ORDER. This was possible as we were still working
on GUI and I could play around in any way according to the requirement. We
can’t add tables using AET as of now. If SAP can provide this option in the
future releases, that would be great.
Below
are few things that I want to highlight about these two tools.
1. Any custom fields added
using AET doesn’t exist on Additional Data/Customer Fields Tab on CRMD_ORDER.
This is a bit strange and I really didn’t understand why SAP didn’t provide
this feature. I know SAP wants to drive CRM only through web UI. But still I
would like to have this feature of displaying custom fields added using AET on
GUI as well. This is the only concern that I have with AET.
2. AET has made life much
simpler if we want to add dropdown boxes, Search Helps, Currency and Quantity
fields. Using EEWB, it was a bit more complicated in having these
features.
3. Using AET, we can reuse
the custom fields in other objects. This is really cool thing which prevents us
to recreate the same custom field if required in any other object.
For now,
I’m enjoying AET more than EEWB. AET is future ahead for adding new fields.
Maybe AET will have the capability to add assignment blocks directly some day.
Application Enhancement Tool 
The Application Enhancement Tool has been introduced to
enhance CRM applications. You can use the tool to search for enhancements, and
to display, create, change, and delete enhancements.
Integration
You can enhance ERP business objects in the CRM
WebClient UI. For more information, see Customizing for Customer
Relationship Management under 

.
Prerequisites
Before you can use the Application
Enhancement Tool, you need to define the package name, generation prefix, and
namespace for enhancements. You can make the necessary settings in Customizing
for Customer Relationship Management under 


.
If you are not authorized to use the
Application Enhancement Tool, you need a certain authorization role.
Only the Z namespace is supported for BDocs. Within
other namespaces, you will not be able to generate enhancements that influence
BDocs. This affects the enabling for CRM Mobile, and enhancements for all
Marketing objects.
Features
The Application Enhancement Tool is
integrated in the UI Configuration Tool, and can be started in this tool. The
fields that you have added to an application are available in the UI
configuration of the corresponding UI component and view. You can
make these new fields available on the user interface by adding them to the
view.
The Application Enhancement Tool offers the
following main functions:
·
Creating custom fields
·
Defining dropdown list boxes
for custom fields
·
Translating field labels and
entries in dropdown list boxes
·
Assigning search helps and
check tables to custom fields
·
Making new custom fields
available in search criteria and/or result lists, Business Intelligence (BI)
reporting, R/3 Adapter, CRM Mobile, and CRM interactive reporting, which
depends on the enhanced business object
·
Using different data types,
such as characters, dates, times, and numbers
·
Reusing fields in other
business objects, if these business objects are based on the same enhancement place
UI Configuration Tool
You can use the UI Configuration Tool to adapt the user
interface of SAP CRM to your company's specific requirements. You can access
the UI Configuration Tool in SAP GUI and in the CRM WebClient UI.
Integration
·
If you want to change field
labels across multiple views, you can use the design layer to consolidate the
field changes. You define these settings in Customizing under 



.
·
If you want to change customer-specific
fields that were created with the Easy Enhancement Workbench (EEW), and are
contained in views, you can do so by using the UI Configuration Tool in the
same way as with standard fields. You define your own fields in Customizing
under 

.
Features
The UI Configuration Tool in the CRM WebClient UI
enables you to easily adjust pages and views to your requirements.
General
Features
The UI Configuration Tool in the CRM
WebClient UI offers the following general features:
·
The UI configuration is based
on an authorization object.
The UI configuration in SAP GUI is also based on an authorization
object.
·
The UI configuration is
automatically started with the parameters that were found.
This is true, if you start the UI configuration directly from an
application. If you start it from the navigation bar or the work center page,
you need to select manually the configuration parameters of the pages or views
that you want to change.
·
All configuration changes that
you have made are automatically visible in the application.
·
To save your configuration
changes you can create a new transport request or select an existing transport
request in the CRM WebClient UI.
DIFFERENCE
BETWEEN AET AND EEWB:
AET is a Web UI based Tool to generate New Attributes in CRM. It
came into being from 7.0 Version. Earlier EEWB was being used and is a SAP GUI
based tool, a little tedious as well.
The attributes which are generated from AET are well connected
through BOL layer and also into the DB layer. The framework takes care of
everything else.
UI Configuration Access
You can enter the view configuration and fact sheet
configuration in the CRM WebClient UI in the following ways.
Via Logical Links in the
Navigation Bar or from a Work
Center Page
You can access the view configuration and
fact sheet configuration in your system administrator role. They way you access
the view configuration and fact sheet configuration depends on your
Customizing:
·
By using logical links that belong to a direct link group in the
navigation bar
·
By using logical links that
belong to a work center, for example the Administration work center
These logical links are displayed on the second level of the
corresponding work centers in the navigation bar of your system administrator
role.
·
By using logical links on a
work center page
These logical links can be assigned to the Search content
block on the work center page, for example on the Administration work
center page.
Via Icons in the Application
When the configuration mode is activated
on the central personalization page of SAP CRM, you see the Configure Page
icon at the top of Home pages, work center pages, and overview pages. If
you click the icons, you see the View Configuration dialog.
You see the Show Configurable Areas
icon at the top of most pages. If you click the icon, you can see all
configurable areas that are available on this page. Every configurable area is
surrounded by a frame. If you click a configurable area with a frame you see
the view configuration of that specific view. If the configuration mode is
activated, the general navigation is deactivated. To deactivate the
configuration mode click the icon again.
You can use the Show Configurable Areas
icon to configure only those assignment blocks that are expanded. If they are
collapsed, expand them before you click the icon.
Via
F2 Help in the Application
To find out the name of an application component or
view, click F2. The Technical
Data dialog with the technical information is started. To access the UI
configuration of this view and this application component, click Configure
at the bottom of the dialog.
Look and Feel of the UI
Configuration
View Configuration
When you start the view configuration in
the navigation bar you navigate to the search page where you can search for an
application component. All views that belong to a certain application component
are displayed in the result list. Select a view and click View Configuration.
You navigate to the standard configuration page of the selected application
component and view. All configurations that are available for that specific
application component and view are displayed in the Configurations
block. The current configuration is highlighted in the Configurations
block. The View block contains the fields, assignment blocks, and so on,
that are available in that specific view.
If you need more space to display data,
you can collapse either the Configurations block or the View
block.
Fact Sheet Configuration
When you start the fact sheet
configuration in the navigation or in the BSP Component Workbench you navigate
to the search page, where you can search for a fact sheet. All configurations
(customer configuration, standard configuration) and the role configuration
keys that belong to a fact sheet are displayed in the result list. Select a
fact sheet configuration and click Select Page Type to define the page
type and the page layout of the fact sheet. You can also click Next or
the hyperlink in the column Role Config. Key. Click Assign Views
to navigate to the next configuration step. In the Configurations block,
you see the selected fact sheet and its role configuration key. In the View
block you can assign fact sheet views to the selected fact sheet and to the
tiles. In the Properties block you see the different fact sheet titles.
If you need more space to display data,
you can hide each of the above-mentioned blocks.
UI Configuration Based on
Enhancement Sets
If you select an application component and view in the
CRM WebClient UI for which an enhancement set has been previously created in
SAP GUI, you can perform the configuration based on the enhanced component.
Configuration Access Sequence
You can change the standard access
sequence that is used to determine configurations. The actual configuration
that is used for a certain configurable view is determined on the basis of a
search key and the available configurations that exist for a specific view. The
configuration can either be a standard SAP configuration or a customer-specific
configuration.
To use your own access sequence, you need
to implement the Business Add-In (BAdI) BSP_DLC_ACCESS_ENHANCEMENT
in Customizing for Customer Relationship Management, by choosing 



.
DEFINING ROLL KEY
with roll key we can conrol complete configuration of view structure
or standard componenet.rollkey, component usage, object type, subobject type,
these four parameters controls complete configuration of component.these four
fields provides the technical information of component.
roll key controls the complete bussiness role.each config will have
different no of fields.
every transaction will have its own object type.
role key controls fields, navigation bar profile controls links,pecg
controls authorizations.pecg is a connection between user and bussiness
role.multiple bussiness roles are connected with pfcg.multiple pfcg s connected
with userlevel.
·
SELECT SPRO TRANSACTION.
·
CLICK SAP REF IMG.
·
SEARCH (CTRL+F).
·
PROVIDE SEARCH CONTENT AS :
DEFINE ROLE
·
EXECUTE DEFINE ROLE.
·
ADD NEW ENTRIES.
·
PROVIDE ROLE KEY STARTS WITH Z
AND PROVIDE DESCRIPTION.
·
SAVE.
·
PROVIDE ROLE CONFIG KEY AS
YOU’RE PROVIDED ROLE KEY.
·
SAVE.
·
WITH THIS YOUR ROLL KEY
GENARATED.
ENHANCEMENTS TO STANDARD COMPONENT
·
TO ENHANCE STANDARD COMPONENT
NOTHING BUT BSP APPLICATION NAME.
·
TO KNOW THE DETAILS OF STANDARD
APPLICATION GO TO TRANSACTION WEB-UI.
·
SELECT REQUIRED SALES CYCLE
THEN SELECT UR
REQUIRED UI.
·
ON THAT UI PRESS F2
BUTTON.
·
ONE POPUP WILL APPEAR FROM THAT
UI WE CAN GET COMPLETE DETAILS OF STANDARD COMPONENT.
·
DETAILS LIKE STANDARD
COMPONENT, OBJECT TYPE OR WE CAN SEE TECHNICAL INFORMATION AND FUNCTIONAL
INFORMATION.
·
STRUCTURAL INFORMATION MEANS
THAT COMPONENT VIEW STRUCTURE.
Adding A
Custom Description To A Standard Component Field
STEP1:
GO TO TCODE: CRM_UI
ü Select Any Business Role
ü for eg: Sales Professional->Sales
Cycle->Oppertunities->Opportunity ->
FsOppertunity-> Description
ü Press F2 on the Description
Field.
ü Then we Choose Technical Information of Component
like below.

STEP2:
GO TO TCODE: BSP_WD_CMPWB
From the Above we get Component: BT111H_OPPT
ü For this Component we have to
create Enhancement Set
ü Provide Enhancement Name you
want to Create.like: ZTestOPPT

ü Then Click on Create button.
ü Provide Description.
ü Click on Display.
ü Click on Enchance Component

ü Provide Enhancement Set You
have created.

Provide
Bsp Application Name: (USER DEFINE)

ü Click on Yes .
ü Press Enter ( here
Repository.xml will be created…..).
ü Save in local Package or Your
own Package.
Select Component Structure Browser…

ü Go to views-> BT111H_OPPT/Details
ü Right Click
BT111H_OPPT/Details then Select Enhance.

Save in
local package or own package.
Then
Provide Implementation Classname.

Then
Provide Context Class name.

Then
Save in local package or own Package.
In the
status bar u wil get msg like: Enhancement Was prepared Succesfully.
After
Enhancing You wil get ur
Implementation ZCLASS
Go to
BT111H_OPPT/Details double click .
Go to
View Strucutre-> Request Processing->Select DO_PREPARE_OUTPUT->Right
Click->Redefine.

Then
double click on Do_Prepare_Output.
Then
select change mode.
Write
the Code as below.
method DO_PREPARE_OUTPUT.
CALL METHOD SUPER->DO_PREPARE_OUTPUT
EXPORTING
IV_FIRST_TIME = IV_FIRST_TIME.
DATA: LR_COL TYPE REF TO CL_BSP_WD_COLLECTION_WRAPPER,
LR_ENTITY TYPE REF TO CL_CRM_BOL_ENTITY.
LR_COL = ME->TYPED_CONTEXT->BTADMINH->COLLECTION_WRAPPER.
LR_ENTITY ?= LR_COL->GET_CURRENT( ).
LR_ENTITY->SET_PROPERTY_AS_STRING( IV_ATTR_NAME = 'DESCRIPTION'
IV_VALUE = 'TEST OPPUTUNITY' ).
endmethod.
CALL METHOD SUPER->DO_PREPARE_OUTPUT
EXPORTING
IV_FIRST_TIME = IV_FIRST_TIME.
DATA: LR_COL TYPE REF TO CL_BSP_WD_COLLECTION_WRAPPER,
LR_ENTITY TYPE REF TO CL_CRM_BOL_ENTITY.
LR_COL = ME->TYPED_CONTEXT->BTADMINH->COLLECTION_WRAPPER.
LR_ENTITY ?= LR_COL->GET_CURRENT( ).
LR_ENTITY->SET_PROPERTY_AS_STRING( IV_ATTR_NAME = 'DESCRIPTION'
IV_VALUE = 'TEST OPPUTUNITY' ).
endmethod.
Save and
Activate……
Go to
SM30 AND
Provide:
BSPWDV_EHSET_ASG
Click on
Maintain.
Then
provide ZTESTOPPT enhancement
Then
save.

GO TO
CRM_UI
->CHECK
YOUR CUSTOMIZED DESCRIPTION FOR UR
FIELD.
The
Result will be.

View
Creation:
1. Go to Component Structure Browser.
2. Select Views.
3. Right Click On View.
4. Select Create.
Step1:
Create View
1. Start->Continue.
2. Define Name:
View
Name: ZChandu.
3. Add Model Node->Continue.
4. Add
Value Node-> Value Node: ZChandu.
5. Add Model Attributes->Continue.
6. Add Value Attributs.
ü Add AbapDictionaryType
ü Provide DDIC Structure:
ZDemo_Cus_lead.
ü Continue.
7. Create Links To Custom
Controllers->Continue.
Select
View Type: Table View.
Properties:
Configurable, Change/Display->Continue.
8. Complete.
Step2:
1. Go to Component Structure Browser.
2. Select the view you have created.
3. Double Click the view you have created.
4. Go to Configuration Tab.
5. Select New Configuration->Select all
Default values then Save.
6. Move Your Fields from Available Fields to
Display Fields then Save.
7.
Select Copy Configuration->Then Select Yes-> Provide Your Own Role
Config Key. ( For eg: ZRoleKey).
Step3:
1.
Select Runtime Repository Editor.
2.
Select Change Mode.
3.
Select ViewSets->ViewSet BT111H_OPPT/OpportunityOVViewSet->ViewArea
OverviewPage-> Right Click on ViewAreaOverviewPage->Select Addview.
Provide BspApplication of Your
Enhancement: ZchanduBsp
Provide the View You have Created:
TestView.
Step4:
1.
Double Click on above VIEW.
2. Go to
Configuration Tab: New Configuration.
3. Save
4. Go to
Copy Configuration->yes.
5.
Choose Configuration: ZChandu->Enter->Enter.
6. Move
Fields From available to Display Fields.
7. Save
Configration.
8. Save
Runtime Repository Editor.
9. Goto
Windows in Runtime Repository Editor.
1. Windows
Window MainWindow
(default)
View
BT111H_OPPT/OpportunityOVViewSet (default).
Doubli Click on Above Viewset.
10.
Edit.
11. Move
Our View From Assignment Block To Displayed Block.
12.
Provide Title for Our view in Displayed Block.
13.
Save……
14.
Check Our View on WebUI( Crm_ui ).
ADDING (INSERT,DELETE AND EDITLIST) TOOLBAR BUTTONS
AND VIEW BUTTONS
STEP1
1. Go to Component Structure Browser.
2. Go to Our View ( Foreg: TestView ).
3. Go to View Structure->Request
Processing->DO_PREPARE_OUTPUT
4. Right Click DO_PREPARE_OUTPUT-> Select
Redefine.
5. Write the Code…
Provide
Below Details in Implementation Class
Attributes
1. GT_TOOLBAR_BUTTONS
Instance Public Type CRMT_THTMLB_BUTTON_T.
2. GT_VIEW_BUTTONS Instance Public Type CRMT_THTMLB_BUTTON_T.
Code in
DO_PREPARE_OUTPUT
method DO_PREPARE_OUTPUT.
CALL METHOD SUPER->DO_PREPARE_OUTPUT
EXPORTING
IV_FIRST_TIME = IV_FIRST_TIME.
DATA : WA_BUTTON TYPE CRMT_THTMLB_BUTTON.
DATA : V_FLG TYPE boolean.
REFRESH: GT_TOOLBAR_BUTTONS,GT_VIEW_BUTTONS.
WA_BUTTON-ID = 'EDIT LIST'.
WA_BUTTON-TEXT = 'EDIT LIST'.
WA_BUTTON-ON_CLICK = 'EDITLIST'.
V_FLG = VIEW_GROUP_CONTEXT->IS_VIEW_IN_DISPLAY_MODE( ME ).
IF V_FLG = ABAP_TRUE.
WA_BUTTON-ENABLED = 'X'.
ELSE.
WA_BUTTON-ENABLED =''.
ENDIF.
APPEND WA_BUTTON TO GT_TOOLBAR_BUTTONS.
CLEAR WA_BUTTON.
WA_BUTTON-ID = 'INSERT'.
WA_BUTTON-TEXT = 'INSERT'.
WA_BUTTON-ON_CLICK = 'NEW'.
WA_BUTTON-ENABLED = 'X'.
APPEND WA_BUTTON TO GT_VIEW_BUTTONS.
CLEAR WA_BUTTON.
WA_BUTTON-ID = 'DELETE'.
*WA_BUTTON-TEXT = 'INSERT'.
WA_BUTTON-ON_CLICK = 'DEL '.
WA_BUTTON-ENABLED = 'X'.
WA_BUTTON-TYPE = CL_THTMLB_UTIL=>GC_ICON_DELETE.
APPEND WA_BUTTON TO GT_VIEW_BUTTONS.
CLEAR WA_BUTTON.
endmethod.
CALL METHOD SUPER->DO_PREPARE_OUTPUT
EXPORTING
IV_FIRST_TIME = IV_FIRST_TIME.
DATA : WA_BUTTON TYPE CRMT_THTMLB_BUTTON.
DATA : V_FLG TYPE boolean.
REFRESH: GT_TOOLBAR_BUTTONS,GT_VIEW_BUTTONS.
WA_BUTTON-ID = 'EDIT LIST'.
WA_BUTTON-TEXT = 'EDIT LIST'.
WA_BUTTON-ON_CLICK = 'EDITLIST'.
V_FLG = VIEW_GROUP_CONTEXT->IS_VIEW_IN_DISPLAY_MODE( ME ).
IF V_FLG = ABAP_TRUE.
WA_BUTTON-ENABLED = 'X'.
ELSE.
WA_BUTTON-ENABLED =''.
ENDIF.
APPEND WA_BUTTON TO GT_TOOLBAR_BUTTONS.
CLEAR WA_BUTTON.
WA_BUTTON-ID = 'INSERT'.
WA_BUTTON-TEXT = 'INSERT'.
WA_BUTTON-ON_CLICK = 'NEW'.
WA_BUTTON-ENABLED = 'X'.
APPEND WA_BUTTON TO GT_VIEW_BUTTONS.
CLEAR WA_BUTTON.
WA_BUTTON-ID = 'DELETE'.
*WA_BUTTON-TEXT = 'INSERT'.
WA_BUTTON-ON_CLICK = '
WA_BUTTON-ENABLED = 'X'.
WA_BUTTON-TYPE = CL_THTMLB_UTIL=>GC_ICON_DELETE.
APPEND WA_BUTTON TO GT_VIEW_BUTTONS.
CLEAR WA_BUTTON.
endmethod.
Go
to .htm for adding code for Display Buttons
1. Go to SE80.
2. Go to TagBrowser->Bsp
Extensions->chtmlb-> <chtmlb:configTable>->actions.
Drag
actions to .htm inside <chtmlb:configTable >
and
write the code like: actions = "<%= CONTROLLER->GT_VIEW_BUTTONS %>"
4. Go to TagBrowser->Bsp Extensions-> <thtmlb:areaFrameSetter>->toolbar
Buttons.
Drag <thtmlb:areaFrameSetter>
above <chtmlb:configTable>
And
Drag maxButtonNumber and toolbarButtons in between
<thtmlb:areaFrameSetter>
The
code like below.
<thtmlb:areaFrameSetter
maxButtonNumber = "2"
toolbarButtons = "<%= CONTROLLER->GT_TOOLBAR_BUTTONS %>"/>
The
Complete .htm code will be like below.
<%@page language="abap" %>
<%@extension name="thtmlb" prefix="thtmlb" %>
<%@extension name="chtmlb" prefix="chtmlb" %>
<%@extension name="bsp" prefix="bsp" %>
<thtmlb:areaFrameSetter
maxButtonNumber = "2"
toolbarButtons = "<%= CONTROLLER->GT_TOOLBAR_BUTTONS %>"/>
<chtmlb:configTable actionsMaxInRow = "3"
allRowsEditable = "TRUE"
displayMode = "<%= controller->view_group_context->is_view_in_display_mode( controller ) %>"
downloadToExcel = "FALSE"
actions = "<%= CONTROLLER->GT_VIEW_BUTTONS %>"
id = "Table1"
onRowSelection = "select"
personalizable = "FALSE"
selectedRowIndex = "<%= ZCHANDU->SELECTED_INDEX %>"
selectedRowIndexTable = "<%= ZCHANDU->SELECTION_TAB %>"
selectionMode = "<%= ZCHANDU->SELECTION_MODE %>"
table = "//ZCHANDU/TABLE"
usage = "EDITLIST"
visibleFirstRow = "<%= ZCHANDU->VISIBLE_FIRST_ROW_INDEX %>"
visibleRowCount = "6"
width = "100%"
xml = "<%= CONTROLLER->CONFIGURATION_DESCR->GET_CONFIG_DATA( ) %>" />
<%@extension name="thtmlb" prefix="thtmlb" %>
<%@extension name="chtmlb" prefix="chtmlb" %>
<%@extension name="bsp" prefix="bsp" %>
<thtmlb:areaFrameSetter
maxButtonNumber = "2"
toolbarButtons = "<%= CONTROLLER->GT_TOOLBAR_BUTTONS %>"/>
<chtmlb:configTable actionsMaxInRow = "3"
allRowsEditable = "TRUE"
displayMode = "<%= controller->view_group_context->is_view_in_display_mode( controller ) %>"
downloadToExcel = "FALSE"
actions = "<%= CONTROLLER->GT_VIEW_BUTTONS %>"
id = "Table1"
onRowSelection = "select"
personalizable = "FALSE"
selectedRowIndex = "<%= ZCHANDU->SELECTED_INDEX %>"
selectedRowIndexTable = "<%= ZCHANDU->SELECTION_TAB %>"
selectionMode = "<%= ZCHANDU->SELECTION_MODE %>"
table = "//ZCHANDU/TABLE"
usage = "EDITLIST"
visibleFirstRow = "<%= ZCHANDU->VISIBLE_FIRST_ROW_INDEX %>"
visibleRowCount = "6"
width = "100%"
xml = "<%= CONTROLLER->CONFIGURATION_DESCR->GET_CONFIG_DATA( ) %>" />
Go to CRM_UI &
Check the Buttons Added Or Not.
Event
Handling Code for Insert Button
1. Goto Component Structure Browser->Go to
Ourview->View Structure->
Event
Handler->Right Click Event Handler->Select Create option.
Provide
Event Name: NEW.
2. Select EH_ONNEW->Right
Click->Redefine.
CODE FOR
EH_ONNEW
method EH_ONNEW.
DATA: LR_VALUE_NODE TYPE REF TO CL_BSP_WD_VALUE_NODE.
TYPES: BEGIN OF TY_OPPT,
LEADTYPE TYPE ZDEMO_CUS_LEAD-LEADTYPE,
LEADTARGET TYPE ZDEMO_CUS_LEAD-LEADTARGET,
PARTNER TYPE ZDEMO_CUS_LEAD-PARTNER,
END OF TY_OPPT.
DATA: WA_LINE TYPE REF TO TY_OPPT.
CREATE DATA WA_LINE.
CREATE OBJECT LR_VALUE_NODE
EXPORTING
IV_DATA_REF = WA_LINE.
TYPED_CONTEXT->TESTNODE->COLLECTION_WRAPPER->ADD( LR_VALUE_NODE ).
endmethod.
DATA: LR_VALUE_NODE TYPE REF TO CL_BSP_WD_VALUE_NODE.
TYPES: BEGIN OF TY_OPPT,
LEADTYPE TYPE ZDEMO_CUS_LEAD-LEADTYPE,
LEADTARGET TYPE ZDEMO_CUS_LEAD-LEADTARGET,
PARTNER TYPE ZDEMO_CUS_LEAD-PARTNER,
END OF TY_OPPT.
DATA: WA_LINE TYPE REF TO TY_OPPT.
CREATE DATA WA_LINE.
CREATE OBJECT LR_VALUE_NODE
EXPORTING
IV_DATA_REF = WA_LINE.
TYPED_CONTEXT->TESTNODE->COLLECTION_WRAPPER->ADD( LR_VALUE_NODE ).
endmethod.
Event
Handling Code for Delete Button
1. Goto Component Structure Browser->Go to
Ourview->View Structure->
Event
Handler->Right Click Event Handler->Select Create option.
Provide
Event Name: DEL.
2. Select EH_ONDEL->Right
Click->Redefine.
CODE FOR
EH_ONDEL
method EH_ONDEL.
DATA: LR_COL TYPE REF TO IF_BOL_BO_COL,
LR_MARKED_COL TYPE REF TO IF_BOL_BO_COL,
LR_SELECT TYPE REF TO IF_BOL_BO_COL,
SELMODE_MULTIEDIT TYPE REF TO CL_BSP_WD_CONTEXT_NODE_TV,
SELECTION_MODE TYPE REF TO CL_BSP_WD_CONTEXT_NODE_TV,
LR_ENTITY TYPE REF TO IF_BOL_BO_PROPERTY_ACCESS.
LR_COL ?= TYPED_CONTEXT->ZCHANDU->COLLECTION_WRAPPER.
LR_MARKED_COL ?= LR_COL->GET_MARKED( ).
LR_ENTITY ?= LR_MARKED_COL->GET_FIRST( ).
* LR_COL->SET_MULTI_SELECT( ).
*ME->SELECTION_MODE = ME->SELMODE_MULTI .
WHILE LR_ENTITY IS BOUND.
LR_COL->REMOVE( LR_ENTITY ).
LR_ENTITY ?= LR_MARKED_COL->GET_NEXT( ).
ENDWHILE.
endmethod.
DATA: LR_COL TYPE REF TO IF_BOL_BO_COL,
LR_MARKED_COL TYPE REF TO IF_BOL_BO_COL,
LR_SELECT TYPE REF TO IF_BOL_BO_COL,
SELMODE_MULTIEDIT TYPE REF TO CL_BSP_WD_CONTEXT_NODE_TV,
SELECTION_MODE TYPE REF TO CL_BSP_WD_CONTEXT_NODE_TV,
LR_ENTITY TYPE REF TO IF_BOL_BO_PROPERTY_ACCESS.
LR_COL ?= TYPED_CONTEXT->ZCHANDU->COLLECTION_WRAPPER.
LR_MARKED_COL ?= LR_COL->GET_MARKED( ).
LR_ENTITY ?= LR_MARKED_COL->GET_FIRST( ).
* LR_COL->SET_MULTI_SELECT( ).
*ME->SELECTION_MODE = ME->SELMODE_MULTI .
WHILE LR_ENTITY IS BOUND.
LR_COL->REMOVE( LR_ENTITY ).
LR_ENTITY ?= LR_MARKED_COL->GET_NEXT( ).
ENDWHILE.
endmethod.
Event
Handling Code for EDITLIST Button
1. Goto Component Structure Browser->Go to
Ourview->View Structure->
Event
Handler->Right Click Event Handler->Select Create option.
Provide
Event Name: EDITLIST.
2. Select EH_ONEDITLIST->Right
Click->Redefine.
method EH_ONEDITLIST.
DATA: LR_CUCO TYPE REF TO CL_BT111H_O_OPPTDETAILSCU_IMPL,
LR_BTADMINH TYPE REF TO CL_CRM_BOL_ENTITY.
LR_CUCO ?= GET_CUSTOM_CONTROLLER( CONTROLLER_ID = 'BT111H_OPPT/OpptDetailsCuCo' ).
LR_BTADMINH ?= LR_CUCO->TYPED_CONTEXT->BTADMINH->COLLECTION_WRAPPER->GET_CURRENT( ).
IF LR_BTADMINH->LOCK( ) = ABAP_TRUE.
VIEW_GROUP_CONTEXT->SET_VIEW_EDITABLE( ME ).
ENDIF.
endmethod.
DATA: LR_CUCO TYPE REF TO CL_BT111H_O_OPPTDETAILSCU_IMPL,
LR_BTADMINH TYPE REF TO CL_CRM_BOL_ENTITY.
LR_CUCO ?= GET_CUSTOM_CONTROLLER( CONTROLLER_ID = 'BT111H_OPPT/OpptDetailsCuCo' ).
LR_BTADMINH ?= LR_CUCO->TYPED_CONTEXT->BTADMINH->COLLECTION_WRAPPER->GET_CURRENT( ).
IF LR_BTADMINH->LOCK( ) = ABAP_TRUE.
VIEW_GROUP_CONTEXT->SET_VIEW_EDITABLE( ME ).
ENDIF.
endmethod.
Here
TESTNODE is an object of CONTEXTNODE CLASS OBJECT
MAINTAINING
DROPDOWN AND POPUP MESSAGES
STEP1
1. Go to
Component Structure Browser.
2. Go to
Our view (for eg: ZCHANDUBSP/TESTVIEW).
3. Go to
Context->Contex Nodes->TestNode->Attributes-> LeadType->
Select GET_P_LEADTYPE.
4.
Double Click on GET_P_LEADTYPE->select yes.
Write Below code in
GET_P_LEADTYPE method
method GET_P_LEADTYPE.
CASE iv_property.
WHEN if_bsp_wd_model_setter_getter=>fp_fieldtype.
rv_value = cl_bsp_dlc_view_descriptor=>field_type_picklist.
WHEN if_bsp_wd_model_setter_getter=>fp_server_event.
rv_value = 'OPP_TYPE_SELECTED'. “ it is event handle method.
ENDCASE.
endmethod.
CASE iv_property.
WHEN if_bsp_wd_model_setter_getter=>fp_fieldtype.
rv_value = cl_bsp_dlc_view_descriptor=>field_type_picklist.
WHEN if_bsp_wd_model_setter_getter=>fp_server_event.
rv_value = 'OPP_TYPE_SELECTED'. “ it is event handle method.
ENDCASE.
endmethod.
STEP2
1. Go to
Component Structure Browser.
2. Go to
Our view (for eg: ZCHANDUBSP/TESTVIEW).
3. Go to
Context->Contex Nodes->TestNode->Attributes->LeadType->
Select GET_V_LEADTYPE.
4.
Double Click on GET_V_LEADTYPE ->select yes.
Write
Below code in GET_V_LEADTYPE method
method GET_V_LEADTYPE.
DATA: LR_DDLB TYPE REF TO CL_CRM_UIU_DDLB,
IT_DDLB TYPE BSP_WD_DROPDOWN_TABLE,
WA_DDLB TYPE BSP_WD_DROPDOWN_LINE.
CREATE OBJECT LR_DDLB
EXPORTING
IV_SOURCE_TYPE = 'T'.
APPEND INITIAL LINE TO IT_DDLB.
WA_DDLB-KEY = '11'.
WA_DDLB-VALUE = 'TYPE1'.
APPEND WA_DDLB TO IT_DDLB.
WA_DDLB-KEY = '12'.
WA_DDLB-VALUE = 'TYPE2'.
APPEND WA_DDLB TO IT_DDLB.
WA_DDLB-KEY = '13'.
WA_DDLB-VALUE = 'TYPE3'.
APPEND WA_DDLB TO IT_DDLB.
CALL METHOD LR_DDLB->SET_SELECTION_TABLE
EXPORTING
IT_SELECTION_TABLE = IT_DDLB.
* LR_DDLB->SET_SELECTION_TABLE( EXPORTING IT_SELECTION_TABLE = IT_DDLB ).
RV_VALUEHELP_DESCRIPTOR ?= LR_DDLB.
endmethod.
DATA: LR_DDLB TYPE REF TO CL_CRM_UIU_DDLB,
IT_DDLB TYPE BSP_WD_DROPDOWN_TABLE,
WA_DDLB TYPE BSP_WD_DROPDOWN_LINE.
CREATE OBJECT LR_DDLB
EXPORTING
IV_SOURCE_TYPE = 'T'.
APPEND INITIAL LINE TO IT_DDLB.
WA_DDLB-KEY = '11'.
WA_DDLB-VALUE = 'TYPE1'.
APPEND WA_DDLB TO IT_DDLB.
WA_DDLB-KEY = '12'.
WA_DDLB-VALUE = 'TYPE2'.
APPEND WA_DDLB TO IT_DDLB.
WA_DDLB-KEY = '13'.
WA_DDLB-VALUE = 'TYPE3'.
APPEND WA_DDLB TO IT_DDLB.
CALL METHOD LR_DDLB->SET_SELECTION_TABLE
EXPORTING
IT_SELECTION_TABLE = IT_DDLB.
* LR_DDLB->SET_SELECTION_TABLE( EXPORTING IT_SELECTION_TABLE = IT_DDLB ).
RV_VALUEHELP_DESCRIPTOR ?= LR_DDLB.
endmethod.
STEP3
1. Go to
Component Structure Browser.
2. Go to
Our view (for eg: ZCHANDUBSP/TESTVIEW).
3. Go to
Context->Contex Nodes->TestNode->Attributes-> LEADTARGET ->
Select GET_I_LEADTARGET.
4.
Double Click on GET_I_LEADTARGET.
Write the Below Code in
GET_I_LEADTARGET
method GET_I_LEADTARGET.
“ some
predefine code exist in this method.
IF CURRENT->GET_PROPERTY_AS_STRING( IV_ATTR_NAME = 'LEADTYPE' ) IS INITIAL.
RV_DISABLED = 'TRUE'.
ELSE.
RV_DISABLED = 'FALSE'.
ENDIF.
RV_DISABLED = 'TRUE'.
ELSE.
RV_DISABLED = 'FALSE'.
ENDIF.
endmethod.
STEP4
1. Go to
Component Structure Browser.
2. Go to
Our view (for eg: ZCHANDUBSP/TESTVIEW).
3. Go to
Context->Contex Nodes->TestNode->Attributes-> PARTNER ->
Select GET_I_PARTNER.
4.
Double Click on GET_I_PARTNER.
Write the Below Code in
GET_I_PARTNER.
method GET_I_PARTNER.
“ some predefine
code exist in this method.
IF CURRENT->GET_PROPERTY_AS_STRING( IV_ATTR_NAME = 'LEADTYPE' ) IS INITIAL.
RV_DISABLED = 'TRUE'.
ELSE.
RV_DISABLED = 'FALSE'.
ENDIF.
RV_DISABLED = 'TRUE'.
ELSE.
RV_DISABLED = 'FALSE'.
ENDIF.
endmethod.
“ Go to crm_ui and check dropdown list added or
not.
Step4: (Event Handler Method 'OPP_TYPE_SELECTED' Code)
1. Go to
Component Structure Browser.
2. Go to
Our view (for eg: ZCHANDUBSP/TESTVIEW).
3. Go to EventHanlder.->Right Click->Create
Provide
Event Name as: OPP_TYPE_SELECTED ->enter
4. Double Click On method EH_ONOPP_TYPE_SELECTED.
Write the
Below Code in EH_ONOPP_TYPE_SELECTED
method EH_ONOPP_TYPE_SELECTED.
DATA: LR_EVENT TYPE REF TO CL_HTMLB_EVENT_SELECTION,
LR_COL TYPE REF TO IF_BOL_BO_COL,
LR_ITR TYPE REF TO IF_BOL_BO_COL_ITERATOR,
LR_ENTITY TYPE REF TO IF_BOL_BO_PROPERTY_ACCESS,
LR_CORE TYPE REF TO CL_CRM_BOL_CORE,
LR_MSG TYPE REF TO CL_CRM_GENIL_GLOBAL_MESS_CONT,
V_INDEX TYPE I.
LR_CORE = CL_CRM_BOL_CORE=>GET_INSTANCE( ).
CALL METHOD LR_CORE->GET_GLOBAL_MESSAGE_CONT
RECEIVING
RV_RESULT = LR_MSG.
LR_EVENT ?= HTMLB_EVENT_EX.
CALL METHOD CL_THTMLB_UTIL=>GET_EVENT_INFO
EXPORTING
IV_EVENT = HTMLB_EVENT_EX
IMPORTING
EV_INDEX = V_INDEX.
LR_COL ?= TYPED_CONTEXT->TESTNODE->COLLECTION_WRAPPER.
LR_ITR ?= LR_COL->GET_ITERATOR( ).
LR_ENTITY ?= LR_ITR->GET_FIRST( ).
WHILE LR_ENTITY IS BOUND.
IF LR_ENTITY->GET_PROPERTY_AS_STRING( IV_ATTR_NAME = 'LEADTYPE' ) = LR_EVENT->SELECTION ANDSY-INDEX NE V_INDEX.
* CALL METHOD LR_MSG->ADD_MESSAGE
* EXPORTING
* IV_MSG_TYPE = 'F'
* IV_MSG_ID = 'ZMSG19'
* IV_MSG_NUMBER = '000'
* IV_MSG_V1 = LR_EVENT->SELECTION
* IV_SHOW_ONLY_ONCE = 'X'
* IV_MSG_LEVEL = '1'.
CALL METHOD LR_MSG->ADD_MESSAGE
EXPORTING
IV_MSG_TYPE = 'E'
IV_MSG_ID = 'ZMSG11'
IV_MSG_NUMBER = '000'
* IV_MSG_TEXT =
IV_MSG_V1 = LR_EVENT->SELECTION
* IV_MSG_V2 =
* IV_MSG_V3 =
* IV_MSG_V4 =
IV_SHOW_ONLY_ONCE = 'X'
IV_MSG_LEVEL = '1'.
ENDIF.
LR_ENTITY ?= LR_ITR->GET_NEXT( ).
ENDWHILE.
DATA: LR_EVENT TYPE REF TO CL_HTMLB_EVENT_SELECTION,
LR_COL TYPE REF TO IF_BOL_BO_COL,
LR_ITR TYPE REF TO IF_BOL_BO_COL_ITERATOR,
LR_ENTITY TYPE REF TO IF_BOL_BO_PROPERTY_ACCESS,
LR_CORE TYPE REF TO CL_CRM_BOL_CORE,
LR_MSG TYPE REF TO CL_CRM_GENIL_GLOBAL_MESS_CONT,
V_INDEX TYPE I.
LR_CORE = CL_CRM_BOL_CORE=>GET_INSTANCE( ).
CALL METHOD LR_CORE->GET_GLOBAL_MESSAGE_CONT
RECEIVING
RV_RESULT = LR_MSG.
LR_EVENT ?= HTMLB_EVENT_EX.
CALL METHOD CL_THTMLB_UTIL=>GET_EVENT_INFO
EXPORTING
IV_EVENT = HTMLB_EVENT_EX
IMPORTING
EV_INDEX = V_INDEX.
LR_COL ?= TYPED_CONTEXT->TESTNODE->COLLECTION_WRAPPER.
LR_ITR ?= LR_COL->GET_ITERATOR( ).
LR_ENTITY ?= LR_ITR->GET_FIRST( ).
WHILE LR_ENTITY IS BOUND.
IF LR_ENTITY->GET_PROPERTY_AS_STRING( IV_ATTR_NAME = 'LEADTYPE' ) = LR_EVENT->SELECTION AND
* CALL METHOD LR_MSG->ADD_MESSAGE
* EXPORTING
* IV_MSG_TYPE = 'F'
* IV_MSG_ID = 'ZMSG19'
* IV_MSG_NUMBER = '000'
* IV_MSG_V1 = LR_EVENT->SELECTION
* IV_SHOW_ONLY_ONCE = 'X'
* IV_MSG_LEVEL = '1'.
CALL METHOD LR_MSG->ADD_MESSAGE
EXPORTING
IV_MSG_TYPE = 'E'
IV_MSG_ID = 'ZMSG11'
IV_MSG_NUMBER = '000'
* IV_MSG_TEXT =
IV_MSG_V1 = LR_EVENT->SELECTION
* IV_MSG_V2 =
* IV_MSG_V3 =
* IV_MSG_V4 =
IV_SHOW_ONLY_ONCE = 'X'
IV_MSG_LEVEL = '1'.
ENDIF.
LR_ENTITY ?= LR_ITR->GET_NEXT( ).
ENDWHILE.
endmethod.
TO ADD AN ERROR MESSAGE FOR
SAME TYPE SELECTION.
1. Go to
Component Structure Browser.
2. Go to
Our view (for eg: ZCHANDUBSP/TESTVIEW).
3. Go to EventHanlder
4. Open method EH_ONOPP_TYPE_SELECTED
add below code to the existing code.
Create
ZMSGCL: To Display Message
1. Go SE91
2. Provide Message Class: ZMsgcl
4. Click on Create.
5. Go to Message Tab.
Write Below Code in the Message Tab.
000: LEADTYPE &1 ALREADY EXIST
Add below code to the existing code.( show pop up
code ).
LR_COL ?= TYPED_CONTEXT->TESTNODE->COLLECTION_WRAPPER.
LR_ITR ?= LR_COL->GET_ITERATOR( ).
LR_ENTITY ?= LR_ITR->GET_FIRST( ).
WHILE LR_ENTITY IS BOUND.
IF LR_ENTITY->GET_PROPERTY_AS_STRING( IV_ATTR_NAME = 'LEADTYPE' ) = LR_EVENT->SELECTION AND
CALL METHOD LR_MSG->ADD_MESSAGE
EXPORTING
IV_MSG_TYPE = 'E'
IV_MSG_ID = 'ZMSGCL'
IV_MSG_NUMBER = '000'
* IV_MSG_TEXT =
IV_MSG_V1 = LR_EVENT->SELECTION
IV_SHOW_ONLY_ONCE = 'X'
IV_MSG_LEVEL = '1'.
ENDIF.
LR_ENTITY ?= LR_ITR->GET_NEXT( ).
ENDWHILE.
Creation of POPUP DIALOG
Requirement: If We change the LEADTYPE the pop up
should be displayed as
Dependencies Exist do you want to change
them.
CONFIRMATION POP UP DIALOG
DISPLAY CODE
1. Go to
Component Structure Browser.
2. Go to
Our view (for eg: ZCHANDUBSP/TESTVIEW).
3. Go to EventHanlder
4. Open method EH_ONOPP_TYPE_SELECTED
add below code to the existing code.
Some
prerequisite information has to follow
The
Attributes that should be declared in Implementation Class
1. GR_CONF_POPUP Instance Attribute Type Ref To IF_BSP_WD_POPUP.
2.
V_INDEX TYPE I.
Add
below code to the existing code.( show pop up code ).
************* SHOW POPUP CODE ***************
LR_ENTITY ?= TYPED_CONTEXT->TESTNODE->COLLECTION_WRAPPER->FIND( IV_INDEX = V_INDEX ).
IF LR_ENTITY->GET_PROPERTY_AS_STRING( IV_ATTR_NAME = 'LEADTARGET' ) IS NOT INITIAL OR
LR_ENTITY->GET_PROPERTY_AS_STRING( IV_ATTR_NAME = 'PARTNER' ) IS NOT INITIAL.
CALL METHOD COMP_CONTROLLER->WINDOW_MANAGER->CREATE_POPUP_2_CONFIRM
EXPORTING
IV_TITLE = 'DEPENDANCY CONFIRMATION'
IV_TEXT = 'DEPENDANCY EXIST. DO YOU WANTO TO CANCEL'
IV_BTNCOMBINATION = IF_BSP_WD_WINDOW_MANAGER=>CO_BTNCOMB_YESNOCANCEL
* IV_CUSTOMBUTTONS =
RECEIVING
RV_RESULT = GR_CONF_POPUP.
CALL METHOD GR_CONF_POPUP->SET_ON_CLOSE_EVENT
EXPORTING
IV_VIEW = ME
IV_EVENT_NAME = 'CONF_POP_CLOSED'.
GR_CONF_POPUP->OPEN( ).
ENDIF.
Code for Event Handler CONF_POP_CLOSED.
1. Go to Component Structure Browser.
2. Go to Our view (for eg:
ZCHANDUBSP/TESTVIEW).
3. Go to
EventHanlder.->Right Click->Create
Provide Event Name as: CONF_POP_CLOSED
->enter
4.
Double Click On method EH_ CONF_POP_CLOSED.
Write the Below Code in EH_CONF_POP_CLOSED.
method EH_ONCONF_POP_CLOSED.
DATA: V_PLUG TYPE SEOCMPNAME,
LR_ENTITY TYPE REF TO IF_BOL_BO_PROPERTY_ACCESS.
V_PLUG = GR_CONF_POPUP->GET_FIRED_OUTBOUND_PLUG( ).
IF V_PLUG = 'YES'.
LR_ENTITY ?= TYPED_CONTEXT->TESTNODE->COLLECTION_WRAPPER
LR_ENTITY TYPE REF TO IF_BOL_BO_PROPERTY_ACCESS.
V_PLUG = GR_CONF_POPUP->GET_FIRED_OUTBOUND_PLUG( ).
IF V_PLUG = 'YES'.
LR_ENTITY ?= TYPED_CONTEXT->TESTNODE->COLLECTION_WRAPPER
-> FIND( IV_INDEX = V_INDEX ).
LR_ENTITY-> SET_PROPERTY_AS_STRING( IV_ATTR_NAME = 'LEADTARGET' IV_VALUE = '').
LR_ENTITY-> SET_PROPERTY_AS_STRING( IV_ATTR_NAME = 'PARTNER' IV_VALUE = '').
LR_ENTITY-> SET_PROPERTY_AS_STRING( IV_ATTR_NAME = 'LEADTARGET' IV_VALUE = '').
LR_ENTITY-> SET_PROPERTY_AS_STRING( IV_ATTR_NAME = 'PARTNER' IV_VALUE = '').
ENDIF.
endmethod.
endmethod.
Saving
Custom Data From Webui to Our Custom Table ( EH_ONSAVE )
STEP1:
1. Go to Component Structure Browser.
2. Go to CustomController
3. Select Any CustomeController( for eg:
BT111H_OPPT/OpptDetailsCuCo ).
4. Right Click on above Customcontrol.
5.
select Enhance.( after enhancing your zclass of impl & contx wil be
created).
6. Go to
Context->ContexNode->Right Click on Context Node->Select Create.
ContextNode
Creation
=====================
1. Start
2.
Define ContextNode.
ü Provide Name: OpptCn.
ü Select ValueNode RadioButton.
ü Continue.
3. Add Value.
ü Add AbapDictionaryType
ü Provide DDIC Structure:
ZDemo_Cus_lead.
ü Continue.
4.
Create Links to CustomController->Continue.
5.
Complete.
Save
Details………………
STEP2:
1. Go to
VIEWS From Component Structure Browser.
2. Go to
Context->Context Node->select your ContextNode->Right Click On
Context Node( OpptCn) ->Select Create
Binding.
3.
Provide Following Details:
BspApplication : BT111H_OPPT.
ControllerType : CustomController.
CustomController : OpptDetailsCuCo.do
TargetContextNode : OpptCn.
STEP3:
1. Go To
Componet Structure Browser->Views.
2.
Enhance BT111H_OPPT/OpportunityOVViewSet.
3.
Double Click on BT111H_OPPT/OpportunityOVViewSet.
4. Go to
EventHandler.
5.
Select EH_ONSAVE.
6. Right
Click EH_ONSAVE and Redefine.
Write
the Following Code in EH_ONSAVE
method EH_ONSAVE.
CALL METHOD SUPER->EH_ONSAVE
EXPORTING
HTMLB_EVENT = HTMLB_EVENT
HTMLB_EVENT_EX = HTMLB_EVENT_EX.
DATA: LR_CUCO TYPE REF TO ZL_BT111H_O_OPPTDETAILSCU_IMPL,
(the above class is whatever we enhanced in
CustomContoller….).
LR_COL TYPE REF TO IF_BOL_BO_COL,
LR_ITR TYPE REF TO IF_BOL_BO_COL_ITERATOR,
IT_DATA TYPE STANDARD TABLE OF ZDEMO_CUS_LEAD,
LR_ENTITY TYPE REF TO IF_BOL_BO_PROPERTY_ACCESS,
LR_BTADMINH TYPE REF TO CL_CRM_BOL_ENTITY,
WA_DATA TYPE ZDEMO_CUS_LEAD.
LR_CUCO ?= GET_CUSTOM_CONTROLLER( CONTROLLER_ID = 'BT111H_OPPT/OpptDetailsCuCo' ).
LR_BTADMINH ?= TYPED_CONTEXT->BTADMINH->COLLECTION_WRAPPER->GET_CURRENT( ).
WA_DATA-LEADGUID = LR_BTADMINH->GET_PROPERTY_AS_STRING( IV_ATTR_NAME = 'GUID' ).
LR_COL ?= LR_CUCO->ZTYPED_CONTEXT->OPPTCN->COLLECTION_WRAPPER.
LR_ITR ?= LR_COL->GET_ITERATOR( ).
LR_ENTITY ?= LR_ITR->GET_FIRST( ).
WHILE LR_ENTITY IS BOUND.
LR_ENTITY->GET_PROPERTIES( IMPORTING ES_ATTRIBUTES = WA_DATA ).
APPEND WA_DATA TO IT_DATA.
LR_ENTITY ?= LR_ITR->GET_NEXT( ).
ENDWHILE.
MODIFY ZDEMO_CUS_LEAD FROM TABLE IT_DATA.
LR_COL TYPE REF TO IF_BOL_BO_COL,
LR_ITR TYPE REF TO IF_BOL_BO_COL_ITERATOR,
IT_DATA TYPE STANDARD TABLE OF ZDEMO_CUS_LEAD,
LR_ENTITY TYPE REF TO IF_BOL_BO_PROPERTY_ACCESS,
LR_BTADMINH TYPE REF TO CL_CRM_BOL_ENTITY,
WA_DATA TYPE ZDEMO_CUS_LEAD.
LR_CUCO ?= GET_CUSTOM_CONTROLLER( CONTROLLER_ID = 'BT111H_OPPT/OpptDetailsCuCo' ).
LR_BTADMINH ?= TYPED_CONTEXT->BTADMINH->COLLECTION_WRAPPER->GET_CURRENT( ).
WA_DATA-LEADGUID = LR_BTADMINH->GET_PROPERTY_AS_STRING( IV_ATTR_NAME = 'GUID' ).
LR_COL ?= LR_CUCO->ZTYPED_CONTEXT->OPPTCN->COLLECTION_WRAPPER.
LR_ITR ?= LR_COL->GET_ITERATOR( ).
LR_ENTITY ?= LR_ITR->GET_FIRST( ).
WHILE LR_ENTITY IS BOUND.
LR_ENTITY->GET_PROPERTIES( IMPORTING ES_ATTRIBUTES = WA_DATA ).
APPEND WA_DATA TO IT_DATA.
LR_ENTITY ?= LR_ITR->GET_NEXT( ).
ENDWHILE.
MODIFY ZDEMO_CUS_LEAD FROM TABLE IT_DATA.
Endmethod.
SEARCHING
BASED ON LEADTYPE ( EH_ONSEARCH )
STEP1
(Create New Enhancement Set for Search Component).
1. Go to Transaction: bsp_wd_cmpwb.
2. Provide Component as BT111S_OPPT .
( Because it is the search
component for BT111H_OPPT).
Provide Component : BT111S_OPPT
Provide Enhancement Set : ZSearch.
Click On Create.
Provide Short Text.
3. Click Display for Created Enhancement.
4. Click on Enhancement Componenet.
5. Provide Enhancement Set: ZSearch.
6. Provide Bsp Application: ZSearchBsp
->Enter->yes->Enter.
7. Save Enhancement.
Step2.
1. Go to Componenet Structure Browser.
2. Right Click on BT111S_OPPT/Search->Select
Enhance.
3. Double Click on BT111S_OPPT.
4. Go to
ViewStructure->Event Handler->Select EH_ONSEARCH ->Right Click
Select Redefine.
5. Double Click on EH_ONSEARCH.
6. Go to Change Mode.
7. Write the Code.
Provide
Below Details in Implementation Class
1.
Attributes:
GT_ORIGINAL_SEARCH_CRITERIA
Instance Attribute public Type GENILT_SELECTION_PARAMETER_TAB
2.
Methods:
1. SAVE_UI_SEARCH_CRITERIA
Parameters: IR_QS importing Type Ref To CL_CRM_BOL_DQUERY_SERVICE
2. RESTORE_UI_SEARCH_CRITERIA
Parameters: IR_QS importing Type Ref To CL_CRM_BOL_DQUERY_SERVICE
method EH_ONSEARCH.
DATA: LR_QS TYPE REF TO CL_CRM_BOL_DQUERY_SERVICE,
LR_SEL_COL TYPE REF TO IF_BOL_BO_COL,
LR_ENTITY TYPE REF TO IF_BOL_BO_PROPERTY_ACCESS,
WA_PARAM TYPE GENILT_SELECTION_PARAMETER,
IT_DATA TYPE STANDARD TABLE OF ZDEMO_CUS_LEAD,
IT_SEL_TYPE TYPE STANDARD TABLE OF SELOPTTAB,
WA_SEL TYPE SELOPTTAB,
WA_DATA TYPE ZDEMO_CUS_LEAD,
LV_LOW TYPE STRING.
LR_QS ?= TYPED_CONTEXT->SEARCH->COLLECTION_WRAPPER->GET_CURRENT( ).
SAVE_UI_SEARCH_CRITERIA( IR_QS = LR_QS ).
LR_SEL_COL ?= LR_QS->GET_SELECTION_PARAMS( ).
LR_ENTITY ?= LR_SEL_COL->GET_FIRST( ).
WHILE LR_ENTITY IS BOUND.
LR_ENTITY->GET_PROPERTIES( IMPORTING ES_ATTRIBUTES = WA_PARAM ).
IF WA_PARAM-ATTR_NAME = 'LEADTYPE'.
MOVE-CORRESPONDING WA_PARAM TO WA_SEL.
APPEND WA_SEL TO IT_SEL_TYPE.
ENDIF.
LR_ENTITY ?= LR_SEL_COL->GET_NEXT( ).
ENDWHILE.
SELECT * FROM ZDEMO_CUS_LEAD INTO TABLE IT_DATA
WHERE LEADTYPE IN IT_SEL_TYPE.
LOOP AT IT_DATA INTO WA_DATA.
LV_LOW = WA_DATA-LEADID.
CALL METHOD LR_QS->ADD_SELECTION_PARAM
EXPORTING
IV_ATTR_NAME = 'OBJECT_ID'
IV_SIGN = 'I'
IV_OPTION = 'EQ'
IV_LOW = LV_LOW.
ENDLOOP.
CALL METHOD SUPER->EH_ONSEARCH
EXPORTING
HTMLB_EVENT = HTMLB_EVENT
HTMLB_EVENT_EX = HTMLB_EVENT_EX.
RESTORE_UI_SEARCH_CRITERIA( EXPORTING IR_QS = LR_QS ).
endmethod.
DATA: LR_QS TYPE REF TO CL_CRM_BOL_DQUERY_SERVICE,
LR_SEL_COL TYPE REF TO IF_BOL_BO_COL,
LR_ENTITY TYPE REF TO IF_BOL_BO_PROPERTY_ACCESS,
WA_PARAM TYPE GENILT_SELECTION_PARAMETER,
IT_DATA TYPE STANDARD TABLE OF ZDEMO_CUS_LEAD,
IT_SEL_TYPE TYPE STANDARD TABLE OF SELOPTTAB,
WA_SEL TYPE SELOPTTAB,
WA_DATA TYPE ZDEMO_CUS_LEAD,
LV_LOW TYPE STRING.
LR_QS ?= TYPED_CONTEXT->SEARCH->COLLECTION_WRAPPER->GET_CURRENT( ).
SAVE_UI_SEARCH_CRITERIA( IR_QS = LR_QS ).
LR_SEL_COL ?= LR_QS->GET_SELECTION_PARAMS( ).
LR_ENTITY ?= LR_SEL_COL->GET_FIRST( ).
WHILE LR_ENTITY IS BOUND.
LR_ENTITY->GET_PROPERTIES( IMPORTING ES_ATTRIBUTES = WA_PARAM ).
IF WA_PARAM-ATTR_NAME = 'LEADTYPE'.
MOVE-CORRESPONDING WA_PARAM TO WA_SEL.
APPEND WA_SEL TO IT_SEL_TYPE.
ENDIF.
LR_ENTITY ?= LR_SEL_COL->GET_NEXT( ).
ENDWHILE.
SELECT * FROM ZDEMO_CUS_LEAD INTO TABLE IT_DATA
WHERE LEADTYPE IN IT_SEL_TYPE.
LOOP AT IT_DATA INTO WA_DATA.
LV_LOW = WA_DATA-LEADID.
CALL METHOD LR_QS->ADD_SELECTION_PARAM
EXPORTING
IV_ATTR_NAME = 'OBJECT_ID'
IV_SIGN = 'I'
IV_OPTION = 'EQ'
IV_LOW = LV_LOW.
ENDLOOP.
CALL METHOD SUPER->EH_ONSEARCH
EXPORTING
HTMLB_EVENT = HTMLB_EVENT
HTMLB_EVENT_EX = HTMLB_EVENT_EX.
RESTORE_UI_SEARCH_CRITERIA( EXPORTING IR_QS = LR_QS ).
endmethod.
The Code for Below two Methods SAVE_UI_SEARCH_CRITERIA & RESTORE_UI_SEARCH_CRITERIA available In Repository
Information System (SE15).
SAVE_UI_SEARCH_CRITERIA
code.
method SAVE_UI_SEARCH_CRITERIA.
DATA: lr_selparam_col TYPE REF TO if_bol_bo_col.
CALL METHOD ir_qs->get_selection_params
RECEIVING
rv_result = lr_selparam_col.
DATA: lv_iterator TYPE REF TO if_bol_bo_col_iterator,
lv_param TYPE REF TO if_bol_bo_property_access.
DATA: ls_selection TYPE genilt_selection_parameter.
REFRESH gt_original_search_criteria.
TRY.
lv_iterator = lr_selparam_col->get_iterator( ).
lv_param = lv_iterator->get_first( ).
WHILE lv_param IS BOUND.
* Get the attributes out
lv_param-> get_properties( IMPORTING es_attributes = ls_selection ).
* save in global instance varialbe for later reuse.
APPEND ls_selection TO gt_original_search_criteria.
* Get all the entitys from the collection
lv_param = lv_iterator->get_next( ).
ENDWHILE.
CATCH cx_sy_ref_is_initial. "#EC NO_HANDLER
ENDTRY.
endmethod.
DATA: lr_selparam_col TYPE REF TO if_bol_bo_col.
CALL METHOD ir_qs->get_selection_params
RECEIVING
rv_result = lr_selparam_col.
DATA: lv_iterator TYPE REF TO if_bol_bo_col_iterator,
lv_param TYPE REF TO if_bol_bo_property_access.
DATA: ls_selection TYPE genilt_selection_parameter.
REFRESH gt_original_search_criteria.
TRY.
lv_iterator = lr_selparam_col->get_iterator( ).
lv_param = lv_iterator->get_first( ).
WHILE lv_param IS BOUND.
* Get the attributes out
lv_param-> get_properties( IMPORTING es_attributes = ls_selection ).
* save in global instance varialbe for later reuse.
APPEND ls_selection TO gt_original_search_criteria.
* Get all the entitys from the collection
lv_param = lv_iterator->get_next( ).
ENDWHILE.
CATCH cx_sy_ref_is_initial. "#EC NO_HANDLER
ENDTRY.
endmethod.
RESTORE_UI_SEARCH_CRITERIA code.
method RESTORE_UI_SEARCH_CRITERIA.
DATA: col TYPE REF TO if_bol_bo_col.
FIELD-SYMBOLS: <ls_selection_parameters> TYPE genilt_selection_parameter.
col = ir_qs->get_selection_params( ).
* clear the selection parameter collection....
CALL METHOD col->clear .
LOOP AT gt_original_search_criteria ASSIGNING <ls_selection_parameters>.
* to have the original UI selection param table for the search
CALL METHOD ir_qs->add_selection_param
EXPORTING
iv_attr_name = <ls_selection_parameters>-attr_name
iv_sign = <ls_selection_parameters>-sign
iv_option = <ls_selection_parameters>-option
iv_low = <ls_selection_parameters>-low
iv_high = <ls_selection_parameters>-high.
DATA: col TYPE REF TO if_bol_bo_col.
FIELD-SYMBOLS: <ls_selection_parameters> TYPE genilt_selection_parameter.
col = ir_qs->get_selection_params( ).
* clear the selection parameter collection....
CALL METHOD col->clear .
LOOP AT gt_original_search_criteria ASSIGNING <ls_selection_parameters>.
* to have the original UI selection param table for the search
CALL METHOD ir_qs->add_selection_param
EXPORTING
iv_attr_name = <ls_selection_parameters>-attr_name
iv_sign = <ls_selection_parameters>-sign
iv_option = <ls_selection_parameters>-option
iv_low = <ls_selection_parameters>-low
iv_high = <ls_selection_parameters>-high.
ENDLOOP.
endmethod.
AET (APPLICATION ENHANCEMENT
TOOL)
-------------------------------------------------
1.
AET is
available from version 7.0 onwards
2.
Any
program is starts with ‘AXT’ means that
is belongs to AET
3.
AET is
used to add the custom field to standard application.
DEMO:
---------
STEP 1:
(ONE TIME ACTIVITY PER CLIENT)
--------
1.
TCODE :
AXTSYS
2.
Provide
package for extension : zvicky
3.
provide
name space : z
STEP 2:
--------
1.
Goto
webui (CRM_UI)
2.
Click on
personalize(user level )
3.
under
settings,click on personalize settings
4.
select
Enable configuration mode check box
5.
save.(after
save one button will appear on screen with some text ‘show configuration
area’).
6.
In the
UI , select Opportunity
7.
On the
screen, click on show configurable area
8.
single
click on blue screen where you want add the field in the application.
9.
A new
window is displayed with configurations
10.
under
that window select create new field
11.
select
one business object (opportunity)
12.
select
ORDERADM_H from object part(for add a
field to header view.
13.
click on
ok .
14.
Provide
field label : TEST ACTION
15.
Data
type : Text with capital
letter
16.
length : 20
17.
search
relavent : search and result(f4)
18.
Enable
the generate check box
19.
select
translations( for different languages)
(Note the enhancement id in notepad)
20. click on back,click on enable expert mode button
(for adding our own
field id and data element)
21. click on your enhancement id then
we will get one
Window
22. provide field id : zztest_aet(always starts ‘zz’)
Provide data element :
zoppt_type->enter.
23. click on back
24. click on save and generate
button.
25. select choose button request number
26. Goto UI then check ur
field added or not.
27. SELECT SHOW CONFIGURABLE AREAS.
28. CLICK ON HEADER AREA.
29. WEB PAGE DIALOG WILL OPEN.
30.IN AVAILABLE FIELDS WE CAN SEE OUR FIELD WHICH IS ADDED BY AET.
31.MAKE IT DISPLAYED FIELD.
32.WE CAN SEE THE FIELD IN STANDARD COMPONENT.
EEWB(EASY ENHANCEMENT
WORKBENCH)
--------------------------------------------------
Ø EEWB is used in <7.0
version.
Ø Here we are using project to
do enhancement
Ø It is used to add the new
field to the standard one
DEMO :
--------
1.
TCODE:EEWB
2.
Enter
filter : project
3.
name : zproject ->enter.
4.
create
5.
description
: my enhancement on eewb
6.
package : zvicky
7.
save
8.
under
create field select change for two fields
9.
save
step 2:
-------
1.
Right click on customized project
2.
create
extension
3.
provide
the following things
Name : zeewb_vicky
Desription: my extension
EEWB bus.obj: Opportunity
(using f4 select suitable
Extension type: Opport_h (using f4)
4.
click on
ok
5.
then we
wil get wizard
step 3:
-------
1.
click on
continue
2.
provide
extension title : zeewb_extvicky->continu
3.
under
business transaction types select CRM Opportunity ->continue
4.
provide
field label : Test EEWBvicky
5.
Data
type : character string
6.
field
length : 20->continue
7.
Enable
header check box
8.
sub
object : adminstration
header(use f4)
9.
continue
10.
Enable
search check box->continue
11.
complete
12.
click on
CRM_BTX_ADD_NEW_FIELDS we can see all
the details of customization.
step 4:
-------
1.
Goto
Tcode :SE11
2.
Provide
table name : CRMD_ORDERADM_H
3.
Display
4.
click on
include: CRMT_ORDERADM_H_EXT
5.
Here we
will check our field added or not, through our description.
CUSTOM COMPONENT CREATION
For Custom Component Creation we have to follow the below steps

Clear Explanation
ReplyDeleteThanks & Regards
Dinesh Gurram
Really helpful. Thanks.
ReplyDeletei am newly working in crm ,please anyone tell where & what codes are using in this ?
ReplyDelete1. A new field will be introduced in the quote line item screen showing the applicable pricing category derived from the custom table. This field should be called, “Third Party Pricing” To derive the right pricing, the system should look for an entry in the custom table that holds the quote’s location account material id, and a validity to and from date range that is still active (e.g., current system date falls within the validity date range) AND the inhibit flag is unchecked. If no entry exists for the given location account OR if there is an entry but the third party pricing is no longer valid according to the PPL (pricing table), a third party pricing should be defaulted. This default should be one of the following:
a. Non- Professional: If the location account has an attribute of “Non-Professional” and if the non-professional third party pricing is available for the product. This non-professional attribute can be derived by pulling the customer’s organization type. Customers with an assigned organizational type of either “Academia” or “Retail” are considered Non-Professional. See Appendix 10.2.2 for the listing of organizational types. Note that the non-professional/professional attribute is NOT part of customer master but it is based on the organizational type value of the customer. It will be derived by SAP CRM only when determining if a customer should receive a non-professional or educational discount during the quote process. This needs to be especially highlighted during user training.
b. Standard: If customer is NOT a non-professional, then default to Standard. Standard will always have a 0% discount.
nice post thanks for sharing Swathi
ReplyDeleteThere are various online sources to provide you informative details on this topic, but this is one is very helpful.
ReplyDeleteSap CRM