Techskills

May 9, 2009

SAP CRM — WEB IC Create a new search view and result view

Result View

Now let  let us add the result view.

Adding the result view is same as the above.  Just follow the steps.

1. Create the Result view with name as resultview.

2.Add Model node as TestResult and link to BOL Entity as TestResult.

3. Add model attributes and select all the fields in the node.

4. Link the node to the custom controller to the view node.

      search-result-20

5. In the end select the view type as Table view  and the context node as TestResult and complete the view creation.

     search-result-19

Make the view configurable and change the existing code to 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” %>
<%@extension name=”chtmlb” prefix=”chtmlb” %>
<%@extension name=”thtmlb” prefix=”thtmlb” %>
<%
  DATA:
  lv_xml    TYPE string,
  lv_collapsed type abap_bool,
  lv_lines     type i.
  lv_xml = controller->configuration_descr->get_config_data( ).
  lv_lines = 20.
%>
<chtmlb:tableExtension tableId = “ResultList”
                       layout  = “FIXED” >
  <chtmlb:configTable xml                   = “<%= lv_xml %>”
                      id                    = “ResTable”
                      navigationMode        = “BYPAGE”
                      onRowSelection        = “select”
                      table                 = “//TestResult/Table”
                      width                 = “100%”
                      headerVisible         = “FALSE”
                      visibleRowCount       = “10″
                      fillUpEmptyRows       = “FALSE”
                      selectionMode         = “<%= TestResult->SELECTION_MODE %>”
                      selectedRowIndex      = “<%= TestResult->SELECTED_INDEX %>”
                      selectedRowIndexTable = “<%= TestResult->SELECTION_TAB %>”
                      downloadToExcel       = “TRUE” />
</chtmlb:tableExtension>

Make sure you copy the code and change the asci character if there is any.
See the following screen shot for the resultview.

search-result-21

Now the resultview is ready. We need to combine the search view and the result view in the view set. Let us create a viewset for that.

View Set

Now we need to create a view set and the both view to this view set. See the following screen shot.

search-result-22

10 Comments »

  1. Great post. Very much informative and useful.

    I would really appreciate if you could send to my e-mail an example of view navigation.

    Thanks
    Raj

    Comment by Raj — May 12, 2009 @ 11:26 am

  2. Hi,
    Its really very good blog…You are doing a great job…

    Could you please post some good examples on BOL programming……

    Comment by Vijay — July 2, 2009 @ 3:38 am

  3. Hi,
    This is really a good blog explaining each and every step with screen shot, really appreciate your effort.
    Recently I did this example but I am getting following error:

    Cannot display view Z10345028/Search of UI Component Z10345028
    An exception has occurred Exception Class CX_SY_REF_IS_INITIAL – Dereferencing of the NULL reference
    BSP Application: Z10345028
    View Layout: Search.htm
    Method: CL_O24G6ISYMTO34P4BA6I1VLD1NNS=>_ONLAYOUT
    Source Text Row: 63

    I analysed the code and found that the TestSearch is initial and on calling TestSearch->get_param_struct_name( ), it is throwing exception in the SearchAdv.htm. Could you please guide me in this.

    Comment by Jwalith — December 16, 2009 @ 11:37 pm

  4. Hi,

    I followed the procedure as given in the blog for creating the search view.
    But on click of configuration tab,it is giving the following error.
    An exception occurred in inbound plug IP_DEFAULT of target view BSP_DLC_CONF/AdvSearchConfig
    An exception has occurred Exception Class CX_SY_CREATE_OBJECT_ERROR – The object could not be created: The class does not exist.
    Method: CL_BSP_MODEL=>CREATE_STANDALONE_MODEL
    Source Text Row: 10
    Could you please help in resolving the error.

    Comment by Archana — February 3, 2010 @ 11:46 pm

  5. Hello,
    Great Blog! I was just wondering that would it be possible for you to provide/guide me to some documentation about how to create a BOL object in CRM?
    The objects are already defined as BOR in ERP with webservices as well. Now the problem that I am running into is to how to create a BOL for it in CRM.
    ANy help/guide would be highly appreciated. This is kind of urgent.
    Regards,
    Excimp1

    Comment by excimp1 — February 16, 2010 @ 4:18 am

  6. Awesome blog! Very detailed…

    Comment by KKAK52 — March 24, 2010 @ 3:20 am

  7. Hi,

    It is very good… but how get data to result view ???..

    kathir.

    Comment by kathir — April 29, 2010 @ 2:13 am

  8. I have the same question as Kathir. How to get data into result view?

    Comment by Banu — May 27, 2010 @ 6:43 am

  9. check this link

    http://blogs.moovar.com/sap/sap-crm-web-ic-search-view-and-result-view-navigation/

    Comment by kumar — June 2, 2010 @ 7:40 pm

  10. Cannot display view Z10345028/Search of UI Component Z10345028
    An exception has occurred Exception Class CX_SY_REF_IS_INITIAL – Dereferencing of the NULL reference
    BSP Application: Z10345028
    View Layout: Search.htm
    Method: CL_O24G6ISYMTO34P4BA6I1VLD1NNS=>_ONLAYOUT
    Source Text Row: 63

    I analysed the code and found that the TestSearch is initial and on calling TestSearch->get_param_struct_name( ), it is throwing exception in the SearchAdv.htm. Could you please guide me in this.

    Comment by Sathish — July 19, 2010 @ 12:02 pm

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress