Skip to Content
Author's profile photo Durairaj Athavan Raja

SAP Logged on Users List Widget

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

Assigned Tags

      22 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member
      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

      Author's profile photo Durairaj Athavan Raja
      Durairaj Athavan Raja
      Blog Post Author

      Hi Frank,Raja

      Author's profile photo Former Member
      Former Member
      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!

      Author's profile photo Former Member
      Former Member
      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

      Author's profile photo Durairaj Athavan Raja
      Durairaj Athavan Raja
      Blog 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

      Author's profile photo Former Member
      Former Member
      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

      Author's profile photo Former Member
      Former Member
      Could this be adapted to a java standalone portal?
      Author's profile photo Durairaj Athavan Raja
      Durairaj Athavan Raja
      Blog 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

      Author's profile photo Former Member
      Former Member
      Hi raja,

      Can you tell me how to see the .kon file code.

      Thanks
      Purshoth

      Author's profile photo Durairaj Athavan Raja
      Durairaj Athavan Raja
      Blog Post Author
      use the widget converter widget to convert the .kon file. you can get the same from
      http://widgets.yahoo.com/gallery/view.php?widget=40093

      Raja

      Author's profile photo Former Member
      Former Member
      Thanks for fast answer ...I got the .kon file...
      Author's profile photo Jaideep Srinivasan
      Jaideep Srinivasan
      This was a wonderful effort by you..and i tried this example..the xml file is displaying in the browser..but not displaying in the browser..am using the abap NW2004s trail version and my host is loaclhost..wht should i give in WAS host..

      this the URL when executing the BSP..
      http://localhost:8000/sap(bD1lbiZjPTAwMA==)/bc/bsp/sap/y_widget_data/users.xml

      thanks
      jaideep

      Author's profile photo Former Member
      Former Member
      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

      Author's profile photo Durairaj Athavan Raja
      Durairaj Athavan Raja
      Blog 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

      Author's profile photo Former Member
      Former Member
      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

      Author's profile photo Former Member
      Former Member
      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

      Author's profile photo Durairaj Athavan Raja
      Durairaj Athavan Raja
      Blog Post Author
      do you connect to internet via proxy server, if yes did you exclude the abaphost/domain from going via proxy.
      Author's profile photo Former Member
      Former Member
      Not sure where this is done.  IE? Widgets?
      Author's profile photo Durairaj Athavan Raja
      Durairaj Athavan Raja
      Blog Post Author
      set it up in IT tools->internet options->connections->lan settings->advanced.

      Y widget engine will  use this expception.

      Author's profile photo Former Member
      Former Member
      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 ...

      Author's profile photo Former Member
      Former Member
      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

      Author's profile photo Former Member
      Former Member
      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.