Вы находитесь на странице: 1из 21

HANA = High Performance Analytic Appliance

ROW store Vs Column Store : http://saphanatutorial.com/sap-hana-basic-course-2-3/

Check how to check hana version and SPS version


To know the HANA Studio version:
Help->About SAP HANA Studio.
It will be like
Version: 1.0.27
Build id: 201205021925 (361805)
Here 1.0.27 means -> 1.0 version and Revision is 27 and Build No is : 361805
To know the HANA DB version:
Right click the System(Eg:IN1 (SYSTEM)) under Navigator->Properties...->Version History
This will list all the versions using which the DB is upgraded and the Installation Time.The top most one
would be current version of your HANA DB
Take first five digits and last two digits will tell exact SPS version
From Revision 20 and above,its SP3 and the previous Revisions are SP2.And the current Revision in the
market is 27 which is SP3.
To know more about,what are the limitations of SAP 1.0 SP2
http://www.bluefinsolutions.com/insights/blog/the_sap_hana_faq_answering_key_sap_in_memory_questi
ons/

Variable
http://saphanatutorial.com/sap-hana-online-training-sap-hana-advanced-modeling/#/
Variables are bound to columns and are used for filtering using WHERE clauses. As such, they can
only contain the values available in the Columns they relate to
 Variable filter data at run time.
 In modeling whole data will come to semantics and then data will get filtered based on the
selection value of filter
 You use variables to filter data at runtime. You assign values to these variables by entering the
value manually, or by selecting it from the drop-down list.
 You can also define whether the Variable is Mandatory or if it should have a Default Value.
 You can apply variables only in analytic and calculation views.
You can apply variable only to attributes and not to measures

https://sapstudent.com/hana/sap-hana-variables/

Input Parameters(IP)

http://saphanatutorial.com/sap-hana-online-training-sap-hana-advanced-modeling/#

If we have expression and want data for any field at run time input parameter comes in picture

Variable filters data at semantics level while IP filters data at node level(Join,Projection, Aggregation)

If IP has been created and not used anywhere in modeling it won’t ask value at run time

Input Parameter is passed using PLACEHOLDER:

The value of Input Parameter is passed using PLACEHOLDER clause.


('PLACEHOLDER' = ('$$DISCOUNT$$', '10'))

WHERE:
The value of Variable is passed using WHERE clause.
WHERE ("REGION_NAME" IN ('Asia') )
To use IP of child calc view in parent view, there should be mapping between IP of child view to IP of
parent view in manage mapping in semantic node.Check Scenario (States and city),(Child in parent) calc
views

Rank Node
https://www.youtube.com/watch?v=yA3qaTVSFVg/
 Rank node is available from SPS-9 only
 If you want Rank column in output table than u can’t in SPS 9, it’s available from SPS 10 only.
 Threshold value will tell how many rows will come for each ‘partition by’ group in rank node.

Restricted Column (Measure)

 Restrict measure column based on specific attribute column.


 For given condition it will show the measure value for the records who satisfy condition and rest
will be NULL(?)
 Can be created only on STAR JOIN NODE and Aggregation Node because these two nodes
have measures only
http://teachmehana.com/sap-hana-restricted-column/

Text Join
 Use it while joining, Description table with fact table. Better to use Text Join instead of Left Outer
join
https://www.youtube.com/watch?v=ED7Xx78u5Xo/

Procedure (USE OF ARRAY, SUB_STR, LOOP)S

FOR I IN 1 ..i
DO
End for

IF :MYROWID > 0
THEN
DROP TABLE "DBO"."IDQ_INTEGRITY";
END IF;

'ALTER TABLE DBO.IDQ_COMP3_APRIORI_OUTPUT ADD ( PRERULE_'||:I||' NVARCHAR(256))'

DECLARE ARY_COLUMN_LIST NVARCHAR(256) ARRAY;


ARY_COLUMN_LIST := ARRAY_AGG(:COLUMNS_TAB.COLUMN_NAME); //Table to array

SELECT SCHEMA_NAME, TABLE_NAME, COLUMN_NAME, POSITION


FROM SYS.COLUMNS
WHERE SCHEMA_NAME = 'SRK' AND TABLE_NAME = 'EMPLOYEE'
ORDER BY POSITION;
To Get Description of calculation view
SELECT

COLUMN_NAME,DATA_TYPE_NAME,LENGTH,"DESCRIPTION",

CASE WHEN DIM IS NULL

THEN 'MEASURE'

ELSE 'ATTRIBUTE'

END AS TYPE

FROM (SELECT

COLUMN_NAME,DATA_TYPE_NAME,LENGTH,B."DESCRIPTION", C.DIM

FROM "SYS"."TABLE_COLUMNS" as A

inner join "_SYS_BI"."BIMC_DESCRIPTIONS" AS B on A.COLUMN_NAME = B.ID

left outer join (SELECT

DISTINCT DIMENSION_NAME,CUBE_NAME,'ATTRIBUTE' AS DIM

FROM "_SYS_BI"."BIMC_ALL_DIMENSIONS"

WHERE CUBE_NAME = 'CA_SD_SL_SO_INT2'

ORDER BY DIMENSION_NAME) AS C on A.COLUMN_NAME = C.DIMENSION_NAME

WHERE A.SCHEMA_NAME = '11374346'

AND A.TABLE_NAME='INT2'

AND B."QUALIFIED_NAME" = 'AIEP.Leonardo.SD::CA_SD_SL_SO_INT2')

ORDER BY COLUMN_NAME

Q UE RY = ‘ S EL E CT (
"TOTAL_COUNT"/'||:V_ROW _COUNT||'*100),("TOTAL_COUNT"/'''||:ARY_CO
M P L E T E NE S S _ CO UN T[ : V _I ] | | '''* 1 00)
F RO M " DB O ". "I DQ _ DI S TI NCT _ V A L UE S _ NE W " W HE RE " CO L UM N _ NAM E " =
'''| | : A RY _ CO L UM N_ LI S T[ : V _I ] | | ''' ';

EXECUTE IMMEDIATE QUERY;

Definer vs Invoker
https://dba.stackexchange.com/questions/59887/what-are-definer-and-invoker-rights-in-database-oracle-
and-mysql/
Let's take a simple example:

You have this procedure using "definer rights" - which is the default in Oracle.

CREATE PROCEDURE DEL_EMP AS


BEGIN
DELETE FROM EMP;
END;
 Another user who calls this procedure only needs EXECUTE privilege for this procedure,
it is not required that such user has DELETE privilege on table EMP.
 Procedure runs under permission of the procedure owner (or user who defined is, thus
it is called "definer" rights).
 "Inovker Rights" is the opposite. A user who likes to runs this procedure successfully
must have EXECUTE privilege for this procedure and DELETE privilege for table EMP.

If the procedure has definer rights and another user want to execute it, user should have
EXECUTE privilege and it will execute with privilege of user who define it.

If the procedure has invoker rights and another user want to execute it. It will execute with
privilege of user who is calling it

Analytical Privilege
https://www.guru99.com/sap-hana-analytic-privileges.html/

Difference between analytical privilege and Restricted column is

Restricted column = Filter data based on Data


Analytical privilege = Filter data based on Role of user

SAP HANA Referential Join:


Referential Join is semantically an inner join that assume that referential integrity is given.

Note: Referential integrity is the property of database which ensures that each foreign key value in a
table exists as a primary key in the referenced table.

Referential join is performance wise better than inner join, but only be used when you are sure that
referential integrity is maintained.

• Join Engine:
o • Used when querying an Attribute View
o • The join engine is also used, when you run plain SQL.

• OLAP Engine:
o • Used for Analytic view (without calculated columns).

• Calculation Engine:
o • Used for Analytic views with calculated attributes and Calculation views

System Schemas

_SYS_BIC: (Activated Data or view)


This schema contains all the columns views of activated objects. When the user activates the Attribute
View/Analytic View/Calculation View/Analytic Privilege /Procedure, the respective run-time objects are
created under _SYS_BIC/ Column Views.

_SYS_REPO:
Whatever the objects are there in the system is available in repository. This schema contains the list of
Activated objects, Inactive Objects, Package details and Runtime Objects information etc.
Also _SYS_REPO user must have SELECT privilege with grant option on the data schama.
Read more about "GRANT SELECT PRIVILEGE ON _SYS_REPO"

_SYS_REPO is a User
http://saphanatutorial.com/sap-hana-online-training-sap-hana-advanced-modeling/#/
If objects (tables/views) of a schema (say SCHEMA_ABC) are used to build modeling views then it’s
necessary to grant _SYS_REPO the SELECT WITH GRANT privilege on this schema.

The following SQL statement must be executed before activating any such modeling views.
GRANT SELECT ON SCHEMA SCHEMA_ABC TO _SYS_REPO WITH GRANT OPTION

If you miss this step, an error will occur when you activate your views later.

Table Type in SAP HANA

A table type is
o • Similar to a database table but do not have an instance
o • Used to define parameters for a procedure that represent tabular results.

CREATE TYPE [schema.]name AS TABLE


(name1 type1 [, name2 type2,...])

DROP TYPE [schema.]name [CASCADE]

Hierarchy
https://sapstudent.com/hana/level-hierarchy-in-sap-hana/
We can create two types of hierarchies in SAP HANA, they are
 Level Hierarchy
 Parent-Child Hierarchy
Point to Remember: Hierarchies created in Attribute views are not available in
a Calculation views that reuses the attribute view, however the same will be
available in Analytic View that reuses that attribute view.

Currency conversion
https://blogs.sap.com/2012/04/27/how-to-perform-currency-conversion-in-sap-hana/
While using this option you need to replicate the standard table into SAP HANA that are TCURR,
TCURC, TCURX, TCURF, TCURT, TCURV . If these standard tables are not available then you will
not be able to perform Currency Conversion.
Decision Table
https://sapstudent.com/hana/sap-hana-decision-tables-with-return-values/
To avoid multiple if-else statement we can use decision table

Things to remember:
1. If we assign the actual column (from physical table) as action, then when we execute the decision
table the values for that column will be modified permanently. This is called decision tables with
update values.
2. If we don’t want to modify the actual values and wants to have the result values in a new column,
then we need to add ‘parameter’ as action instead of actual column. This is called decision tables
with return values.

DT in calc view : https://www.youtube.com/watch?v=ooQV37OU2_Y/

Check why calc view used and not attri and any view anymore
 https://www.quora.com/Why-were-the-analytical-view-and-attribute-view-been-removed-in-SAP-HANA/
 https://www.youtube.com/watch?v=DYyPrhwQsdY&index=27&list=PLDa15_03h61dluXfRC68nTZp1LUAQ
QOLw
 From SPS10, it is always recommended to use calc view with SQL engine default
 If we use all 3 views, all 3 engines will be used and data will pass from one to another engine which can
reduce performance.
Data Provisioning TECHNIQUE
SLT (SAP Landscape Transformation Replication Server)
Read PDF of SLT
https://www.guru99.com/slt-sap-landscape-transformation-replication-server-in-sap-hana.html/

BODS

Visulization Plan and Explain Plan

1) Execute view and get SQL statement


2) Go to console and paste and select query right click and visualization plan->execute
https://www.youtube.com/watch?v=a9YmWhXRGuQ/

Partitioning
https://www.youtube.com/watch?v=B2AtgeWBNE0/

Table Function
https://www.youtube.com/watch?v=ZIzljhIjH6Q
https://www.youtube.com/watch?v=OK5upVCq9A8
 Table function can not have insert update delete query
You must be in SQL Developer mode to create Function from File Menu->New->Other
 Table function have 2 types scaler function and tabular function
 We can create our custom logic and put it in function to use it N number of times
 If there is any logic which is going to use multiple times than we can create function of that logic and use it in
view N number of times
Table function can be used in Calc view while procedure can not

Dynamic Join
https://www.youtube.com/watch?v=bKJ3ao8XaLM/

In you do dynamic join in any field in aggregation and if you don’t use that fiend in data preview than aggregation
won’t take place on that field

Select Country AG1, Company, Product, Sales, Total_Sales AG2 from AG1 INNER JOIN AG2 on AG1.PRODUCT =
AG2.PRODUCT AND AG1.Country = AG2.Country

