What if you could modernize your decades-old SAP BW investment without losing a single line of critical business logic? SAP Business Data Cloud (BDC) makes this reality possible through AI-assisted migration capabilities that transform traditional BW modernization challenges into strategic opportunities. Organizations can now seamlessly transition from rigid Business Warehouse environments to agile, future-proof data ecosystems that deliver trusted, delta-enabled data products for fact-based decision support while preserving decades of critical business investments.
As a recap in the previous blogs, we have seen
- the creation of AI-ready Data Products from SAP BW via âData Product Generatorâ, that replicates BW Infoprovider data and its semantics to SAP HANA Cloud Data Lake files Storage (HDLFS) within SAP BDC for analytical and AI/ML scenarios/workflows.
- how to integrate BW standard extractors and preserve custom extractors business logic into SAP BDC.
- how to leverage existing BW custom logic in ABAP transformations to replicate to SAP Business Data Cloud by using GenAI functionality in GenAI Hub and allowing human in the loop (HITL) to review and improve the AI-assisted generated SQL code.
You can find below the previous blogs, plus the links to the subsequent blogs will be listed here:
In this blog, the focus is on how SAP BW 7.5 on-premise customers can replicate and modernize their custom BW business logic as part of BW BEx Query, BW custom ABAP authorization and user exit variables into SAP BDC and leveraging SAP Datasphere, Business Technology Platform and Business Data Cloud capabilities, based on practical experiences in a recent pilot project.
Business Challenges and Objective
Most of the mature BW customers have built for many years complex custom business logic in their ad-hoc and operational reporting via SAP BW BEx Query design that apply only to their business needs while ensuring the right data access and control to the end users. 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 logic and processes without manually re-designing the new environment.
In the example below, we will illustrate how a BW customer can replicate their custom BW business logic written in ABAP used in BW BEx Query as user exit variable into the BDC semantic layer, in a semi-automated manner.
Custom Example
For our complex BW pilot case, we are using both a user exit and a custom ABAP authorization variable that is used in one of the custom BW queries that is based on the data loaded from the 2LIS_02_ITM Datasource (Purchase Order Item data).
In SAP BW, a BEx query mainly defines how data is consumed in BW reports. In SAP Datasphere, in Business Data Cloud, this functionality is handled by Analytic Models. The analytic models support filters, input parameters, hierarchies, and measures, just like BW Queries, but with a streamlined experience for both developers and business users.
The Analytic Model in SAP BDC serves as a semantic layer, exposing business logic and relationships in a form that is directly consumable by business users.
The analytic model allows us to create and define multi-dimensional models to provide data for analytical purposes to answer different business questions. The sources for analytic models are facts, which can contain dimensions, texts and hierarchies. Please note that some terms and concepts are used differently in analytic models to align more closely with the terminology in SAP Analytics Cloud stories:
- “Input parametersâ are called âvariablesâ in analytic models.
- “Attributesâ are called âdimensionsâ in analytic models.
The graphic below shows the role of the analytic model within SAP Datasphere in SAP Business Data Cloud:
 In our example, we are using a custom analytic model on top of the SQL view defined as semantic usage âfactâ that we have created in SAP Datasphere within BDC in the previous blog Blog 4 – Beyond Data Warehousing: AI-assisted migration of Business Logic from BW 7.5 to BDC Part 1.
First, letâs look at the custom analytic model creation in SAP Business Data Cloud.
Custom Analytic Model
In the previous blog, we saved the SQL view for the Purchase Order Item as semantic usage âfactâ, which is like the Star schema in SAP BW and it includes measures, From the same SQL view defined as semantic usage âfactâ, we can create our analytic model automatically, as shown in below picture, that will also inherit all associations defined in the previous SQL view.Â
Like in SAP BW star schema, in SAP Datasphere a table or view to any other table or view at any level of the data layer can have multiple associations which mainly define semantic relationships between entities. In our BW pilot case example, we have defined 3 associations in the Purchasing SQL view.
- The 1st association is based on BW Vendor master data attributes that is generated via the Data Product Generator. More details can be found here.
-
The 2nd association is based on standard Time dimension from SAP Datasphere. In SAP Datasphere space, time tables and dimension views can be created automatically to provide standardized time data for our analyses (more details SAP Help Portal).
- The 3rd association is based on BW Custom hierarchy uploaded to SAP Datasphere.
So now, when we create our analytic model automatically from the SQL view for the Purchase Order Item, including the associations, Â we can view below results, similar to the BW extended star schema.Â
The analytic model can include different types of measures (calculated, restricted, standard and exception aggregation, count distinct, currency conversion and non-cumulative), dimensions, structures of members, variables, data access controls, filters, similar to SAP BW BEx query.
Below is an example of
Now letâs deep dive at the 1st variable Date, which is a dynamic default single value filter variable (equivalent to a BW user exit variable).
There are different types of variables to choose from. In our case this is a filter variable that mainly refers to the Date attribute. When a story is opened, the variable dialog shows the filter for the attribute. Now the variable can be filled by different types. In our example, we created a dynamic default variable that mainly allows us to get a derived value in the parameter dialog list when opening the analytic preview, and in the variable prompt for an SAP Analytics Cloud story. For Dynamic Default, the value is derived before the variable prompt pops up, which means the values appear in the variable prompt.
The lookup entity is a table or view that we want to join to our input entity, in order to enrich it. We can reuse the lookup entity in other analytic models as well similarly to SAP BW where the same user exit variable is used across different BEx Queries. Therefore, changes can be governed centrally in the lookup entity if required.
In our example the derived value is mainly the previous year date based on current date, which is mainly the same day as today for last year.
Example of Custom SAP BW User Exit Variable
In our case, the custom ABAP variable (user exit variable) is retrieving the same date as current date but for last year, with below ABAP code.
DATA:
l_s_range type rrs0_s_range_c,
l_initdate type sy-datum,
l_prevdate type sy-datum,
l_year type N length 4,
l_monthday type N length 4.
CASE i_vnam.
WHEN 'ZDATE_LY'.
IF i_step = 1.
l_initdate = sy-datum.
l_year = l_initdate+0(4) â 1.
l_monthday = l_initdate+4(4).
CONCATENATE l_year l_monthday INTO l_prevdate.
l_s_range-low = l_prevdate.
l_s_range-sign = 'I'.
l_s_range-opt="EQ".
APPEND l_s_range TO e_t_range.
ENDIF.
ENDCASE.
 AI-assisted replication of BW ABAP code to SQL Code
