How to display only one attribute value from LedgerDimension

In this post, I will explain how to display only one attribute value from LedgerDimension. I will use CostCenter attribute for my example. As you know LedgerDimension table are DimensionAttributeValueCombination , DimensionAttributeValueGroupCombination and DimensionAttributeLevelValue . This tables holds the related data. Instead of this tables I wil use only DimensionAttributeLevelValueAllView view. This view is very simple and useful.
I have a LedgerDimension’s RecId end i want to display only CostCenter value. I will join DimensionAttributeValue to DimensionAttributeLevelValueAllView and give the ranges.

Here is the method displays costCenter values.

// FD: Display CostCenter Value from LedgerDimension
display num dispFinancialDisplayValue()
    DimensionAttributeValue             dimAttrValue;
    DimensionAttributeLevelValueAllView dimAttrLevelValueAllView;

    select firstonly dimAttrLevelValueAllView
    where dimAttrLevelValueAllView.ValueCombinationRecId == this.LedgerDimension
    join dimAttrValue
        where dimAttrValue.RecId == dimAttrLevelValueAllView.AttributeValueRecId
        &&    dimAttrValue.DimensionAttribute   == 5637144851;
        // CostCenter RecId. Must be parametric.

    return dimAttrLevelValueAllView.DisplayValue;

I wrote this method to a table that have LedgerDimension field.

Until next time.

Comment are closed.