Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

Wrong dimension in WHSInventReserve causes incorrect "Total available" quantity for some products

Posted on by Microsoft Employee

Hello,

We have an issue that some products those are WHS enabled has some invalid "Total available" on on-hand inventory form (Product information management/Common/Released products/ on product-tab  Manage inventory->On-Hand inventory)

After some search and look at "WHSInventReserve" table  we have found, there is wrong "INVENTDIMID" according to "HIERARCHYLEVEL" 

Suppose that for the ItemId "8806088640150" and its variant with following query 

	 select ITEMID,cast ( AVAILPHYSICAL as numeric(18,0)) AVAILPHYSICAL,
	cast( AVAILORDERED as numeric(18,0)) AVAILORDERED,WHSInventReserve.INVENTDIMID,HIERARCHYLEVEL ,INVENTSERIALID,CONFIGID
	    from WHSInventReserve inner join INVENTDIM on WHSInventReserve.INVENTDIMID = INVENTDIM.INVENTDIMID and WHSInventReserve.DATAAREAID = INVENTDIM.DATAAREAID
		and WHSInventReserve.PARTITION = INVENTDIM.PARTITION
		where [HIERARCHYLEVEL] = 0  and  itemid = '8806088640150' and INVENTDIM.CONFIGID =N'همراه سروی'  and  INVENTDIM.INVENTCOLORID = '' and  INVENTDIM.INVENTSIZEID =''  and  INVENTDIM.INVENTSTYLEID = '' 

The result is as follows : 

ITEMID   	AVAILPHYSICAL	AVAILORDERED	INVENTDIMID	HIERARCHYLEVEL	INVENTSERIALID	CONFIGID
8806088640150	21	         44	         K1-002311	0	                	همراه سروی
8806088640150	1	         1	         K1-007538	0	        354021087839666	همراه سروی
 

I think "K1-007538" is wrong according to HIERARCHYLEVEL.

And aggregation of Inventsum for this ItemId and its variant is as follows :

	 select ITEMID ,sum(ONORDER),sum(AVAILORDERED),	CONFIGID	,INVENTSIZEID,	INVENTCOLORID,	INVENTSTYLEID	
			from dbo.INVENTSUM INNER JOIN
         dbo.INVENTDIM ON dbo.INVENTSUM.INVENTDIMID = dbo.INVENTDIM.INVENTDIMID AND dbo.INVENTDIM.DATAAREAID = dbo.INVENTSUM.DATAAREAID AND dbo.INVENTDIM.PARTITION = dbo.INVENTSUM.PARTITION
			where ITEMID ='8806088640150' and INVENTDIM.CONFIGID =N'همراه سروی'  and  INVENTDIM.INVENTCOLORID = '' and  INVENTDIM.INVENTSIZEID =''  and  INVENTDIM.INVENTSTYLEID = ''
		 GROUP BY dbo.INVENTSUM.ITEMID, dbo.INVENTDIM.CONFIGID, dbo.INVENTDIM.INVENTSIZEID, dbo.INVENTDIM.INVENTCOLORID, dbo.INVENTDIM.INVENTSTYLEID, dbo.INVENTSUM.DATAAREAID, dbo.INVENTSUM.PARTITION


ITEMID	       ONORDER	AVAILORDERED	CONFIGID	INVENTSIZEID	INVENTCOLORID	INVENTSTYLEID
8806088640150	44	1	        همراه سروی			


And according to xpp code "Total available" is  (AggregatedWHSInventReserve.AVAILORDERED - AggregatedInventsum.OnOrder), so that according to current code of AX it is "44-44 =0 " but it wrong, when i subtract number of Qty in purchase order from Sales order plus none posted retail transaction it must be 1 and we can get the desire result when i sum of all hierarchy level 0 from WHSInventReserve(44+1) and then subtract from "Aggregated Inventsum On-order" that is (45-44 = 1).

We have found such wrong dimension for almost 17 products.

How to solve this issue?

Thanks

*This post is locked for comments

  • venkateswarrao v Profile Picture
    venkateswarrao v 360 on at
    RE: Wrong dimension in WHSInventReserve causes incorrect "Total available" quantity for some products

    Could you pls confirm, is this issue resolved?

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,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans