Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics GP (Archived)

The stored procedure aagBuildBudgetTree returned error

Posted on by 1,195

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

  • Verified answer
    Manjunath Vemula Profile Picture
    Manjunath Vemula 1,195 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.

  • Community Member Profile Picture
    Community Member Microsoft Employee 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.

  • Manjunath Vemula Profile Picture
    Manjunath Vemula 1,195 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
    Community Member Microsoft Employee 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.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans