This is one of the ways of creating a calculation view that is based on a script
Step 1) Create a new calculation view and select subtype to be "SQL Script" ( other option is Graphical)
Step 2)
Insert the code as shown below
/********* Begin Procedure Script ************/
BEGIN
var_out = SELECT "MaterialOldID" as "Product",
COUNT(*) as "Materials"
FROM "_SYS_BIC"."sap.hba.ecc/Material"
GROUP BY "MaterialOldID";
END /********* End Procedure Script ************/
Please note you will have to define the columns and the column meta data
In this example we have defined two output columns
Product
Materials
Important Consideration
Please note that though it is convenient to write a calculation view based on a script there are consideration for aggregation and calculation columns you have to consider the implication of further usage of the calculation view.
if you script has complex calculated columns one needs to be aware of the formula and how it will be summed up if it is used for some other views
Another hint is to use SQL script as a means to create INLINE tables and this gives you a lot of flexibility in doing the modelling.
Avoid using SELECT * FROM always as that will be a not very efficient
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
11 | |
10 | |
7 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 | |
3 |