Blog 4 – Beyond Data Warehousing: AI-assisted migration of Business Logic from BW 7.5 to BDC Part 1

Estimated read time 18 min read

In the earlier parts of this blog series, we discussed the upcoming end‑of‑maintenance deadline (now 2030) for SAP NetWeaver Business Warehouse 7.5 on-premise (SAP BW 7.5 on-prem) customers and the options they have going forward.  

Based on practical experiences in a recent pilot project, we showed how “lifting” an SAP BW system in Private Cloud edition (SAP BW in PCE) in SAP Business Data Cloud (SAP BDC) can extend maintenance of the as-is environment while unlocking new capabilities to kick-start modernization.

This follow on blog explores how SAP BW 7.5 on-premise customers can reuse their existing investments in data extraction and data modeling flows (including complex ABAP transformations and BW business logic) and modernize them by leveraging SAP Datasphere, Business Technology Platform and Business Data Cloud capabilities.

As a recap in the previous blogs, we have seen

the creation of Data Products from SAP BW via ‘Data Product Generator’, that enables SAP BW customers to easily replicate InfoProvider data and its semantics to SAP HANA Cloud data lake files storage (HDLFS) within SAP BDC and transforms traditional BW data into modern data products for consumption in analytical scenarios and AI/ML workflows.how to integrate BW standard extractors and preserve custom extractors business logic into SAP BDC.

In this part of the blog series, we will focus on how we can leverage existing BW investments on data extraction and transformation (BW DataSources, data models, transformations and ABAP routines, etc) into SAP BDC and leveraging SAP Datasphere and SAP Business Technology Platform capabilities beyond Data Warehousing.

Business Challenges and Objective

One of the main challenges that multiple BW customers face is that in order to transform their business and move into a cloud-native architecture they need to be able to ensure full coverage of their existing BW business logic and data modeling, In addition to that, they need to understand the transition to the cloud with minimal business disruption by leveraging existing investments and custom managed modeling and developments.

Most of the mature BW customers have built for many years complex custom business logic in the daily transformations and data flows in BW that apply specifically to their business. In order to move to the cloud and adopt AI and innovation in data and analytics, they need to ensure seamless migration of their existing business models without manually re-designing the whole business logic in the new environment.

In the example below, we will illustrate how a BW customer can replicate their custom BW business logic written in ABAP to SQL code in SAP Datasphere, in a semi-automated manner.

Custom Example

For our complex BW pilot case, we are using a custom BW transformation that is used to load data from the 2LIS_02_ITM DataSource (Purchase Order Item data) into the custom BW ADSO (advanced DataStore object) including a custom ABAP routine.

First, let’s look at the 2LIS_02_ITM DataSource and source data preview in SAP Business Data Cloud.

Source Data

The below data preview is mainly the data from the remote table in S/4HANA for Purchasing Data (Item Level) (2LIS_02_ITM). More details on how to extract the data in SAP BDC can be found in the previous blog Blog 3 – From BW 7.5 to SAP BDC: Reusing Extractors, Custom Logic, and Models Standard Extractors.

Custom SAP BW Transformation / ABAP Routine

The below example will explain what a custom ABAP routine in SAP BW can do. This is not intended to be a comprehensive tutorial on what an ABAP routine can do in BW, but we believe a summary is useful for the purpose of this blog example.

In our case, the custom ABAP routine in the data transformation is mainly a start routine transferring data from 2LIS_02_ITM data source into a custom-built purchasing DSO.  The custom ABAP routine includes the ABAP code populating the additional object as part of the target DSO.

Example of Custom ABAP routine

To transform the data in Business Data Cloud for the target object we need to migrate the below ABAP routine.

Please note, the following ABAP code is a condensed example intended for demonstration. In our pilot project, the solution was substantially more comprehensive – using exceptions, authorization rules, and extensive customer-specific business logic implemented via enhancements (e.g. user exits) and domain rules.

 

 

 

 

 

 

 

AI-assisted replication of BW ABAP Transformation to SQL Code

