cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Reference Master Data Type

willsuus
Participant
0 Likes
1,139

I have a Customer MDT (BBCUSTOMER) with a key of CUSTID.

I then created a reference MDT based on BBCUSTOMER for Distributor (BBDISTRIBUTOR) with a key of ZDISTRID whose referenced attribute is CUSTID.

The planning level created is MTHPRODCUSTDISTR - it includes both of these MDTs.

I then have a Key Figure (Total Gross Sales Units) that is at PL MTHPRODCUSTDISTR. In one of the calculations for this key figure, I want to be able to check the value of ZDISTRID - but when I edit the calculation, it does not recognize the ZDISTRID attribute.

Does anyone have any idea of what is causing this issue?

Accepted Solutions (1)

Accepted Solutions (1)

piyush_parekh
Active Contributor
0 Likes

Hi Susan,

Can you try splitting the calculation as below?

ZTOTALDELIVQTY@MTHPRODCUSTDISTR = IF("ZDISTRID" =''0'',"ZTOTALDELIVQTY@MTHPRODCUSTDISTR",0)

[Double quotes for attribute and two single quotes for attribute value]

And then another calculation definition to sum it up at required level as below:

ZTOTALDELIVQTY@MTHPRODCUST = SUM("ZTOTALDELIVQTY@MTHPRODCUSTDISTR")

Once you validate and save key figure, try to perform planning area check and see you get any errors related to this key figure.

Hope this helps!!

Regards,

Piyush

willsuus
Participant

Splitting the calculation was the answer. It now works as designed.

Thank you very much for your assistance.

Answers (4)

Answers (4)

willsuus
Participant
0 Likes

Unfortunately, the last time I included the screenshots, they did not stay included. I will try again. But, as it will not submit when I put this information in the Comments portion, I am trying in the "Your Answer" section.

I am using the double quotes around the name of the attribute and two single quotes around the value I am checking. I have done attribute checking in the past and have had no issues.

*** I am thinking that the issue may be that I am trying to check an attribute that is part of a reference master data type.

Below are screenshots which will hopefully stay with this entry.

MASTER DATA TYPE:

KF CALCULATION

When I am entering the calculation, the name of the attribute (ZDISTRID) does not show up in the dropdown list of suggested entries (as it does other times when I have referenced an attribute in a calculation):

This is what the calculation looks like before I click on Validate -

SUM(IF("ZDISTRID" =''0'',"ZTOTALDELIVQTY@MTHPRODCUSTDISTR",0))

This is what it looks like after I click Validate (quotes are removed and the attribute name is all in black - where it usually is in purple and the double quotes remain) -

ZTOTALDELIVQTY@MTHPRODCUST = SUM(IF(ZDISTRID =''0'',"ZTOTALDELIVQTY@MTHPRODCUSTDISTRî‚€",0))

piyush_parekh
Active Contributor
0 Likes

Hi Susan,

Can you share the KF screenshot? You need to use double quotation mark for attribute and two single quotation marks around attribute value in key figure expression.

Regards,

Piyush

willsuus
Participant
0 Likes

Please reference the information I added in the "Your Answer" section as when I placed it in the "Add Comment" section, it would not submit.

willsuus
Participant
0 Likes

Here is how a calculation that is working referencing an attribute appears - the attribute, CUSTID, is in purple and surrounded by double quotes.

Here is the Total Gross Sales Units KF - though I put the attribute in double quotes, it removed them and the attribute is just listed in black

former_member296874
Participant
0 Likes

Hello Susan,

Please use attributes surrounded by double quotation marks in the calculation expression. For example "ZDISTRID". However unlike KF, attributes names won't popup in KF calculation box.

Can you please confirm if the calculation for KF "Total Gross Sales Units" is working as expected?

Refer below link for more details.

https://help.sap.com/viewer/bf99e931b8d44aafb4e306ec3602cbdd/2008/en-US/00d82d554c95743ce10000000a17...

In case of further queries, please provide snapshot of KF calculation.

willsuus
Participant
0 Likes

Please see my additional comments in the "Your Answer" section as it would not submit when I tried to put it in the "Add Comment" section.