Zepl
Search…
SAP Data Warehouse Cloud (DWC)
Zepl’s native integration into SAP Data Warehouse Cloud (DWC) gets teams connected to Zepl and analyzing their data in seconds. Read and write back are supported.

Create an SAP Data Warehouse Cloud Data Source

  1. 1.
    Navigate to: Resources > Data Sources
  2. 2.
    Select the SAP Data Warehouse Cloud icon:

Data Source Inputs

  • Name (required)
  • Host (required):
    • Enter the hostname of your SAP Data Warehouse Cloud database.
    • Example: ww23456-1db2-4dd0-8cbe-71521705c697.hana.prod-eu10.hanacloud.ondemand.com
  • Port (required): 30015 or 443 are default values
  • Database (optional)
  • Credential Type: See Data Source Security
  • Username (required - can be entered later): Username used for connecting to SAP Data Warehouse Cloud
  • Password (required - can be entered later): Password used for connecting to SAP Data Warehouse Cloud

Use SAP Data Warehouse Cloud

Read

Python
SQL
1
%python
2
import pandas as pd
3
4
# Create dbapi Connection object
5
conn = z.getDatasource("zepl_docs_sap_hana")
6
7
# Create dbapi Cursor object
8
cursor = conn.cursor()
9
10
# Create SQL statement
11
sql_command = 'SELECT * FROM "ZEPL"."View_1" LIMIT 100;'
12
13
# Execute SQL statment and fetch results
14
cursor.execute(sql_command)
15
data = cursor.fetchall()
16
17
# Convert to Pandas DataFrame
18
df = pd.DataFrame(data)
19
df.columns = [col[0] for col in cursor.description]
20
21
z.show(df)
Copied!
Use z.getDatasource() to return SAP Connection Object: pyhdbcli.Connection
1
%datasource.zepl_docs_sap_hana
2
3
SELECT * FROM "ZEPL"."View_1" LIMIT 3;
Copied!

Write

Python
1
%python
2
import pandas as pd
3
4
# Create dbapi Connection object
5
conn = z.getDatasource("zepl_docs_sap_hana")
6
7
# Create dbapi Cursor object
8
cursor = conn.cursor()
9
10
# Values to insert into the HANA table. This is an example, but these values can come from a list or dataframe. Simply loop through and insert each row.
11
sql = "INSERT INTO \"ZEPL\".\"View_1\" VALUES(19, 'PAYMENT', 1234.00, 'C1616398702',0, 0, 'M2089277435',0,0, FALSE, FALSE )"
12
13
# Insert row into SAP HANA
14
cursor.execute(sql)
15
16
# Display number of rows inserted successfully
17
cursor.rowcount
Copied!

Configure Authentication

Please reference SAP's Documentation to setup your SAP Data Warehouse Cloud database environment. Create a Space for your Zepl project and Database Users with both Ingest and Consumption enabled. You will be given a Username and Password that you can enter into the Zepl Data Source inputs.

Last modified 1yr ago