If dynamic join NOT done on country and if we remove country from data preview, query will be like

Select Company, Product, Sales, Total_Sales AG2 from AG1 INNER JOIN AG2 on AG1.PRODUCT = AG2.PRODUCT
AND AG1.Country = AG2.Country

If dynamic join done on country and if we remove country from data preview, query will be like

Select Company, Product, Sales, Total_Sales AG2 from AG1 INNER JOIN AG2 on AG1.PRODUCT = AG2.PRODUCT

so Run time query will generate as per selection

Migrate Attribute view/SQL script view in Calc view


https://www.youtube.com/watch?v=Po9ILcakKrw&t=9s/
Quick view -> Migrate

WHEN TO USE PROCEDURE AND CAN’T USE VIEWS

Window functions in sql scripts(RaNK, DENSE RANK,ARRAY), looping CAN’T DO IN VIEWS.


Window Functions : https://drill.apache.org/docs/sql-window-functions-introduction/
In Proc 183, used Add_days(), case when then, for that need procedure
Table Function vs Procedure
 Table function returns only 1 table in output and can set only 1 OUTPUT parameter(TOTAL 2 RETURN
VALUES ) while in procedure we can return so many tables by keeping OUT parameters in argument and
set its value in procedure
 Table function can have only one Out parameter table
 DML queries can’t use in Functions
 In calc view, Procedure can’t be used
 In select query we can use Function and can’t use Procedure

How to Debug Procedure


https://www.youtube.com/watch?v=jhZvBtrX0Gk

Check about KEEP FLAG functionality used in BW4HANA project

- If we set the KEEP FLAG true for the attribute the aggregation will happen at final level.
- We set KEEP FLAG for the VBELN and NETWR aggregation as MAX , so that NETWR(SUM) will
happen at each level and so it will give correct output.

Example :
How to Debug Calculation View

1) Click on flag symbol on right top

2) Click on debug view

3) Click on execute , then select any node and execute the query as per req.
Delivery Unit
1. Click on Delivery Unit from Quick launch(login to system then go to help click quick launch)
2. Select system
3. Create delivery Unit and Add require details
4. Click on add in assign packages and add packages which needs to Export and create it
5. Go to Export from quick launch and under “SAP HANA content” click on delivery unit
6. Select system and select your deliver unit from dropdown
7. Select package and click on either export to server or client and select path click finish

Developer mode VS Delivery Unit


1) Developer mode - Individual objects(views) can be selected for import and export
2) Delivery Unit - Standard manual delivery-unit export will contain all objects in those packages
that are assigned to the delivery unit

1) Developer mode - No special privilege required for Developer Mode Export


2) Delivery Unit - System privilege REPO.MAINTAIN_DELIVERY_UNITS required in order to
manage delivery Units

1) Developer mode – All repository objects such as roles cannot be transported using Developer
Mode
2) Delivery Unit - All repository objects can be transported using Deliver Units

Finance KPIs
Measures
1) Number of open items
2) Number of Overdue items
3) Amount of Open Items
4) Amount of Overdue Items
5) Overdue item(%)
6) Amount of Overdue Items(%)
Open Items : (Payment karvanu baki che or thyu che to analysis date pachi)
 For this date the document is not cleared:
o Clearing date (BSEG-AUGDT > analysis date) OR (BSEG-AUGDT is empty)
 For this date the posting date for payment is passed: BSEG-BUDAT <= analysis date(To_Date)

Overdue Items : (Payment karvanu baki che and chelli date vai gai hoy, chelli date analysis period
ni andar hoy)
 For this date the document is not cleared: Clearing date (BSEG-AUGDT > analysis date) OR (BSEG-
AUGDT is empty).
 For this date the net due date for payment is passed: NETDT < analysis date

