please help me to join below views?what is the field that can we use for join?
&AO.inventory_part_in_stock
&AO.INVENTORY_PART_PLANNING
Requirement is need to get safety stock with on handy quantity.
please help me to join below views?what is the field that can we use for join?
&AO.inventory_part_in_stock
&AO.INVENTORY_PART_PLANNING
Requirement is need to get safety stock with on handy quantity.
Best answer by JasonB1098
I’m assuming you want to sort by your site (maybe you only have 1 site, but many others have multiple), so I added that along with some other useful pieces of information that I would consider using from IPIS:
select
i.contract
,i.part_no
,nvl(s.qty_on_hand, 0) as QTY_ONHAND
,nvl(s.qty_res, 0) as QTY_RESERVED
,nvl(s.qty_transit, 0) as QTY_IN_TRANSIT
,p.safety_stock
,i.unit_meas
from inventory_part i
left join inventory_part_planning p on i.part_no=p.part_no and i.contract=p.contract
left join (
select
contract
,part_no
,sum(qty_onhand) as QTY_ON_HAND
,sum(qty_reserved) as QTY_RES
,sum(qty_in_transit) as QTY_TRANSIT
from inventory_part_in_stock_uiv
group by contract, part_no
) s on i.part_no=s.part_no and i.contract=s.contract
where i.part_status='A'--depending how you use Part Status in your Inv Part record
order by 2
I just wrote this as if I were going to use it. I don’t currently use something like this but I can see now where it could be helpful.
see if that helps you out at all.
-jason
** i don’t know if I like the way the code insert function formats this so here’s the code like I wrote it:
select
i.contract
,i.part_no
,nvl(s.qty_on_hand, 0) as QTY_ONHAND
,nvl(s.qty_res, 0) as QTY_RESERVED
,nvl(s.qty_transit, 0) as QTY_IN_TRANSIT
,p.safety_stock
,i.unit_meas
from inventory_part i
left join inventory_part_planning p on i.part_no=p.part_no and i.contract=p.contract
left join (
select
contract
,part_no
,sum(qty_onhand) as QTY_ON_HAND
,sum(qty_reserved) as QTY_RES
,sum(qty_in_transit) as QTY_TRANSIT
from inventory_part_in_stock_uiv
group by contract, part_no
) s on i.part_no=s.part_no and i.contract=s.contract
where i.part_status='A' -- depending how you use Part Status in your Inv Part record
order by 2
** you can always comment out the WHERE clause if you don’t have any conditions **
May be easier to cut and paste and try….
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.