web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

The stored procedure aagBuildBudgetTree returned error

(0) ShareShare
ReportReport
Posted on by 1,197

Hi all,

I am doing the AA Budget uploading in Microsoft Dynamics GP 10 SP5. In my environment we have multiple dimensions and dimension codes linked to it. I had created a new Budget ID with new Budget Tree and assigning the Dimension codes from first to last in a Dimension Code. When i am trying to assign all the codes in Assign Budget Tree codes window, I am getting a Primary key violation error for a temp table as subquery returned more than 1 value. Followed by the error "The stored procedure aagBuildBudgetTree returned error the following results: DBMS : 16917.

I took the profiler and got the query mentioned below:

insert into ##1022527(aaBudgetTreeID,aaTrxDimCodeID,    aaTrxDimParCodeID,aaCodeSequence,aaLevel,aaLvlCodeString,aaTrxDimCodeDescr1) 
(select 15,65745,0,3600,1,65745, AAG00401.aaTrxDimCodeDescr from  AAG00401 WHERE AAG00401.aaTrxDimCodeID =65745)

My understandings from the above query is, there is a where condition only on TrxDimcodeid without Dimid. In my case i have more than 1 results in aag00401 table with same dimcodeid value. So getting the errors and this is stopping me to assign Budget tree codes.

*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at
    Re: The stored procedure aagBuildBudgetTree returned error

    AAG00401 is the Analytical Code master table, it should have only one record per ID, make sure to remove unwanted record from the table.

  • Manjunath Vemula Profile Picture
    1,197 on at
    Re: The stored procedure aagBuildBudgetTree returned error

    As i have multiple dimensions and dimension codes, table contains the same dim codeid values but different dim id values. where as the budget SP is looking only for dimcode id value but not chekcing for dim id value also. I feel this is a system bug. Let me know if i am going wrong.

  • Community Member Profile Picture
    on at
    Re: The stored procedure aagBuildBudgetTree returned error

    I have a customer who is running with a scenario looks typical to yours with no issues during budget import, try to change the way you import the budget with simpler scenarios as it might help identifying the exact issue you have to be reported.

  • Verified answer
    Manjunath Vemula Profile Picture
    1,197 on at
    Re: The stored procedure aagBuildBudgetTree returned error

    I identified the exact issue. When i am trying to insert the dimension codes in Assign Budget Tree codes window. I am getting the errors. Because the same dimension code id value is there for multiple dimension code ID which are related to different dimension ID. I feel aagBuildBudgetTree SP needs to be updated to include Dimension ID in the where condition at line 60 (before executing   aagBuildBudgetTreeSubNodes stored procedure.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics GP (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans