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+ viewsComplex 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 and calls Skills that connect to Datasphere CLI to create artifacts.
The steps:
You describe what you need in plain languageClaude Code understands what you meanIt calls the right SkillThe Skill connects to Datasphere using SAP’s official @sap/datasphere-cli toolIt makes the JSON and creates 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:100
The 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 }
}
}
}
}
Done.
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 JSON format.
What to do?
Let AI learn it.
The method is simple:
Create an example artifact in Datasphere UI by handUse CLI to read that object’s full structureLet Claude Code look at the JSON and find the patternsUse 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-tableMakes tablescreate-viewMakes viewscreate-analytic-modelMakes analytic modelscreate-data-flowMakes data flowscreate-replication-flowMakes replication flowscreate-transformation-flowMakes transformation flows
Analytic Models
Why focus on this one? Because it’s the most complex.
Analytic models need:
Linking fact and dimension tablesSetting up measure calculationsChoosing dimension fieldsSetting up business layers
The old way to create an analytic model:
Drag dimension tablesSet up link fieldsPick dimension fieldsDefine measuresSave and deploy
Takes 10-20 minutes.
The new way:
/create-analytic-model –name AM_SALES
—source SALES_FACT
–measures AMOUNT:sum,QUANTITY:sum
–dimensions CUSTOMER_ID:DIM_CUSTOMER:ID:NAME,CITY;PRODUCT_ID:DIM_PRODUCT:ID:NAME,CATEGORY
Done in 30 seconds.
It does this automatically:
Links customer dimension (using CUSTOMER_ID)Links product dimension (using PRODUCT_ID)Adds the dimension fields you want (NAME, CITY, CATEGORY)Sets up measure calculations (sum of AMOUNT and QUANTITY)
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.
Finally, make an analytic model based on the sales fact table, linking these two dimensions, 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
# 3. Create product dimension table
/create-local-table –name DIM_PRODUCT
–columns ID:String:10:key,NAME:String:100,CATEGORY:String:50
# 4. Create analytic model
/create-analytic-model –name AM_SALES
—source SALES_FACT
–measures AMOUNT:sum
–dimensions CUSTOMER_ID:DIM_CUSTOMER:ID:NAME,CITY;PRODUCT_ID:DIM_PRODUCT:ID:NAME,CATEGORY
What happens:
You describe what you need in plain languageClaude Code understands and breaks it into stepsIt calls the right SkillsYour whole data model is built
Time to build:
Old way: 2-3 hoursNatural 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 SkillsFull instructions (in English and Chinese)Setup guideSecurity 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 thingsYou might need to fix problems by handThe 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 testMove to harder models slowlyLeave 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
– Analytic model: multi-dimension sales analysis
The AI Agent would:
Read the documentCreate all tables and dimensionsBuild analytic modelsHit an error? Read the error messageCheck API docs to understand whyFix 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.
How It StartedA 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 ModelingThen 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 WorkData engineers spend a lot of time creating artifacts in SAP Datasphere.When projects get big:One data warehouse: 50+ tables, 30+ viewsComplex analytic models: 10+ linked tablesEach artifact needs manual work: open UI → fill in fields → set up links → saveOne 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 LanguageThe 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 CLIHow It WorksClaude Code understands your words and calls Skills that connect to Datasphere CLI to create artifacts.The steps:You describe what you need in plain languageClaude Code understands what you meanIt calls the right SkillThe Skill connects to Datasphere using SAP’s official @sap/datasphere-cli toolIt makes the JSON and creates the artifactAn ExampleYou 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 }
}
}
}
}Done.Why Natural Language WorksYou 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 GuideProblem: Datasphere CLI docs don’t show you how to write the JSON format.What to do?Let AI learn it.The method is simple:Create an example artifact in Datasphere UI by handUse CLI to read that object’s full structureLet Claude Code look at the JSON and find the patternsUse 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 ModelsThe Skills I made:Skill What It Doescreate-local-tableMakes tablescreate-viewMakes viewscreate-analytic-modelMakes analytic modelscreate-data-flowMakes data flowscreate-replication-flowMakes replication flowscreate-transformation-flowMakes transformation flowsAnalytic ModelsWhy focus on this one? Because it’s the most complex.Analytic models need:Linking fact and dimension tablesSetting up measure calculationsChoosing dimension fieldsSetting up business layersThe old way to create an analytic model:Drag dimension tablesSet up link fieldsPick dimension fieldsDefine measuresSave and deployTakes 10-20 minutes.The new way:/create-analytic-model –name AM_SALES
–source SALES_FACT
–measures AMOUNT:sum,QUANTITY:sum
–dimensions CUSTOMER_ID:DIM_CUSTOMER:ID:NAME,CITY;PRODUCT_ID:DIM_PRODUCT:ID:NAME,CATEGORYDone in 30 seconds.It does this automatically:Links customer dimension (using CUSTOMER_ID)Links product dimension (using PRODUCT_ID)Adds the dimension fields you want (NAME, CITY, CATEGORY)Sets up measure calculations (sum of AMOUNT and QUANTITY)V. Real Results: Talk in Natural LanguageCreating a Sales Analysis ExampleYou 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.
Finally, make an analytic model based on the sales fact table, linking these two dimensions, 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
# 3. Create product dimension table
/create-local-table –name DIM_PRODUCT
–columns ID:String:10:key,NAME:String:100,CATEGORY:String:50
# 4. Create analytic model
/create-analytic-model –name AM_SALES
–source SALES_FACT
–measures AMOUNT:sum
–dimensions CUSTOMER_ID:DIM_CUSTOMER:ID:NAME,CITY;PRODUCT_ID:DIM_PRODUCT:ID:NAME,CATEGORYWhat happens:You describe what you need in plain languageClaude Code understands and breaks it into stepsIt calls the right SkillsYour whole data model is builtTime to build:Old way: 2-3 hoursNatural language + Claude Code: 1 minuteVI. Open Source ProjectThe code is on GitHub: https://github.com/yuyonggang/dsp-cliWhat’s included:6 complete SkillsFull instructions (in English and Chinese)Setup guideSecurity guideYou 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 ThoughtsWhat to Know1. This Is Still NewRight now, the Skills work best for simple models. For complex business cases:You need to test and try thingsYou might need to fix problems by handThe Skills need more workThis is a step-by-step process, not instant.2. Be Careful with Big ProjectsIf your project is complex:Start with simple cases to testMove to harder models slowlyLeave time for fixing issuesWhat’s NextMy goal:Give it a design doc → It creates everythingFor 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
– Analytic model: multi-dimension sales analysisThe AI Agent would:Read the documentCreate all tables and dimensionsBuild analytic modelsHit an error? Read the error messageCheck API docs to understand whyFix it and try againFully automatic, no human help needed.Using AI Agents to understand needs, work on their own, and fix their own mistakes in Datasphere projects. Read More Technology Blog Posts by SAP articles
#SAP
#SAPTechnologyblog