Sales Order Entry On Hand Quantity

i have a BPM code which works to some degree. The only problem is that the stage bin from the last part is being subtracted from every part on hand quantity. Can someone give me a hand with this code? i need the stage bin quantity subtracted from the parwhse qty of each part number.

define var stageohqty as integer.
define var ohqty as integer.
define var totalohqty as integer.

for each ttOrderDtl no-lock, each OrderRel no-lock where ttOrderDtl.Company = OrderRel.Company AND ttOrderDtl.OrderNum = OrderRel.OrderNum:

find partbin where partbin.PartNum = orderrel.PartNum and partbin.WarehouseCode = orderrel.WarehouseCode and partbin.BinNum = 'Stage'.
if avail partbin then do:
stageohqty = partbin.OnhandQty.
end.
end.

for each ttOrderDtl no-lock, each OrderRel no-lock where ttOrderDtl.Company = OrderRel.Company AND ttOrderDtl.OrderNum = OrderRel.OrderNum:
find partwhse where partwhse.PartNum = orderrel.PartNum and partwhse.WarehouseCode = orderrel.WarehouseCode.
if avail partwhse then do:
totalohqty = partwhse.OnHandQty.
ohqty = totalohqty - stageohqty.
run lib\updatetablebuffer.p(input BUFFER Orderrel:HANDLE, 'number10', ohqty).
end.
end.




--- In vantage@yahoogroups.com, "neverunmacron" <neverunmacron@...> wrote:
>
> Thanks Amelie.
>
> What about a calculated field. We have a stage bin and the palnt on hand qty minus this stage bin is our actual available qty.
>
> Jose
>
> --- In vantage@yahoogroups.com, Amélie Pelletier <amelie.pelletier@> wrote:
> >
> > I would really create three new fields, epibinded on the onhandqty by plant
> > you need, you could always make the fields you don't want to be hidden.
> >
> >
> >
> > *Amélie Pelletier*
> >
> > *Analyste Programmeur / Program analyst*
> >
> > * *
> >
> > [image: cid:image001.jpg@]
> >
> > * *
> >
> > *230, Boulevard Nilus-Leclerc*
> >
> > *L'Islet, Québec (Canada)*
> >
> > *G0R 2C0*
> >
> > *Téléphone: 418-247-3986 ext. 2390*
> >
> > *Fax: 418-247-7925*
> >
> > *amelie.pelletier@ <brigitte.savoie@>*
> >
> > *P** *Est-ce nécessaire d'imprimer ce message?
> > *Please consider the environment before printing this email**.*
> >
> >
> > [Non-text portions of this message have been removed]
> >
>
Good Morning,
I am in Vantage 8.03.409C and in Sales Order Entry under the release tab , there a re a couple of fields with the on hand quantity part. the only problem is that that is the on hand quantity of the entire company (We have multiple plants). I am trying to see whats the best way to customize three fields to give me each plants on hand quantity. Through a BPM?

Jose
I would really create three new fields, epibinded on the onhandqty by plant
you need, you could always make the fields you don�t want to be hidden.



*Am�lie Pelletier*

*Analyste Programmeur / Program analyst*

* *

[image: cid:image001.jpg@01CD5525.2091A820]

* *

*230, Boulevard Nilus-Leclerc*

*L'Islet, Qu�bec (Canada)*

*G0R 2C0*

*T�l�phone: 418-247-3986 ext. 2390*

*Fax: 418-247-7925*

*amelie.pelletier@... <brigitte.savoie@...>*

*P** *Est-ce n�cessaire d�imprimer ce message?
*Please consider the environment before printing this email**.*


[Non-text portions of this message have been removed]
Thanks Amelie.

What about a calculated field. We have a stage bin and the palnt on hand qty minus this stage bin is our actual available qty.

Jose

--- In vantage@yahoogroups.com, Amélie Pelletier <amelie.pelletier@...> wrote:
>
> I would really create three new fields, epibinded on the onhandqty by plant
> you need, you could always make the fields you don't want to be hidden.
>
>
>
> *Amélie Pelletier*
>
> *Analyste Programmeur / Program analyst*
>
> * *
>
> [image: cid:image001.jpg@...]
>
> * *
>
> *230, Boulevard Nilus-Leclerc*
>
> *L'Islet, Québec (Canada)*
>
> *G0R 2C0*
>
> *Téléphone: 418-247-3986 ext. 2390*
>
> *Fax: 418-247-7925*
>
> *amelie.pelletier@... <brigitte.savoie@...>*
>
> *P** *Est-ce nécessaire d'imprimer ce message?
> *Please consider the environment before printing this email**.*
>
>
> [Non-text portions of this message have been removed]
>