Cancel
Showing results for 
Search instead for 
Did you mean: 

Remove Item from all BOMs referenced

Creator
Creator

Looking for a quick repeatable method remove an identified Item from All BOMS it is associated with. We have a lot of parts where the UOM and QTY are incorrect, but to correct them they need to be removed from all BOM's, and some items may exist in hundreds of BOMs, so opening each one is not practical.

8 REPLIES

Re: Remove Item from all BOMs referenced

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom
Changing the structure of 100's of BOMS without knowing the impact isn't practical either. Thankfully, a tool like this does not exist ootb. You'll have to write your own tool using ITK.

Maybe change your perspective and think about fixing the UOM/QTY for the existing psoccurrences instead of removing them from their structures?

Randy Ellsworth, Teamcenter Architect, Applied CAx, LLC
NX 11 | SW 2016 | Creo 4 | TcUA 11.4
Evaluating: AW 3.4

Re: Remove Item from all BOMs referenced

Creator
Creator

To my knowledge, you cannot fix the UOM\QTY of an item if it exists in a BOM already, or have I misread?

Re: Remove Item from all BOMs referenced

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom
You cannot fix UOM directly in the application once the Item has been used or revised. Depending on your use-case, you can likely fix it directly with SQL by changing the UOM tag applied to the Item which will fix it in all of your BOMs at once. QTY is a different subject as I've never had to change QTY in SQL (mass quantity changes are what Temps are for).

Randy Ellsworth, Teamcenter Architect, Applied CAx, LLC
NX 11 | SW 2016 | Creo 4 | TcUA 11.4
Evaluating: AW 3.4

Re: Remove Item from all BOMs referenced

Genius
Genius

There is an uom value that can be set at BOMLine level (which I assume will override the child Item's UoM). Have you considered/explored this?

 

Re: Remove Item from all BOMs referenced

Creator
Creator

Qty looks to be updated in a similar vein. Just to sanity check what I intend on doing.

I am selecting puid from PITEM, where pitem_id ="My Item Number"

from here I update ruom_tagu and ruom_tagc with data (puid) from PUNITOFMEASURE

Also updating both ruom_tagu and ruom_tagc against all rows of PPSOCCURRENCE where the rchild_itemu is the puid number from initial PITEM lookup. The Qty looks to be also in the PPSOCCURRENCE table.

I'm hoping this makes sense.

Re: Remove Item from all BOMs referenced

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom

Excellent. You only need update ruom_tagu:

! Get old UOM for validation
SELECT RUOM_TAGU FROM dbo.PITEM WHERE PITEM_ID = 'C-12345';
QPHBsnnp1kBOfB

! Query PUNITOFMEASURE. The old UOM (QPHBsnnp1kBOfB) is EA. The new UOM (w8$4M7$O1kBOfB) is FT.
SELECT * FROM PUNITOFMEASURE;
w8$4M7v_1kBOfB  SF       Square Feet
w8$4M7$O1kBOfB  FT       Feet
w8$4M7$a1kBOfB  SH       Sheet
w8$4M7$m1kBOfB  LY       Linear Yards
gv288Fyi1kBOfB  PS       Process Spec
ANCBcZub1kBOfB  ML       Milliliter
QPHBsnnp1kBOfB  EA       Each
gqDFq2e51kBOfB  QT       Quart
gqGFq2e51kBOfB  PT       Pint
gqJFq2e51kBOfB  GA       Gallon

! Change the UOM.
UPDATE dbo.PITEM SET RUOM_TAGU = 'w8$4M7$O1kBOfB' WHERE PITEM_ID = 'C-12345';

! To set RUOM_TAGU to NULL use 'AAAAAAAAAAAAAA';
UPDATE dbo.PITEM SET RUOM_TAGU = 'AAAAAAAAAAAAAA' WHERE PITEM_ID = 'C-12345';
COMMIT;

All the usual warnings apply. This sql is from a much older implementation so use your own due dilligence.

 


Randy Ellsworth, Teamcenter Architect, Applied CAx, LLC
NX 11 | SW 2016 | Creo 4 | TcUA 11.4
Evaluating: AW 3.4

Re: Remove Item from all BOMs referenced

Pioneer
Pioneer

In order to correct UOM, you need not to remove it from ALL BOMs.

UI does not allow you to modify UOM if item already exists in some BOM or released.

 

However, you can consider using POM calls to update UOM on item and all its existing PSOccurrences.

 

There is a sample code provided by GTAC, you can refer it to get some idea

 

https://solutions.industrysoftware.automation.siemens.com/view.php?q=%22modify+unit+of+measure+of+it...

 

Re: Remove Item from all BOMs referenced

Creator
Creator

After playing with our Dev servers, this seems to be the best outcome

 

UPDATE dbo.PITEM
SET ruom_tagu = 'UNIT OF MEASURE PUID', ruom_tagc='CHECK YOUR DB'
WHERE pitem_id = 'YOUR ITEM ID'

UPDATE dbo.PPSOCCURRENCE
SET ruom_tagu = 'UNIT OF MEASURE PUID', ruom_tagc = 'CHECK YOUR DB'
WHERE PPSOCCURRENCE.rchild_itemu = (select puid from PITEM where pitem_id='YOUR ITEM ID')

 

You can also update the dbo.PPSOCCURRENCE.pqty_value, but you need to ensure you are using BOM Sync, and ensure you have the right qty set against each BOM it belongs to in PPSOCCURRENCE, but that is for another day.