Queries Report For Last Purchased Price

Dear All,
Can someone helps me to get queries report for last purchased price vs new purchase price that recently being enter on purchased order.
Trigger by purchased order document posting and we can choose % variance
Report by order :
No. Document PO ; Vendor code ; Vendor Name ; Doc Posting Date ; Item code ; Item Name : New Purchased price ; Last Purchased Price; Variance; Buyer Name
i will used it on alert management.. each time there % variance automaticaly sending an email with those report.
Thanks

So.. is it the right query if i join it?:
SELECT T0.DocEntry, T1.CardCode, T1.CardName, T1.DocDate, T0.ItemCode, T0.Dscription, T0.PriceBefDi, T2.LastPurPrc, (T0.PriceBefDi - T2.LastPurPrc) AS Variance, ((T0.PriceBefDi - T2.LastPurPrc)/T0.PriceBefDi) AS 'Variance%', T3.SlpName FROM POR1 T0 INNER JOIN OPOR T1 ON T0.DocEntry = T1.DocEntry INNER JOIN OITM T2 ON T0.ItemCode = T2.ItemCode INNER JOIN OSLP T3 ON T0.SlpCode = T3.SlpCode
select * from opor where month(docdate) = MONTH(GETDATE()) and Year(docdate) = YEAR(GETDATE())
But i still find document with last month posting include on the report adn the report became different too

Similar Messages

  • DTW for Last Purchase Price

    Dear all,
    Can we import Last Pruchase Price to SBO using DTW ? so, I can see the historical of last purchase price when I open PO
    Best regards
    Wibisana

    Dear Wibisana,
    what is your pupose to update last purchase price list ?
    To update price list, you must have the explanation about how to update last purchase pricelist:
    Last Purchase Price List
    The prices in this price list are updated automatically by the system when the following transactions are performed:
    1.     When you enter an incoming invoice # see Purchasing
    1.     When you enter a goods receipt # see Goods Receipt
    1.     When you enter a positive opening balance for an item # see Inventory and Stock Postings
    1.     When you enter a positive inventory result that triggers a goods receipt # see Inventory and Stock Postings
    1.     When a product with a BOM is manufactured, where the price of the product is calculated from the last purchase prices of the components # see Production.
    1.     When data imports are performed
    If none of these transactions have been performed in the system for an item, the "Last Purchase Price" price list will not contain the item
    Only the list of the transactions mentioned above changes the price of an item in the "Last Purchase Price" price list.
    Even if you enter one of these transactions, but assign it the value 0, the price will not be included or updated in the "Last PurchasePrice" price list.
    You can refer other price lists to the "Last Purchase Price" price list with a defined factor. You cannot, however, change the prices in the "Last Purchase Price" price list manually.
    then you use the DTW template:
    1. item
    2. item_prices
    you can have both from this folder:
    C:\Program Files\SAP\Data Transfer Workbench\Templates\Templates\oItems
    then, in the DTW, you use object oItem.
    the DTW templates (item and item_prices) must contains the data where they will not act like import but update.
    in the item_prices, you must put :
    1. linenum : 0 for pricelist 1; 1 for pricelist 2; etc
    2. pricelist : 1 for pricelist 1; 2 for pricelist 2; etc
    actually, in the pricelist window, do you see that the pricelist last purchase price have base pricelist ? in the form, you will see that the 01 Purchase Price List have last purchase price as its base pricelist.
    So, in the template you must use it.
    After updating using DTW finished, you could try to use one of the item in the purchase order and see if the unit price changes or not.
    I will ask my friend to send the template if you need.
    Rgds,

  • Last Purchase price Warehouse wise for given date

    Hai all....
                      I Want query report for Last purchase price for all items, warehouse wise for given date, i tried following query
    SELECT
    T10.ItemCode,
    (Select i1.Itemname from  oitm i1 where i1.itemcode = T10.[ItemCode]) as 'ItemName',
    T10.[Whscode],
    (SELECT T1.[DocDate] FROM OPDN T1 where  T1.[DocEntry] = max(T10.[DocEntry])) as 'Doc_Date',
    (SELECT T1.[DocNum] FROM OPDN T1 where  T1.[DocEntry] = max(T10.[DocEntry])) as 'GRPO_NO',
    (SELECT case avg(T2.[Rate]) when 0 then avg(T2.[price]) else (avg(T2.[price]) * isnull(avg(T2.[Rate]),1)) end  FROM PDN1 T2 where  T2.[DocEntry] = max(T10.[DocEntry])
    and T2.Itemcode = T10.[ItemCode]) as 'Unit_Price',
    (SELECT isnull(avg(T3.[Rate]),0) FROM PDN1 T3 where  T3.[DocEntry] = max(T10.[DocEntry])
    and T3.Itemcode = T10.[ItemCode]) as 'CurrencyRate',
    (Select isnull(max(OP1.Docnum),0) from OPCH op1 where op1.Docentry in
    (SELECT T12.[trgetEntry] FROM PDN1 T12 where  T12.[DocEntry] = max(T10.[DocEntry]))) as 'Invoice_No'
    FROM PDN1 T10 
    INNER JOIN OPDN T11 ON T10.DocEntry = T11.DocEntry and T11.[DocType] = 'I'
    where T11.Docdate <= '[%0]' and t10.targettype <> 21
    GROUP BY
    T10.[ItemCode],T10.[Whscode]
    this query working good but problem in this query is ,when the user put back dated entry means this report will show wrong value,bcz i write this query based on MAX of docentry please help me to solve this issue
    Edited by: Prasanna s on Mar 27, 2009 5:49 AM
    Edited by: Prasanna s on Mar 27, 2009 8:00 AM

    Hai ...
    please help me in this query,my question is not clear or??

  • Last purchase price

    Hello
    I upload Purchase Order through DTW
    But the system does not take the price in the the file but take the last evaluated price instead, as I believe there is no record for last purchase price
    How to keep the price recorded in the file? Or how to upload a last purchase price?
    Thank you

    dear
    pleaes kindly refer to note 991114 to see if it helps on your issue.
    i  paste the contents for your reference.
    The behaviour of SAP Business One 2005A SP01 when calculating the row
    total has changed.
    A new checkbox named 'Calculate Row Total Using Unit Price' has been
    added to Adminstration -> System Initialization -> Document Settings ->
    General tab.
    Once it is checked, B1 will calculate the Line Total as (Quantity * Unit
    Price * Discount), so 'Price After Discount' becomes a read-only field.
    Since 'Price' field in DI API is pointing to that field, the price set
    in this field is ignored, therefore the system will use the default
    price or zero if it does not exist.
    In order to adjust your needs to this new behaviour, you can choose
    either of the following:
    1.  Uncheck the box 'Calculate Row Total Using Unit Price' thus you will
        be able to keep using the 'Price' field (or column in DTW) as
        before.
    or
    2.  Use the 'UnitPrice' field instead of the 'price' field if you want
        to keep 'Calculate Row Total Using Unit Price' checked. When using
        DTW, you must rename the 'Price' column as 'UnitPrice'.
    best regards,
    xiaodan an
    sap business one forum team

  • Last Purchase Price Report

    Hello All,
    I need to get a Report on the Last Purchase Price for some materials. Where can I find this report?
    Is there any report that shows the materials related to the suppliers.
    Best Regards,
    Miguel
    Edited by: Miguel Barbosa on May 25, 2009 5:59 PM

    You can try via MBEWH, that has the history of price at material master level
    Or go to EKPO and get there the actual price of the PO
    Or go trough EINE and EINA and review the actual price..
    if you have conditions, then go to KONP to see the validity prices.
    hope that could help you.

  • Last Purchase Price for a product

    Hi,
    I need some here.
    Item A is made up of Item B and C (in production BOM)
    Item B is in production BOM as well and is made up of Item D, E and F.
    I need to calculate the Last Purchase Price of Item A, which is:
    Item C (LPP $10)
    Item D (LPP $12)
    Item E (LPP $20)
    Item F (LPP $30)
    Total Item A LPP = $72
    Any suggestion of what the best approach of doing a query/ a XL report for this?

    Hi!
    1. Define BOM for Item A
    2. Link a Price List for tht.
    3. Update your child items and child price's in a price List.
    4. Click the orange Drop Down Arrow in BOM window.
    5. This will automatically calculate the Item Price for Item A and update the Price List tht linked in it's BOM
    Hope Help u !!

  • PO Last Purchase Price ??

    Hi ! currently I'm working on a P.O. Report. My query is :- I want to display the last purchase price of the P.O..
    For this requirement, I've joined the tables EKKO & EKPO, sorted on material & plant. And now I want to fetch the last purchase price from EIPA table using the info rec no. For that how can I write a select query.
    Right now I'm using :- 
    SELECT SINGLE PREIS    INTO DISP-LASTPR      FROM EIPA  WHERE INFNR    = DISP-INFNR.
    which is not solving the problem.
    Please help.

    Hi,
    Try below logic.
    Select <required fields> from EINA
    into table <itab>
    where matnr = <matnr>.
    sort <itab> by erdat descending
    read table <itab> into <wa> index 1.
    Last info record = <wa>-infnr.
    Regards
    Vinod

  • Last Purchase Price Currency

    Hi Experts,
    My client purchases stock from all around the world.  When posting a Purchase Invoice in Dollars, the Last Purchase Price of the item is then changed to USD.
    Is it possible to always show the Last Purchase Price in the local currency (GBP)?
    Thanks
    Greig

    Hi Greig,
    we've had the same problem with one of our customers.
    To solve the problem we've used SDK and we've developed an addon which create/update an "own" last purchase price list.
    The prices in foreign currencys will be convert into local bp currency. And that price list will be used for reports an gross profit calculation instead of the system last purchase price list.
    I think that is the only way to do that.
    Kind regards
    Jacqueline

  • Last Purchase Price & Last evaluated Price

    hello experts,
    i just wanna know what is the difference in between Last Purchase Price and Last evaluated price. our company uses FIFO.
    what is the effect in goods issue if i will use last Purchase Price or Last evaluated price.
    Thanks in advance.
    FIDEL

    Hi Avelino,
    The last Purchase Price is the last price paid for an Item, meaning that this price is updated when an AP Invoice is posted as this is considered the purchase price. The price is not updated by Goods Receipt or Prchase Order as an example.
    The Last Evaluated Price or Last Calculated is updated when either running the Stock Audit Report or the Stock Valuation Report.
    Please note that if the company has been defined with 'Manage Item Cost per Warehouse' in the Company
    Details and the Stock Audit Report is used to update the last evaluated price, then the price will be as calculated in the default warehouse of the Item.
    For the Goods Issue, the price as given on the rows is only informative, the price that will be credited from the stock account in the Journal Entry is the calculated cost price according to the valuation method that has been defined for the item (FIFO, Moving Average, Standard).
    With the Form Settings you can chose to display the 'Item Cost' field in the Goods Issue, this will however only be populated after the Goods Issue has been added. The reason for this is that the price could have changed between the moment when the Goods Issue form was opened and the time that it is added.
    I hope this helps.
    Jesper

  • Price List and Last Purchase Price.

    When a Price List based on the Last Purchase Price is created, we have found that a set of problems arise in companies using u201CGoods Receipt POu201D.
    EXAMPLE:
    Every article received from their suppliers are enclosed with a GOODS RECEIPT.
    After 20 days, the supplier issue an invoice including all the Goods Receipts provided during the corresponding month.
    Recall that the company has a List Price based on the Last Purchase price.
    But, since the Goods Receipt do not update the Last Purchase Price, all new articles in the database, are kept without a Selling Price, and the old articles are not subject to an updated Selling Price.  I enclose a draft to show this behavior.
    [http://s2.subirimagenes.com/privadas/previo/thump_1047037compraitem.jpg]
    You may note that SAP HELP explains:
    1.In addition, two price lists are automatically created and calculated by the system:
        - Last purchase price list u2013 the price list is automatically updated when an item enters the stock with its entering price.
        - Last evaluated price list u2013 the price list is automatically updated after you run the Inventory Valuation report.
    [http://s2.subirimagenes.com/privadas/previo/thump_1047038help-sap-b1-2007a.jpg]
    But this does not happen.
    Selling Prices are only updated when the corresponding invoice is entered, but this happen too late, since the invoice issued 20 days after by the supplier.
    In other words, it does not work properly for the company.   The example shows:
    1 Goods Receipt PO
    2 Item master data with Price calculated alter Goods Receipt processing
    3 base Price driven to zero.
    If Goods Receipts do not update the last Purchase, is not easy to understand why a Selling Price can be based in the Las Purchase Price.
    Our customer and me, think that there is a programming error.
    Otherwise, the system behavior has not be properly explained to SAP users.
    The described facts happen with SAP 2007A PL 49, and SAP 8 PL 5, both versions properly tested
    That we need:  That Goods Receipt update the last purchase Price and Price List could be constructed don Item bases cost.

    Hi Dana,
    I'm not sure if this will solve your problem, but, you can create a new price list which is based on the "Last Purchase Price" and set as a factor of 1.65. I'm not sure if the "Last Purchase Price" updates from the Goods Receipt or the PO though?
    Does this sound like it might solve your problem?

  • Last Purchased Price not adding tax

    Hi guys, I have a new question today.
    I have my tax definition set up as Included in Price.
    So now let's say I purchase one Item A for $100
    From this $100, $10 are tax.
    When I see the last prices report it's showing correctly, $100
    But when I see the Last Purchased Price, in item master data, it's showing $90 ($100-$10). Since my tax is included in price, shouldn't it show me the full price??
    Thanks a lot!

    Danilo,
    The last purchased price is set by the unit price in the purchasing document, it does not take into account the tax amount.
    If you wanted this to be reflected in the Last Purchased Price you would need to set the tax amount for the item, and possibly the entire document to zero.
    Hope this helps,
    Lucas

  • Item Last Purchase Price

    In SAP 8.8 inventory table OITM, there's a 'Last Purchase Price' field. This particular field grabs the price from Item Posting List (Right click on Item Master Data and select 'Inventory Posting List' from the list). Inventory Posting List normally consists of goods issue, jounal entry, inventory transfer etc.
    For some strange reasons, some of the items have negative 'last purchase price'. When I further tested out by drag and relate those items to PO, the last PO was created years ago and the price is not what it shows in 'last purchased price'. Seems like this 'last purchase price' field is showing some strange result after internal inventory transfer. Any idea why it is causing this? Many thanks.

    Hi......
    You can get the last purchase price by a Query report or you can get it by FMS at transaction level........
    For report try this....
    SELECT Top 1 T0.CardName, t1.ItemCode, T1.Price, T0.DocNum  FROM OPCH T0 Inner Join PCH1 T1 On T0.DocEntry=T1.DocEntry
    Order By T0.DocDate DESC
    Regards,
    Rahul

  • Last Purchasing Price of Material

    hii,
    is there any report or txn by which i can know the last purchasing price of a particular material...
    abhishek suppal

    I am not sure if there is a report for the same. You might have to find the latest PO for that material and look at the price.
    It should not be a big deal.
    Join between EKPO and EKKO should give you the required info.
    Regards,
    Ravi
    Note : Please mark the helpful answers

  • Centralised Report for Sales/Purchase

    Hi guys,
    One of my client needs a Centralised report for Sales & Purchase for a particular period .
    Like we are mainting multiple taxcodes  like
    BED,eCess,HeCEss,
    VAT 4,VAT 2,VAT12.5,
    VAT10.3,TAXEXEMPTED,ETC...
    So every month they need to know total sales and purchase value in a single report to be displayed respective of each tax code
    lie
    Taxcode 1 = tax Value1,total value
    Taxcode 2 = tax value 2,total value
    Total Sales value = Sum of all tax values, sum of total values
    Total Purchase value = Sum of all tax values, sum of total values
    And  needs Item Wise Sales For Each customer.
    I tried in system defined Sales and Purchase analysis report but our client needs the above type of report..
    Pls give us some solution for this..
    Regards,
    Vams

    Hi VamSam......
    Try the below query for purchase details alongwith tax amt.....
    SELECT T0.[DocNum], T0.[DocDate], T0.NumAtCard As 'Bill No.', T0.[CardName], T1.[Dscription], T1.[Quantity], T1.Price As 'Rate', T1.[LineTotal] As 'Value', T0.[DocTotal] As 'Total Value', (ISNULL((SELECT SUM(T2.QUANTITY) FROM rpc1 T2 WHERE T2.DocEntry=T0.DocEntry),0)) RetQTY, (ISNULL((SELECT SUM(T2.LineTotal) FROM RPC1 T2 WHERE T2.DocEntry=T0.DocEntry),0)) RetValue, (isnull((SELECT SUM((case when upper(t4.STACode) like 'BED%' then T4.TaxSum else 0 end))
          FROM PCH4 T4 WHERE T4.DocEntry=T0.DocEntry ),0)) ExciseDuty,
         (isnull((SELECT SUM((case when upper(t4.STACode) like 'eCess%' then T4.TaxSum else 0 end))
          FROM PCH4 T4 WHERE T4.DocEntry=T0.DocEntry ),0)) ECess,
         (isnull((SELECT SUM((case when upper(t4.STACode) like 'hes%' then T4.TaxSum else 0 end))
          FROM PCH4 T4 WHERE T4.DocEntry=T0.DocEntry ),0)) HEdCess, (isnull((SELECT SUM((case when upper(t4.STACode) like 'VAT%' and t4.TaxRate=12.5 then T4.TaxSum else 0 end))
    FROM pch4 T4 WHERE T4.DocEntry=T0.DocEntry ),0)) As 'VAT12.5',
    (isnull((SELECT SUM((case when upper(t4.STACode) like 'VAT%' and t4.TaxRate=4 then T4.TaxSum else 0 end))
    FROM pch4 T4 WHERE T4.DocEntry=T0.DocEntry ),0))VAT4, (isnull((SELECT SUM((case when upper(t4.STACode) like 'VAT%' and t4.TaxRate=2 then T4.TaxSum else 0 end))
    FROM pch4 T4 WHERE T4.DocEntry=T0.DocEntry ),0))VAT2, (isnull((SELECT SUM((case when upper(t4.STACode) like 'CST%' and t4.TaxRate=2 then T4.TaxSum else 0 end))
    FROM pch4 T4 WHERE T4.DocEntry=T0.DocEntry ),0)) As 'CST2',
    (isnull((SELECT SUM((case when upper(t4.STACode) like 'CST%' and t4.TaxRate=4 then T4.TaxSum else 0 end))
    FROM pch4 T4 WHERE T4.DocEntry=T0.DocEntry ),0)) As 'CST4', T2.TransCat As 'Form No.'  FROM OPCH T0  INNER JOIN PCH1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN PCH12 T2 ON T0.DocEntry = T2.DocEntry WHERE (T0.[DocDate]>='[%0]' and T0.[DocDate]<='[%1]')
    Regards,
    Rahul

  • Price List Auto Update based on Last Purchase Price

    Dear Expert
                         I have a problem in updating the PriceList at one of my client site . They are making CST purchase
    Eg.    We are entering purchase through Goods Receipt PO item cost 100RS and CST tax 20 RS
             Then Copy to AP invoice . so the item cost is coming to 120 as CST is non deductible tax .
             If we goto Price list , it will clearly show last purchase Price is 120 every thing is fine till now
           Now the issue comes :- company is incurring frieght charges 10 Rs or any amount this also has to be included to cost that we are entering through Landed Cost . This 10Rs is automatically adding to cost . if we look the item cost it will be 130 this is also correct . But the Problem is that when we go to Pricelist we find that Last Purchase price as 110 that is 100 Rs base doc price +10 Rs Frieght (Landed Cost) . .
    Actually the Last Purchase Price should come as 130 (1002010) . We are dealing with 4000+ items it is difficult to mannually update the Price List .
    Regards
    Shihabuddin CC
    Jr . Consultant SAP B1
    CCS Technologies P Lrd

    Dear Shihabuddin,
    In most localization, price is for before tax price. If you want tax included in the price, you can create your own price list to calculate.
    Thanks,
    Gordon

Maybe you are looking for