create or replace package body  PAG_WIPBYPRODUCT     
 is    
procedure pro_WIPByProduct(varWorkDate in varchar2,getDataCur in out myCursor) as     
str varchar2(250); 
opSeq1 number:=0224;
opSeq2 number:=0225;
opSeq3 number:=0226;
opSeq4 number:=0227;        
begin          
open getDataCur for select line,product,sum(decode(StdOpCode,opSeq1,TtlInQty,0)) as "opSeq1",sum(decode(StdOpCode,opSeq2,TtlInQty,0)) opSeq2,sum(decode(StdOpCode,opSeq3,TtlInQty,0)) opSeq3,sum(decode(StdOpCode,opSeq4,TtlInQty,0)) opSeq4 from tActWipSrc1 group by line,product;     
     
end pro_WIPByProduct;  
---------------------------------------------------
LINE PRODUCT         opSeq1 OPSEQ2   OPSEQ3   OPSEQ4    
2 LLATHFBR-1402 3496 0 0 0
2 LLATHFBR-1404 0 0 0 0
2 LLATHFBR-1414 7616 1200 1200 1200
2 LLATHFBR-1424 0 0 0 0
2 LLATHFBR-14E4 0 0 0 0
2 LLATHFBR-2402 0 0 0 0
2 LLATHFBR-2412 2380 2400 2400 2400
2 LLATHFBR-2414 0 0 0 0
2 LLATHFBR-2416 11836 4640 4640 4640
2 LLATHFBR-24E6 14292 10128 10128 10128
2 LLATQFBR-1236 6468 0 0 0