技能创建器
skill-creator
创建、改进和评估自定义技能,把专业流程转化为可重复使用的 AI 能力。
bdc-connect-sharing【数据与研究】Use when the user is sharing data products into or out of SAP BDC via BDC Connect, working with the sap-bdc-connect-sdk Python library, using Delta Sharing to publish Databricks/Snowflake data into BDC, using the Data Product Generator to extract BW/BW4HANA InfoProviders as BDC data products, or dealing with ORD/CSN metadata. Trigger phrases include …
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
BDC Connect enables zero-copy, bidirectional data product sharing between SAP Business Data Cloud and external systems like Databricks and Snowflake. Instead of replicating data, BDC Connect uses Delta Sharing (an open protocol) to provide direct, secure access to a single source of truth.
Key benefits:
Prerequisites:
Catalog Asset –R–––––– and Cloud Data Product -----S- privileges)ORD (Open Resource Discovery) provides human-discoverable metadata about a data product.
Mandatory ORD fields (required for all data products):
title: Short, clear name (e.g., "Customer Order")shortDescription: One-sentence summary (e.g., "Offering access to all customer orders")description: Detailed explanation (must NOT contain shortDescription)Optional ORD fields (include if you want them to appear):
labels: Functional grouping (e.g., ["sales", "orders"])tags: Technical tags (e.g., ["storage", "high-availability"])industry: Applicable industries (e.g., ["Retail", "Public Sector"])lineOfBusiness: LOB scope (e.g., ["Sales"])deprecationDate: When data product will be retired (ISO 8601 timestamp)sunsetDate: Final removal date (ISO 8601 timestamp)successors: Array of replacement data product URIscorrelationIds: Links to source systems (e.g., ["sap.s4:communicationScenario:SAP_COM_0008"])dataProductLinks: Relationships to other data productslinks: Documentation, support, terms URLsdocumentationLabels: Organized documentation linksAlways-overridable fields:
visibility: "public" (default), "interval", or "private"releaseStatus: "active" (default), "beta", or "deprecated"ORD is provided as a JSON object with the @openResourceDiscoveryV1 key when using the SDK.
CSN (Core Schema Notation) defines the technical structure: tables, columns, data types, primary/foreign keys, and relationships.
CSN is the standardized format for specifying table schemas in Delta Sharing contexts. It includes:
The Python SDK provides csn_generator.generate_csn_template() to automatically generate CSN from a Databricks share, then you can manually edit it for accuracy.
CSN compliance is validated against the CSN Interop Effective v1 specification. For full CSN examples, consult CSN Interop Effective v1 · Examples documentation.
pip install sap-bdc-connect-sdk
Requires Python ≥3.9. License: SAP Developer License Agreement.
By the way — earlier versions of this skill pinned the SDK at
==1.1.13. That hard pin is now incorrect. The SAP-published reference version (per help.sap.com "Working with Data Products in SAP Databricks", May 2026) is 1.0.9, and PyPI may publish higher 1.x versions. Use>=1.0.9as a floor, not a hard pin. The MCP server v0.5.0+ already does this.
When running the SDK inside an SAP Databricks notebook, set the Serverless environment version to 3 before installing the SDK:
Source: help.sap.com "Working with Data Products in SAP Databricks", May 2026, page 10.
from bdc_connect_sdk.auth import BdcConnectClient, DatabricksClient
# Create Databricks client (requires Databricks notebook context)
databricks_client = DatabricksClient(dbutils, "<recipient-name>")
# Create BDC Connect client
bdc_connect_client = BdcConnectClient(databricks_client)
Parameters:
dbutils: Databricks notebook utility object<recipient-name>: Name of the BDC recipient (usually the BDC tenant name or system identifier)To share data products to/from BDC, the executing principal must have these 6 metastore privileges, granted via Catalog → Manage → Metastore → Permissions → Grant:
CREATE CATALOGCREATE SHARESET SHARE PERMISSIONUSE PROVIDERUSE RECIPIENTUSE SHAREUse the MCP server's validate_databricks_privileges tool to pre-flight this check before any sharing operation.
When sharing Databricks Delta Shares back to BDC, the recipient name is fixed: sap-business-data-cloud. This recipient is auto-provisioned in the SAP Databricks tenant during the formation join. Do not create a different one.
Materialized views are NOT supported by SAP Databricks Delta Sharing. You can share schemas, tables, and regular views — but materialized views must be re-exposed as a regular view or persisted as a Delta table. Use the MCP server's list_unsupported_share_assets tool to scan a catalog/schema.
When you create a Delta table in SAP Databricks that you intend to expose back to BDC as a derived data product, set both:
df.write.format("delta") \
.option("delta.enableChangeDataFeed", "true") \
.option("delta.enableDeletionVectors", "true") \
.saveAsTable("my_catalog.my_schema.my_derived_table")
CREATE TABLE my_catalog.my_schema.my_derived_table
TBLPROPERTIES (
delta.enableChangeDataFeed = true,
delta.enableDeletionVectors = true
)
AS SELECT * FROM source.schema.table WHERE ...;
Deletion vectors clarification — SAP Note 3706399 says deletion vectors break sharing. That note covers the consume side of an inbound share you don't own. The recommendation above covers the produce side of derived tables you create yourself. Both are correct in their own context.
Source: help.sap.com "Working with Data Products in SAP Databricks", May 2026, pages 7–9.
from bdc_connect_sdk.auth import BdcConnectClient, DatabricksClient
bdc_connect_client = BdcConnectClient(DatabricksClient(dbutils, "<recipient-name>"))
share_name = "<share-name>"
open_resource_discovery_information = {
"@openResourceDiscoveryV1": {
"title": "<title>",
"shortDescription": "<short-description>",
"description": "<description>"
}
}
response = bdc_connect_client.create_or_update_share(
share_name,
open_resource_discovery_information
)
print(f"Share created/updated: {response}")
Key method: create_or_update_share(share_name, open_resource_discovery_information)
from bdc_connect_sdk.auth import BdcConnectClient, DatabricksClient
from bdc_connect_sdk.utils import csn_generator
bdc_connect_client = BdcConnectClient(DatabricksClient(dbutils, "<recipient-name>"))
share_name = "<share-name>"
# Auto-generate CSN from Databricks share
csn_schema = csn_generator.generate_csn_template(share_name)
# Update the share's CSN metadata
response = bdc_connect_client.create_or_update_share_csn(
share_name,
csn_schema
)
print(f"CSN updated: {response}")
To edit CSN manually:
import json
csn_schema = csn_generator.generate_csn_template(share_name)
file_path = f"csn_{share_name}.json"
# Write to file for editing
with open(file_path, "w") as f:
f.write(json.dumps(csn_schema, indent=2))
# Later, read edited CSN
with open(file_path, "r") as f:
edited_csn = json.load(f)
response = bdc_connect_client.create_or_update_share_csn(share_name, edited_csn)
Key methods:
csn_generator.generate_csn_template(share_name): Auto-generates CSN from Databricks share tablescreate_or_update_share_csn(share_name, csn_schema): Pushes CSN to BDC Connectfrom bdc_connect_sdk.auth import BdcConnectClient, DatabricksClient
bdc_connect_client = BdcConnectClient(DatabricksClient(dbutils, "<recipient-name>"))
share_name = "<share-name>"
response = bdc_connect_client.publish_data_product(share_name)
print(f"Data product published: {response}")
What happens:
Key method: publish_data_product(share_name)
from bdc_connect_sdk.auth import BdcConnectClient, DatabricksClient
bdc_connect_client = BdcConnectClient(DatabricksClient(dbutils, "<recipient-name>"))
share_name = "<share-name>"
response = bdc_connect_client.delete_share(share_name)
print(f"Share deleted: {response}")
Unpublishing removes the data product from catalog and revokes access. Use when data is no longer needed or to enforce data governance.
Key method: delete_share(share_name)
The Data Product Generator (DPG) automates extraction of BW/BW4HANA InfoProviders into BDC local tables, enabling legacy BW data to be published as modern data products.
Configuration > Tenant Configuration > Object Store (set Storage in TB, Compute in block-hours, API Requests/month)A data subscription is a new BW object type (TLOGO DSUB or legacy SUBS) that defines:
Data subscriptions are NOT the extracted data itself—they are metadata definitions of extraction operations.
Data subscription types:
All new subscriptions are created as DSUB by default.
Delta extraction available on:
Full extraction only:
Archived data: DPG can extract from NLS (Near-Line Storage) but NOT from ADK-based Data Archiving Process (DAP).
In RSDPS transaction, navigate to Goto > Maintain Target System:
| Action | Steps |
|---|---|
| View target details | Select target name; properties populate |
| Check connectivity | Click [Check Connectivity] icon |
| Edit target | Click [Display ↔ Change] then modify; click [Save] |
| Delete target | Click [Display ↔ Change] then [Delete Target System]; confirm |
| Create new target | Click [Display ↔ Change] then [Create Target System]; enter Target Name, set type to HDLFS |
Important: Target Type MUST be HDLFS (only supported type).
When you create or maintain a data subscription, these properties are managed:
| Property | Description | Editable After First Run? |
|---|---|---|
| Technical Name | Auto-generated | No |
| Description | Manual entry | Yes |
| Source Name | InfoProvider selected | No |
| Source Type | Always ODP (Operational Data Provisioning) | No |
| Target Name | Datasphere space/tenant | No (fixed at creation) |
| Target Type | Always HDLFS | No |
| Subscription Type | DSUB or SUBS | No |
| Status | Active/Inactive | Yes |
| Extraction Mode | Full or Delta | No (locked after first run) |
| Scheduling | None, Direct Execution, or Process Chain | Yes |
| Last Run | Success/failure status | Auto-generated |
| Created At / By | Timestamp + user | Auto-generated |
| Last Changed At / By | Timestamp + user | Auto-generated |
In Data Subscriptions App (BW/4HANA Cockpit):
In RSDPS Transaction (SAP GUI):
Target selection (CRITICAL):
After creating a subscription, run it manually or schedule it:
Execution flow:
Once extracted, local tables can be published as data products via Data Sharing Cockpit in Datasphere:
Available in BWMT 1.27+:
BW Data Product Generator Perspective:
Scenario Generator:
Use case: Map entire BW analytical model into BDC with one scenario, respecting dependencies.
DSUB data subscriptions are transportable objects (TLOGO type DSUB):
Process Chain Integration:
Available on BW/4HANA 2023 SP04+:
Step-by-step with Python SDK:
Create Delta Share in Databricks (native; consult Databricks docs for AWS/GCP/Azure)
CREATE SHARE my_sales_data; in Databricks SQLAdd tables to share (Databricks side)
Create share metadata in BDC Connect (Python SDK)
open_resource_discovery = {
"@openResourceDiscoveryV1": {
"title": "Sales Analytics Data",
"shortDescription": "Shared sales transactions and metrics",
"description": "Real-time sales data for analytics and ML workflows..."
}
}
response = bdc_client.create_or_update_share("my_sales_data", open_resource_discovery)
Generate & update CSN schema (Python SDK)
csn = csn_generator.generate_csn_template("my_sales_data")
# Optionally edit CSN for accuracy (data types, keys, references)
response = bdc_client.create_or_update_share_csn("my_sales_data", csn)
Publish as data product (Python SDK)
response = bdc_client.publish_data_product("my_sales_data")
Discover in BDC Catalog (BDC Cockpit)
Consume in Datasphere or downstream (recipient side)
BDC Connect metering measures cloud subscription usage. Reference SAP Cloud Subscription Usage page or SAP Business Data Cloud Capacity Unit Estimator:
Common issues:
generate_csn_template() outputGetting help:
When sharing data from Enterprise Databricks on Azure into BDC, if the underlying Azure Storage account has its firewall enabled (default posture for production), the consumer side hits AuthorizationFailure 403 on the parquet reads behind the share.
Fix (from SAP Notes 3718680 + 3726123):
Notes:
For the raw error-code → note mapping, delegate to the bdc-troubleshooter skill.
The sap-bdc-mcp-server MCP (v0.5.0) provides programmatic execution of BDC Connect operations.
SDK wrappers (core):
create_or_update_share — wraps SDK; in v0.5.0+, automatically pre-validates ORD JSON via validate_ord_metadata (bypass with skip_validation=true)create_or_update_share_csn — wraps SDKpublish_data_product — wraps SDKdelete_share — wraps SDKprovision_share — sets up recipient access end-to-endgenerate_csn_template — wraps csn_generator utilityvalidate_share_readiness — pre-flight before BDC registrationDiscovery & diagnostics (v0.3.0):
list_shares, get_share_details, list_recipientsvalidate_tenant_hostname (SAP Notes 3652165 / 3705747)check_deletion_vectors (SAP Note 3706399)cleanup_orphaned_data_product (SAP Note 3720724)diagnose_share_error — regex-based mapping to indexed SAP NotesNew in v0.5.0 (driven by SAP help.sap.com 2026-05-02 batch):
validate_databricks_privileges — confirm CREATE CATALOG / CREATE SHARE / SET SHARE PERMISSION / USE PROVIDER / USE RECIPIENT / USE SHARE on the metastorevalidate_ord_metadata — local ORD JSON validation (required fields, description ≠ shortDescription, visibility/releaseStatus enums, ISO 8601 dates)list_unsupported_share_assets — flag materialized views and other unsupported types in a catalog/schemaThis skill covers the concepts and manual workflows; the MCP handles automated/scripted execution in Databricks notebooks or orchestration tools.