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!

MICR fonts in Adobe Forms

I write this post due to lack of info in all SAP documents that I’ve read about this topic.

MICR fonts used in Adobe Forms are third party products. As these are not SAP products, SAP unfortunately cannot recommend. SAP does not hold rights of those fonts. So must download these fonts from internet (free or paying form them)

Related Notes:

In case you need info for spools created via SAPscript or Smart Forms you can read the following documents:

Resetear Samsung Galaxy s2 I9100 con la imagen original de fábrica desde Linux

Síntoma

El móvil no arranca. Se queda indefinidamente mostrando el logotipo de Samsung.

 

Entorno

Samsung Galaxy SII I9100 con sistema operativo Android

 

Causa

Accidentalmente :) borré la tarjeta SD e hice wipe (dalvik cache, /system, etc…) por lo que el móvil se quedó inusable. La única solución pasa por volver a dejarlo como estaba cuando salió de fábrica. Y eso es lo que veremos aquí.

 

Resolución

  1. Este procedimiento debe ser realizado desde un ordenador con cualquier distribución de linux instalada. También es necesario tener instalado el programa Heimdall. Heimdall[1] es una herramienta multiplataforma con licencia Open Source usada para escribir firmware (aka ROMs) en dispositivos móviles de Samsung.
     
  2. Crear una cuenta en sammobile[2] y buscar el firmware adecuado. En mi caso descargué el fichero I9100XWLS8_I9100FOPLS3_FOP.zip (542 MB):
    Samsung-Galaxy-S2-I9100XWLS8 
  3. Extraer el contenido

     
  4. Reiniciar móvil en modo Download
    • Presiona Volumen abajo + Power + Botón Central
    • Cuando aparezca el Warning, conectar el cable usb
    • Presionar Volumen arriba

    Realizar este paso siempre y cuando el móvil se reinicie (generalmente después de ejecutar algún comando con Heimdall)

  5. Convertirse en root y comprobar que se puede ver el dispositivo

    Es una buena práctica realizar esta comprobación siempre que se reinicie el móvil.

  6. Descargar el PIT (Partition Information Table) del móvil.
      Heimdall v1.4.1Copyright (c) 2010-2014 Benjamin Dobell, Glass Echidna http://www.glassechidna.com.au/This software is provided free of charge. Copying and redistribution is encouraged.If you appreciate this software and you would like to support future development please consider donating: http://www.glassechidna.com.au/donate/Initialising connection… Detecting device… Claiming interface… Attempt failed. Detaching driver… Claiming interface again… Setting up interface…Initialising protocol… Protocol initialisation successful.

      Beginning session…

      Some devices may take up to 2 minutes to respond. Please be patient!

      Session begun.

      Downloading device’s PIT file… PIT file download successful.

      Entry Count: 15 Unknown 1: 0 Unknown 2: 0 Unknown 3: 0 Unknown 4: 0 Unknown 5: 0 Unknown 6: 0 Unknown 7: 0 Unknown 8: 0

      — Entry #0 — Binary Type: 0 (AP) Device Type: 2 (MMC) Identifier: 0 Attributes: 0 (Read-Only) Update Attributes: 0 Partition Block Size/Offset: 0 Partition Block Count: 0 File Offset (Obsolete): 0 File Size (Obsolete): 0 Partition Name: GANG Flash Filename: emmc.img FOTA Filename:

      — Entry #1 — Binary Type: 0 (AP) Device Type: 2 (MMC) Identifier: 1 Attributes: 0 (Read-Only) Update Attributes: 0 Partition Block Size/Offset: 0 Partition Block Count: 0 File Offset (Obsolete): 0 File Size (Obsolete): 0 Partition Name: BOOT Flash Filename: boot.bin FOTA Filename:

      — Entry #2 — Binary Type: 0 (AP) Device Type: 2 (MMC) Identifier: 4 Attributes: 1 (Read/Write) Update Attributes: 0 Partition Block Size/Offset: 8192 Partition Block Count: 40960 File Offset (Obsolete): 0 File Size (Obsolete): 0 Partition Name: EFS Flash Filename: efs.img FOTA Filename:

      — Entry #3 — Binary Type: 0 (AP) Device Type: 2 (MMC) Identifier: 2 Attributes: 0 (Read-Only) Update Attributes: 0 Partition Block Size/Offset: 49152 Partition Block Count: 2560 File Offset (Obsolete): 0 File Size (Obsolete): 0 Partition Name: SBL1 Flash Filename: Sbl.bin FOTA Filename:

      — Entry #4 — Binary Type: 0 (AP) Device Type: 2 (MMC) Identifier: 3 Attributes: 0 (Read-Only) Update Attributes: 0 Partition Block Size/Offset: 53248 Partition Block Count: 2560 File Offset (Obsolete): 0 File Size (Obsolete): 0 Partition Name: SBL2 Flash Filename: FOTA Filename:

      — Entry #5 — Binary Type: 0 (AP) Device Type: 2 (MMC) Identifier: 5 Attributes: 0 (Read-Only) Update Attributes: 0 Partition Block Size/Offset: 57344 Partition Block Count: 16384 File Offset (Obsolete): 0 File Size (Obsolete): 0 Partition Name: PARAM Flash Filename: param.lfs FOTA Filename:

      — Entry #6 — Binary Type: 0 (AP) Device Type: 2 (MMC) Identifier: 6 Attributes: 0 (Read-Only) Update Attributes: 0 Partition Block Size/Offset: 73728 Partition Block Count: 16384 File Offset (Obsolete): 0 File Size (Obsolete): 0 Partition Name: KERNEL Flash Filename: zImage FOTA Filename:

      — Entry #7 — Binary Type: 0 (AP) Device Type: 2 (MMC) Identifier: 7 Attributes: 0 (Read-Only) Update Attributes: 0 Partition Block Size/Offset: 90112 Partition Block Count: 16384 File Offset (Obsolete): 0 File Size (Obsolete): 0 Partition Name: RECOVERY Flash Filename: FOTA Filename:

      — Entry #8 — Binary Type: 0 (AP) Device Type: 2 (MMC) Identifier: 8 Attributes: 1 (Read/Write) Update Attributes: 0 Partition Block Size/Offset: 106496 Partition Block Count: 204800 File Offset (Obsolete): 0 File Size (Obsolete): 0 Partition Name: CACHE Flash Filename: cache.img FOTA Filename:

      — Entry #9 — Binary Type: 0 (AP) Device Type: 2 (MMC) Identifier: 9 Attributes: 0 (Read-Only) Update Attributes: 0 Partition Block Size/Offset: 311296 Partition Block Count: 32768 File Offset (Obsolete): 0 File Size (Obsolete): 0 Partition Name: MODEM Flash Filename: modem.bin FOTA Filename:

      — Entry #10 — Binary Type: 0 (AP) Device Type: 2 (MMC) Identifier: 10 Attributes: 1 (Read/Write) Update Attributes: 0 Partition Block Size/Offset: 344064 Partition Block Count: 1048576 File Offset (Obsolete): 0 File Size (Obsolete): 0 Partition Name: FACTORYFS Flash Filename: factoryfs.img FOTA Filename:

      — Entry #11 — Binary Type: 0 (AP) Device Type: 2 (MMC) Identifier: 11 Attributes: 1 (Read/Write) Update Attributes: 0 Partition Block Size/Offset: 1392640 Partition Block Count: 4194304 File Offset (Obsolete): 0 File Size (Obsolete): 0 Partition Name: DATAFS Flash Filename: data.img FOTA Filename:

      — Entry #12 — Binary Type: 0 (AP) Device Type: 2 (MMC) Identifier: 12 Attributes: 2 (STL Read-Only) Update Attributes: 0 Partition Block Size/Offset: 5586944 Partition Block Count: 24133632 File Offset (Obsolete): 0 File Size (Obsolete): 0 Partition Name: UMS Flash Filename: FOTA Filename:

      — Entry #13 — Binary Type: 0 (AP) Device Type: 2 (MMC) Identifier: 13 Attributes: 1 (Read/Write) Update Attributes: 0 Partition Block Size/Offset: 29720576 Partition Block Count: 1048576 File Offset (Obsolete): 0 File Size (Obsolete): 0 Partition Name: HIDDEN Flash Filename: hidden.img FOTA Filename:

      — Entry #14 — Binary Type: 1 (CP) Device Type: 1 (File/FAT) Identifier: 9 Attributes: 0 (Read-Only) Update Attributes: 0 Partition Block Size/Offset: 0 Partition Block Count: 0 File Offset (Obsolete): 0 File Size (Obsolete): 0 Partition Name: Flash Filename: FOTA Filename:

      Ending session… Rebooting device… Releasing device interface… Re-attaching kernel driver…


      Posiblemente se reinicie el móvil. Apágalo y vuelve a poner el móvil en modo Download.
    • Extraer el nombre de todas las particiones. Dichos nombres corresponderán con los parámetros que pasemos a Heimdall:
      • # cat pit.txt | grep -i 'PARTITION NAME'
      Partition Name: GANG Partition Name: BOOT Partition Name: EFS Partition Name: SBL1 Partition Name: SBL2 Partition Name: PARAM Partition Name: KERNEL Partition Name: RECOVERY Partition Name: CACHE Partition Name: MODEM Partition Name: FACTORYFS Partition Name: DATAFS Partition Name: UMS Partition Name: HIDDEN

       
    • Último paso. Instalar el firmware en el móvil:
      • # heimdall flash --BOOT boot.bin --CACHE cache.img --FACTORYFS factoryfs.img --HIDDEN hidden.img --MODEM modem.bin --PARAM param.lfs --SBL1 Sbl.bin --KERNEL zImage
      Heimdall v1.4.1Copyright (c) 2010-2014 Benjamin Dobell, Glass Echidna http://www.glassechidna.com.au/This software is provided free of charge. Copying and redistribution is encouraged.If you appreciate this software and you would like to support future development please consider donating: http://www.glassechidna.com.au/donate/

      Initialising connection… Detecting device… Claiming interface… Attempt failed. Detaching driver… Claiming interface again… Setting up interface…

      Initialising protocol… Protocol initialisation successful.

      Beginning session…

      Some devices may take up to 2 minutes to respond. Please be patient!

      Session begun.

      Downloading device’s PIT file… PIT file download successful.

      Uploading BOOT 100% BOOT upload successful

      Uploading CACHE 100% CACHE upload successful

      Uploading FACTORYFS 100% FACTORYFS upload successful

      Uploading HIDDEN 100% HIDDEN upload successful

      Uploading MODEM 100% MODEM upload successful

      Uploading PARAM 100% PARAM upload successful

      Uploading SBL1 100% SBL1 upload successful

      Uploading KERNEL 100% KERNEL upload successful Ending session… Rebooting device… Releasing device interface… Re-attaching kernel driver…


       

    Referencias

    1. Heimdall
    2. Sammobile Firmwares