To replicate complex ABAP transformation with the above example of start routine to Business Data Cloud, SAP Datasphere, we are going to use the GenAI functionality in Generative AI Hub via SAP AI Launchpad by also allowing human in the loop (HITL) to review and improve the AI-assisted generated SQL code. In our case, the main target audience for this role is mainly a Developer with SQL knowledge.

SAP AI Launchpad is a multitenant software as a service (SaaS) application in SAP Business Technology Platform. Customers and partners can use SAP AI Launchpad to manage AI use cases (scenarios) across multiple instances of AI runtimes (such as SAP AI Core). SAP AI Launchpad also provides generative AI capabilities via the Generative AI Hub, that we are showcasing in this example.

In SAP AI Launchpad, navigate to Generative AI Hub → Model Library and select the Claude 4.5 Sonnet model. Alternatively, you can choose from any of the foundation models and versions available in the Model Library based on multiple providers.

 

And ask to create the SQL code for the start routine in ABAP in the Chat menu. 

The prompt mainly is the below:

Please convert below ABAP routine to SQL code for SAP Datasphere SQL view and change only the names of the fields with the equivalent S/4HANA names. Please don’t change the DataSource names in the joins. The source object in SAP Datasphere is not the equivalent CDS view but the 2lis_02_itm DataSource.

The response from GenAI is the below:

 

Now that we have the code generated by GenAI Hub, we can use it in the data builder layer in SAP Datasphere in Business Data Cloud. First, we create a space in SAP Datasphere environment with HANA Database Storage Type:

Then we create a SQL view in SAP Datasphere with the above suggested GenAI code, and we make the below modifications for the source table and joins. Please find below the detailed steps:

