on 08-31-2011 7:59 PM
Hola estimad@s: tengo la siguiente cuestion, se tiene que generar una alerta cuando realizamos una OV ( no manejan inventario permanente) por lo cual se tiene que generar la OC, pero resulta que se le olvida al usuario y su proveedor tiene como fecha de entrega 30 dias. es decir ya no va a cumplir esa OV lo cual le genera una Multa. lo cual se me ocurrio es para amarrar una OV con una OC es crear un campo de usuario a nivel detalle y poder enlazar aqui mi query y mi problema.
SELECT T0.[CardCode], T0.[CardName], T1.[ItemCode],T1.[Dscription],T1.[Quantity],DATEDIFF(d,T1.[DocDueDate],GetDate()) AS 'Dias de Atraso'
FROM
RDR1 INNER JOIN POR1 ON RDR1.U_match = POR1.U_match
ORDR INNER JOIN RDR1 ON ORDR.DocEntry = RDR1.DocEntry
WHERE T0.[DocDueDate] > getdate()
NOTA: ( El MRP duplica las OC al parecer es un bug version de SAP 8.8 PL 21)
de ante mano agradezo su apoyo.
se resuelve con el query que deje
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
perdon, esto ya lo habia solucionado pero no pude postearlo por cuestión de tiempo, pude ligar las OV con las OC con un campo de usuario a nivel linea que lo identificara, ese indentificador lo tome del DocNum para no errar. aqui les dejo el query si alguien algun dia lo ocupe
SELECT T0.[DocNum] AS 'Orden de Venta', T1.[DocNum] AS 'Orden de Compra', T1.[CardName] as 'Codigo Proveedor', T2.[ItemCode] AS 'Articulos', T2.[Quantity] AS 'Cantidad',T0.CardName AS 'Cliente', T3.[U_junction] as 'Union Compra', T2.[U_junction] AS 'Union Venta', T0.[DocDueDate]as 'Fecha de Entrega al Cliente',
T0.[DocDate]AS 'Creacion Pedido',DATEDIFF(d,T0.DocDueDate,GETDATE()) AS 'DIAS DE ATRASO',T2.LineTotal AS 'Subtotal'
FROM ORDR T0 INNER JOIN
RDR1 T2 ON T0.DocEntry = T2.DocEntry INNER JOIN
POR1 T3 ON T2.U_junction = T3.U_junction inner join
OPOR T1 ON T1.DocEntry = T3.DocEntry
WHERE T1.DocDueDate <= T0.DocDueDate and T0.DocStatus = 'O'
Edited by: Luis Miguel Perea López on Sep 21, 2011 7:05 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
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.