shrikantc
12th April 2003, 09:27
We are using Baan4C4 on Solaris.
Dtabase is tbase6.1

I would like to write a script which will replace the field purchase price i.e. prip from table tiitm001 (item data). with some formula.
like prip * 1.1.


I had not written any script till today. But for this particular requirement I need to write some code and do the this job as early as possible this is required for Item stock valuation.

Shrikant

mohan05
12th April 2003, 10:30
Dear Shrikant,

you can use this script -

db.retry.point()
select tiitm001.item, tiitm001.prip
from tiitm001 for update
where tiitm001._index1 between :item.f and :item.t
order by tiitm001._index1
selectdo
tiitm001.prip = tiitm001.prip + (tiitm001.prip * 1.1)

update.db(ttiitm001, db.retry)
commit.transaction()
endselect

Hope this will help you. But you try this in test VRC first and confirm whether you really want to update tiitm001 or other.

-Mohan

Originally posted by shrikantc
We are using Baan4C4 on Solaris.
Dtabase is tbase6.1

I would like to write a script which will replace the field purchase price i.e. prip from table tiitm001 (item data). with some formula.
like prip * 1.1.


I had not written any script till today. But for this particular requirement I need to write some code and do the this job as early as possible this is required for Item stock valuation.

Shrikant

tools123
12th April 2003, 15:16
If your requirement is a one time valuation based on the multiplier and the end result required is just an idea of value with
a new prip, you are better off reading prip and multiplying in the script to get at your report.YOU MAY NOT NEED TO UPDATE THE TABLE.

All the 4 fields prip, avpr, copr, and the last purchase price are critical to standard cost update (based on how standard cost is updated) and caution is advised before you make a blanket update with a multiplier like that.

ahulikavi
14th April 2003, 06:28
Hi,

Why not use session tdpur0201m000 "Global Update of Purchase Prices and Discounts", This session gives you functionality to effect changes as desired by you using either a % increase or a value increase over existing prices.

Caution given by tools123 remains !!

shrikantc
16th April 2003, 07:28
thanks for script mohan05,

But currently I had done in following way.

Actually this was required to calculate Standard Cost price the priority set for the calculation was pp lp (i.e. purchase price

So I had exported the data using exchange scheme | separetor
then save this data in Excel. (Only Purchased Items)

Read the same file using VB applied the suggested formula by A/c's dept. Created | separeted file using VB and imported the data into baan.

I had done excercise in test company and now I will apply the same into live company, while doing the same no one will work in that company.

Thanks once again

Shrikant