o Where the net due date is calculate from the baseline date (BSEG-ZFBDT), then it depends of the
payment terms of the invoice.
NETDT = BSEG-ZFBDT + Max (BSEG-ZBD1T, BSEG-ZBD2T, BSEG-ZBD3T)
183_01 = Number of vendor open items
Formula:
Count document items where a document contains at least one item with
[(BSEG-AUGDT>Analysis Date) OR (BSEG-AUGDT=Blank)] AND (BSEG-BUDAT <=Analysis Date) AND (BSEG- KOART =
K) AND BSEG-SHKZG=’H’
183_02 = Amount of vendor open items
Formula: Sum Amount where
[(BSEG-AUGDT>Analysis Date) OR (BSEG-AUGDT=Blank)] AND (BSEG-BUDAT<=Analysis Date)
For each entry in Filter(List 1) where field BSEG-SHKZG = “H” AND BSEG- KOART = ‘K’ sum the value of field BSEG-
DMBTR.
183_03 = Number of overdue items
Formula:
Select all items of document in which at least 1 vendor item ((BSEG-SHKZG = “H”) AND (BSEG-
KOART=’K’)) of the document has NETDT < Analysis date or if the NETDT is zero
Count document items where a document contains at least one item with
[(BSEG-AUGDT>Analysis Date) OR (BSEG-AUGDT=Blank)] AND (NETDT<Analysis Date) AND (BSEG- KOART = K) AND
BSEG-SHKZG=’H’
183_04 = Amount of overdue items
Select all items of document in which at least 1 Vendor item ((BSEG-SHKZG = “H”) AND (BSEG-
KOART=’K’)) of the document has NETDT < Analysis date or if the NETDT is zero
Formula: Sum amounts where [(BSEG-AUGDT>Analysis Date) OR (BSEG-AUGDT=Blank)] AND (NETDT<Analysis
Date)
For each entry in Filter(List 1) where field BSEG-SHKZG = “H” AND BSEG- KOART = ‘K’, sum the value of field BSEG-
DMBTR.
183_05 = Number of days between the clearing date and the due date
Formula: Sum (Days per item (BSEG-AUGDT - NETDT)
Note than axis Time Gap is not considered for this measure.
183_06 = Overdue Items (%) = number of overdue items x 100 / number of open items
Formula: 183_03 x 100 / 183_01
183_07 = Overdue Invoices (%) = number of overdue invoices x 100 / number of open invoices
Formula: Count documents (BKFP-BELNR) where (BSEG-AUGDT>Analysis Date) OR (BSEG-AUGDT=Blank)] AND
(NETDT<=Analysis Date) x 100 / Count documents where [(BSEG-AUGDT>Analysis Date) OR (BSEG-AUGDT=Blank)]
AND (NETDT<=Analysis Date)
Consider a ‘document’ as a combination (primary key) of following fields :
- BKPF-BUKRS (Company Code)
- BKPF-GJAHR (Fiscal Year)
- BSEG-BELNR (Document Number)
183_08 = Overdue Amount (%) = amount overdue x 100 / amount open invoices
Formula: 183_04 x 100 / 183_02

Procure to Pay KPIs


https://sap-certification.info/mm/free-training/sap-procure-to-pay-process/
Steps in PTP
1) Purchase Requisition: a document that allows people working in various departments of a company to specify
the goods or resources that have to be purchased.
2) Request for Quotation (RFQ) : RFQ is required when you don’t know your vendor and need quotations from
several vendors for a material/service. It is the complete set of process that is triggered once a purchase
requisition has been received.
3) Open Contract : Open contract is a general agreement with the vendor for a given period of validity with agreed
price list
4) Purchase Order : Purchase order is an agreed upon official document from the customer to vendor for
customer’s intent to buy or receive one/multiple materials with agreed prices, lead times/delivery dates,
quantities and specifications
Contract Release Order : Contract Release Order is an agreed upon an official document from the customer to the
vendor regarding the customer’s intent to buy or receive one/multiple materials with agreed prices, lead
times/delivery dates, quantities and specifications and it is created with reference to an Open Contract.
5) Goods Receipt : Goods Receipt is the step in the procurement cycle where the actual goods ordered via a
Purchase Order/Contract Release Order are received by the company and it is checked for the required quality /
quantity.
Service Entry : Service entry certifies that the requested services from the Purchase Order/Contract Release Order
have been actually delivered/rendered.
6) Invoice Handling : The process is triggered whenever a vendor invoice received for the purchases is to be
entered in the SAP system.
7) Payment : If the invoice is approved via workflow, the last step in the cycle of purchasing is the payment to the
vendor.
Tables
-(145-2)EKKO (Purchase Order Header).
- EKPO (Purchase Order Item).
- EKET (Purchase Order Schedule Lines).
-(103-1)EKKO (Purchase Order Header).
- EKPO (Purchase Order Item).
- EKET (Purchase Order Schedule Lines).
- RBKP (Document Header : Invoice Receipt)
- RSEG (Document Item : Incoming Invoice)
- EKBE ( History per Purchasing Document)

Process of Best Purchase Price: (103_1)


1) calculate lowest price for both 1) If invoice has generated(WRBTR/MENGE) 2) If it
hasn’t(NETWR/MENGE)
2) PO is nothing but unique combination of (LIFNR=VENDOR MATNR=MATERIAL EKORG =
PURG ORG)
3) PO = 1 MATERIAL ORDERED BY 1 PUR. ORG TO 1 VENDOR
4) If invoice has generated take that value as lowest price for that item else take other
lowest unit price value
Lowest Unit Price = If( isnull(UP_INV), UP_PO, UP_INV)
5) Multiply with quantity (MENGE) to get Lowest_Price(2nd measure)
6) Subtract with NETWR(1 MEASURE) – LOWEST PRICE(2 MEASURE) will give purchase
order savings(3rd measure)
Measures
103_1_01: Value of PO Items with/without Contract
103_1_02: Value of PO items with/without a Contract if lowest price Purch.Org/material/vendor applied
103_1_03: Potential Savings in Value (of variance) between purchasing invoiced amount and purchasing at
lowest price for PO with/without Contract

103_1 : NETWR

103_2 :
For the same combination EKORG-LIFNR-MATNR; calculate the value of PO items with lowest price found:
 [Best PO Item Value Material/Vendor] = Lowest unit price Material/Vendor * (MENGE
*UMREZ/UMREN)
Where MENGE*UMREZ/UMREN is the total sum of all MENGE*UMREZ/UMREN purchase item of the
Aggregation for every Purch.Org/Material/Vendor combination.
For each distinct occurrence of the combination of values EKKO-EKORG, RBKP-LIFNR and RSEG-MATNR, where the
lowest unit price is the lowest price for each combination:
W RBTR
LowestUnitPrice 
UMREZ
MENGE*
UMREN
In the case that the Purchase Order has not yet been billed, i.e. no invoice exists, then the price from the purchase
order for that material/vendor combination will be taken as the only applicable price in scope of the analysis, so
the Lowest Unit Price will be calculated as:
EKPO  NETW R
LowestUnitP rice 
UMREZ
EKPO  MENGE*
UMREN
One Purchase Order item has no invoice when:
For EKPO-EBELN = RSEG-EBELN and EKPO-EBELP = RSEG-EBELP has no result.

103_3
- Measure 103_01_3(Gain) =

 UMREZ 
Gain  NETWR   LowestUnit Pr ice * (MENGE * )
 UMREN 
Where:
- NETWR is the Purchase Order Item amount (EKPO-NETWR)
- Lowest Unit Price is the lowest unit price for every combination of EKORG/LIFNR/MATNR.
- MENGE is the Purchase Order item quantity in PO units.
- UMREZ and UMREN are the numerator and denominator for the conversion between PO units and the
base unit of the material.
So, Gain = Measure1 – Measure2
Supplier Quantity Reliability performance (145_2)
This indicator measures vendor delivery performance in terms of quantity reliability.
Measures
145_2_01: Sum Value of the Not fully delivered Scheduled Lines (Value)(aatli items haji deliver nai
thai)
145_2_02: Average Rate of Not fully delivered Schedule Lines in % from total docs (Ratio)(Total
amount mathi aatla X% amount ni items haji deliver nai thai)

Formula 1: Schedule Lines Not Fully Delivered (Quantity)

Formula Name Definition Calculation


01 (F1) Sum the Quantity on The sum of the For all entries in List 1 where EKET-MENGE is
Schedule Lines Not quantities of the greater than EKET-WEMNG, compute the
Fully Delivered schedule lines that following:
have not been fully
𝑛
delivered
𝑄𝑢𝑎𝑛𝑡𝑖𝑡𝑦 = (∑ 𝑀𝐸𝑁𝐺𝐸𝑖 − 𝑊𝐸𝑀𝑁𝐺𝑖 )
𝑖=1
𝑈𝑀𝑅𝐸𝑍
∗( )
𝑈𝑀𝑅𝐸𝑁

Where:
- MENGE is the scheduled quantity.
- WEMNG is the delivered quantity.
- UMREZ and UMREN are the
numerator and denominator for the
conversion of the PO quantity from
PO units into base units.

145_2_01: Sum Schedule Lines Not Fully Delivered (Value)

Formula Name Definition Calculation


02 Sum of the The sum of the For all entries in List 1 where EKET-MENGE is greater than
value of total value of EKET-WEMNG, compute the following:
Schedule Lines schedule lines
Not Fully that have not Amount   (
n
NETPRi
) * Quantityi * (
BPUMZ i
)*(
UMREN i
) Field Code Changed
Delivered been fully i 1 PEINHi BPUMN i UMREZ i
delivered Field Code Changed
Where: Field Code Changed
- NETPR is the net price.
- PEINH is the unit net price
- BPUMZ and BPUMN are the numerator and
denominator for the conversion of PO quantity
- Quantity is obtained with Formula1.

Formula 3: Sum Total Schedule Lines Ordered (Value)

Formula Name Definition Calculation


03 (F3) Sum of The sum of the For all entries in List 1, compute the following:
the total total value of
value of schedule lines n
NETPRi BPUMZ i Field Code Changed
Schedule that have Amount   ( ) * MENGEi * ( )
i 1 PEINH i BPUMN i Field Code Changed
Lines been ordered.
Ordered Field Code Changed
Where:
- NETPR is the net price Field Code Changed
- PEINH is the unit net price. Field Code Changed
- MENGE is EKET-MENGE, quantity ordered.
Field Code Changed
145_2_02: Value Ratio; Rate of Schedule Lines Not fully Delivered in % from Total Ordered Value (Ratio)

Formula Name Definition Calculation


04 Rate of Schedule Amount of not
Lines Not fully delivered Value /
Formula02 / Formula03 *100 Field Code Changed
Delivered in % from Total value ordered
total value ordered

COUNT_SCHEDULE_LINES: Total Number of Schedule Lines NOT fully delivered (Item Level)

Formula Name Definition Calculation


05 Total Number of of Total Number of of For all entries in List 1 where EKET-MENGE is
Schedule Lines Schedule Lines greater than EKET-WEMNG:
(Item Level) NOT (Item Level) NOT - Count the number of distinct
fully delivered fully delivered (for Purchase Order Item (EKET-EBELP)
which 145_2_F1 ≠ for which 145_2_F1 ≠ 0
0)

This measure indicates the number of Purchase Order (at Item level) not fully delivered.
Predictive Analysis Library
To use PAL algorithm, you must do the following:
1. Generate a procedure that wraps the PAL function
2. Call the procedure, for example, from a SQLScript procedure.

http://saphanatutorial.com/what-is-predictive-analysis/
http://saphanatutorial.com/sap-hana-predictive-analysis-library-pal/
http://saphanatutorial.com/how-to-work-with-hana-pal-library/
http://saphanatutorial.com/run-abc-analysis-using-hana-pal-part-1/
total amount of customer - 100
remaining amount of customer - 50
remaining amount of customer after due date - 20
% remaining amount of customer - 50%
% of amount remaining after Due Date of customer -
% of total remaining amount(20/Total of remaining amount of all customer)(can use to identify risk base
customer)
1. Generate a PAL Procedure
In this step, we need to do following things

Identify an INPUT table:


Identify the input table which contains the source data.

Identify an OUTPUT table:


This table will be used to save PAL result. The type of INPUT and OUTPUT table must be same.
Populate a PARAMETER table:
PAL functions use parameter tables to transfer parameter values. Each PAL function has its own
parameter table. To avoid a conflict of table names when several users call PAL functions at the
same time, the parameter table must be created as a local temporary column table, so that each
parameter table has its own unique scope per session.

The table structure is as follows:

Column Name Data Type Description

Name Varchar Parameter name

