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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

How can I get the total BOM cost for an item programmatically?

(0) ShareShare
ReportReport
Posted on by

I'm a newbie when it comes to the GP Manufacturing module, so I need some help :)

I have a user who wants to (via a SmartList, if possible) get a list of items with their BOM costs (i.e., the 'BOM Cost' field on the Bill of Materials View window).

You would think this would be stored in a table somewhere, but for the life of me I can't find it. Does GP calculate this every time the BOM View window is displayed? Is there a standard stored procedure I could use to come up with this number?

Thanks!

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Tim Foster Profile Picture
    8,515 on at

    GP does calculate it each time.  There are resources on the web to assist you.

    http://dynamicsgpblogster.blogspot.ca/2009/04/using-t-sql-and-recursive-cte-to.html

    http://msdynamicstips.com/2013/11/15/recursive-querying-in-sql-server/

    I wrote my own (non-recursive) SQL SPROC using a stack structure and looping.

    Tim

  • Suggested answer
    Redbeard Profile Picture
    12,931 on at

    You have correctly surmised the BOM Cost field in the Bill of Materials Entry/View Windows is a calculated field and not a value in a table. This is illustrated best when you click the "Recalculate BOM Cost" button to the right of the BOM Cost field in the BOM Entry window.

     When you click this button, The Standard Cost Maintenance Window is opened. The window will show the detail buckets of the Current Standard Cost, Pending Costs and allows for Standard Cost Overrides.

     When there is a Current Standard Cost, the Total in this column will be the value you see in the BOM Cost. If the Current Standard Cost is Zero, it does not matter if there is a Pending Standard Cost, the BOM Cost will still be $0.00

    So where do you get the data, and which data should you use, when putting together a SmartList? The easiest thing to do is link the Inventory Master or IV00101 table on the ITEMNMBR (I would suggest a Left Join), and return the STNDCOST field from this table.  You can also link the IC_IV_STANDARD or ICIV0323 table also on ITEMNMBR (again, a left join), and return the TOTALCOSTI_1 field.

    Here is a query to help you get started. I would suggest opening the BOM Entry or View Window, and scroll through the records and compare them to results of the query below to determine which field will work best for you. 

    -------------------------

    select

    'Manufacturing' 'Cost_Source',

    SCM.ITEMNMBR 'Item_ID',

    cast(SCM.TOTALCOSTI_1 as money) Current_Cost

    from ICIV0323 SCM

    Left join IV00101 IVI on IVI.ITEMNMBR = SCM.ITEMNMBR

    Union All

    select

    'Inventory' 'Cost_Source',

    SCID.ITEMNMBR 'Item_ID',

    cast(IVC.STNDCOST as Money) Current_Cost

    from CT00003 SCID

    Left  Join IV00101 IVC

    on SCID.ITEMNMBR = IVC.ITEMNMBR

    order by Item_ID,Cost_Source

    ------------------

  • Community Member Profile Picture
    on at

    Hmmm...when I click on the 'Recalculate BOM Cost' button in the Bill of Materials Entry window, nothing happens. And then, when I tried running your sample query, I found there's nothing in the ICIV0323 or CT00003 tables. What's that telling me??

  • Suggested answer
    Redbeard Profile Picture
    12,931 on at

    I wish I had better news.  Having no values in the ICIV0323 table is odd, unless you are using a test environment and/or haven't processed any transactions (purchases, receipts, etc.)- here is a link to a post that offers a solution, should this not be the case.

    Here is an excerpt from the post:

    If there is mismatching or missing information in CT00003, IV00101 and

    ICIV0323 you will need to rebuild costing table for the item(s).  

    msgroups.net/.../599453

    Rebuilding these tables will require assistance from Microsoft Technical Support.

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics GP (Archived)

#1
Community Member Profile Picture

Community Member 2

#2
mtabor Profile Picture

mtabor 1

#2
Victoria Yudin Profile Picture

Victoria Yudin 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans