SAP for Consumer Products Discussions
Share ideas and solve challenges on branding, personalization, and supply chain optimization with fellow SAP users in consumer products. Join a discussion.
cancel
Showing results for 
Search instead for 
Did you mean: 

Query con lotes y maquina

echiluiza
Member
0 Kudos
223

Podrían ayudarme, necesito un query donde me visualice lo siguiente
GuiaRemision | Codigo_Prod | Producto | numero de lote | Maquina

hasta el numero de lote ya tengo la consulta, pero necesito se me visualice la maquina en la que se realizo ese producto, si me pueden ayudar con ese dato.

SELECT DISTINCT
T5."DocNum" AS "Guia_Remision",
T5."DocDate" AS "Fecha_Remision",
T3."ItemCode" AS "Codigo_Producto",
T3."Dscription" AS "Detalle_Producto",
T2."DistNumber" AS "Numero_Lote",
T2."InDate",
--T8."WhsCode",

CASE
WHEN MAX(T4."U_ProcesoProductivo") = '01' THEN 'EXTRUSION'
WHEN MAX(T4."U_ProcesoProductivo") = '02' THEN 'SELLADO'
WHEN MAX(T4."U_ProcesoProductivo") = '03' THEN 'SOPLADO CONVENCIONAL'
WHEN MAX(T4."U_ProcesoProductivo") = '04' THEN 'INYECCION CONVENCIONAL'
WHEN MAX(T4."U_ProcesoProductivo") = '05' THEN 'INYECCION PET'
WHEN MAX(T4."U_ProcesoProductivo") = '06' THEN 'SOPLADO PET'
WHEN MAX(T4."U_ProcesoProductivo") = '07' THEN 'INYECTO SOPLADO'
WHEN MAX(T4."U_ProcesoProductivo") = '08' THEN 'MATERIAL SEGUNDA'
WHEN MAX(T4."U_ProcesoProductivo") = '09' THEN 'SERVICIOS CYREL'
WHEN MAX(T4."U_ProcesoProductivo") = '10' THEN 'DESCUENTO VENTAS'
WHEN MAX(T4."U_ProcesoProductivo") = '11' THEN 'SERVICIO FAJILLADO'
WHEN MAX(T4."U_ProcesoProductivo") = '12' THEN 'SERVICIO FABRIMOLDES'
WHEN MAX(T4."U_ProcesoProductivo") = '13' THEN 'SERVICIO ARRIENDO'
WHEN MAX(T4."U_ProcesoProductivo") = '14' THEN 'OTROS SERVICIOS'
END AS Proceso,
T6."ItemCode",
T7."Dscription" AS "Nombre_Maquina"
FROM "ITL1" T0
INNER JOIN "OITL" T1 ON T0."LogEntry" = T1."LogEntry"
INNER JOIN "OBTN" T2 ON T0."ItemCode" = T2."ItemCode" AND T2."AbsEntry" = T0."MdAbsEntry"
INNER JOIN "DLN1" T3 ON T1."DocEntry" = T3."DocEntry" AND T1."DocLine" = T3."LineNum"
INNER JOIN "OITM" T4 ON T3."ItemCode" = T4."ItemCode"
INNER JOIN "ODLN" T5 ON T3."DocEntry" = T5."DocEntry"
INNER JOIN "WOR1" T6 ON T3."DocEntry" = T6."DocEntry"
INNER JOIN "IGE1" T7 ON T3."DocEntry" = T7."BaseEntry"
--INNER JOIN "RBTN" T8 ON T2."DocEntry" = T8."BaseEntry"

GROUP BY
T5."DocNum",
T5."DocDate",
T3."ItemCode",
T3."Dscription",
T2."DistNumber",
T2."InDate",
--T8."WhsCode",
T6."ItemCode",
T7."Dscription"

ORDER BY T5."DocDate" ASC

0 REPLIES 0