2026 Jan 27 1:53 PM - edited 2026 Jan 27 3:28 PM
Hi everyone,
I am working with SQL Views using SQLScript (Table Function) in SAP Datasphere and noticed that the output columns must always be created manually in the Model Properties → Columns section before the SQLScript can be validated or deployed.
Even when the SQLScript contains a simple RETURN SELECT ... statement, Datasphere does not automatically generate the column definitions based on the SQL result. As far as I can see, this is different from standard SQL views, where column inference works automatically.
RETURN SELECT ...In all cases, Datasphere requires me to manually maintain the business/technical names and data types in the Model Properties panel before validation succeeds.
Example SQLScript:
return
with "cte_customers" as (
select
"id",
"name"
from "customers"
)
, "cte_customers_ranked" as (
select
"id",
"name",
1 as "rank_number"
from "cte_customers"
)
select
"id",
"name",
"rank_number"
from "cte_customers_ranked";Some way to auto‑populate the column list based on the SQLScript output (similar to SQL Standard views).
Columns must be fully defined manually, otherwise validation fails.
If anyone has additional insight, workaround ideas, or official SAP statements regarding this behavior, I would really appreciate it.
Thank you.
Kind regards,
Anna
tab =
select
"id" AS ID
from "customers";
return
select ID from :tab;
tab = with "cte1" (ID) as (
select
"id" AS ID
from "customers"
)
select ID from "cte1";
return
select ID from :tab;
WITH clause?Request clarification before answering.
From a developer’s perspective, SAP Datasphere should explicitly support a Code-First modeling approach — not as a replacement for the UI, but as a first-class, equal alternative.
I have only started working with SAP Datasphere since last week, and this was the very first limitation my colleague and I noticed. The inability to fully define models in code immediately stood out in our daily development work.
For professional developers, it is essential to be able to define models entirely in code. This includes the ability to declare a structured output schema directly in SQLScript, such as a header with column names, data types, and semantics (similar to RETURNS TABLE or declarative column definitions).
Today, this metadata must be maintained manually in the UI, which becomes extremely time-consuming and error-prone for complex or frequently changing queries.
A Code-First approach would provide significant advantages:
• Versioning and Traceability
Fully declarative models can be cleanly versioned in Git, reviewed via diffs, and reproduced reliably. UI-managed metadata cannot offer the same level of transparency.
• Maintainability and Scalability
Large SQL models with many columns are difficult to refactor and maintain through the UI. Code is inherently better suited for restructuring, reuse, and long-term maintenance.
• Reduction of Manual Errors
Maintaining logic in SQL and semantics in the UI creates duplication and inconsistency. A declarative schema in code would establish a single source of truth.
• Developer Adoption and Productivity
Many Datasphere users come from HANA, SQL, and data engineering backgrounds. A UI-only modeling approach creates friction and limits Datasphere’s adoption as a true enterprise-grade platform.
Importantly, Code-First does not exclude UI-First.
Business users can continue to benefit from graphical modeling, while developers gain the flexibility to define everything in code — including structure, semantics, and output schema.
If SAP Datasphere aims to position itself as a modern, developer-friendly data platform, Code-First modeling is not a nice-to-have — it is a necessity.
I strongly encourage SAP to consider this capability and to provide a clear roadmap in this direction.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 15 | |
| 9 | |
| 6 | |
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.