Groovebox

Groovebox: free online Groovy IDE for SAP CPI, on Groovy 2.4 and Groovy 4

Groovebox is a free, browser-based Groovy IDE and playground for SAP Integration Suite (Cloud Integration, CPI) Groovy scripts. Paste a script, give it a payload, headers, properties and value mappings, and run it on Groovy 2.4 (Java 8) or Groovy 4 (Java 17): you see the output body, what changed in headers and properties, the Message Processing Log and any error. No tenant needed, no iFlow to deploy.

Open the playground

You may know the product under one of its names over the years: SAP Cloud Integration (part of SAP Integration Suite on SAP BTP), formerly SAP Cloud Platform Integration (CPI) and HANA Cloud Integration (HCI). Groovebox works for the Groovy scripts of all of them: think of it as an online Groovy editor, script tester and debugger for iFlow script steps.

Who it is for

Features

AreaWhat Groovebox does
RuntimesV1: Groovy 2.4.21 on Java 8 with com.sap.gateway.ip.core.customdev.util.Message. V2: Groovy 4.0.24 on Java 17 with the Script API v2 (com.sap.it.script.v2.api.Message and Exchange).
MessageBody as String, InputStream or byte[] with the usual getBody(...) conversions, case-insensitive headers, properties, attachments.
Value mappingITApiFactory.getApi(ValueMappingApi.class, null) with getMappedValue and getMappedValues, from a table you fill in or import (CSV or the value_mapping.xml of a CPI export).
Other SAP APIsSecureStoreService (user credentials, OAuth2 tokens), PartnerDirectoryService parameters and a number range counter, all with test data you provide.
Message Processing LogmessageLogFactory.getMessageLog(message) works as in CPI: string properties, attachments and custom headers appear in the MPL tab.
ResultsOutput body (beautified XML / JSON), header and property diff against the input, console output, the SAP API calls made, and errors with the failing line highlighted.
Your workKept in your browser; save the script as a .groovy file or export the whole session (script and inputs) as JSON.

How to use it

  1. Choose the runtime: V1 (Groovy 2.4) or V2 (Groovy 4).
  2. Write or paste the script. The function to call is processData by default; you can change it.
  3. Fill in the input: body, headers and properties (with their Java type), value mappings, attachments, secure store and partner directory entries.
  4. Press Run or Ctrl+Enter.
  5. Check the output tabs: Body, Headers, Properties, Attachments, MPL, Console, API and Error.
  6. Save the script with Save: it is downloaded to your computer as a .groovy file.

Example script

A typical CPI script reads the payload, looks up a value mapping, sets headers and properties and writes to the Message Processing Log. It runs unchanged in Groovebox:

import com.sap.gateway.ip.core.customdev.util.Message
import com.sap.it.api.ITApiFactory
import com.sap.it.api.mapping.ValueMappingApi

def Message processData(Message message) {
    def order = new XmlSlurper().parseText(message.getBody(String))

    def valueMapping = ITApiFactory.getApi(ValueMappingApi.class, null)
    def country = valueMapping.getMappedValue('S4', 'Country', order.Customer.Country.text(), 'SF', 'Country')

    message.setHeader('SF_Country', country)
    message.setProperty('OrderId', order.Id.text())

    def messageLog = messageLogFactory.getMessageLog(message)
    messageLog?.setStringProperty('Country', country)
    return message
}

What Groovebox does not do

Privacy and security

Frequently asked questions

Is Groovebox free?

Yes. It runs in the browser, with no account and no installation.

Do I need an SAP tenant to test a Groovy script?

No. Groovebox simulates the CPI script environment (Message, value mapping, secure store, partner directory, Message Processing Log), so you can run a script before deploying it to a tenant.

Which Groovy versions are supported?

Groovy 2.4.21 on Java 8 (the classic CPI script runtime) and Groovy 4.0.24 on Java 17 (the Script API v2 runtime).

Can I test value mapping lookups?

Yes. Enter the mappings in the Value Mapping tab or import them from a CSV or a CPI value_mapping.xml; getMappedValue and getMappedValues return them, in both directions.

Can my script call external systems?

No. For security, scripts run without network access, file system access or the ability to start processes.

Is my code or data stored?

No. Nothing is stored or logged on the server; your work is kept only in your own browser.

Is Groovebox made by SAP?

No. Groovebox is an independent tool, not affiliated with or endorsed by SAP.

Last updated: