Project: SAP Integration Agents

Using the HTTP adapter to call SAP BTP service APIs, an agent that monitors a CAP service health endpoint and auto-files issues on failure, and a BTP workflow integration.

Project: SAP BTP Integration

What you'll build

Integrate Paperclip agents with SAP BTP services — using the HTTP adapter to call SAP APIs and the shell adapter to run CAP queries.

Why SAP + Paperclip?

SAP BTP customers often have repetitive enterprise workflows that are perfect for Paperclip:
- Extract and summarise data from S/4HANA
- Classify incoming SAP support messages
- Generate weekly operational reports from CAP OData services
- Automate BTP subaccount provisioning documentation

Pattern 1: CAP OData Reader Agent

{
  "adapter_type": "http",
  "adapter_config": {
    "url": "https://your-cap-app.cfapps.eu10.hana.ondemand.com/api/Orders?$top=50&$format=json",
    "method": "GET",
    "headers": {
      "Authorization": "Bearer {{env.BTP_TOKEN}}",
      "Accept": "application/json"
    },
    "response_path": "value",
    "post_process": "summarise"
  }
}

The agent receives the OData result as its task context and produces a summary.

Pattern 2: Shell Agent Running CF CLI

#!/usr/bin/env python3
# /agents/cf_report.py
import subprocess, json, sys

# Get Cloud Foundry app status
result = subprocess.run(
    ['cf', 'apps', '--json'],
    capture_output=True, text=True
)
apps = json.loads(result.stdout)

summary = [
    f"- {a['name']}: {a['state']} ({a['instances']} instances)"
    for a in apps
]
print('\n'.join(['## CF Apps Status', ''] + summary))
{
  "adapter_type": "shell",
  "adapter_config": {
    "command": "python3 /agents/cf_report.py",
    "env": { "CF_API": "{{env.CF_API}}", "CF_TOKEN": "{{env.CF_TOKEN}}" }
  }
}

Pattern 3: HANA Cloud Query Agent

#!/usr/bin/env python3
# /agents/hana_query.py
import hdbcli.dbapi, sys, json

conn = hdbcli.dbapi.connect(
    address=os.environ['HANA_HOST'],
    port=443,
    user=os.environ['HANA_USER'],
    password=os.environ['HANA_PASS'],
    encrypt=True
)

cursor = conn.cursor()
cursor.execute("SELECT TOP 20 * FROM OPEN_PURCHASE_ORDERS ORDER BY NET_AMOUNT DESC")
rows = cursor.fetchall()
columns = [d[0] for d in cursor.description]

print(json.dumps({"columns": columns, "rows": [list(r) for r in rows]}))

Then an LLM agent (claude-code) receives this JSON as the task description and produces a human-readable summary.

BTP Service Binding Pattern

In Cloud Foundry, service credentials are injected via VCAP_SERVICES. Read them in a shell agent:

import os, json
vcap = json.loads(os.environ.get('VCAP_SERVICES', '{}'))
destination_creds = vcap.get('destination', [{}])[0].get('credentials', {})

Typical SAP Paperclip Workflow

Daily at 06:00 UTC (heartbeat trigger):
  1. HANA Query Agent → fetch yesterday's sales data
  2. Summariser Agent (claude-code) → produce executive summary
  3. Approval Gate → CFO approves distribution
  4. Email Agent (shell) → sends via SAP BTP Mail service

Checkpoint ✓

Sign in for progress tracking & Q&A →