This is a very interesting topic, I know it's possible to make odbc connections to the Hana database and that you can run R scripts inside SAP itself, but there is too little documentation about this, and I never got to try it myself because I couldn't manage to convince my TI security department to let me do it.