You are on page 1of 7

9/19/22, 12:51 PM SAP HANA Tutorial, Material and Certification Guide

More

SAP HANA Central


Home SAP HANA Tutorials Database Training Interview - Q&A Job Certifications Books

Wednesday, 14 April 2021

View for external Access (The ‘8’ View) for


aDSOs in BW/4HANA 2.0 Mixed modelling
In this blog post, I would focus on
some of the key aspects of the
generated view for external
access or the external SAP HANA
SQL View for aDSOs in BW/4HANA
2.0 by a use case scenario. The
view is generated with naming Total Pageviews
convention as following : /BIC
(namespace)/A<technical 1,698,859
name of the aDSO>8.

We are all well familiar with the


SAP HANA Certification Material
below generated tables of aDSOs : SAP HANA Certification Material
(depending on the type of
SAP HANA Training Videos
particular aDSO they are relevant)

/BIC/A<technical name of the aDSO>1 : Inbound Table for aDSO.

/BIC/A<technical name of the aDSO>2 : Active Data Table for aDSO.

/BIC/A<technical name of the aDSO>3 : Change Log Table for aDSO.

And the generated views :

/BIC/A<technical name of the aDSO>6 : View for Extraction from aDSO.

/BIC/A<technical name of the aDSO>7 : View for Reporting for aDSO.

Now with BW/4HANA 2.0, we have another view generated with name :
/BIC/A<technical name of the aDSO>8 : View for external Access for
aDSO.

It is recommended that the view for external access to be used in mixed


modelling scenarios or exposing data to 3rd party consumers, while on the
contrary, the usages of the database tables directly are discouraged & not
supported by SAP. However, direct access to these tables is said to be
supported in routines scripted in HANA being used in transformations

1. New controller technical flag : “COLD_STORE_FLAG”.

2. The internal & external formats of amount type keyfigures.

There’s another interesting feature for aDSOs with non-cumulative key


figures – the marker for non-cumulative keyfigures. The reference points
are exposed with an additional column with naming convention as following
: “<Column Name>_NCUM_REFP“. More details about this can be found in
above mentioned SAP help portal link.

https://www.hanaexam.com/2021/04/view-for-external-access-8-view-for.html 1/7
9/19/22, 12:51 PM SAP HANA Tutorial, Material and Certification Guide
Note : All newly created aDSOs in BW/4HANA 2.0, will have this ‘8’ view Labels
generated by default. For pre-existing aDSOs prior to the introduction of
database developer Dynamic-Tiering
this feature, a reactivation is needed in order to have this view generated.
hana-academy hana-api hana-backup
This can be achieved by the program : RSDG_ADSO_ACTIVATE as well as in-memory modeling mysql odata odbc
manual activation of the same.
predictive sap SAP HANA sap-
hana sap-hana-cloud-platform sap-
Use Case
hana-database sap-hana-usecases

For this blog post, I have a standard aDSO with technical name : sap-hana-xs sap-hana2 sap-xs
SAPHANA sapmentor sapmentors
SALESADSO, which contains some sales data for 2019 & 2020.
sapui5 sda spark sps11 sps12 sql
The view for external Access for DataStore SALESADSO is generated as : statistics xs xsjs

/BIC/ASALESADSO8.
Search This Blog
At the initial stage, no data tiering is set except for Hot Data.
Search

Like Our Official Page

Popular Posts

Core Data Services


in ABAP
Core Data services
(CDS) are domain
specific languages
(DSL) and services for defining
Now let’s have a look at the definition of the generated ‘8’ view in database and consuming semantically rich
catalog. We can find it under the DB owned schema. data models in SAP ...

Download and
Installation of SAP
HANA Studio 2.0
(SP3) with ABAP &
BW Perspectives
Here are the comprehensive
steps for download and
installation of SAP HANA Studio
with ABAP & BW perspectives
which helps to initiate t...

How to Setup Hana


