BW4 Query Linked Components – an intelligent feature
Author – Rashi Singal , SAP Analytics Consultant, NTT DATA Business Solutions UK&I
In this blog we will discuss about a new intelligent feature introduced with SAP BW/4HANA called Linked Components
Introduction to Linked Components
With BW/4HANA, SAP introduced a new intelligent feature at query level called Linked Components. This allows you to link Query components so that changes in the source query components are reflected in the target query components. The system maintains mapping information that allows the queries to be synchronised automatically. We can create Linked components based on Calculated/Restricted Key figures and Queries.
Mapping is supported for InfoObjects, Hierarchies, Restricted Key Figures, Calculated Key Figures, and Variables. Some features are not currently available/supported, such as Filters and Currency/unit conversions.
For example, the business requirement is to write a large number of BW/4 Queries, the majority of which use comparable Restricted / Calculated Key Figures but are based on different InfoProviders. As they are dependent on common business requirements, most of the Restricted / Calculated Key Figures follow the same logic. If the business logic changes, all Restricted / Calculated Key Figures need to be changed.
Instead of manually altering all of these Restricted/ Calculated Key figures, why not just change one of them and the others would automatically be updated?
The question now is, “How can I accomplish such automatic functionality?” This is where the Linked Components feature comes in.
Using Linked Components feature, the central management of Query objects is achievable. It is now possible to describe the logic of components centrally (for example Calculated/Restricted Key Figures) and reuse the logic across queries created on top of other Info Providers. When the source Restricted / Calculated Key Figure is modified, all linked (target) components are updated.
We shall examine four topics in this blog concerning Linked Components:
1. Creating Linked Components
2. Modifying the Source Component
3. Modifying/Deleting the Target Component
4. Decoupling the Target Component
Let us look at the following scenario and see how to work with linked components.
Scenario: IP1 and IP2 are two Info Providers with a similar structure. You have created the query Q1 for IP1. You need to create query Q2 for IP2. This query (Q2) should be similar to query Q1 and should alter automatically whenever query Q1 is changed.
Creating Link Components
To create a Linked Component based on a query, follow the steps below:
1. Open source query Q1 and click on ‘Show Linked Components View’:
This opens a new tab called Linked Components:
2. Open the context menu for the source component and choose New Component:
3. Enter the name of the target component & target Info Provider and a description.
4. Click on Create Proposal.
When you click “Create Proposal,” the system will automatically map the objects based on the reference info object. You have the option to alter the mapping by clicking on ellipsis button on the target object, this opens up a dialog box to choose from.
If the data types for Info Objects match and the system is able to map source and target objects, the status will be green. If the system cannot find any similar fields, the status will be red, with the message “Could not locate a suitable object for **.” In this case, you map it manually.
5. Validate & Create. Now you can see the newly created query (IP2_Q2) is linked to the source query (IP1_Q1):
Modifying the Source Component
If we make any changes to the source component these will be added in the target component as well. Let us look at it in more detail:
1. Open source query (IP1_Q1) and make any changes to it. Let us add Product in rows.
2. Save the changes in Source query.
After saving the source query, the target component icon on the Linked Components tab has been changed and an * is added, indicating that the target component is currently not synchronous with the source component and that any changes made in the source will not be reflected in the target:
3. To start synchronization, choose Synchronize from the context menu for the source component:
If the synchronization is successful, you will get status as green.
Modifying/deleting the Target Component
As the target component is linked to the source component, you are allowed to make limited changes to it. You can only change description or mapping.
Let us look at how to make these changes in the target component.
1. Choose Open from the context menu of the link target component on the Linked Components tab:
2. Under General, press the Edit mapping and synchronize with source component button.
3. Edit mapping and synchronize with source component dialog box appears, make relevant changes (Description / Mapping):
4. Validate & Synchronize.
Note: If you try to make any more modifications to the target component, such as adding filters, removing characteristics/key figures, or even deleting the target query, you will get an error that the Component is still linked and cannot be changed:
Decoupling the Target Component
In order to make further changes/delete the target component, we need to Decouple (breaking the link between source & target component) the target component.
Follow these steps to decouple target component:
1. From the Linked Components tab, open the context menu of target component and press Decouple:
2. Open the target component, in the general tab press Decouple button:
Note: It is not possible to re-link a broken query component; if you wish to re-synchronize, you must restart the entire process.
Overall, Linked Components is a helpful and straightforward feature for mapping source and destination components and automatically synchronising them. It also assures uniformity and saves time.
Supporting documentation can be found here
If you have any questions arising from this blog please do not hesitate to contact us