table view in crm

18
Table view Creation of new component : Go to BSP_WD_CMPWB(TCode) and give component name and select create button and give Description, Window name. Go to Runtime Repository and right click on model and select Add Model. Give Component set name is ‘ALL’. Than save the Runtime Repository. Creation of Custom Controller: Go to Component structure browser and right click on custom controller and select create option. Than you will get wizard like below screen shot.

Upload: chiranjeevi-meesa

Post on 28-Oct-2014

92 views

Category:

Documents


5 download

DESCRIPTION

Explains how to work with Table Views in CRM UI.

TRANSCRIPT

Page 1: Table View in CRM

Table view

Creation of new component: Go to BSP_WD_CMPWB(TCode) and give component name and select create button and give Description, Window name.

Go to Runtime Repository and right click on model and select Add Model. Give Component set name is ‘ALL’. Than save the Runtime Repository.

Creation of Custom Controller: Go to Component structure browser and right click on custom controller and select create option. Than you will get wizard like below screen shot.

Page 2: Table View in CRM

Click continue and give custom controller name. Then click continue and give model node name and give BOL Entities like below screen shot.BOL Entity — BTQR1Order Search Result Object

Then skip all steps and click complete button.Right click on context node of custom controller and select create option like below screen shot. Than you will get wizard.

Page 3: Table View in CRM

Click continue. Than give context node name and give Bol entity like below screen shot.BOL Entity — BTOrder Root Object

Click continue till Define Dependency option. Give Higher level context node is BTQR1Order and Bol Relation is BTADVS1Ord like below screen shot.BTADVS1Ord BOL relation in BTQR1order objectwith the root object (BTOrder).

Page 4: Table View in CRM

Click complete button.

Creation of Search View: In Component structure browser, right click on view and select create option you will get wizard. Then click continue and give View name as ‘Search’ and click continue. Then give Model nodes like below screen shot.

BOL Entity — BTQ1Order dynamic search Object

BOL Entity — BTQR1Order Search Result object

Page 5: Table View in CRM

Click continue till Create links to Custom Controller step. In this step give context node, BSP Application, Custom controller and context node name like below screen shot.

Click continue and select View Type as Empty View. Than click complete.

Page 6: Table View in CRM

Creation of Result View: In Component structure browser and right click on view and select create option you will get wizard. Then click continue and give View name as ‘Result’ and click continue. Then give Model nodes like below screen shot.BOL Entity — BTQR1Order Search Result objectBOL Entity — BTOrder Root object

Click continue till Create links to Custom Controllers step.

Page 7: Table View in CRM

Click continue and In next step select view type as Table view like below screen.

Then click complete.

Creation of Viewset: In component structure browser right click on views and select create View Set option like below screen shot.

Page 8: Table View in CRM

Then give viewset name and give grid size like below screen shot.

Then click continue. In next step define view areas for search view and result view like below screen shot.

Page 9: Table View in CRM

Then click complete.Then Go to Runtime repository and add views to view area of view set like below screen shot.

Add Search and Result views to respecting view areas. And add this viewset to window like below screen shot. Then save the Runtime repository.

Page 10: Table View in CRM

Then right click on window and select Flag as Default option like below screen.

Then go to Implementation class of Search view like below screen shot.

Page 11: Table View in CRM

Go to properties of Implementation of class like below.

Then click on super class you will get another super class like below screen shot.

Page 12: Table View in CRM

Then change this super class i.e. CL_BSP_WD_VIEW_CONTROLLER to CL_BSP_WD_ADVSEARCH_CONTROLLER like below screen shot.

Now go to Implementation class of Search view context node like below.

Now go to properties tab and change the super class to CL_CRM_UIU_BT_ADVS_CN like below screen shot.

Page 13: Table View in CRM

Then go to Search.htm and add the following code.