To transform the code in BDC we need to migrate the ABAP routine. For that we will use SAP AI Launchpad by also allowing human in the loop (HITL) to review and improve the AI-assisted generated code. Again, the main target audience for this role is a Developer with SQL knowledge. The response from SAP AI Launchpad is the below:
Now that we have the code generated, we can use it in the data builder layer in SAP Datasphere in BDC. Please find below the steps:
- Copy the generated code from SAP AI Launchpad
- Create a SQL script table function in SAP Datasphere and paste the code
- Replace the naming as per your variable name
- Check validity of the code and make any other modifications required
- Save the SQL script table function as Relational Dataset Semantic Usage and expose for consumption.
- Test the data preview.
Import of BW Authorizations to SAP Datasphere in SAP Business Data Cloud
Now letâs look at how we can migrate authorizations and roles from SAP BW into SAP Datasphere in Business Data Cloud befrore we share an example of an SAP BW Authorization User Exit Variable.
SAP Datasphere and SAP Analytics Cloud share the same authorization rules regarding the users and roles created. This blog describes the whole security framework in detail. In SAP Business Data Cloud in SAP Datasphere, we can import SAP BW permissions via the Data Builder menu as shown below:
We select the BW Connection (established natively in SAP Datasphere via the DP Agent to SAP BWÂ Private Cloud edition (PCE)Â or on-premise BW).
SAP BW is mainly populating the user roles and authorizations in RSDWC_RSEC_DAC. This is a specific table in SAP BW systems from version 7.5 SP16+ used to store analysis authorizations for export to SAP Datasphere. The table stores a snapshot of defined analysis authorizations (both the object structure and associated filter values) within BW. It acts as a bridge for replicating authorization information to external analytics tools, enabling consistent data access control across different platforms. Entries in this table are generated using the SAP transaction code RSDWC_DAC_RSEC_GEN within BW. A wizard in SAP Datasphere facilitates importing the permissions, automatically mapping BW users to Datasphere users (often using email addresses for matching). More details can be found here.
Example of Custom SAP BW Authorization User Exit Variable
Now letâs look at the example of an SAP BW Authorization User Exit Variable, which is equivalent to the Data Access Control (DAC) framework to implement row-level security.Â
In our recent BW pilot case, we used the variable Purchasing group, which is a dynamic default single value filter variable (equivalent to an authorization user exit variable in BW):
The logic of the authorization of the user is mainly maintained in a SQL script table function as shown below that mainly utilizes the table that is used also in the Data Access Control.Please note, the below SQL code is an example intended for demonstration. In our pilot case, we used a more complex authorization business logic.Â
The Data Access Control Table for purshasing looks like below:
 When we do model preview, we test the results.
In our example below we have included in our analytic model the data access control based on the material group hierarchy.
Â
This specific data access control will trigger the authorizations that we are allowed to see as users on this analytic model based on the hierarchy nodes that we have provided for the material group. As we can see from below screen we are only viewing the “other” component of the material group hierarchy and we are not allowed to see the rest view.
Â
Â
 The analytic model and all components demonstrated above can also be consumed by the SAP Analytics Cloud Stories with live connectivity. Here below is an example of a simple SAP Analytics Cloud Dashboard or Story based on the same analytic model we showcased earlier with the same variables used.Â
In SAP Analytics Cloud we can also add additional input parameters in the story level if required.
These data now can also be shared as a custom data product and consumed in the open data Lakehouse architecture environment. This will be demonstrated in the next blog post of the series.
Alternative Solutions
There are a few more options to replicate BW BEx Query logic from BW 7.5 on HANA to SAP Business Data Cloud. One of them is mainly to generate the SAP HANA Views from the BW system (SAP Help ) or leverage the Data Product Generator in BW by using BW query as Infoprovider (Blog-2).
In addition, the SAP BW Migration Assistant in SAP Business Data Cloud will be available Q4.2026 (Roadmap) that translates data flows into corresponding entities in SAP Datasphere. The main benefit is reducing manual effort in recreating data flows for SAP BW from scratch in SAP Datasphere within SAP Business Data Cloud.Â
Conclusion
SAP BW customers can now have a clear path to maximize their existing investments while embracing the future of enterprise analytics and AI. Through SAP Business Data Cloud, organizations can preserve their proven SAP BW 7.5 on HANA assets and seamlessly integrate them with modern cloud-native capabilities, creating a scalable, future-ready architecture that delivers immediate value without requiring complete system redesign or rebuild.
Please stay tuned for the 6th blog post in this series, âBlog 6 â How to modernize SAP BW 7.5 APDâs in SAP BDC Architecture and create custom Data Productsâ.
Â



