Introduction
For BW system we need many times, text datasources based on domain values. We have predefined datasources which are domain based and SAP delivered. With the help of CDS, we can create just only CDS view to support all the domain text needs.
Applies to
BW/4HANA
Summary
Create a CDS view to support all domain based text datasources.
Author : Lakshminarasimhan Narasimhamurthy
Created on : 04/Mar/2022
Body
Requirement
We build only one CDS view, which will extract all domain texts. Based on this CDS view we will create one datasource at BW/4HANA side.
This datasource will satisfy all the domain text needs. All we need to do is that when ever domain text is needed, the datasource will be mapped to the respective InfoObject with filter on the domain values at the DTP level.
Below is the CDS view built in S4 side on top of table dd07t. This is built as text datasource.
@AbapCatalog.sqlViewName: 'ZCAXXDOMAINTEXT'
@AbapCatalog.compiler.compareFilter: true
--@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #CHECK
@Analytics.dataExtraction.enabled: true
@Analytics.dataCategory: #DIMENSION
@ObjectModel.representativeKey: ['Domname','As4local','Valpos','As4vers']
@EndUserText.label: 'Domain Texts'
define view ZCAXX_DOMAINTEXT as select from dd07t {
key domname as Domname,
key as4local as As4local,
key valpos as Valpos,
key as4vers as As4vers,
domvalue_l as DomvalueL,
domvalue_h as DomvalueH,
appval as Appval
}
Now create the Datasource at the BW/4HANA side, based on the SQL view generated via CDS. In our case it is ZCAXXDOMAINTEXT. We will create datasource based on this view.
now this datasource can be used to load domain text when ever you need domain text within your BW/4HANA system.