Updated ABC codes in a BAQ

This is the code from the baq.

select
[PartWhse].[WarehouseCode] as [PartWhse_WarehouseCode],
[PartWhse].[Company] as [PartWhse_Company],
[PartWhse].[PartNum] as [PartWhse_PartNum],
[PartWhse].[ManualABC] as [PartWhse_ManualABC],
[PartWhse].[SystemAbc] as [PartWhse_SystemAbc],
[Warehse].[Plant] as [Warehse_Plant],
(sum(PartCost.AvgLaborCost+PartCost.AvgBurdenCost+PartCost.AvgMaterialCost+PartCost.AvgSubContCost)) as [Calculated_PartCosts],
[Part].[ClassID] as [Part_ClassID],
[Part].[Company] as [Part_Company]
from Erp.PartWhse as PartWhse
left outer join Erp.Warehse as Warehse on
PartWhse.Company = Warehse.Company
and PartWhse.KBWarehouseCode = Warehse.WarehouseCode
right outer join Erp.PartCost as PartCost on
PartCost.PartNum = PartWhse.PartNum
left outer join Erp.Part as Part on
PartWhse.Company = Part.Company
and PartWhse.PartNum = Part.PartNum
where (PartWhse.WarehouseCode = ‘FGA’ or PartWhse.WarehouseCode = ‘FG’ or PartWhse.WarehouseCode = ‘SKIN-C’ or PartWhse.WarehouseCode = ‘TOOL-IN’ or PartWhse.WarehouseCode = ‘DROP’ or PartWhse.WarehouseCode = ‘ASSEM’ or PartWhse.WarehouseCode = ‘C-FG’ or PartWhse.WarehouseCode = ‘CENTRAL’ or PartWhse.WarehouseCode = ‘CR’ or PartWhse.WarehouseCode = ‘HDW’ or PartWhse.WarehouseCode = ‘T-TLCRIB’ or PartWhse.WarehouseCode = ‘HYDRO’ or PartWhse.WarehouseCode = ‘SEALANT’ and PartWhse.OnHandQty > ‘0’)
group by [PartWhse].[WarehouseCode],
[PartWhse].[Company],
[PartWhse].[PartNum],
[PartWhse].[ManualABC],
[PartWhse].[SystemAbc],
[Warehse].[Plant],
[Part].[ClassID],
[Part].[Company]
having (sum(PartCost.AvgLaborCost+PartCost.AvgBurdenCost+PartCost.AvgMaterialCost+PartCost.AvgSubContCost)) > ‘500.00’

image

Any help would be appreciated.

Seems like you are returning results from all sites… but then you try to modify a record that belongs to a different site than your current session. Just filter to only show parts in the current site (plant).

You can link PartPlant and filter that way if needed.

I am still getting the error. I had to step away yesterday or I was going to throw my shoe at it. I will pick it up again shortly.

why is your site in the BAQ blank? Shouldn’t there be something in there?

image

interesting. I pulled a SQL query and it shows it is populated.

And so I am at this…

image

PartWhse does not contain a ‘plant’ table…

You can hard code that mapping if you only have one site. You can make a calculated field if you have to make it work with more than one.

Here’s an image of an unrelated query, but this is where you can set that.

That got me past the error code, thank you! Now I have to figure out why there is no results! haha