Convert saplogon.ini to SAP Java PlatinGUI connections

I like to use my native Mac OSX system and the Java PlatinGUI for working and developing with SAP whenever I can. Of course, I know that the native Windows GUI is way more advanced (because better taken care of by SAP), but I hate to boot my Windows VM every time I want to do something SAP-related. Since I work for multiple clients having multiple SAP installations (ERP, CRM, Solution Manager, …), I want to have my SAP connections in synch. For my Windows systems – yes, I do have a few of them – I share the saplogon.ini via Dropbox. However, that doesn’t help me having the same connection entries in my Mac Java SAPGUI (PlatinGUI).

Hence, I wrote a tiny (and not very fancy) Python script to convert the saplogon.ini entries to the connection strings used in the Java SAPGUI’s connections file (which on Mac OSX can be found in the user’s Application Library folder). It doesn’t do much and it is not very robust against invalid input, but I would like to share it here, so anybody can use it for their own purposes. If you have an advice on how to improve the script radically or on how to support more input information, please let me know.

#!/usr/bin/env python

import sys, os

    fname = sys.argv[1]
    fh = open(fname, 'r')
    print sys.argv[0], ' <path/saplogon.ini>'

data = fh.readlines()

# initialize entry data base (100 records)
entries = []
for i in range(100):
    entry = {'description': '', 'server': '', 'router': '', 'database': ''}

for line in data:
    data = line.strip()
    if data != '':    # ignore empty lines
        if data.startswith('[') and data.endswith(']'):
            key = data.lower()[1 : len(data) - 1]
            parts = data.split('=')
            item = parts[0]
            value = parts[1]
                nr = int(item[4 : ])
                entries[nr][key] = value
            except ValueError:

# now print connection strings for Java GUI
for e in entries:
    if e['description'] != '':
        comp = '/' if e['router'] != '' else ''
        connStr = e['description'] + ':conn=' + \
            e['router'] + comp + \
            '/H/' + e['server'] + \
            '/S/32' + e['database'] + '&expert=true&wan=true'
        connStr.replace("/H//H/", "/H/")
        print connStr

Citrix Receiver not working with Mac OS X Yosemite

With the update to Mac OS X Yosemite, my Citrix Receiver–which I need for accessing customer systems–suddenly stopped working. I do not know if or why the problem is caused by the update, but it stopped working on both–my iMac and my Macbook Air–at the same point of, meaning with the Mac OSX update. For those Mac and Citrix users having the same problem, I want to provide a quick solution.

The reason for Citrix Receiver not working properly are invalid file permissions in the app specific folder in $HOME/Library. This can easily be fixed, changing the permissions with this simple Terminal command (quick and dirty setting the specific directory to writeable for everyone):

chmod 777 $HOME/Library/Application\ Support/Citrix\ Receiver/Modules