How to implement JQuery autocomplete functionality in SAP BSP

If I had to guess a majority of people today do not realize the power within SAP BSP. In this blog I want to introduce some of this power by showing how to implement autocomplete functionality like google search.

The first thing we need to do is create a new BSP application.

1. Go to SE80, select BSP Application.

2. Next create a controller class. Right click on your object and select create -> Controller

3. Next enter a name for the ABAP class that will be associated with the index.do, double click on the name and the system will automatically create the class for you.

4. Now we need to redefine the method do_request.

5. Once we have the method redefined we can start adding code. For this example add the following lines of code

data view type ref to if_bsp_page.

me->view_name = ‘index.htm’.

view = me->create_view( view_name = me->view_name ).

if view is bound.

me->call_view( view ).

endif.

6. In order for this to get activated you need to add a class attribute called VIEW_NAME of type string. Activate your new class.

7. Now we need to create the index.html view that we reference in the do_request method.

8. Right-click on your application, choose create->page

9. Now lets write some HTML and show the power of BSP!!

10. First thing is to open the index.html and remove everything except the following tags at the top.

Hi guys, has anyone tried this for search views in CRM web UI as well? E.g. BP_HEAD_SEARCH/MainSearch? I tried to use the autocomplete function for the account name field (C32_W39_V132_search_parameters[1].VALUE1) getting values from an AJAX json call, however, it didn’t work. The logic itself is fine since it works without any issues on a Z BSP application outside CRM UI. Thanks & regards Wolfgang