I have been reading and hearing a lot of questions about widgets. Most of the times people ask
Repling to that question I decided to convince myself as first of the potential advantages and benefits of using widgets. The aim of this blog is to share with the community one of the characteristics of widgets that I feel as probably the most interesting and the one where the added value of widgets is easily understandable and touchable.
1. The scenario:
Every day system administrators have a lot of activities to take care, one of this is job monitoring. Typically the administrator logs on the system and run transaction SM37 to check the status of jobs in the system. This activity is normally performed several times during the day and sometimes could require an immediate response in case of error.
2. The Idea:
What about monitoring jobs with a widget? Since here someone could say “Ok, fabulous look and feel, but I am a system administrator, not a designer, and it’s an SAP Job not a wheater forecast..”, yes but the widget can do more and take care of verify the status of the most critical jobs and warn as soon as a problem occurs.. This for me is a benefit. If the benefit is also nice to see and easy to implement what do we want more?
3. The Implementation:
Step by step “overview” of the process I followed to implement this idea.
3.1. Identify the function module used by job monitor transaction (SM37)
Little bit of debugging to discover that transaction SM37 uses function module BP_JOB_SELECT_SM37B.
3.2. Expose the function module as a Web Service
Unfortunately the function module BP_JOB_SELECT_SM37B is not remote enabled, so it cannot be exposed as a web service, anyway it is possible to create a wrapper function module and flag it as remote enabled.
CALL FUNCTION ‘BP_JOB_SELECT_SM37B’
JOBSELECT_DIALOG = ‘N’
JOBSEL_PARAM_IN = JOBSEL_PARAM_IN
ENDDATE = ENDDATE
ENDTIME = ENDTIME
JOBSEL_PARAM_OUT = JOBSEL_PARAM_OUT
JOBSELECT_JOBLIST = JOBSELECT_JOBLIST
JOBSELECT_JOBLIST_B = JOBSELECT_JOBLIST_B.
Now that we have a remote enabled function module, we just need to expose it as a webservice.
Note that on a WAS 6.40 you can expose the web service directly from transaction SE37: Utilities –> More utilities –> Create web service –> From the function module
As I have assigned to the web service the name ZBP_JOB_SELECT_SM37B, the corresponding url is: http://<hostname>:<port>/sap/bc/srt/rfc/sap/ZBP_JOB_SELECT_SM37B?sap-client=<client>&wsdl=1.1
3.3. Create the widget
For the implementation of the widget I needed:
(yellow border in the image below) to insert parameters and launch the search. As you will see in the video, this window is mostly a jpg image with everything painted on it (even text boxes); with a few widgets-xml lines I placed transparent text boxes and buttons over the background image.
(orange border) to show the search results in a list and to allow the user to filter results on the base of the job status. I followed the same idea, jpg background + widgets-xml for the labels.
(red border) to set parameters like web service URI and user/password. The configuration panel is a standard functionality of widgets, you just have to define the name, type and description of the parameter and it is automatically shown in the configuration panel.
(green border) to switch from search mode to alert mode; this is as well a standard functionality, you just have to define the action corresponding to each context menu item.
4. The Result:
The following screenshot gives an idea of the result, it is possible to launch a search, setting job name, user and time parameters, and in the result pane it is possible to dinamically filter the results on the base of the job status.
Here is a screenshot of the second (probably more interesting) possible usage of the widget, the
. On the base of the search criteria every n minutes (configuration parameter) the search is launched in background and in case a job is in error the widget will become active showing the failing jobs.
In this way the administrator will not look for errors, but errors will look for the administrator 🙂
5. The Demo:
Don’t want to spend to much time donwloading and configuring the widget?!? Never seen a widget in action?!?
6. The special guest (last but not least), the widget:
If you are interested in this widget you can download it from here.
After having exposed the web service in your WAS you need to download & install yahoo widget engine .
Check this SAP NetWeaver Administration Gadgets – Getting Started by Tarun Telang on how to install yahoo widget engine.
Please post any technical question regarding the setup/configuration of the widget in the Software Downloads.
In the next Blog I would like to illustrate another interesting scenario where Widgets could improve the user experience speeding up common tasks like searching a customer or a material code without calling popups that display hundreds of items with a scrolling mechanism not yet so fast!