BW4HANA Scripting PDF

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Summary:

In this task you will learn to utilize SQLScript to transform/harmonize/adjust transactional data. In a
first step you will create a expert routine within a transformation from source to target. In a second
step you will apply exactly the same logic from the expert routine to a calculation view to see the
difference between data persitence and virtualizaion.

1.1 Create a new aDSO Z<username>DA02 in your personal infoarea containing the following
fields:

Name Key Type Length/ Precision:Scale Aggregation Criteria InfoObject

ZBRAND false CHAR 3 ZBRAND

ZCOUNTRY false CHAR 2 ZCOUNTRY

0CALMONTH2 false NUMC 2 0CALMONTH2

0CALYEAR false NUMC 4 0CALYEAR

ZDCHAN false CHAR 3 ZDCHAN

ZKYF false DEC 17:3 SUM ZKYF

ZKYFD false CHAR 6 ZKYFD

1.2 Create a Transformation from Z<username>DA01 to Z<username>DA02. Within this


transformation you create an expert routine type HANA Script. Within this code there are
two local tables :InTab and :OutTab. These tabs have the structure oft he respective source
and targets of your transformations. Write sql fort he following algorithm:
1. Accumulate the values of CASHTO of your source data from level CALMONTH2 to
CALYEAR
2. Calculate a share from each CASHTO at level CALMONTH in relation to the respective
CASHTO at level calyear.
3. Write the results of 2. To account CASSHR tot he target.
4. Create a DTP and load the data.
5. (If you have Problems creating your logic, and the Proc is a AMDP which currently is not
debuggabel in our system do the following. Check in SAP GUI SE11 for your aDSO with a
search on *<aDSOname>* which tables exist for your aDSO and check their respective
content. Then create your logic successively with writing scripts in the SQL console,
choosing the fitting aDSO tables as data sources for your selects.)
1.3 Now rebuild the same logic of 1.2 with a scriptbased HANA CalculationView
Y<username>_CV_CASSHR in Package Y<username>. To gain access to this Package sync the
HANA repository with your client:
Choose the HANA Development perspective in eclipse. There go tot he Repositories Tab and
rightclick on HDB(<username>) choose „create repository workspace“.
Then rightclick on your package Y<username> and choose check out and import package.
Then go to the project explorer tab and create in your packacke the calcview by rightclicking
new->other->Calc View. Choose script based and write your logic.

1.4 Extend your composite provider with the second DSO of 1.1 and with the CalcView of 1.3, do
the field assignments and activate it.
1.5 Create a new query upon your composite provider which shows the CASHTO of DA01, the
CASSHR of DA02 and the CASSHR of your CalcView
1.6 Now extend your query a query formula, that shows the absolute variation oft he persisted
and virtual approach.

You might also like