on 05-10-2012 12:03 AM
Hola amigos, pues soy nuevo en esto de SAP B1, pues tengo una duda, espero puedan ayudarme, necesito saber si existe una tabla que contenga el historial de las ventas diarias de todos los productos, sin importar en la forma que hayan sido vendidos, solo me interesa saber el dia, el subtotal y el total, me interesa que no sean ventas canceladas y basicamente eso, si puedieran ayudarme con esto se los agradeceria bastante.
Saludos.
Hola, puedes obtener la información sacando los datos de las líneas de albaranes de venta (DLN1) y de las líneas de facturas de venta (INV1). En las líneas tienes artículo, precio, cantidad...
Tendrás que tener en cuenta todas las facturas no canceladas y sólo aquellos albaranes que estén abiertos (que no estén cancelados ni cerrados - derivados en factura-).
Si quieres obtener más información (cliente, comentarios del documento...) relaciona ambas con sus cabeceras (ODLN y OINV)
Un saludo, Borja.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hola.
¿Ya intentaste con el Informe Análisis de ventas?. Este informe muestra las ventas netas por cliente, o artículo o vendedor, en el rango de fechas que que se desee.
Si quieres construir un query, debes usar las tablas:
- OINV e INV1 para facturas y Notas Débito.
- ORIN y RIN1 para Notas Crédito.
Mira estos otros posts:
- QUERY PARA VENTAS POR PRODUCTO
Saludos cordiales.
Hola, Gracias por responder, basandome en uno de los temas que colocaste puede obtener algo, pero esta agrupado por productos, y necesito que no este agrupado, que esten todas las ventas visibles, trate de quitarle el group by. pero me marca error. les dejo la consulta haber si me pueden ayudar,
SELECT T6.ItmsGrpCod, T6.ItmsGrpNam, SUM(T4.Quantity) , SUM((T4.Gtotal - T4.vatSum))
FROM OINV T0
INNER JOIN INV1 T4 ON T4.DocEntry = T0.DocEntry
INNER JOIN OITM T5 ON T5.Itemcode = T4.itemCode
INNER JOIN OITB T6 ON T6.ItmsGrpCod = T5.ItmsGrpCod
WHERE T0.DocType = 'I' AND T0.CANCELED ='N'
GROUP BY T6.ItmsGrpCod, T6.ItmsGrpNam
UNION
SELECT T6.ItmsGrpCod, T6.ItmsGrpNam, SUM(T4.Quantity) , SUM((T4.Gtotal - T4.vatSum))
FROM ORIN T0
INNER JOIN RIN1 T4 ON T4.DocEntry = T0.DocEntry
INNER JOIN OITM T5 ON T5.Itemcode = T4.itemCode
INNER JOIN OITB T6 ON T6.ItmsGrpCod = T5.ItmsGrpCod
WHERE T0.DocType = 'I' AND T0.CANCELED ='N'
GROUP BY T6.ItmsGrpCod, T6.ItmsGrpNam
Y no entiendo porque usan las tablas OITM y OITB, perdon por tanta pregunta, pero yo no tengo acceso al programa, porque "no formo parte del proceso", entonces no tengo acceso a sap, pero mi jefe quiere que le haga consultas, ustedes entenderan.
Gracias.
Hola.
Quedaría así:
SELECT T6.ItmsGrpCod, T6.ItmsGrpNam, T4.Quantity, (T4.Gtotal - T4.vatSum)
FROM OINV T0
INNER JOIN INV1 T4 ON T4.DocEntry = T0.DocEntry
INNER JOIN OITM T5 ON T5.Itemcode = T4.itemCode
INNER JOIN OITB T6 ON T6.ItmsGrpCod = T5.ItmsGrpCod
WHERE T0.DocType = 'I' AND T0.CANCELED ='N' AND T0.DocDate BETWEEN '[%0]' AND '[%1]'
UNION ALL
SELECT T6.ItmsGrpCod, T6.ItmsGrpNam, T4.Quantity , (T4.Gtotal - T4.vatSum)
FROM ORIN T0
INNER JOIN RIN1 T4 ON T4.DocEntry = T0.DocEntry
INNER JOIN OITM T5 ON T5.Itemcode = T4.itemCode
INNER JOIN OITB T6 ON T6.ItmsGrpCod = T5.ItmsGrpCod
WHERE T0.DocType = 'I' AND T0.CANCELED ='N' AND T0.DocDate BETWEEN '[%0]' AND '[%1]'
Saludos.
SELECT T4.ItemCode, T4.price, T0.Docdate, T4.Quantity, (T4.Gtotal - T4.vatSum)
FROM OINV T0
INNER JOIN INV1 T4 ON T4.DocEntry = T0.DocEntry
WHERE T0.DocType = 'I' AND T0.CANCELED ='N' AND T0.DocDate BETWEEN '2012-01-01' AND '2012-12-31'
UNION ALL
SELECT T4.ItemCode, T4.Price, T0.docdate, T4.Quantity , (T4.Gtotal - T4.vatSum)
FROM ORIN T0
INNER JOIN RIN1 T4 ON T4.DocEntry = T0.DocEntry
WHERE T0.DocType = 'I' AND T0.CANCELED ='N' AND T0.DocDate BETWEEN '2012-01-01' AND '2012-12-31'
Creo ya pude , corrigeme porfavor si me equivoco...
User | Count |
---|---|
89 | |
7 | |
7 | |
4 | |
4 | |
3 | |
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.