Skip to content

Commit

Permalink
Documentation changes for cds view generator (#1438)
Browse files Browse the repository at this point in the history
* Adding the files for CDS Generator

* upload the guide doc

* documentation changes for sap cds generator

---------

Co-authored-by: Andrew Gold <[email protected]>
  • Loading branch information
naitik1995 and agold-rh authored Jan 31, 2025
1 parent 45068f9 commit cebacf3
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 47 deletions.

This file was deleted.

26 changes: 15 additions & 11 deletions examples/sap-bigquery-cds-generator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,32 @@

## Summary

This ABAP utility program automates the creation of CDS views for SAP tables that can be used for replicating SAP tables to BigQuery and for Cortex Data Foundation. It eliminates the manual effort and potential errors associated with individual view creation, ensuring a seamless and efficient process.
This ABAP utility program streamlines the creation of CDS views designed for capturing delta changes in SAP tables. These delta-enabled views are crucial for replicating data to BigQuery, enabling powerful data analytics on SAP data. By automating this process, the utility eliminates the manual effort and potential errors associated with creating individual views. This allows for a more seamless and efficient integration with BigQuery, whether you are building custom data pipelines or utilizing the Google Cloud Cortex Framework to accelerate the establishment of your data foundations.


## Problem Statement

Replicate SAP tables to BigQuery via Datasphere using CDS views provided that enterprise SLT license is not available.
Manually creating CDS views for each SAP source table intended for replication to BigQuery or Cortex integration is time-consuming and prone to errors. This necessitates a more efficient and automated solution.
Many SAP to BigQuery replication scenarios, particularly those using tools like Datasphere, rely on delta-enabled CDS views when an SLT license is unavailable, creating replication flows becomes challenging. Manually creating and maintaining these CDS views is a tedious and error-prone process, especially when dealing with a large number of tables. This necessitates a solution for creating the necessary CDS views, enabling data replication even without SLT. It eliminates the manual effort and potential errors associated with creating and maintaining these views.




## Key Features

* **Automated CDS View Creation:** Generates CDS views for designated SAP tables, eliminating manual development effort.
* **Bulk Processing:** Efficiently handles large datasets of tables through file upload.
* **Cortex Compatibility:** Guarantees one-to-one correspondence between CDS views and source tables, adhering to Cortex expectations.
* **Cortex Compatibility:** Guarantees one-to-one correspondence between CDS views and source tables, adhering to Cortex Framework expectations.
* **Transport and Package Management:** Integrates with the SAP transport system for controlled deployment and versioning of CDS views.
* **Comprehensive Error Handling:** Catches and reports potential errors during data processing and view creation.
* **Log Maintenance:** Maintains log of all activities such as cds views created, errors reported etc for future reference after the
details are displayed in the program's output

## Technical Design

### User Interface

* An intuitive selection screen allows users to:
* Upload an input file containing a list of SAP tables for CDS view creation.
* Upload an input file containing a list of SAP tables, CDS and SQL view names for CDS view creation.
* Provide the target transport request for saving the generated views.
* Input the package where the CDS views will be assigned.

Expand All @@ -32,6 +37,7 @@ Manually creating CDS views for each SAP source table intended for replication t
* It reads the corresponding schema/structure of the input tables from the SAP DD03L table.
* For each table, it dynamically creates the CDS view definition with necessary annotations.
* It generates the underlying SQL view for the defined CDS view.
* If SQL or CDS view name is not defined, it is defaulted as Z_Tablename_CDS and Z_Tablename_SQL
* Utilizes ABAP's built-in capabilities to activate and transport the generated views.
* Implements robust error handling mechanisms.

Expand All @@ -49,11 +55,9 @@ Manually creating CDS views for each SAP source table intended for replication t


* `K900071.S4S`
* `R900071.S4S`

* Refer to this guide for importing transport requests: [How to Import an SAP Transport Request](https://kb.theobald-software.com/sap/how-to-import-an-sap-transport-request-with-the-transportmanagement-system-stms)
* `R900071.S4S`

2. **Prepare Input File:** Create an input file (CSV or TXT) with two columns: `TABLENAME` and `CDSVIEWNAME`.
3. **Execute the Program:** Run the imported program, providing the input file from step 2.
4. **(Optional) Replicate to GCP BQ:** If needed, follow the remaining steps (not provided in this document) to replicate the generated views to Google Cloud BigQuery.
2. **Prepare Input File:** Create an input file (TSV) with three columns: `TABLENAME` , `CDSVIEWNAME` and `SQLVIEWNAME`. Checkout the sample_input_file.txt for reference
3. **Execute the Program:** Run the imported program ZGOOG_CDS_CR, providing the input file from step 2, TR number and package details.
4. **Logs:** Once program executes and displays the output, the same logs are saved in the table ZCDS_CR_LOG

5 changes: 5 additions & 0 deletions examples/sap-bigquery-cds-generator/sample_input_file.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
TABLENAME CDSVIEWNAME SQLVIEWNAME
t002 ZFI_T002_CDS ZFI_T002_SQL
matdoc
mara ZMM_MARA_CDS
makt ZMM_MAKT_SQL

0 comments on commit cebacf3

Please sign in to comment.