Copy the generated code from the AI Launchpad of GenAI Hub. For illustration, this example is limited to an initial overview of the SQL logic and the custom ABAP code used in the start routine. –# SAP Datasphere SQL View Conversion for 2LIS_02_ITM DataSource
–Below is the converted SQL code for SAP Datasphere. This transformation uses the **2LIS_02_ITM DataSource** as the source and includes the field mappings to match the actual DataSource field names.
–“`sql
==================================================================
— SAP Datasphere SQL View
— Converted from ABAP Transformation Routine
— Source: 2LIS_02_ITM DataSource (Purchasing Document Item)
— Purpose: Purchase Order Item Data with Vendor Country Enrichment
— and Price Calculations
==================================================================
SELECT
— KEY FIELDS (from 2LIS_02_ITM)
==================================================================
SRC.EBELN AS OI_EBELN, — Purchasing Document Number
SRC.EBELP AS OI_EBELP, — Item Number of Purchasing Document
==================================================================
— ORGANIZATIONAL DATA
==================================================================
SRC.EKORG AS PURCH_ORG, — Purchasing Organization
.
.
.
.
VEN.LAND1 AS COUNTRY — Enriched field: Vendor Country from Master Data
FROM
==================================================================
— SOURCE: 2LIS_02_ITM DataSource (DO NOT CHANGE)
==================================================================
“2LIS_02_ITM” AS src==================================================================
— VENDOR MASTER DATA JOIN (replaces ABAP custom lookup code)
==================================================================
LEFT OUTER JOIN “/BI0/PVENDOR” AS VEN
ON SRC.LIFNR = VEN.VENDOR
AND VEN.OBJVERS = ‘A’ — Only active master data records
WHERE
==================================================================
— FILTER CONDITIONS (from routine_9998 – start routine)
— OSS Notes: 627498, 636914, 690106
==================================================================
​Create a SQL view in SAP Datasphere with the copied GenAI code.Make the below modifications for the source table and joins.Replace source table with 2LIS_02_ITM DataSourceReplace SAP BW Vendor master data table with the SAP Datasphere view (based on Data Product Generator object)Check validity of the code and make any other modifications required (follow GenAI Hub notes and comment out all the non-SQL code or non-existing objects).Save the SQL view as Fact Semantic Usage and select run in analytical mode and expose for consumption.

 

We can now test the data preview. 

 

These data can now be consumed by the SAP Datasphere Analytic Model layer or can be shared as a custom data product and consumed in the open data Lakehouse architecture environment.

Alternative Solution

Another option for replicating BW business logic written in ABAP to SQL is mainly to leverage SAP Joule for Consultants.

Here below is an example of the same custom ABAP Routine explanation in SAP Joule for Consultants:

SAP Joule for Consultants accelerates SAP projects and cloud transformations with the most authoritative AI assistance, grounded in exclusive SAP knowledge. It enables consultants to increase productivity with fast and reliable answers, minimize rework with expert-level guidance that improves every design decision, and deliver more operational efficiency by ensuring projects align with best practices.

SAP Joule for Consultants provides comprehensive explanation of ABAP code purpose, business logic, and structure, powered by a fine-tuned model trained on the largest and most diverse repository of ABAP code, encompassing 250 million lines of ABAP and 30 million lines of CDS code. Its expert-level guidance is grounded in 9+ terabytes of curated SAP knowledge, including 100+ SAP certifications and 3+ million non-public documents such as SAP Notes and SAP Knowledge Base Articles.

Roadmap

As part of H2.2026 Roadmap, customers can use the query template generator for SAP Business Data Cloud to transfer query metadata from release 7.5 of SAP Business Warehouse (SAP BW) and SAP BW/4HANA to the SAP Datasphere solution within SAP Business Data Cloud. This will mainly mean reducing manual effort needed to transfer a query from SAP BW to SAP Business Data Cloud.

In addition, please stay tuned: a BW Migration tool is planned for SAP Business Data Cloud, that will enable customers to facilitate the migration of BW data flows to SAP BDC.

 

Conclusion

SAP BW customers can now reuse their existing investments from SAP BW 7.5 on HANA and leverage the modern capabilities of Business Data Cloud to consume and analyze the BW data in future proof scalable architecture without the need to re-design or rebuilt everything from scratch.

 

Please stay tuned for the 5th blog post in this series, ‘Blog 5 – Beyond Data Warehousing, AI-assisted migration of Business Logic from BW 7.5 to BDC Part 2’.

 

 

​ In the earlier parts of this blog series, we discussed the upcoming end‑of‑maintenance deadline (now 2030) for SAP NetWeaver Business Warehouse 7.5 on-premise (SAP BW 7.5 on-prem) customers and the options they have going forward.  Based on practical experiences in a recent pilot project, we showed how “lifting” an SAP BW system in Private Cloud edition (SAP BW in PCE) in SAP Business Data Cloud (SAP BDC) can extend maintenance of the as-is environment while unlocking new capabilities to kick-start modernization.This follow on blog explores how SAP BW 7.5 on-premise customers can reuse their existing investments in data extraction and data modeling flows (including complex ABAP transformations and BW business logic) and modernize them by leveraging SAP Datasphere, Business Technology Platform and Business Data Cloud capabilities.As a recap in the previous blogs, we have seenthe creation of Data Products from SAP BW via ‘Data Product Generator’, that enables SAP BW customers to easily replicate InfoProvider data and its semantics to SAP HANA Cloud data lake files storage (HDLFS) within SAP BDC and transforms traditional BW data into modern data products for consumption in analytical scenarios and AI/ML workflows.how to integrate BW standard extractors and preserve custom extractors business logic into SAP BDC.In this part of the blog series, we will focus on how we can leverage existing BW investments on data extraction and transformation (BW DataSources, data models, transformations and ABAP routines, etc) into SAP BDC and leveraging SAP Datasphere and SAP Business Technology Platform capabilities beyond Data Warehousing.Business Challenges and ObjectiveOne of the main challenges that multiple BW customers face is that in order to transform their business and move into a cloud-native architecture they need to be able to ensure full coverage of their existing BW business logic and data modeling, In addition to that, they need to understand the transition to the cloud with minimal business disruption by leveraging existing investments and custom managed modeling and developments.Most of the mature BW customers have built for many years complex custom business logic in the daily transformations and data flows in BW that apply specifically to their business. In order to move to the cloud and adopt AI and innovation in data and analytics, they need to ensure seamless migration of their existing business models without manually re-designing the whole business logic in the new environment.In the example below, we will illustrate how a BW customer can replicate their custom BW business logic written in ABAP to SQL code in SAP Datasphere, in a semi-automated manner.Custom ExampleFor our complex BW pilot case, we are using a custom BW transformation that is used to load data from the 2LIS_02_ITM DataSource (Purchase Order Item data) into the custom BW ADSO (advanced DataStore object) including a custom ABAP routine.First, let’s look at the 2LIS_02_ITM DataSource and source data preview in SAP Business Data Cloud.Source DataThe below data preview is mainly the data from the remote table in S/4HANA for Purchasing Data (Item Level) (2LIS_02_ITM). More details on how to extract the data in SAP BDC can be found in the previous blog Blog 3 – From BW 7.5 to SAP BDC: Reusing Extractors, Custom Logic, and Models Standard Extractors.Custom SAP BW Transformation / ABAP RoutineThe below example will explain what a custom ABAP routine in SAP BW can do. This is not intended to be a comprehensive tutorial on what an ABAP routine can do in BW, but we believe a summary is useful for the purpose of this blog example.In our case, the custom ABAP routine in the data transformation is mainly a start routine transferring data from 2LIS_02_ITM data source into a custom-built purchasing DSO.  The custom ABAP routine includes the ABAP code populating the additional object as part of the target DSO.Example of Custom ABAP routineTo transform the data in Business Data Cloud for the target object we need to migrate the below ABAP routine.Please note, the following ABAP code is a condensed example intended for demonstration. In our pilot project, the solution was substantially more comprehensive – using exceptions, authorization rules, and extensive customer-specific business logic implemented via enhancements (e.g. user exits) and domain rules.       AI-assisted replication of BW ABAP Transformation to SQL Code To replicate complex ABAP transformation with the above example of start routine to Business Data Cloud, SAP Datasphere, we are going to use the GenAI functionality in Generative AI Hub via SAP AI Launchpad by also allowing human in the loop (HITL) to review and improve the AI-assisted generated SQL code. In our case, the main target audience for this role is mainly a Developer with SQL knowledge.SAP AI Launchpad is a multitenant software as a service (SaaS) application in SAP Business Technology Platform. Customers and partners can use SAP AI Launchpad to manage AI use cases (scenarios) across multiple instances of AI runtimes (such as SAP AI Core). SAP AI Launchpad also provides generative AI capabilities via the Generative AI Hub, that we are showcasing in this example.In SAP AI Launchpad, navigate to Generative AI Hub → Model Library and select the Claude 4.5 Sonnet model. Alternatively, you can choose from any of the foundation models and versions available in the Model Library based on multiple providers. And ask to create the SQL code for the start routine in ABAP in the Chat menu. The prompt mainly is the below:Please convert below ABAP routine to SQL code for SAP Datasphere SQL view and change only the names of the fields with the equivalent S/4HANA names. Please don’t change the DataSource names in the joins. The source object in SAP Datasphere is not the equivalent CDS view but the 2lis_02_itm DataSource.The response from GenAI is the below: Now that we have the code generated by GenAI Hub, we can use it in the data builder layer in SAP Datasphere in Business Data Cloud. First, we create a space in SAP Datasphere environment with HANA Database Storage Type:Then we create a SQL view in SAP Datasphere with the above suggested GenAI code, and we make the below modifications for the source table and joins. Please find below the detailed steps:Copy the generated code from the AI Launchpad of GenAI Hub. For illustration, this example is limited to an initial overview of the SQL logic and the custom ABAP code used in the start routine. –# SAP Datasphere SQL View Conversion for 2LIS_02_ITM DataSource
–Below is the converted SQL code for SAP Datasphere. This transformation uses the **2LIS_02_ITM DataSource** as the source and includes the field mappings to match the actual DataSource field names.
–“`sql
==================================================================
— SAP Datasphere SQL View
— Converted from ABAP Transformation Routine
— Source: 2LIS_02_ITM DataSource (Purchasing Document Item)
— Purpose: Purchase Order Item Data with Vendor Country Enrichment
— and Price Calculations
==================================================================
SELECT
— KEY FIELDS (from 2LIS_02_ITM)
==================================================================
SRC.EBELN AS OI_EBELN, — Purchasing Document Number
SRC.EBELP AS OI_EBELP, — Item Number of Purchasing Document
==================================================================
— ORGANIZATIONAL DATA
==================================================================
SRC.EKORG AS PURCH_ORG, — Purchasing Organization
.
.
.
.
VEN.LAND1 AS COUNTRY — Enriched field: Vendor Country from Master Data
FROM
==================================================================
— SOURCE: 2LIS_02_ITM DataSource (DO NOT CHANGE)
==================================================================
“2LIS_02_ITM” AS src==================================================================
— VENDOR MASTER DATA JOIN (replaces ABAP custom lookup code)
==================================================================
LEFT OUTER JOIN “/BI0/PVENDOR” AS VEN
ON SRC.LIFNR = VEN.VENDOR
AND VEN.OBJVERS = ‘A’ — Only active master data records
WHERE
==================================================================
— FILTER CONDITIONS (from routine_9998 – start routine)
— OSS Notes: 627498, 636914, 690106
==================================================================
​Create a SQL view in SAP Datasphere with the copied GenAI code.Make the below modifications for the source table and joins.Replace source table with 2LIS_02_ITM DataSourceReplace SAP BW Vendor master data table with the SAP Datasphere view (based on Data Product Generator object)Check validity of the code and make any other modifications required (follow GenAI Hub notes and comment out all the non-SQL code or non-existing objects).Save the SQL view as Fact Semantic Usage and select run in analytical mode and expose for consumption. We can now test the data preview.  These data can now be consumed by the SAP Datasphere Analytic Model layer or can be shared as a custom data product and consumed in the open data Lakehouse architecture environment.Alternative SolutionAnother option for replicating BW business logic written in ABAP to SQL is mainly to leverage SAP Joule for Consultants.Here below is an example of the same custom ABAP Routine explanation in SAP Joule for Consultants:SAP Joule for Consultants accelerates SAP projects and cloud transformations with the most authoritative AI assistance, grounded in exclusive SAP knowledge. It enables consultants to increase productivity with fast and reliable answers, minimize rework with expert-level guidance that improves every design decision, and deliver more operational efficiency by ensuring projects align with best practices.SAP Joule for Consultants provides comprehensive explanation of ABAP code purpose, business logic, and structure, powered by a fine-tuned model trained on the largest and most diverse repository of ABAP code, encompassing 250 million lines of ABAP and 30 million lines of CDS code. Its expert-level guidance is grounded in 9+ terabytes of curated SAP knowledge, including 100+ SAP certifications and 3+ million non-public documents such as SAP Notes and SAP Knowledge Base Articles.RoadmapAs part of H2.2026 Roadmap, customers can use the query template generator for SAP Business Data Cloud to transfer query metadata from release 7.5 of SAP Business Warehouse (SAP BW) and SAP BW/4HANA to the SAP Datasphere solution within SAP Business Data Cloud. This will mainly mean reducing manual effort needed to transfer a query from SAP BW to SAP Business Data Cloud.In addition, please stay tuned: a BW Migration tool is planned for SAP Business Data Cloud, that will enable customers to facilitate the migration of BW data flows to SAP BDC. ConclusionSAP BW customers can now reuse their existing investments from SAP BW 7.5 on HANA and leverage the modern capabilities of Business Data Cloud to consume and analyze the BW data in future proof scalable architecture without the need to re-design or rebuilt everything from scratch. Please stay tuned for the 5th blog post in this series, ‘Blog 5 – Beyond Data Warehousing, AI-assisted migration of Business Logic from BW 7.5 to BDC Part 2’.    Read More Technology Blog Posts by SAP articles 

#SAP

#SAPTechnologyblog

You May Also Like

More From Author