How It Started
A few weeks ago, I tried an AI tool called Trae_CN to create Datasphere artifacts automatically. After a few hours of testing, it worked well! I was excited and wrote a blog post about it.
AI-Assisted SAP Datasphere Modeling
Then my teams chat filled up with messages from the security team.
The problem? Trae_CN wasn't approved by the company.
So I switched to Claude Code and tried again. This time, I wanted to solve a harder problem: creating complex models automatically. I focused on Analytic Models - the kind that everyone needs but finds hard to automate. These models need many steps: linking tables, setting up measures, and configuring business layers. Usually, you have to do all this by hand in the UI.
If we can use natural language to create these complex models, that would really save time.
I. The Problem: Too Much Manual Work
Data engineers spend a lot of time creating artifacts in SAP Datasphere.
When projects get big:
- One data warehouse: 50+ tables, 30+ views
- Complex analytic models: 10+ linked tables
Each artifact needs manual work: open UI → fill in fields → set up links → save
One table takes 5 minutes. 50 tables = 4 hours.
And many of these objects follow the same patterns. They can be automated.
II. The Idea: Use Natural Language
The ideal way should be like this:
"Create a customer table with ID, name, email, and city"
"Create a view from the customer table, show only ID and name"
"Create an analytic model linking customer and product tables"Just say what you need, and it's done automatically.
III. The Solution: Claude Code + Skills + Datasphere CLI
How It Works
Claude Code understands your words → calls Skills → Skills use Datasphere CLI → creates artifacts.
The three layers:
┌─────────────────────────────────────────────────────────────────┐
│ Layer 1: Natural Language │
│ "Create a customer table with ID, name, and email" │
└─────────────────────────────────────────────────────────────────┘
↓
┌─────────────────────────────────────────────────────────────────┐
│ Layer 2: Skills (Slash Commands) │
│ /create-local-table --name CUSTOMER --columns ID:String:10:key │
└─────────────────────────────────────────────────────────────────┘
↓
┌─────────────────────────────────────────────────────────────────┐
│ Layer 3: Datasphere CLI │
│ datasphere objects local-tables create --file-path table.json │
└─────────────────────────────────────────────────────────────────┘
↓
┌─────────────────────────────────────────────────────────────────┐
│ ✓ Table created in Datasphere │
└─────────────────────────────────────────────────────────────────┘The steps:
- You describe what you need in plain language
- Claude Code understands what you mean
- It calls the right Skill with slash commands
- The Skill generates CSN JSON format and calls Datasphere CLI
- The CLI uses SAP's official
@sap/datasphere-clito create the artifact
An Example
You say:
"Create a customer table with ID, name, and email. ID is the key."Claude Code runs:
/create-local-table --name CUSTOMER --columns ID:String:10:key,NAME:String:100,EMAIL:String:100The Skill creates this JSON:
{
"definitions": {
"CUSTOMER": {
"kind": "entity",
"elements": {
"ID": { "type": "cds.String", "length": 10, "key": true },
"NAME": { "type": "cds.String", "length": 100 },
"EMAIL": { "type": "cds.String", "length": 100 }
}
}
}
}Then CLI executes:
datasphere objects local-tables create --host your-tenant.cloud.sap --space SPACE_ID --file-path table.jsonDone. Table created in Datasphere.
Why Natural Language Works
You can say it different ways:
- "Make a table with order number, amount, and date"
- "I need a table for customer information"
- "Create a sales data table"
Claude Code understands all of these and calls the right Skill.
The Big Challenge: No Format Guide
Problem: Datasphere CLI docs don't show you how to write the CSN format for Replication Flow.
What to do?
Let AI learn it.
The method is simple:
- Create an example artifact in Datasphere UI by hand
- Use CLI to read that object's full structure
- Let Claude Code look at the CSN and find the patterns
- Use that template to make new artifacts
# Read an existing artifact
datasphere objects views read --name EXISTING_VIEW
# Claude Code helps figure out:
# - What fields are required?
# - What can we skip?
# - What are the rules?
This "reverse engineering" method helped me learn the right format for all artifact types.
IV. What I Built: 6 Skills, Focus on Analytic Models
The Skills I made:
Skill What It Does
| create-local-table | Makes tables |
| create-view | Makes views |
| create-analytic-model | Makes analytic models |
| create-data-flow | Makes data flows |
| create-replication-flow | Makes replication flows |
| create-transformation-flow | Makes transformation flows |
Analytic Models
Why focus on this one? Because it's the most complex.
Analytic models need:
- Linking fact and dimension tables
- Setting up measure calculations
- Choosing dimension fields
- Setting up business layers
The old way to create an analytic model:
- Drag dimension tables
- Set up link fields
- Pick dimension fields
- Define measures
- Save and deploy
Takes 10-20 minutes.
The new way (using natural language):
"Create a fact view SALES_FACT_VW from SALES_FACT,
linking customer and product dimensions.
Then create an analytic model AM_SALES with measures from the view."Done in 30 seconds.
It does this automatically:
- Creates fact view with dimension associations
- Links customer dimension (using CUSTOMER_ID)
- Links product dimension (using PRODUCT_ID)
- Adds the dimension fields you want (NAME, CITY, CATEGORY)
- Detects and sets up measure calculations (AMOUNT as sum)
V. Real Results: Talk in Natural Language
Creating a Sales Analysis Example
You tell Claude Code:
"Create a sales analysis data model for me.
First, make a sales fact table with order number, customer ID, product ID, and amount.
Then make a customer dimension table with ID, name, and city.
Next, make a product dimension table with ID, name, and category.
Then make a fact view based on the sales fact table, linking these two dimensions.
Finally, make an analytic model based on the sales fact view, with amount sum as the measure."Claude Code does this:
# 1. Create sales fact table
/create-local-table --name SALES_FACT \
--columns ORDER_ID:String:10:key,CUSTOMER_ID:String:10,PRODUCT_ID:String:10,AMOUNT:Decimal:15:2
# 2. Create customer dimension table
/create-local-table --name DIM_CUSTOMER \
--columns ID:String:10:key,NAME:String:100,CITY:String:50 --dimension
# 3. Create product dimension table
/create-local-table --name DIM_PRODUCT \
--columns ID:String:10:key,NAME:String:100,CATEGORY:String:50 --dimension
# 4. Create fact view with dimension associations
/create-view --name SALES_FACT_VW \
--source SALES_FACT \
--dimensions CUSTOMER_ID:DIM_CUSTOMER:ID;PRODUCT_ID:DIM_PRODUCT:ID
# 5. Create analytic model
/create-analytic-model --name AM_SALES \
--source SALES_FACT_VW \
--dimensions _CUSTOMER:NAME,CITY;_PRODUCT:NAME,CATEGORYBehind the scenes: Each skill generates CSN JSON and calls Datasphere CLI (datasphere objects create ...) to execute the actual creation in your tenant.
What happens:
- You describe what you need in plain language
- Claude Code understands and breaks it into steps
- It calls the right Skills
- Your whole data model is built
Time to build:
- Old way: 20-30 minutes
- Natural language + Claude Code: 1 minute
VI. Open Source Project
The code is on GitHub: https://github.com/yuyonggang/dsp-cli
What's included:
- 6 complete Skills
- Full instructions
- Setup guide
- Security guide
You can use it as is or change it for your needs.
I built this whole project using Claude Code — AI helped from start to finish.
Final Thoughts
What to Know
1. This Is Still New
Right now, the Skills work best for simple models. For complex business cases:
- You need to test and try things
- You might need to fix problems by hand
- The Skills need more work
This is a step-by-step process, not instant.
2. Be Careful with Big Projects
If your project is complex:
- Start with simple cases to test
- Move to harder models slowly
- Leave time for fixing issues
What's Next
My goal:
Give it a design doc → It creates everything
For example, give an AI Agent tool (like Claude Code) a requirements document:
Sales Analysis System Design
- Sales fact table: order, customer, product, amount, date
- Customer dimension: ID, name, city, country
- Product dimension: ID, name, category, price
- Fact view: based on sales fact table, linking customer and product dimensions
- Analytic model: multi-dimension sales analysis based on fact viewThe AI Agent would:
- Read the document
- Create all tables and dimensions
- Build fact view with dimension associations
- Build analytic models
- Hit an error? Read the error message
- Check API docs to understand why
- Fix it and try again
Fully automatic, no human help needed.
Using AI Agents to understand needs, work on their own, and fix their own mistakes in Datasphere projects.