Authorization Trace
How to activate an
Authorization Trace
in case of
authorization Problems:
The definition looks somewhat like below : (something similar to
Transaction ST01 in Netweaver
ABAP) Go t...
CREATE VIEW "<DB Owned Schema>"."/BIC/ASALESADSO8" (
"BILL_NUM", Successful
"BILL_ITEM", implementation of
Cumulative Sum in
"BILL_DATE",
SAP HANA
"COLD_STORE_FLAG", A cumulative sum is
"SALESORG", a sequence of partial sums of a
"PLANT", given sequence. For example,
the cumulative sums of the
"COMP_CODE",
sequence {a, b, c, ...} are a, ...
"CO_AREA",
"DISTR_CHAN", Expose CDS Views
"CALDAY", as OData Service
"CALMONTH", In continuation to
previous blog Core
"CALYEAR", Data Services in
"BILL_TYPE", ABAP in this blog I will show
"MATERIAL", how to create CDS Views and
step by step procedure to...
"QUANTITY",
https://www.hanaexam.com/2021/04/view-for-external-access-8-view-for.html 2/7
9/19/22, 12:51 PM SAP HANA Tutorial, Material and Certification Guide
"AMOUNT__EXT", Business Partner in
"AMOUNT__INT", S4 HANA –
"CURRENCY", Customer Vendor
Integration
"UNIT" ) AS SELECT
It’s been almost 2
"BILL_NUM" , years I have started my journey
"BILL_ITEM" , in SAP world. I started with
"BILL_DATE" , Technical domain for some time
and I landed in Functional d...
CAST( "COLD_STORE_FLAG" AS NVARCHAR(1) ) ,
"SALESORG" , Custom Flexible
"PLANT" , Workflow steps
"COMP_CODE" , Introduction In this
"CO_AREA" , blog post, you will
see how to create
"DISTR_CHAN" , and configure a complex Custom
"CALDAY" , Flexible Workflow for Purchase
"CALMONTH" , Order approval....
"CALYEAR" ,
SAP PDMS 1.0 FP02
"BILL_TYPE" , On-premise edition
"MATERIAL" , 1.0 (Configuration –
"QUANTITY" , Pt.2)
CAST( CONVERT_CURRENCY( amount => "AMOUNT", In the first part of
my documentation (pt.1) , I
source_unit => "CURRENCY", have explained and showed in
target_unit => "CURRENCY", detail how to proceed with the
steps => 'shift', mandatory landscape and
compo...
schema => '<DB Owned Schema>',
client => '<Client ID>' ) AS DECIMAL (000017,
000002) ) , Featured post
"AMOUNT" ,
"CURRENCY" ,
SAP S/4HANA from a
"UNIT"
Developers Point of View -
FROM ( SELECT
Part One
"BILL_NUM" ,
"BILL_ITEM" , Introduction In my first part I try
"BILL_DATE" , to explain what is the main
'' AS COLD_STORE_FLAG , difference between R/3, SAP ERP
"SALESORG" , and S/4. As you can see from the
"PLANT" , pi...
"COMP_CODE" ,
"CO_AREA" ,
"DISTR_CHAN" ,
"CALDAY" ,
"CALMONTH" ,
"CALYEAR" ,
"BILL_TYPE" ,
"MATERIAL" ,
Search This Blog
"QUANTITY" ,
"AMOUNT" , Search
"CURRENCY" ,
"UNIT"
Blog Archive
FROM "/BIC/ASALESADSO2" ) WITH READ ONLY
► 2022 (95)

Firstly, notice that there are two Amount keyfigures in the outer most
▼ 2021 (182)

SELECT as : “AMOUNT__EXT” & “AMOUNT__INT” even though I just have
► December (15)

just one Amount keyfigure in the aDSO as : 0AMOUNT These two
generated Amount keyfigures represent the external & internal format of ► November (13)

0AMOUNT based on the client specific currency settings with reference to ► October (11)

TCURX table.
► September (17)

► August (11)

The derivation of external formal (AMOUNT_EXT) can be seen in the second
select in above shown DDL statement. We usually choose the internal ► July (22)

format (AMOUNT_INT in this context) which is the format we can see from ► June (18)

the active table of aDSO too, but it may vary according to specific technical
► May (8)

https://www.hanaexam.com/2021/04/view-for-external-access-8-view-for.html 3/7
9/19/22, 12:51 PM SAP HANA Tutorial, Material and Certification Guide
need or consumer requirement. They would not differ unless otherwise ▼ April (10)

