Basico: a SAP Notes Manager for SAP Consultants

Basico

The main goal for this application is to assist you (the SAP Consultant), to download the SAP Notes you are interested in, categorize them by tasks and, find them quickly. Another goal is to allow you to share SAP Notes with other fellows.

 

All of it started as an experiment about how to download SAP Notes programatically but quickly became in a small application to manage SAP Notes.

Please, if you are looking for something more serious and reliable go to Launchpad@SAP.


Disclaimer

This software is not linked, affiliated, related or endorsed in any way by any division or subsidiary of SAP® AG.


I always thought that when you browse a SAP Note, the source code would have plain HTML with something of Javascript. I was totally wrong. Almost all source code is Javascript, which is imposible to parse with web scrapper tools.

So, I asked in SCN forums how to download SAP Notes programatically with Python.

odataMonths later I got the first answer which, in turn, became in a deep investigation about available python libraries to work with OData services. Until that moment, OData was another buzzword for me. I didn’t know anything else about this protocol.

In short, you have to build and send a query. Then, the server returns the OData XML. Easy, isn’t it? Well, it is not. It’s been a nightmare for me the last months.

The new ‘Launchpad‘ service from SAP let us consume OData services over HTTPS.

For example, if you want to get the SAP Note 1, you can use this URL and you’ll get the OData XML file.

I only like to develop in Linux environments so the python library should run in Linux and, if possible, be cross-platform. And, of course, be Open Source. This is what I found:

  • Pyslet: OData v2 with both client and server capabilities. Cross-platform. Limited HTTPS support based on certificates. Open-Source (BSD 3-Clause License).
  • ODataPy: OData v4 client. Only for Windows platforms. Open-Source (MIT License).
  • Auth0 SAP OData API: experimental addon to work with SAP OData. Commercial, not open-source.

At first sight, the best option was Pyslet: it’s a Python library, runs in Linux, it is open source and, has support for HTTPS. I’ve been unable to use Pyslet with certificates, though. I’ve tried again and again but without luck. Sadly, I had to discard this option.

So now what?

The same person who answered me in the forum suggested me to look for something similiar to HTMLUnit in Java but for Python. From its webpage:

“””
HtmlUnit is a “GUI-Less browser for Java programs”. It models HTML documents and provides an API that allows you to invoke pages, fill out forms, click links, etc… just like you do in your “normal” browser.
“””

Well, two minutes later, I found it. It’s Selenium: one of the best tools I have ever seen.

Selenium automates browsers.
Selenium automates browsers.

Selenium is a portable software testing framework for web applications. It has bindings for Python among others programming languages. The tests can then be run against most modern web browsers (Firefox, Chrome, IE and, PhantomJS -a headless browser-). Selenium deploys on Windows, Linux, and Macintosh platforms. It is open-source software, released under the Apache 2.0 license.

 

This is a little example of how to download a SAP Note with Selenium and Python:
(Change S_USER and S_PASS with your S-User login data)

At this development stage (basico 0.1), the only browser supported is Firefox.

 

feedparserAnother excelent Python library is Universal Feed Parser (aka feedparser).  It helped me to extract all the necessary info from OData XML.

This Python module download and parse syndicated feeds (it can handle RSS 0.90, Netscape RSS 0.91, Userland RSS 0.91, RSS 0.92, RSS 0.93, RSS 0.94, RSS 1.0, RSS 2.0, Atom 0.3, Atom 1.0, and CDF feeds. It also parses several popular extension modules, including Dublin Core and Apple’s iTunes extensions.

JSONSumming up, I can download SAP Notes and, I can parse them. So the next question is: how should I store them? First, I thought about creating a SQLite database because it is quick and easy. But how could share my notes with other people? I needed something easiest to handle. Up to now the best answer is JSON.

JSON (JavaScript Object Notation) is a syntax for storing and exchanging data, easier-to-use alternative to XML, is text only and, can be read and used as a data format by any programming language.

Morover, I can export a dictionary to JSON and, viceversa, I can import JSON data to a dictionary in Python:

 

gtkLast step: build a GUI around all this concepts with the following prerequsites:

  • It must be easy to use by the end user.
  • It must be cross-platform
  • It must be easy to develop

The answer for this question is GTK+. GTK+, or the GIMP Toolkit, is a multi-platform toolkit for creating graphical user interfaces. Offering a complete set of widgets, GTK+ is suitable for projects ranging from small one-off tools to complete application suites.

 

So here we are:

basico_00

 

Please, read this page in order to install Basico.

Hope you can enjoy it!

One thought on “Basico: a SAP Notes Manager for SAP Consultants

  1. Pingback: Basico - SAP Blogs

Leave a Reply

Your email address will not be published. Required fields are marked *