on 08-06-2015 2:18 AM
Estimados, podrían ayudarme con un query que me de el resultado del siguiente reporte:
ITEM | ALMACEN | FECHA ULTIMO INGRESO AL ALMACEN | STOCK |
---|---|---|---|
Desde ya muchas gracias.
Así quedó el query :
--PRUEBAS CON OINM
SELECT T0.ItemCode CODIGO,I.Itemname NOMBRE,T0.warehouse ALMACEN,
CONVERT(char(10),MAX(T0.CreateDate),103) as 'ULT. INGRESO',
STOCK=SUM(INQTY)-SUM(OUTQTY)
FROM oinm T0
LEFT JOIN OITM I ON T0.ITEMCODE = I.ITEMCODE
LEFT JOIN OITB E ON I.ItmsGrpCod=E.ItmsGrpCod
WHERE T0.WAREHOUSE='107' AND I.FrozenFor='N' AND I.ManbtchNum='N' AND T0.Warehouse='107'
group by T0.ItemCode,I.Itemname, T0.warehouse
HAVING (SUM(INQTY)-SUM(OUTQTY) >0)
order by MAX(t0.Createdate) ASC
Gracias por la ayuda.
Saludos.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Gracias Gerardo, Gracias Boris.
Probaré con OINM ya que aún tenemos la versión 2007 de SAP BO.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hola Emilio.
Como dice Boris, con una consulta a la tabla del historial del almacén es suficiente aunque recomiendo que se haga a la OIVL y su detalle IVL1 ya que hasta donde tengo entendido la OINM ha quedado atrás, se sigue alimentando pero la mandatoria es OIVL y su detalle.
Prueba con una consulta como la siguiente:
SELECT T0.ItemCode, T0.LocCode, MAX(T0.CreateDate), (Select TA.OnHand FROM OITM TA Where TA.ItemCode = T0.ItemCode) FROM OIVL T0 group by T0.ItemCode, T0.LocCode order by MAX(Createdate) DESC
En espera de tus comentarios, saludos.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hola,
realiza una consulta a la tabla OINM que es la que almacena todos los movimientos x articulo y bodega(Diario del Almacén).
Saludos.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
106 | |
12 | |
11 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.