Search from 700 + Posts

Apr 22, 2011

Query to Get Sales Order Line# , Invoice $ Amount associated with a Delivery

below is Simple Query to Get Sales Order Line#(From oe_order_lilnes-all) , Invoice $ Amount(From Ra Interface table )  associated with a Delivery

select to_char(l.line_number) ||
           decode(l.shipment_number, null, null, '.' ||
 to_char(l.shipment_number))||
           decode(l.option_number, null, null, '.' ||
 to_char(l.option_number)) ||
           decode(l.component_number, null, null,
                  decode(l.option_number, null, '.',null)||
                  '.'||to_char(l.component_number))||
           decode(l.service_number,null,null,
                  decode(l.component_number, null, '.' , null) ||
                         Decode(L.Option_Number, Null, '.', Null ) ||
                         '.'|| To_Char(L.Service_Number)),
H.Order_Number,I.Amount,L.Line_Id
From Oe_Order_Lines_All L,oe_order_headers_all h,
Ra_Interface_Lines_All I
Where h.header_id = l.line_id
And L.Line_Id = To_Number(I.Interface_Line_Attribute6)
   and i.interface_line_attribute3 = '&Enter_Delivery_number'

No comments:

Post a Comment