Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9146

Re: Line item - PO price vs. GR Po price vs. AP Invoice price Variance Report

$
0
0

Hi Nadeem,

Please try below query.

 

Select POHead.Docnum[PO Num],POHead.DocDate[PO Date],POHead.CardCode [BP COde]

  ,GRHead.DocNum[GR Num],GRHead.DocDate[GR Date]

  ,APHead.DocNum[AP Num],APHead.DocNum[AP Date]

  , POLine.ItemCode, ItmMstr.ItemName

  , POLine.Quantity[PO Qty], POLine.Price[POPrice]

  , GRLine.Quantity[GR Qty],GRLine.Price[GR Price]

  , APLine.Quantity[AP Qty], APLine.Price[AP price]

 

 

from OPOR POHead

  Inner Join POR1 POLine on POHead.Docentry = POLine.DocEntry

  Left Outer Join OITM ItmMstr on POLine.ItemCode = ItmMstr.ItemCode

  Inner Join OCRD BPMstr on POHead.CardCode = BPMstr.CardCode

  Left Outer Join PDN1 GRLine on GRLine.BaseType = 22 and GRLine.BaseEntry = POLine.DocEntry and GRLine.BaseLine = POLine.LineNum

  Left Outer Join OPDN GRHead on GRHead.Docentry = GRLine.DocEntry

  Left Outer Join PCH1 APLine on APLine.BaseType = 20 and APLine.BaseEntry = GRLine.DocEntry and APLine.BaseLine = GRLine.LineNum

  Left Outer Join OPCH APHead on APHead.Docentry = APLine.DocEntry

Where POHead.DocDate>=[%0] and POHead.DocDate<=[%1]

 

 

 

group By POHead.Docnum,POHead.DocDate,POHead.CardCode

  ,GRHead.DocNum,GRHead.DocDate

  ,APHead.DocNum,APHead.DocDate

  , POLine.ItemCode, ItmMstr.ItemName

  , POLine.Quantity, POLine.Price

  , GRLine.Quantity,GRLine.Price

  , APLine.Quantity, APLine.Price

 

 

 

Thanks

Unnikrishnan


Viewing all articles
Browse latest Browse all 9146

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>