cancel
Showing results for 
Search instead for 
Did you mean: 

Scripts in HCI.

Ganga
Discoverer
0 Kudos

Hi All,

I am aware that in Hana Cloud Platform- Integration Service or Hana cloud Integration (HCI), scripting is done using Groovy or Java script.

My doubt is, is there any specific condition where only groovy can be used and some situations where javascript alone works in HCI?

Also, apart from the use of scripts as UDF, is there any additional advantages of them?

Experts,

Kindly give some existing links about scripting in HCI using Javascript and Groovy.

Thanks in advance!!!

Ganga.

Accepted Solutions (1)

Accepted Solutions (1)

Sriprasadsbhat
Active Contributor
0 Kudos

Hello Ganga,

There are no specific condition where you need to follow either java scripting or groovy in SAP HCI from my understanding ( I am not sure from Performance Perspective ).

You can go with Java Scripting  if you are already good with java or if you are from PI background have in depth knowledge on XML Parser or you have repository of reusable codes from your SAP PI experience.

Where as Groovy scripting is considered you can learn very quickly if you are very new to scripting also because of developer friendly syntax and bunch of very strong built in classes for XML parsing.

For Ex:To parse a XML


In Groovy:

You can use XMLSlurper Class and can be done in few lines of code.


def root = new XmlSlurper().parseText(body)

def T_FILETYPE = root.header.FILETYPE

T_FILETYPE = T_FILETYPE.toString()

In JavaScript:

You need to write multiple lines of code using either SAX or DOM Parser ( you can check in SDN for examples on the same ).

Difference between them very nicely explained in the below blog

Practically Groovy: Building, parsing, and slurping XML

UDF:

UDF in SAP HCI is very similar to SAP PI,but here you will be creating a groovy script to achieve the same which can be used within the Message Mapping .

Script Step can be used within your Integration Process.If you are SAP PI background you can visualize something like you are writing Java Mapping.


Best starting point I would suggest is to go through the Standard Integration Packages available in SAP HCI Content Catalog ( https://cloudintegration.hana.ondemand.com/ ) where you can see multiple Scripts.

Regards,

Sriprasad Shivaram Bhat

Ganga
Discoverer
0 Kudos

Thanks for the deep explanation and references Sri

Answers (1)

Answers (1)

former_member186851
Active Contributor
0 Kudos

Hello Ganga,

Guess you can use both