You are on page 1of 6

4/7/2014 SAP CRM WEBUI Dynamic Navigation to Activity Create - CRM - SCN Wiki

http://wiki.scn.sap.com/wiki/display/CRM/SAP+CRM+WEBUI+Dynamic+Navigation+to+Activity+Create 1/6
Getting Started Newsletters Store
Search the Community


Welcome, Guest Login Register
Products Services & Support About SCN Downloads
Industries Training & Education Partnership Developer Center
Lines of Business University Alliances Events & Webinars Innovation
Added by Guest, last edited by crmuser123 on Jul 17, 2012
CRM / / CRM Web Client UI Framework
SAP CRM WEBUI Dynamic Navigation to Activity Create
Link: Add the f ollowing paper under
http://wiki.sdn.sap.com/wiki/display/CRM/CRM+Web+Client+UI+Framework
Summary: This paper illustrates how to dynamically navigate to "create activity" of transaction type '0010', using the class CL_CRM_UI_DESCRIPTOR_OBJ_SRV and the method
CREATE_UI_OBJECT_BASED.
About Author: I have been working in SAPCRM f or past 6 years. I am currently working f or IBM India Pvt. Ltd. My Key skills are BSP, CRM technical and WEB ui.
Create a component. Create a view without any Model and value nodes.
Attach the view to the window.
Create an inbound plug f or the window.
Create an interf ace.
Attach the window and inbound plug to the interf ace.
Create target links and logical links.

4/7/2014 SAP CRM WEBUI Dynamic Navigation to Activity Create - CRM - SCN Wiki
http://wiki.scn.sap.com/wiki/display/CRM/SAP+CRM+WEBUI+Dynamic+Navigation+to+Activity+Create 2/6
Add the f ollowing code in the view layout
Once you have added the link in the navigation prof ile of your business role.
You will get the f ollowing output.
4/7/2014 SAP CRM WEBUI Dynamic Navigation to Activity Create - CRM - SCN Wiki
http://wiki.scn.sap.com/wiki/display/CRM/SAP+CRM+WEBUI+Dynamic+Navigation+to+Activity+Create 3/6
Af ter this is done , create an event handler of the name "create".
Add the f ollowing code in the "create" event handler.
As you can see in the code below, we are using the class CL_CRM_UI_DESCRIPTOR_OBJ_SRV and method CREATE_UI_OBJECT_BASED.
We are passing the f ollowing parameters.
OBJECT_TYPE= BT126_APPT
and OBJECT_ACTION = 'D' ********* 'D' is f or create.
Also we are creating a value node, to pass the value of the transaction type.
In our example the transaction type is '0010'
We add the 2 entities
1) The dynamic navigation entity and
4/7/2014 SAP CRM WEBUI Dynamic Navigation to Activity Create - CRM - SCN Wiki
http://wiki.scn.sap.com/wiki/display/CRM/SAP+CRM+WEBUI+Dynamic+Navigation+to+Activity+Create 4/6
2) The value node entity to the navigation object.
Our Navigation prof ile needs to have the generic mapping entry shown in red.
At runtime webui picks the target id TBT110APPC and calls the inbound plug related to this target link.
Once you click on the button create now, it navigates to the Activity Creation Screen.


4/7/2014 SAP CRM WEBUI Dynamic Navigation to Activity Create - CRM - SCN Wiki
http://wiki.scn.sap.com/wiki/display/CRM/SAP+CRM+WEBUI+Dynamic+Navigation+to+Activity+Create 5/6
Following is the code witten in the event handler create.
************************************************************************************
method EH_ONCREATE.
data: lr_nav_descr TYPEREF TO if _bol_bo_property_access.
data: lr_navigation TYPEREF TO if _crm_ui_navigation_service.
data: lr_col TYPEREF TO cl_crm_bol_bo_col.
data: rv_value_node TYPEREF TO cl_bsp_wd_value_node.
DATA dref TYPEREF TO data.
FIELD-SYMBOLS <ref > TYPEzprocesstype.
CREATEDATA dref TYPEzprocesstype.
ASSIGN dref ->* TO <ref >.
<ref >-PROCESS_TYPE= '0010'.
CREATEOBJECT rv_value_node
EXPORTING
iv_data_ref = dref .
CALL METHOD rv_value_node->if _bol_bo_property_access~set_property
EXPORTING
iv_attr_name = 'PROCESS_TYPE'
iv_value = <ref >-PROCESS_TYPE.
cl_crm_ui_descriptor_obj_srv=>create_ui_object_based(
EXPORTING iv_ui_object_type = 'BT126_APPT'
iv_ui_object_action = 'D'
RECEIVING rr_result = lr_nav_descr ).
CHECK lr_nav_descr IS BOUND.
lr_navigation = cl_crm_ui_navigation_service=>get_instance( ).
CHECK lr_navigation IS BOUND.
* Check whether navigation is supported
IF lr_navigation->is_dynamic_nav_supported( lr_nav_descr ) NEabap_true.
return.
ELSE.
CREATEOBJECT lr_col.
lr_col->if _bol_bo_col~add( iv_entity = lr_nav_descr ).
lr_col->if _bol_bo_col~add( iv_entity = rv_value_node ).
lr_navigation->navigate_dynamically( lr_col ).
endif .
endmethod.
4/7/2014 SAP CRM WEBUI Dynamic Navigation to Activity Create - CRM - SCN Wiki
http://wiki.scn.sap.com/wiki/display/CRM/SAP+CRM+WEBUI+Dynamic+Navigation+to+Activity+Create 6/6
************************************************************************************
No labels
Follow SCN
Contact Us SAP Help Portal
Privacy Terms of Use Legal Disclosure Copyright

You might also like