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.
5. In the end select the view type as Table view and the context node as TestResult and complete the view creation.
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” %>
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” />
Make sure you copy the code and change the asci character if there is any.
See the following screen shot for the resultview.
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.
Now we need to create a view set and the both view to this view set. See the following screen shot.