Parallelization in Web UI
Part1
1. General Idea
All modern web-browser applications support parallelization or asynchronous processing of the requests from the user. Nowadays, the backend systems are scalable and therefore the processing of several requests will not consume more system power (system time) than one big request which contains the logic of four requests. Of course, the load must be properly distributed across the processing units (servers) and in time, so that we never come to the system resources border. Implementation of the parallel request processing can significantly improve the performance and usably without a need in new hardware.
Initially, when SAP WebUI was designed, it did not implement this concept and it was done by intention. Also by intention, it is implemented as a stateful application. Only after some time several asynchronous features like Asynchronous Value Fetch (AVF), asynchronous table rendering (fake rendering), drag-and-drop were introduced.
You would like to implement parallel processing in your SAP WebUI and you are looking for more information regarding possible solutions.
2. Possible variants
In this document, we will review some options, which can be implemented in SAP WebUI. Particularly we will review the use of HTML iframes, AJAX calls and asynchronous RFCs and their implementations in stateful and stateless applications. Later you will understand all possible options and choose the most appropriate one or the combination.
3. iFrames
One of the oldest concept of enabling the parallelization of the requests in the browser-based applications is based on HTML iframes.
<iframesrc="http://www.w3schools.com"></iframe> |
For more information, please refer to W3Schools’ web site: http://www.w3schools.com/tags/tag_iframe.asp
3.1.iFrames in WebUI
You can also implement this concept in WebUI. The following diagram explains how you can do it.
This approach can work with stateless applications or stateless frames only, and therefore the typical use case for this would be a customer fact sheet or similar applications. In our case, I created a Main Window, a main View Set and several views containing iframes. You can see that each iframe contains an independent HTML (in our case BSP) application. The parameters can be transported via URL, and it does not have to be static.
Most of the time the information in WebUI is shown in tables and you can do it as well with iframes.
In our example opportunity frame PartnerOpportunity.htm looks as below.
<%@page language="abap" %> |
To get the data I am using event OnInitializationwith the following coding.
* event handler for data retrieval |
Take the HTTPWatch trace to see how the parallelization works.
One can see that all our three main requests were triggered at the same time and were processed in parallel.
3.2.Limits of a iframes in WebUI
However, using this concept has one very big constraint. The WEBUI framework does not know tables visible on the screen and therefore you cannot easily jump into the object, e.g. opportunity, as it has no navigation link and cannot have it by definition. You can easily show static information, as plain text, pictures, external links etc., but navigation within WEBUI is almost impossible.
Why almost, because you can still use your own iterator (IF_HTMLB_TABLEVIEW_ITERATOR) and build a link to launch a certain object in WEBUI, e.g. incident; however this looks too brutal to me.
concatenate '/sap/bc/bsp/sap/crm_ui_start/default.htm?' |