maintained with specific decimal shifts or specific currency settings as Planning UAT across SAP
described in the note I mentioned earlier. S/4HANA and SAP IBP: 5
Les...
Now coming to the custom field in the generated view : the much awaited Querying ABAP CDS views
‘COLD_STORE_FLAG‘. From the definition we can see it’s generated with from an ArcGIS HANA
tenant
blank value like : ‘ ‘ AS COLD_STORE_FLAG.
BAdI Implementation in ABAP
on HANA for BW Extractors
Here comes the relevance of the aDSO being created with data tiering
properties selected only to access temperature tier containing the HOT data Enabling cold store data
access using view for ext...
as stated in the beginning and that’s the reason the innermost SELECT
query in the DDL statement can be seen to read data only from the Active View for external Access (The
‘8’ View) for aDSOs ...
Data Table of aDSO SALESADSO (/BIC/ASALESADSO2). So, we can
conclude from the observations until here that for the HOT data residing in SAP S/4HANA Business
Partner Toolset (BDT) at
HANA standard nodes, the COLD_STORE_FLAG holds value as ‘ ‘ (blank).
Busi...

Now let’s experiment a little more with this data temperature access Hands-On Tutorial: Leverage
SAP HANA Machine Learn...
controller flag by changing the Data Tiering Properties of the aDSO.
Partitioning Data Volumes for
HANA DB performance ...
How to use a REST API to
post data into SAP
S/4HAN...
How to sizing SAP S/4HANA
Conversion

► March (21)

► February (17)

► January (19)

► 2020 (218)

► 2019 (196)

► 2018 (154)

Make sure you have a valid external Cold Storage Connection set up to
► 2017 (206)

move the data around prior to this step. I have a time characteristic as key
field of the aDSO ie. 0BILL_DATE, which is my partition specifier field. I ► 2016 (252)

have maintained Static Partitions on 0BILL_DATE. ► 2015 (31)

After reactivating the aDSO with the external Cold Storage tiering enabled,
Subscribe To SAP HANA Central
let’s check the DDL of the regenerated ‘8’ view once again from database
catalog. Now DDL creation statement looks like below : Posts

CREATE VIEW "<DB Owned Schema>"."/BIC/ASALESADSO8" ( Comments


"BILL_NUM",
"BILL_ITEM",
"BILL_DATE",
"COLD_STORE_FLAG",
"SALESORG",
"PLANT",
"COMP_CODE",
"CO_AREA",
"DISTR_CHAN",
"CALDAY",
"CALMONTH",
"CALYEAR",
"BILL_TYPE",
"MATERIAL",
"QUANTITY",
"AMOUNT__EXT",
"AMOUNT__INT",
"CURRENCY",
"UNIT" ) AS SELECT
https://www.hanaexam.com/2021/04/view-for-external-access-8-view-for.html 4/7
9/19/22, 12:51 PM SAP HANA Tutorial, Material and Certification Guide
"BILL_NUM" ,
"BILL_ITEM" ,
"BILL_DATE" ,
CAST( "COLD_STORE_FLAG" AS NVARCHAR(1) ) ,
"SALESORG" ,
"PLANT" ,
"COMP_CODE" ,
"CO_AREA" ,
"DISTR_CHAN" ,
"CALDAY" ,
"CALMONTH" ,
"CALYEAR" ,
"BILL_TYPE" ,
"MATERIAL" ,
"QUANTITY" ,
CAST( CONVERT_CURRENCY( amount => "AMOUNT",
source_unit => "CURRENCY",
target_unit => "CURRENCY",
steps => 'shift',
schema => '<DB Owned Schema>',
client => '<Client ID>' ) AS DECIMAL (000017,
000002) ) ,
"AMOUNT" ,
"CURRENCY" ,
"UNIT"
FROM ( SELECT
"BILL_NUM" ,
"BILL_ITEM" ,
"BILL_DATE" ,
'' AS COLD_STORE_FLAG ,
"SALESORG" ,
"PLANT" ,
"COMP_CODE" ,
"CO_AREA" ,
"DISTR_CHAN" ,
"CALDAY" ,
"CALMONTH" ,
"CALYEAR" ,
"BILL_TYPE" ,
"MATERIAL" ,
"QUANTITY" ,
"AMOUNT" ,
"CURRENCY" ,
"UNIT"
FROM "/BIC/ASALESADSO2"
UNION ALL SELECT
CAST( "BILL_NUM" AS NVARCHAR(10)) ,
CAST( "BILL_ITEM" AS NVARCHAR(6)) ,
CAST( "BILL_DATE" AS NVARCHAR(8)) ,
'X' AS COLD_STORE_FLAG ,
CAST( "SALESORG" AS NVARCHAR(4)) ,
CAST( "PLANT" AS NVARCHAR(4)) ,
CAST( "COMP_CODE" AS NVARCHAR(4)) ,
CAST( "CO_AREA" AS NVARCHAR(4)) ,
CAST( "DISTR_CHAN" AS NVARCHAR(2)) ,
CAST( "CALDAY" AS NVARCHAR(8)) ,
CAST( "CALMONTH" AS NVARCHAR(6)) ,
CAST( "CALYEAR" AS NVARCHAR(4)) ,
CAST( "BILL_TYPE" AS NVARCHAR(4)) ,
CAST( "MATERIAL" AS NVARCHAR(18)) ,
"QUANTITY" ,

https://www.hanaexam.com/2021/04/view-for-external-access-8-view-for.html 5/7
9/19/22, 12:51 PM SAP HANA Tutorial, Material and Certification Guide
"AMOUNT" ,
CAST( "CURRENCY" AS NVARCHAR(5)) ,
CAST( "UNIT" AS NVARCHAR(3))
FROM "/BIC/OUSALESADSO" ) WITH READ ONLY

