Introduction
Using ABAP CDS views created in BW4 system, we can create real time reports in BW4 system.
Applies To
BW/4HANA
Summary
we are going to achieve the report execution in B4HANA system in Realtime using ABAP CDS view.
Author : Lakshminarasimhan Narasimhamurthy
Created on : 24/Nov/2021
Body
Requirement
In BW4HANA system we had a requirement to list out the custom created InfoObjects and to see if they are adhering to the company standard of 9 character length. No custom InfoObjects name must be less than 9 characters, which is our organization standard. Also to minimize the creation of custom InfoObjects. The usual procedure in the previous BW version was to create a generic datasource based on table RSDIOBJ, then load it into the Custom DSO and in the transformation write a formula to get the length of the InfoObjects name. On the top of the DSO to create a query and our lead executes the query whenever needed, also additionally a process chain had to be scheduled to load the DSO and monitored. Now we are going to make it real time using CDS views.
custom CDS is given below, to read the data from the RSDIOBJ table to get the list of custom created InfoObjects and check the length of the infoobject which are Active excluding 0* and /*.
The below analytic annotations has been added
@Analytics.dataExtraction.enabled: true
@Analytics.dataCategory: #DIMENSION
@ObjectModel.representativeKey: ['iobjnm', 'objvers' ]
@AbapCatalog.sqlViewName: 'ZCDSIOLISTS'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'List of Custom generated IO''s'
@Analytics.dataExtraction.enabled: true
@Analytics.dataCategory: #DIMENSION
@ObjectModel.representativeKey: ['iobjnm', 'objvers' ]
define view ZCDS_IOLIST
as select from rsdiobj {
key iobjnm as Iobjnm,
key objvers as Objvers,
length(iobjnm) as length,
iobjtp as Iobjtp,
objstat as Objstat,
contrel as Contrel,
conttimestmp as Conttimestmp,
owner as Owner,
bwappl as Bwappl,
activfl as Activfl,
protecfl as Protecfl,
privatefl as Privatefl,
fieldnm as Fieldnm,
atronlyfl as Atronlyfl,
bctcomp as Bctcomp,
bdsfl as Bdsfl,
tstpnm as Tstpnm,
timestmp as Timestmp,
origin as Origin,
mtinfoarea as Mtinfoarea,
mtmodelversion as Mtmodelversion,
txtsh_set as TxtshSet,
ral_enabled as RalEnabled
} where objvers = 'A' and ( ( iobjnm not like '0%' ) and ( iobjnm not like '/%' ) )
Now create a datasource in B4HANA system based on the CDS view. This needs to be created under the "ODP_CDS" source system.
Datasource referencing CDS view
Datasource name = ZDS_IOLISTS
CDS name = ZCDSIOLISTS(Data dictionary view Generaeted when activating the CDS) in our case it is ZCDSIOLISTS
Extraction Tab of Data Source
Now we will create a Open ODS view using this Datasource.
Open ODS view
Activate it and create a BW query on top of it.
BW Query / BEx Query
Execute the query
Query Output
Now i am going to create a infoobject with lessthan 9 char. ytest0
Test InfoObject
execute the query immediately and filter length less than 9.
Test InfoObject shows up
So using CDS views, we can create datasource and connect it to Open ODS view and then create a query upon them. This will be Realtime and no data loads needed.