<thtmlb:advancedSearch id = "advs0" fieldMetadata = "<%=controller->get_dquery_definitions( ) %>" header = "<%= BTQ1Order->get_param_struct_name( ) %>" fieldNames = "<%= controller->GET_POSSIBLE_FIELDS( ) %>" values = "//BTQ1Order/PARAMETERS" maxHits = "//BTQ1Order/MAX_HITS" onEnter = "SEARCH" ajaxDeltaHandling = "false" />

<thtmlb:searchButtonsArea><thtmlb:button id = "SearchBtn"design = "EMPHASIZED"onClick = "SEARCH"text = "Search"tooltip = "Search" /></thtmlb:searchButtonsArea>

Now click on Configuration tab of Search view. And move fields from Available to Selected criteria like below screen shot. Later save the changes.

Page 14: Table View in CRM

Then Go to Result.htm and add the following code.

<%Data: lv_xml type string.lv_xml = controller->configuration_descr->get_config_data( ). %><chtmlb:config xml = "<%= lv_xml %>"mode = "RUNTIME" />

<chtmlb:tableExtension tableId = "ResultList" layout = "FIXED" ><chtmlb:configTable xml= "<%= lv_xml %>" id ="ResTable" navigationMode = "BYPAGE" onRowSelection = "select" table = "//BTQR1Order/TABLE" width = "100%" headerVisible = "FALSE" hasLeadSelection = "TRUE " visibleRowCount = "10" actionsMaxInRow = "5" selectionMode = "<%=BTQR1Order->SELECTION_MODE %>" /></chtmlb:tableExtension>

Now click on Configuration tab of Result view. And move fields from Available to Selected criteria like below screen shot. After save this changes.

Page 15: Table View in CRM

Go to Searchviewset.htm and adjust this view code with help of following code.

<chtmlb:pageType type = "SEARCH">

<thtmlb:searchFrame showSearchFields = "TRUE">

<thtmlb:searchCriteriaFrame><thtmlb:searchArea><thtmlb:searchTagArea>

<bsp:call comp_id = "<%= controller->GET_VIEWAREA_CONTENT_ID( 'Query' ) %>" url = "<%= controller->GET_VIEWAREA_CONTENT_URL( 'Query' ) %>" />

</thtmlb:searchTagArea></thtmlb:searchArea></thtmlb:searchCriteriaFrame>

<thtmlb:searchResultFrame> <bsp:call comp_id = "<%= controller->GET_VIEWAREA_CONTENT_ID( 'Result' ) %>" url = "<%= controller->GET_VIEWAREA_CONTENT_URL( 'Result' ) %>" /></thtmlb:searchResultFrame>

</thtmlb:searchFrame></chtmlb:pageType>

Creation of Event handler for Search button: Go to search view and right click on event handler and select create option like below screen shot.

Page 16: Table View in CRM

Then give name of Event handler and click continue.

Then double click on Event handler method and add below code.

DATA : lr_qs TYPE REF TO cl_crm_bol_dquery_service, lr_qr TYPE REF TO if_bol_bo_col, lr_msg_srv TYPE REF TO cl_bsp_wd_message_service.

lr_qs ?= me->typed_context->btq1order->collection_wrapper->get_current( ). lr_qr = lr_qs->get_query_result( ).

IF lr_qr->size( ) IS INITIAL. lr_msg_srv = me->view_manager->get_message_service( ). lr_msg_srv->add_message( iv_msg_type = 'I' iv_msg_id = 'CRM_UIU_SEARCH' iv_msg_number = '001' ). ENDIF.

me->typed_context->btqr1order->set_collection( lr_qr ).

Now test your application. You will get screen like below.

Page 17: Table View in CRM

Give Business partner or Object id and click search button you will get result like below screen shot.

You can also cross check the result using Bol browser. Go to Tcode Genil_Bol_Browser and select BTQ1Order and give Business partner number which you have given in search view like below screen shot.

Page 18: Table View in CRM

If you get same entries which you got in result view that means your application is working properly.