Additional Blogs by Members
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member
0 Kudos

I have been reading and hearing a lot of questions about widgets. Most of the times people ask

“Why Widgets?”

.

A really Why Widgets? was posted some time ago by Nigel James in the Enterprise widgets forum.

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


I could have used direct RFC call to read data from the function module but I prefer the use of web services as in this way this functionality is exposed as a "service" that can be consumed by different applications without having to know RFC programming and above all it is easier to manage with standard javascript functionalities.

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.

   FUNCTION

WRAP_BP_JOB_SELECT_SM37B


     CALL FUNCTION 'BP_JOB_SELECT_SM37B'
       EXPORTING
          JOBSELECT_DIALOG = 'N'
          JOBSEL_PARAM_IN = JOBSEL_PARAM_IN
          ENDDATE = ENDDATE
          ENDTIME = ENDTIME
       IMPORTING
          JOBSEL_PARAM_OUT = JOBSEL_PARAM_OUT
       TABLES
          JOBSELECT_JOBLIST = JOBSELECT_JOBLIST
          JOBSELECT_JOBLIST_B = JOBSELECT_JOBLIST_B.
   ENDFUNCTION.

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:

A

search window

(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.

An independent

result window

(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.

A

configuration window

(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.

A

context menu

(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

alerting mode

. 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 :smile:

5. The Demo:

Don't want to spend to much time donwloading and configuring the widget?!? Never seen a widget in action?!?

Have a look at this Widget Tutorial, (ipod version) , and get in touch with widgets.

 

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!

18 Comments