Graphical Calculation View Nodes – JOIN
Continuing the build of our first graphical calculation view, we repeat the same process for VBAP to be added to Projection 2. Also, some of the fields we need from this table are also selected.
At this point, these are two individual tables floating in space with no interaction or relation whatsoever. Let’s change that. Bring in a Join block by dragging it into the space from the left menu as shown below.
Now you have a floating JOIN block. You need to tell it what it needs to join. As explained earlier, we want to do a left outer join between VBAK and VBAP. See those little circles on top of the projection nodes, the bottom circle is an input connector and the top circle is an output connector. Drag and drop the Output connector from projection 1 into the input node of Join 1 as shown below. Do the same thing for Projection 2. This means that you have taken the output of those projections and are using them as an input to the join block. The input connector that is dropped first into the join becomes the left part of the join and the second one becomes the right. The join connector only takes two inputs. So if we had a third table to join, you would need another Join block.
The join block now houses the two projections.
Click on the Join 1 node to open up the join mappings on the right hand side as seen below. Here, again select the fields that you want to send to the next level and as you see, the ones I selected are orange. Actually I selected all but the ones that are grey are the not selected because they are duplicate, i.e they exist in both tables so we only need it only once. Drag and drop the fields from one table to the other based on which you wish to join the two tables. This creates a linking line between the two as shown below. In this case, we join using the MANDT (Client) and VBELN (Sales Document Number) as the join conditions. Also, our requirement was to do a left outer join and all join nodes provide inner join by default. To change this, in “Join Type”, click on where the value is marked as ‘Inner’ as pointed by the green arrow below.
In this Join Type section, this opens up the drop down where you can select Left Outer Join.
Now the join is complete. As we did earlier, connect the output connector of the Join block to the input connector of the Aggregation block. After this is done, click on the aggregation block to bring up the selected field list as shown below.
Select the fields you require to move to the output.
Once done, click on the Semantics block. This is where you maintain the overall settings of this graphical calculation view. Go to the “View Properties” tab. Data Category is CUBE as we selected in the beginning. You can change it here even at this point. If you are working with tables of SAP source systems, they most probably will have the MANDT field as I explained earlier. These tables are cross client and in those cases, change the Default client setting to “Cross Client” instead of “Session Client” as shown by the green arrow below. Also on the Execute In drop down, select “SQL Engine” for best performance.
Press the activate button shown below when done.
If the job executes with no red signs, your graphical calculation view was successfully built. If you don’t see your log anywhere, press the button I have marked by the red arrow below to bring it up.
Press the data preview button marked below to see if our view brings up any data.
Move to the raw data tab pointed by the red arrow. You would see the data preview of the first 200 records of this successful join. If you wish to display more, change the max rows setting pointed by the blue arrow and press execute to refresh the data again.
Also, you would see your first view inside your package as well. Well done! Pat yourself on the back. You are well on your way to be the HANA expert this world so desperately desires.
In the next tutorials, we will try out further features of the graphical calculation view. Help this website grow by sharing this document on social media by using the icons below. Be sure to subscribe to our newsletter when the message pops up for latest alerts on new tutorials.