Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
ttrapp
Active Contributor
In my blog series about Decision Management with HANA and R I gave some examples about analytical and predictive rules with HANA and R. I covered use cases like time series forecast and (integer) optimization of linear functions with linear constraints. Before I continue with more examples I want to discuss technical difficulties implementing those scenarios.

Missing Links: Integration between ABAP and R

At the moment AMDP doesn’t support R procedures. For me it was not possible to create R procedures using ADBC in ABAP, so I had to create HANA content that is called via ABAP. This is easily done but software logistics of HANA artifacts is not trivial because the activation of ABAP objects depends on the HANA content. Luckily SAP created HTA as successor of HTC (HANA Transport Container). In case you don’t know HTA I give some links to the documentation:

  1. presentation about HTA: http://go.sap.com/documents/2016/05/80f9d984-737c-0010-82c7-eda71af511fa.html

  2. central note: HTA https://launchpad.support.sap.com/#/notes/0001990798

  3. HTA documentation: http://help.sap.com/saphelp_nw74/helpdata/de/ff/7652bd542849b18b218efe8d2f2373/frameset.htm

  4. HTA Troubleshooting: https://launchpad.support.sap.com/#/notes/2321486


I asked my colleagues who work very often with HTA about their experience. They said that working is possible but it is not easy. So this is the workflow for export and import of HANA artifacts using SAP transport system:


    1. collect all HANA artifacts using transaction SCTS_HTA and synchronize it with transports

    2. then assign those objects to a transport request using this transaction

    3. This is easy. You only have to take care that you synchronize the HANA artifacts after a Change. Here HTA behaves like HTC: the transport contains the versions of at the time of synchronization and not of the release time. There is also the possibility to tale influence on the activiation time but this requires more work:

      1. collect all HANA artifacts using transaction SCTS_HTA and synchronize it with transports

      2. then assign those objects to a transport request using this transaction

      3. use "SUPRESS SYNTAX ERRORS" in the signature of the ADMP

      4. collect all HANA artifacts using transaction SCTS_HTA and synchronize it with transports

      5. then assign those objects to a transport request using this transaction

      6. set deployment mode in this transaction to “P” in the menu via utilities -> deployment mode, metadata will be added to the transport request

      7. you can release and transport the transport request

      8. in the target system you maintain transparent table CTS_HOT_PREWORK with the package to import – don’t set the flag “Prework Done” to true!

      9. then start transaction SCTS_HTA and run it with the name of the package

      10. then mark all deployable objects, type in DEPLOY and press enter to start the deployment




Even if you can avoid prework activities which should be possible in most cases I consider it still to too complex especially for business rules. SAP supports flexible deployment of decision services using SAP Decision Service Management.

So my message is easy: ABAP should support not only SQLscript procedures but also R. I don’t expect a full blown editor with supporting syntax highlighting – only the basic functions. It would also be interesting to integrate R in SAP Decision Service Management but this is a different topic that requires much more conceptual work.

Missing Documentation

If I read the SAP HANA and R integration guide I get the feeling that it is written by administrators. It covers many integration aspects: http://help.sap.com/hana/SAP_HANA_R_Integration_Guide_en.pdf
There is also a complex scenario contained in the documentation. Unfortunately something is missing: a description how HANA and R type systems fit together.

From my experience this is the most important information for hybrid programming (i.e. programming with two or more programming languages). I developed my own best practices for interfaces between SQLscript and R, for dealing with types like DECIMAL and so on but I am not sure whether they are true. It would be very useful to have a document describing the most important facts:



      • Which HANA data types correspond to which R data types?

      • Are there special things to consider f.e. conversions?

      • What about capital letters?

      • What are typical pitfalls?

      • What kind of “complex types” are possible for an interface? Is only data.frame but also data.table? What else is possible?




These are the typical questions of a beginner but also for people who mastered the first steps.
I am sure that SAP has this information since SAP created the HANA-R integration. So I would appreciate if SAP would publish it perhaps as non-normative documentation on SCN.

Summary

In my opinion the combination of operational analytics, prediction and business rules is an outstanding feature of SAP technology. The problem is software logistics. Compared to the HANA Transport Container, HTA is much better but not complex and cumbersome in the world of business rules. ADMP supporting R would be the perfect solution.
3 Comments
Labels in this area