Skip to Content

UIF_CALLBACK is a service, as seen from its description in SICF – ‘Generic callback’,  it is used to dispatch the requests into specific classes which are specified as value of parameter ‘crm_handler’. It’s handler class is: CL_CRM_WEB_UTILITY:
1. handler class for uif_callback.PNG

In this article, I will explain with some samples how this service runs.

Sample 1:

We all know, for performance purpose, when CRM webui is loaded, Java script files under BSP Application THTMLB_SCRIPTS will be merged into one scripts.js file:
2. scripts.js.png

But in this way, it is not convenient to debug when we have some java script problems. Thus user parameter BSP_DLC_DEBUG_PARAM is introduced(in SAP Note 1771865). When this user parameter is set to JS_ALL_FRAMES, things will be changed — all java script files under BSP Application THTMLB_SCRIPTS will not be merged and loaded into one file, they will be loaded separately and one by one.

4 user parameter.PNG
3. all js.png

From the trace, we can see the service uif_callback is being used, for example:

…/SAP(====)/webcuif/uif_callback/crm_ui_frame/SCRIPTS_.GLOBALS.JS?CRM_HANDLER=CL_THTMLB_SCRIPTS_MANAGER…

Here, value for parameter CRM_HANDLER is CL_THTMLB_SCRIPTS_MANAGER.

How is it done?

In method CL_THTMLB_CONTENT-> IF_BSP_ELEMENT~DO_AT_BEGINNING, parameter BSP_DLC_DEBUG_PARAM is checked. If it is not set, the JS script will be ‘thtmlb_scripts/scripts.js’. But if it is set to value JS_ALL_FRAMES, requests of ‘…webcuif/uif_callback/…’ will be formed instead:
4-1 logics.PNG

Then how are these classes working?

Let’s set a breakpoint in methods CL_CRM_WEB_UTILITY-> IF_HTTP_EXTENSION~HANDLE_REQUEST and  CL_THTMLB_SCRIPTS_MANAGER-> IF_CRM_WEB_CALLBACK~HANDLE_REQUEST and see what happens.

  1. When the request is sent to backend system, CL_CRM_WEB_UTILITY-> IF_HTTP_EXTENSION~HANDLE_REQUEST parses the request parameters and gets the handler class, here it is CL_THTMLB_SCRIPTS_MANAGER:
    5. utility hander.PNG
  2. Object is created and initialized:
    6. initiate class.PNG
  3. Application handler is called back:
    7. call the handle_request of the class.PNG
  4. Inside the method CL_THTMLB_SCRIPTS_MANAGER->IF_CRM_WEB_CALLBACK~HANDLE_REQUEST, requests are processed, the .JS content is read and returned:
    8. load the JS.PNG
  5. From the httpwatch trace, we can see the JS content is returned:
    8-1 JS content is loaded into IE.PNG

Sample 2:

As introduced in SAP Note 2181937 ( Recent Items Filtering ), ‘Recent Items’ have filter functions added. Now, for the initial load of recent Items, for the filter dropdown list, for the items retrieving on a specific filter, they are using UIF_CALLBACK.

Take initial load of recent items as an example:

  • In crm_bsp_recobj/RecentObjects.htm, there are codes:
    1. initla load codes.PNG
  • ‘Fetch’ function is defined in THTMLB_SCRIPTS-> scripts_areaframe.js.
    2. fetch function.PNG
  • In this function, the request is sent out:
    3. submit url.PNG
    value for parameter ajaxURL is: “/sap(bD1FTiZjPTUwNCZpPTEmZT1TVEF6TXpVME1WOWZYMTlmTkRkZk1Ua3dBRkJXckViRUh1V21sQlNIX1ZJM2JnJTNkJTNk)/webcuif/uif_callback?crm_handler=CL_CRM_BSP__RECENTOBJECT0_IMPL&crm_controller=C6_W23_V24&wcf_request=display&wcf-request-ticket=CDB907FAF99F328F1997F34FF2C21322”
  • The same, if we set breakpoint in CL_CRM_BSP__RECENTOBJECT0_IMPL-> IF_CRM_WEB_CALLBACK~HANDLE_REQUEST, we will get the callstack:
    4. callstack.PNG

The same thing happens when click the triangle icon for ddlb and select an item to filter:

5. click ddlb.PNG6. select an item.PNG

Additional:

There are many other usages via this service uif_callback. For example, CL_THTMLB_COLOR_UTIL, CL_CRM_UI_SESSION_MANAGER, CL_THTMLB_COLOR_UTIL, CL_THTMLB_SMART_VALUE_HELP, CL_THTMLBX_SILVERLIGHT_ISLAND, CL_THTMLBX_FLASH_ISLAND, etc.

To report this post you need to login first.

2 Comments

You must be Logged on to comment or reply to a post.

Leave a Reply