Skip to Content

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

image

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.

 

image

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.

image

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.

image

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?!?

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!

To report this post you need to login first.

18 Comments

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

    1. Alvaro Tejada Galindo
      I really like this blog…It’s nice to read all the steps taken to develop the widget…Also, the widget itself looks really nice -;)

      I’m not into widgets so I can’t make further comments -;) Still, hope to see more on this in the future -:)

      Greetings,

      Blag.

      (0) 
      1. Sergio Cipolla Post author
        Hi Durairaj,
        I think that you are facing an authorization problem that depends on the logon procedure set for the web service.

        In transaction SICF verify that you have configured the logon procedure flagging “All Logons”.

        PS: if possible, please post any technical issue in the Enterprise Widget Forum.

        Best Regards,
        Sergio

        (0) 
          1. Durairaj Athavan Raja
            Thanks for the clue Anton.

            i had the similar problem.

            i named my wrapper FM as ZBP… and also the webservice as ZB… where as in this example sergio use WARP….

            Once i fixed the same in the main.js it working fine.

            Thanks again.

            Regards
            Raja

            (0) 
      2. Anton Wenzelhuemer
        hi durairaj,

        had the 500 problem also. it was due to the fact, that i gave the WS another name, and the WS operation therefore also had another name. just corrected it inside the script where the soap call is built.

        hope it helps,
        anton

        (0) 
  1. Saujanya GN
    hi,

    this blog is really helpful one.It focuses on not only on the usage of ‘Widgets’,but also explains in detail how it can be done.The video really gives the look and feel of the widget, and the functionality which can be built in widget.

    Thanks alot and i m really waiting for ur next blog 🙂

    Regards,
    Saujanya

    (0) 
  2. Anonymous
    Hi Sergio,

    Great job. Putting in the video was very helpful. A lot of potential in various areas.

    Sunil

    (0) 
  3. Reinhold Müller
    I have also the problems with http 500…
    I am not able to modify thw widget.
    It would be nice to get a version which is functional.

    Regards
       Reinhold

    (0) 
  4. Arun Varadarajan
    Sergio,
    FOund your tutorial extremely useful on creating a webservice and consuming the same.
    However is this thing transportable – that is can I look at deploying the same in my Production system. We had a lot of issues transporting web services across systems – does the same hold good for this too ?

    Arun varadarajan

    (0) 

Leave a Reply