There are situations when there is a need to make a restriction on a characteristic with its compounding characteristic. I will try to explain the problem with an example, mention about the SAP Note related with this problem and propose a shortcut solution for this problem.
Suppose we have a characteristics ZDUMMY_PA (Personnel Area) and ZDUMMYPSA (Personel Sub Area). ZDUMMY_PA is the compounding characteristic of ZDUMMY_PSA. We have data such as:
We have an infoprovider using these two characteristics. We have a query where we make a restriction on ZDUMMY_PA. We want to restrict the Sub Areas: 100 from A area and 200 from C area. In the query when we drag A/100 for the restriction, only 100 is dragged and all personnel areas related with 100 are included in the restriction as seen below:
An overview on SAP Note related with this problem:
The SAP Note: 541253 describes this situation and proposes a solution. However, this solution is not suitable for the requirement described above. The note suggests restricting the compounded infoobject. When we do that in this case, we have to restrict A and C for personnel area and 100 and 200 for personnel subarea. Then in the report we will see all 100 and 200 subareas belonging to A and C. That is; even if we don’t want to show A/200, it will be shown in the report.
Solution approach for the problem:
The shortcut solution I suggest will be defining a new attribute to Personnel Subarea characteristic. For this aim, we define a new characteristic with data type char 8 (8 comes from the total number of characters defined in personnel area and personnel subarea. In our example, personnel area is defined as char 4 and personnel subarea is also defined as char 4).
We add this new characteristic as the attribute of personnel sub area: ZDUMMYPSA.
In the transformation for master data we add personnel area and subarea to source fields list and select rule type as routine:
We write a small routine to update ZDUMMYCH:
SOURCE_FIELDS_RULE–/BIC/ZDUMMYPSA INTO RESULT.
In this part, we may give any other character in between the personnel and subarea. I generally use ‘/’ sign in between.
This kind of approach may become a must in some situations. For example if we had personnel_areas such as A and A1 and subarea
such as 100 and 00, when we concatenate there will be one concatenated value for two different personnel area – subareas: A100.
Then it will mislead the report when filtered. For sake of simplicity in this blog I go with direct assignment without any character in between.
After we load and activate master data we see the master data as:
Now we need to add ZDUMMYCH to the navigation attributes of the infoprovider. Then in the query designer we can add ZDUMMYCH to the characteristic restrictions pane and we can easily select ZDUMMYCH to filter with our desired restrictions:
As a result, with some modeling changes in both characteristic and the infoprovider, we can achieve to see the desired results. I hope it gives an idea.