2.0 - BOL - Advanced Search One Order Web UI Component
2.0 - BOL - Advanced Search One Order Web UI Component
References:
https://blogs.sap.com/2012/04/08/sap-crm-oneorder-advanced-search-webui-
component-part1/
https://blogs.sap.com/2012/04/08/sap-crm-oneorder-advanced-search-webui-
component-part2/
PART 01 - Scenario:
Create a search component for one order objects. The Search component has 2 views,
one for search criterias and the other for result list respectively.
11. Choose Higher Level Context node as BTQR1Order and choose BOL
Relation BTADVS1Ord.
Note: The relation BTADVS1Ord was already discussed at the start which we
found in Genil model Browser.
12. Go to the Search View and create binding for context node BTQR1Order.
13. As shown below enter the BSP Application, Controller Type, Custom Controller
Name and Target Context node of Custom Controller.
16. Create binding/links of context node BTQR1Order with the custom controller
context node BTQR1Order.
17. Choose view type as Table View and Configurable checkbox too.
Note: Make sure context node BTQR1Order is selected from list box.
18. As shown below create new View Set.
19. Enter view set name as SearchVS and mention grid size as Lines 2, Columns 1.
20. Enter View areas names (e.g. Search & Result) and respectively choose the
positioning of ViewAreas.
21. As shown below the wizard displays the overview of ViewSet ViewAreas.
22. Select the ViewArea Search, right click and choose ‘Add View’.
29. Open the Super class (e.g. ZL_ZRAK_ORD_SEARCH) and change the
inheritance of controller class with new class
CL_BSP_WD_ADVSEARCH_CONTROLLER.
30. Choose ‘Yes’ to keep the redefinitions of methods.
32. Replace the super class inheritance with new class name
CL_BSP_WD_CONTEXT_NODE_ASP.
33. Copy the below code into the Search.htm page.
36. Test the Component. The following window with Search and
Result views should appear.
37. Create new event in View ZRAK_ORDERSRCH/Search.
39. The event handler method EH_ONSEARCH would appear as shown below.
40. Copy the following code.
Reads the current context of BTQ1Order (search parameters) into dynamic query
service object LR_QUERY_SERVICE. The method GET_QUERY_RESULT
returns the one order collection into dynamic query result LR_RESULT. The result
list collection will be assigned to result context node BTQR1Order.
method EH_ONSEARCH.
DATA: lr_query_service TYPE REF TO cl_crm_bol_dquery_service,
lr_result TYPE REF TO if_bol_bo_col.
lr_query_service ?= me->typed_context->btq1order->collection_wrapper->get_current(
).
lr_result = lr_query_service->get_query_result( ).
CHECK lr_result is BOUND.
me->typed_context->btqr1order->set_collection( lr_result ).
endmethod.
41. The event names are Case Sensitive. Make sure to match the event name in
Search.htm page and DO_HANDLE_EVENT method of its implementation
class.
42. Your Search component is ready to use. Mention the search criteria (e.g. ID
5000000) and then either press enter key or click the ‘Search’ button. The result
appears in result list.
PART 02 - Scenario:
1) FP_FIELDTYPE – Checks for property ‘fieldType’ and returns the field type as
LINK.
2) FP_ONCLICK – Checks for property ‘onClick’ and returns the event name (e.g.
SELECTION).
3) FP_TOOLTIP – Checks for property ‘tooltip’ and returns the tooltip text. (e.g.
‘Click to see the details’).
method GET_P_OBJECT_ID.
case iv_property.
when if_bsp_wd_model_setter_getter=>fp_fieldtype.
rv_value = cl_bsp_dlc_view_descriptor=>field_type_event_link.
when if_bsp_wd_model_setter_getter=>fp_onclick.
rv_value = ‘SELECTION’. “#EC NOTEXT
when if_bsp_wd_model_setter_getter=>fp_tooltip.
rv_value = ‘Click to see the details’.
endcase.endmethod.
3. Create new view to display the one order details into separate view. E.g. Details.
4. Define the Model Node BTOrder of type BOL BTOrder and Model Node
BTAdminH of type BOL BTAdminH. Use the BTOrder as higher level node
with BOL relation BTOrderHeader for Model Node BTAdminH.
5. Create the Binding/Linkage with the Custom Controllers (QueryCuCo.do)
context node BTOrder.
6. Select the View Type as ‘Form View Without Buttons’ and also choose
Configurable checkbox.
7. Right click on Views and choose ‘Create Overview Page’ from context menu.
Enter the name ‘DetailsOV’.
8. Right click on ViewArea ‘OverviewPage’ and then choose ‘Add View’ to add
‘Details’ View into it. Then choose the ‘Details’ view from search help and
press ‘Enter’ key.
9. As shown below the ‘Details’ view will appear under the Overview Page
‘DetailsOV’ (ViewArea OverviewPage). Then Click on ‘SAVE’ button.
15. New method OP_TODETAILS will appear as shown below under the node
Outbound Plugs.
16. Open the Runtime Repository Editor. Create Navigational Link from Result list
to Details Overview Page.
17. Enter the Navigational Link ID ‘TODetails’. As shown below choose the
Source Details (View ZRAK_ORDERSRCH/Result, Outbound Plug
TODETAILS) and the Target Details
(ViewZRAK_ORDERSRCH/DetailsOV, Inbound Plug DEFAULT).
21. Call the outbound plug method OP_TODETAILS into event handler method
EH_ONSELECTION.
method EH_ONSELECTION.
OP_TODETAILS( ).
endmethod.
22. Pass the navigational link name ‘TODETAILS’ as outbound plug name for
navigation from View Manager.
method OP_TODETAILS.
call method view_manager->if_bsp_wd_navigation~navigate
exporting
endmethod.
23. The Navigation from Result list to Details OverviewPage is ready to use. Test
the Component. Search the one order object. E,g, 5000000. Hover the cursor on
Transaction Number, you would see the tooptip text ‘Click to see the details’.
Click on the Hyperlink. The Details would appear into new Overviewpage.