Skip to Content

After my SAP XI Quick Launcher Widget with developing widgets, was looking to develop a useful one
and came up with a widget which will show all logged on users in a SAP system.
The widget will list out logged on users along with the client to which they are
logged on and the transaction that they are using. For this first we are going
to develop a small BSP application which will feed the data for this widget.

Let’s get started and create the BSP application.

1. Go to transaction SE80 and create a BSP application (Y_WIDGET_DATA).

2. Create one simple page (users.xml a page with flow logic) and clear all
the contents from the layout section of the page.

3. Enter the following code in the type definition tab of the page

<b>types: userstype type standard table of uinfo .   </b>

4. Enter the following page attributes

<b>users TYPE USERSTYPE </b>

<b>xml_out TYPE STRING</b>

5. Enter the following code in the

OnInitialization

event of the BSP
page.

+refresh users .

call function ‘THUSRINFO’

tables

usr_tabl = users . +

+call transformation (`ID`)

source output = users[]

result xml xml_out. +

+call method response->if_http_entity~set_cdata

exporting

data = xml_out.+

6. Save and activate the page and application.

7. Test the page by right click and choose test on the page (users.xml). You
should see the xml output in the browser.

8.

Download the widget from this link
.

To run this 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.

How to run this widget.

Once yahoo widget engine is installed, unzip the downloaded

SAP_Logged_on_Users.zip

To report this post you need to login first.

22 Comments

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

  1. Frank Brackmann
    Hello Raja,

    nice and very very helpful!! If will try to use this kind of widget to display my last Workflow Tasks. But for that i didn’t want to take a anonymous BSP Login. I analysed you kon file.
    My questions: Is it possible to add user and password in the widget-preferences and also concatenate it into the URL-String as you have done it for the WAS settings? Are there any BSP parameter available to pass user and password in the URL?

    Thanks for the nice widget!
    Frank

    (0) 
      1. Frank Brackmann
        Thanks for fast answer.I didn’t recognized that there was a user propt from WAS so it wasn’t a anonymous BSP,sorry for my stupid question;-)
        But i will still try the way by passing usr/pwd from the widget preferences through the URL-String,cause i dont like the popup every 30 min(from the polling interval:-))

        Keep on good work!

        (0) 
  2. Snehal Pandya
    Hello Raja

    I developed this widget and am trying to run this but it does not execute. It just returns back to the input screen.

    Please help.
    Thx
    Snehal Pandya

    (0) 
    1. Durairaj Athavan Raja Post author
      did you run the BSP application in the browser to see it works fine? did you enter proper values for washost, port, bsp appn name, page and client.

      if any of this value is wrong and the widget cannot connect and get results will throw that input screen. (preferencepane)

      Regards
      Raja

      (0) 
  3. Hi Raja,
    I tried to execute the BSP page stanalone, just to test if the page fine.
    Following message appears in the browser:
    “The XML page cannot be displayed ” followed by
    “Switch from current encoding to specified encoding not supported. Error processing resource ‘http://us0302.wdf.sap.corp:500…”

    There was no code in the layout.

    I also tried to specify the encoding in the layout of the page explicity, still it issued the same message.

    When I remove the execution of Set_Cdata put some code in layout the page displays.
    Any clues what went wrong..?

    Thanks in advance,

    Regards,
    Gaurav

    (0) 
    1. Durairaj Athavan Raja Post author
      yes, but needs little tweaking on the widget code. the widget code is specific to the xml format returned by ABAP engine.

      All we need to do is to get a http service or a webservice which would provide list of logged on users in EP, then with little tweaking on the widget side , this can be adapted to EP.

      Regards
      Raja

      (0) 
  4. Brian Zugel
    Having the same issue as Gaurav Shrivastav. Am getting the error message:

    Switch from current encoding to specified encoding not supported. Error processing resource ‘http://tsphl815.phl.sap.corp:8

    Debugging shows that this is NOT happening in the program, but within the WAS.

    Any ideas on how to fix this? I’m very keen on getting this working, as this is a very nice tool.

    Thanks!

    Brian

    (0) 
    1. Durairaj Athavan Raja Post author
      to avoid this during in
      call transformation (`ID`)
      source output = users[]
      result xml xml_out.

      use the options parameter (without_encoding) to  Output the XML without specification of encodings

      Regards
      Raja

      (0) 
      1. Brian Zugel
        Raja,

        Perfect! I changed your code to the following:

        refresh users.
        call function ‘THUSRINFO’
        tables
        usr_tabl = users.

        call transformation (`ID`)
        options XML_HEADER = ‘WITHOUT_ENCODING’ <===
        source output = users[]
        result xml xml_out.

        call method response->if_http_entity~set_cdata
        exporting
        data = xml_out.

        Works!

        Thanks!

        Brian

        (0) 
  5. Brian Zugel
    Raja,

    Am using Yahoo! Widgets v 4.5.1.  The widget attempts to execute, then disapears, then displaying the setup dialog.

    Any ideas?

    Thanks

    Brian

    (0) 
    1. Brian Zugel
      I managed to turn you Widget into a .KON file (sorry), and turned debug on.  The widget code is executing and returning an XML with the signed-on users.  I can also cut-and-paste the generated URL into the browser:

      http://tsphl815.phl.sap.corp:8002/sap/bc/bsp/sap/
      y_widget_data/users.xml?001.  The browser asks for userid/password, and the browser returns the same XML data!

      I’ve searched the Widget code and can’t figure out why the widget won’t display.  I have tried Widget engine 4.5.1, and also tried 4.0.3.  No joy …

      (0) 
  6. Bjoern Bayerschmidt
    Hi there,
    i have a problem.

    I followd the whole instructions.
    When i open the Widget i give it the WAS HOST Port etc.. then i click “save”

    But the widget do not ask me for user and password.. it takes about 20 – 30 seconds. then the Window were i can give WAS Host Port etc pop up again.. that was it…

    can anybody tell me how this works?

    Thanks
    Bjoern

    (0) 
  7. Santiago Ruiz Ramos
    Congratulations for this widget, I follow your instructions and it works fine, but, Are there any way to get users from other site? for example, users from Enterprise Portal (EP),
    thanks in advance.
    (0) 

Leave a Reply