Changing Product Codes

davsch

New Member
I want to update the majority of our Product Codes.
I know I can do this:

for each item
where item.product-code = "OLDNAME":

update item.product-code = "NEWNAME".


But, I am not sure of all if the ramifications. If I simply do the above, will I be OK?
 

longhair

Member
davsch,
you need to look at the db schema for your version of Syteline. there may be a product-code field in other tables. you'd then have to check and see what it is populated with.
i would also suggest asking infor what tables are updated when you save / update the record manually.
regards,
longhair
 

davsch

New Member
Thanks longhair,

I did contact Infor and though they said they always recommend making changes through the system, but they did note that this was not an issue.

But you are right, there is a prodcode.product-code and item.product-code

Hmmm... More testing I guess.
 

panyawadee

New Member
Our SyteLine Verion is 6.01.00 and found the problem same as you. Our company has no time to change all product-code through the system. So we have to change it by programming

Don't forget to update account-code in Stockroom Location of each item based on new product-code.

/*update product-code*/
define variable NotEqual as logical no-undo.

for each symix.item no-lock use-index si-product
where item.product-code = "OLDNAME":

find first symix.distacct where distacct.product-code = "NEWNAME" no-lock no-error.
if not available distacct then next.

for each symix.itemloc where itemloc.item = item.item no-lock:
NotEqual = false.
if itemloc.inv-acct <> distacct.inv-acct
or itemloc.inv-acct-unit1 <> distacct.inv-acct-unit1
or itemloc.inv-acct-unit2 <> distacct.inv-acct-unit2
or itemloc.inv-acct-unit3 <> distacct.inv-acct-unit3
or itemloc.inv-acct-unit4 <> distacct.inv-acct-unit4
or itemloc.lbr-acct <> distacct.lbr-acct
or itemloc.lbr-acct-unit1 <> distacct.lbr-acct-unit1
or itemloc.lbr-acct-unit2 <> distacct.lbr-acct-unit2
or itemloc.lbr-acct-unit3 <> distacct.lbr-acct-unit3
or itemloc.lbr-acct-unit4 <> distacct.lbr-acct-unit4
or itemloc.fovhd-acct <> distacct.fovhd-acct
or itemloc.fovhd-acct-unit1 <> distacct.fovhd-acct-unit1
or itemloc.fovhd-acct-unit2 <> distacct.fovhd-acct-unit2
or itemloc.fovhd-acct-unit3 <> distacct.fovhd-acct-unit3
or itemloc.fovhd-acct-unit4 <> distacct.fovhd-acct-unit4
or itemloc.vovhd-acct <> distacct.Vovhd-acct
or itemloc.vovhd-acct-unit1 <> distacct.vovhd-acct-unit1
or itemloc.vovhd-acct-unit2 <> distacct.vovhd-acct-unit2
or itemloc.vovhd-acct-unit3 <> distacct.vovhd-acct-unit3
or itemloc.vovhd-acct-unit4 <> distacct.vovhd-acct-unit4
or itemloc.out-acct <> distacct.out-acct
or itemloc.out-acct-unit1 <> distacct.out-acct-unit1
or itemloc.out-acct-unit2 <> distacct.out-acct-unit2
or itemloc.out-acct-unit3 <> distacct.out-acct-unit3
or itemloc.out-acct-unit4 <> distacct.out-acct-unit4 then NotEqual = true.

end.
item.product-code = "NEWNAME".
end.


procedure update-acct-loc:
define input parameter in-item like symix.item.item no-undo.
define input parameter in-product-code like symix.item.product-code no-undo.

define buffer itemloc for symix.itemloc.
define buffer distacct for symix.distacct.

find first distacct where distacct.product-code = in-product-code no-lock no-error.
if not available distacct then return.

for each itemloc use-index si-item-loc-wc-whse where itemloc.item = in-item:
assign itemloc.inv-acct = distacct.inv-acct
itemloc.inv-acct-unit1 = distacct.inv-acct-unit1
itemloc.inv-acct-unit2 = distacct.inv-acct-unit2
itemloc.inv-acct-unit3 = distacct.inv-acct-unit3
itemloc.inv-acct-unit4 = distacct.inv-acct-unit4
itemloc.lbr-acct = distacct.lbr-acct
itemloc.lbr-acct-unit1 = distacct.lbr-acct-unit1
itemloc.lbr-acct-unit2 = distacct.lbr-acct-unit2
itemloc.lbr-acct-unit3 = distacct.lbr-acct-unit3
itemloc.lbr-acct-unit4 = distacct.lbr-acct-unit4
itemloc.fovhd-acct = distacct.fovhd-acct
itemloc.fovhd-acct-unit1 = distacct.fovhd-acct-unit1
itemloc.fovhd-acct-unit2 = distacct.fovhd-acct-unit2
itemloc.fovhd-acct-unit3 = distacct.fovhd-acct-unit3
itemloc.fovhd-acct-unit4 = distacct.fovhd-acct-unit4
itemloc.vovhd-acct = distacct.Vovhd-acct
itemloc.vovhd-acct-unit1 = distacct.vovhd-acct-unit1
itemloc.vovhd-acct-unit2 = distacct.vovhd-acct-unit2
itemloc.vovhd-acct-unit3 = distacct.vovhd-acct-unit3
itemloc.vovhd-acct-unit4 = distacct.vovhd-acct-unit4
itemloc.out-acct = distacct.out-acct
itemloc.out-acct-unit1 = distacct.out-acct-unit1
itemloc.out-acct-unit2 = distacct.out-acct-unit2
itemloc.out-acct-unit3 = distacct.out-acct-unit3
itemloc.out-acct-unit4 = distacct.out-acct-unit4.

end.

end procedure.


Hope it can help you.
 

davsch

New Member
Pany,

Thank you!

Fortunately this has been one of those projects that has not been rushed into implementation and it has not been completed yet. I will include this in the process.

Thanks again!
 
Top