• No results found

Create the Calculation View

In document 05 HANA_Student Exercise (Page 67-80)

Lesson 5: Modelling Overview

5.4 Create the Calculation View

20. Navigate to the Calculation View under your student package. Right click to create a new Calculation View.

Name your calculation view CE_PLAN_ACTUAL_XX

Description: Plan Actual Comparison for CO-PA

Specify Graphical for the type of the Calculation View.

66

21. Since we will be reading from existing Analytical Views you do not have to select any tables.

Click Next.

22. Select the previously created 2 Analytical Views within the studentXX package. CEA1_XX

CEP1_XX

Replace XX with your student number.

67

23. As a result the Graphical Calculation View editor will open.

24. From the Tools Palette select 2 Projection graphical nodes one for each Analytical View. This is where you will set the Actual versus Planned data indicator.

25. Double Click on each Projection node and rename each to Projection_A and Projection_P

68

26. Add a Union Graphical node and Rename the node to Union.

27. With the mouse pointer hover over each graphical node and draw a connection line between the nodes as shown on the right representing a data flow graph.

69

28. Add a new Calculated Column called KPLIKZ.

In the diagram select the Projection_A node. Within the Output right click on Calculated Columns > New.

29. Enter KPLIKZ for the name of the field. Select INTEGER and enter 0 in the Expression Editor as the Planned Indicator value. Click OK.

30. Ensure the Calculated Column is visible in the Output of Projection_A.

70

31. Add all the fields of CEA1_XX to the Output of the Projection_A node. Select the Projection A node, within the details view select all the fields > Right Click > Add to Output. HINT: Use the CTRL key to select multiple fields except !!!

** DO NOT ADD FIELD PLIKZ ***

32. Proceed to work on the Projection_P node. As before add the field KPLIKZ but this time set the Expression value to 1 as an indication for planned data.

71

33. Since we will eventually use a Union to combine the results from both Analytical views we have to ensure that the field names are identical in both views. After you have added all of the CEP1_XX fields to the Output select the field PERBL (within Output of Projection_P) and then within the properties view rename the PERBL field to PERIO Hint: If renaming is not allowed, close and reopen the Studio.

34. Proceed to select and work with the Union node. Within the details of the Union CTRL select all the fields from the Projection_A node > Right Click > Add to Target.

72

36. Scroll down and select all the fields on the Projection_P node. Since we want to combine the two analytical views we need to map the fields from both views to each other. Right Click > Map to Target.

You can also select each individual field on the left and drag & drop it over the corresponding field on the right hand side.

HINT : You can also use the automatic mapping by name

37. The completed Calculation View mapping should look as follows. Save your work.

73

38. Click on the Output Node in the main diagram. Within the Details view pane select each field > Right Click > Add the field as Attribute or as Measure according to the following.

Activate and Preview HINT :

Make sure that the Participant Element Check is not selected Quick Launch tab -> Setup -> Manage Preferences -> Validation Rules

Uncheck the Participant Element Check under the Calculation View section

74

1. Create a Script based Calculation View. Right click on Calculation views > New > Calculation View...

2. Enter CE_PLAN_ACTUAL_XX2 for the name of the Calculation view.

Select SQL Script for the type and be sure to select the _SYS_BIC schema. Click Finish.

75

4. In the left side of the diagram double click on the Script Node. Before entering code into the middle section click on the icon Define Output Parameter within the Output section in the right side of the screen.

5. Enter all the output fields according including the corresponding Data Type and Length.

WARNING: While defining the Output for the Data type VARCHAR, DO NOT click on the Scale fields.

HINT: List of fields and data types for

the output table. Name Data type Length Scale MATNR VARCHAR 40 0 KUNNR VARCHAR 35 0 REGIO VARCHAR 20 0 LANDX VARCHAR 15 0 ORT01 VARCHAR 35 0 PERIO VARCHAR 7 0 VKORG VARCHAR 4 0 KPLIKZ VARCHAR 1 0 GROSSREV DECIMAL 15 0 SALESDEC DECIMAL 15 0 PRODVAR DECIMAL 15 0 OTHEREXP DECIMAL 15 0 NETREV DECIMAL 15 0 CM1 DECIMAL 15 0 CM2 DECIMAL 15 0

76

6. Refer to the Appendix (SQL Script Example 1) and copy all the SQL code statements and past it between the BEGIN & END section replacing the

var_out = ... code.

You find an electronic version of the SQL Script template in

Start -> My Documents -> My

Documents -> 01 Calc View Template Union.txt

7. The completed SQL Script. Remember to replace studentxx with your assigned number.

Save your work.

8. Click on the Output Node in the Scenario on the left hand side. Within the Script View details select all the Attributes > Right Click > Add as Attribute to move the fields into the outputs over to the right hand side of the screen. Proceed to do the same for the measures.

77

78

In document 05 HANA_Student Exercise (Page 67-80)

Related documents