IntArgs Integer Integer parameter value

DoubleArgs Double Double parameter value

StringArgs Varchar String parameter value

Each row contains only one parameter value, either integer, double or string.

Generate PAL Procedure:


Any user granted with the AFLPM_CREATOR_ERASER_EXECUTE role can generate a procedure for a
specific PAL function. The syntax is shown below:
2. Call PAL Procedure

After generating a PAL procedure, any user that has the AFL__SYS_AFL_AFLPAL_EXECUTE or
AFL__SYS_AFL_AFLPAL_EXECUTE_WITH_GRANT_OPTION role can call the procedure, using the
syntax below.
CREATE SEQUENCE mySequence START WITH 1000 INCREMENT BY 1;
SELECT mySequence.NEXTVAL FROM DUMMY;

CREATE TABLE myTable (a INT);


INSERT INTO myTable VALUES (mySequence.NEXTVAL);
SELECT * FROM myTable;

INSERT INTO myTable VALUES (mySequence.NEXTVAL);


SELECT * FROM myTable;
Identity Column
https://blogs.sap.com/2014/06/04/quick-note-on-identity-column-in-sap-hana/
create column table some_names
(ID bigint not null primary key generated by default as IDENTITY,
NAME nvarchar(30));
And now we can do things like this:
insert into some_names (name) values (‘Huey’);
insert into some_names (name) values (‘Dewey’);
insert into some_names (name) values (‘Louie’);
select * from some_names;
ID NAME
1 Huey
2 Dewey
3 Louie

SAP LUMIRa
https://www.guru99.com/sap-hana-reporting.html#4

BW ON HANA
DataStore Object
DataStore Object (DSO) is known as a storage place to keep cleansed and consolidated
transaction or master data at lowest granularity level. This data can be analyzed using BEx
query.
DSO Architecture
DSO component consists of three tables −
Activation Queue
This is used to store the data before it is activated. The key contains request id, package id,
and record number. Once activation is complete, the request is deleted from the activation
queue.
Active Data Table
This table is used to store the current active data and it contains the semantic key defined
for data modeling.
Change Log
When you activate the object, changes to active data are stored in the change log. Change
log is a PSA table and is maintained in Administration Workbench under PSA tree.
InfoCube
InfoCube is defined as a multidimensional dataset, which is used for analysis in a BEx query.
An InfoCube consists of a set of relational tables which are logically joined to implement star
schema.

HANA Optimized InfoCubes


When you use SAP BW on HANA, you can create your existing InfoCubes to HANA
Optimized InfoCubes. When InfoCubes are moved to HANA database, they become
column-based tables and act like BWA Indexed InfoCubes.

Composite Providers
Composite Providers are used to combine multiple InfoProviders using Join or Union
operations. When you use SAP BW on HANA, one of the InfoProvider should use in-memory
database and the data in composite providers can be used for reporting and analysis.
DSO: Data is stored in 2-dimensional format like a regular table.
Cube data is stored as star schema (multi dimensional data)
Cube is used mainly used for analytical reports. DSO is used for operational reports.
DSO has the overwrite capability.
Infocube data will get appended.
DSO gives detailed data, Infocube gives aggregated information
DSO can be used as a datastage and of data consolidation
DSO
1 flat file format structure
2 two dimensional
3 overwrite data functionality
4 performance is less as compared to cube
5 detailed form of data
infocube
1 star schema
2 16 dimentional
3 additive data functionality
4 performance is better as compared to DSO
5 summerised form of data

Now Lets see what happens in DSO Scenario:


1. When First Record is loaded it will have value like this
Rec CompCode ItemNo NoofItems
1. 1199 677 79
2. When second record come it will be Intenally happining like this
Rec CompCode ItemNo NoofItems
2. 1199 677 0 ( Overriden 79 with 0 )
Now Lets see what happens in CUBE Scenario:
1. When First Record is loaded it will have value like this
Rec CompCode ItemNo NoofItems
1. 1199 677 79
2. When second record come it will be Internally happening like this
Rec CompCode ItemNo NoofItems
1. 1199 677 -79
Since the CUBE will not have property of Override it will pass the value as -79 to make it to zero.

Вам также может понравиться