Notice the very important change in the DDL sttement here – now it
invokes a union of the previously used Active Data Table of SALESADSO
with the virtual table : /BIC/OUSALESADSO generated in the DB owned
schema. We can see three new virtual tables generated in the above
schema upon activation of the aDSO with Cold Storage Access enablement
in DTO.

The last one is what is used in the ‘8’ view & it secures that the data moved
to Cold Storage successfully is accessed correctly. The ‘OU’ virtual table is
formed by (defined in the external cold storage DB) an inner join of other
two generated virtual tables /BIC/ONSALESADSO & /BIC/ORSALESADSO on
column : ARCHREQTSN with a restriction on REQSTAT = ‘7’ (status
indicating successfully completed archiving request).

The second interesting observation is that the COLD_STORE_FLAG value is


set to ‘X‘ in the select from /BIC/OUSALESADSO, meaning the cold storage
data. This way it is easily distinguished from the Hot Data, where the flag
was set as ‘ ‘ (blank).

We can test it easily by setting up a rule & move some of the data to
external Cold Storage. For SALESADSO, I set up & executed a rule &
moved all the data prior to the year 2020 to Cold Storage.

Now if I preview the data of the generated ‘8’ view on 0CALYEAR level, it
looks like below :

This way it makes it more simpler to have a reporting solution through


mixed modelling approach by consuming this view for external access in a
calculation view (I might come up with another blog post explaining a use
case of the same). Thus we can expose this flag to control whether or not
should the cold storage data be accessed based on the flag value.

Another important thing to notice is the typecasting of characteristic fields


in the select from ‘/BIC/OU‘ virtual table. The reason for this is in the
https://www.hanaexam.com/2021/04/view-for-external-access-8-view-for.html 6/7
9/19/22, 12:51 PM SAP HANA Tutorial, Material and Certification Guide
external Cold Storage (in this context IQ system), the characteristic fields
are created with increased length. Observation : Even though the note says
it’s created with 4 times the length of the field in HANA, in actual case it’s
thrice the length. However, the measures are not impacted. Below is a side
by side comparison of the characteristic columns between the HANA based
Active Table & the IQ based Virtual Table.

So, to make the union on similar data types of the unique columns the
typecasting is handled by the generated ‘8’ view.

Posted by Sabrina Pinto at 16:13:00

Labels: BW (SAP Business Warehouse), BW Data Modeling (WHM), BW SAP HANA


Modeling Tools (Eclipse), sap bw/4hana

No comments:

Post a Comment

Enter comment

Newer Post Home Older Post

Subscribe to: Post Comments (Atom)

Privacy Policy

© 2016 saphanacentral.com, All rights reserved. Simple theme. Theme images by gaffera. Powered by Blogger.

https://www.hanaexam.com/2021/04/view-for-external-access-8-view-for.html 7/7

You might also like