on 12-30-2015 6:41 PM
Muy buen día apreciados Consultores
Me están solicitando el Siguiente informe: en el proceso de Compras
Sap me muestra un comparativos de ofertas abiertas y el me dice de acuerdo a la cantidad de ofertas
en cuales están los mejores Precios por artículos
Ahora el Solicitante pide que de las ofertas que se Hicieron
le personalice un Informe consolidado "en un solo documento"
Donde se le presenten todos los artículos con menores precios de acuerdo a esa solicitud
empece haciendo pero esas tablas no se relacionan en nada
--Tablas proceso de Compras
OPRQ = SOLICITUD DE COMPRA
OPQT = OFERTA DE COMPRA
OPOR = PEDIDO DE CLIENTE
De antemano quedo atento a sus amables indicaciones
desde villavicencio Colombia
Ariel Plata
Compañeros les cuento que ya encontre la consulta sql
ahora solo me falta pintarla en Cristal Reports y listo
Papita para Loro
SELECT T0.[ItemCode], T0.[Dscription], T1.[CardCode], T1.[CardName], T1.[DocNum], T1.[PQTGrpNum], T0.[PriceBefDi],
T0.[PQTReqDate], T0.[ShipDate], T0.[PQTReqQty], T0.[Quantity], T0.[LineTotal], T0.[LineStatus], T0.[DocEntry],
T0.[LineNum], T0.[Currency], T0.[PriceBefDi], T0.[Rate], T0.[TargetType], T0.[TrgetEntry], T5.[DocNum], T2.[LineTotal],
T3.[LineTotal], T4.[LineTotal], T0.[PriceBefDi], T0.[Length1], T0.[Len1Unit], T0.[length2], T0.[Len2Unit], T0.[Width1],
T0.[Wdth1Unit], T0.[Width2], T0.[Wdth2Unit], T0.[Height1], T0.[Hght1Unit], T0.[Height2], T0.[Hght2Unit], T0.[Volume],
T0.[VolUnit], T0.[Weight1], T0.[Wght1Unit], T0.[Weight2], T0.[Wght2Unit], T1.[PQTGrpSer], T0.[OpenQty], T0.[Dscription],
T6.[FormatCode], T6.[AcctName], T6.[AcctCode], T0.[OpenSum], T0.[OpenSumFC], T1.[DocCur], T0.[TotalFrgn], T5.[DocNum],
T0.[OpenQty], T7.[U_BPCO_RTC], T7.[U_BPCO_TDC], T7.[U_BPCO_CS], T7.[U_BPCO_City], T7.[U_BPCO_TP], T7.[U_BPCO_Nombre],
T7.[U_BPCO_1Apellido], T7.[U_BPCO_2Apellido], T7.[U_BPCO_BPExt], T7.[U_BPCO_TBPE], T7.[U_BPCO_Address], T7.[U_Manejo],
T7.[U_EsAutorret], T7.[U_OK1_AC_ECO], T7.[U_HBT_AutRet], T7.[U_HBT_RegTrib], T7.[U_HBT_TipDoc], T7.[U_HBT_MunMed],
T7.[U_HBT_TipEnt], T7.[U_HBT_Nombres], T7.[U_HBT_Apellido1], T7.[U_HBT_Apellido2], T7.[U_HBT_Nacional], T7.[U_HBT_TipExt],
T7.[U_HBT_ActEco], T1.[U_KitNo], T1.[U_WUID], T1.[U_BPCOST], T1.[U_Objeto_contrato], T1.[U_TipoNota], T1.[U_IVCDone],
T1.[U_Autorret], T1.[U_Retefue], T1.[U_ReteIca], T1.[U_OK1_IFRS], T1.[U_DocEntryLeg], T1.[U_idLineLeg], T1.[U_serieLeg],
T1.[U_CatRet], T1.[U_EsIndep], T1.[U_CON_CONSEC], T1.[U_HBT_Tercero], T1.[U_HBT_Maquina], T1.[U_HBT_AutRet], T1.[U_HBT_AreVal],
T1.[U_HBT_Independ], T1.[U_HBT_AjusteCartera], T0.[U_IVCDone], T0.[U_HBT_DocEntryCap]
FROM [dbo].[PQT1] T0
INNER JOIN [dbo].[OPQT] T1 ON T1.[DocEntry] = T0.[DocEntry]
LEFT OUTER JOIN [dbo].[PQT2] T2 ON T2.[DocEntry] = T0.[DocEntry] AND T2.[LineNum] = T0.[LineNum]
AND T2.[GroupNum] = 0
LEFT OUTER JOIN [dbo].[PQT2] T3 ON T3.[DocEntry] = T0.[DocEntry] AND T3.[LineNum] = T0.[LineNum]
AND T3.[GroupNum] = 1
LEFT OUTER JOIN [dbo].[PQT2] T4 ON T4.[DocEntry] = T0.[DocEntry] AND T4.[LineNum] = T0.[LineNum] AND T4.[GroupNum] = 2
LEFT OUTER JOIN [dbo].[OPOR] T5 ON T5.[DocEntry] = T0.[TrgetEntry] AND T0.[TargetType] = 22
LEFT OUTER JOIN [dbo].[OACT] T6 ON T6.[AcctCode] = T0.[AcctCode]
LEFT OUTER JOIN [dbo].[OCRD] T7 ON T7.[CardCode] = T1.[CardCode]
INNER JOIN [dbo].[OITM] T8 ON T8.[ItemCode] = T0.[ItemCode]
WHERE T1.[DocStatus] = 'O'
order by 1
un Saludo desde villavicencio Colombia
Ariel plata
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
107 | |
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.