Vendor list as per last purchase price!

I need a query to display all vendors  as per last purchase price.
Thanks...

hi,
try this one,
SELECT T2.[CardCode], T2.[CardName], T0.[ItemCode], T0.[ItemName], T0.[LastPurDat], T0.[LastPurPrc]
FROM [dbo].[OITM]  T0 INNER JOIN PCH1 T1 ON T0.ItemCode = T1.ItemCode INNER JOIN OPCH T2 ON T1.DocEntry = T2.DocEntry WHERE T2.[CardCode] = '[%0]'
GROUP BY T2.[CardCode], T2.[CardName], T0.[ItemCode], T0.[ItemName], T0.[LastPurDat], T0.[LastPurPrc]
regards,
Fidel

Similar Messages

  • Add a Price List based on last purchase price

    Hi!
    I'm working with SAP B1 2005 A SP01 PL39 and I'm trying to add a Price List via DIAPI using this code in VB.net.
    Dim oPriceList As SAPbobsCOM.PriceLists
    oPriceList = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oPriceLists)
    oPriceList.PriceListName = "PriceList Z"
    oPriceList.BasePriceList = 0  '// last purchase price
    oPriceList.Factor = 1
    oPriceList.GroupNum = BoPriceListGroupNum.boplgn_Group1
    oPriceList.RoundingMethod = BoRoundingMethod.borm_NoRounding
    oPriceList.Add()
    The problem is when the Price List is added, the base price list changes and becomes "PriceList Z" instead of "last purchase price"!!
    After i try to update the base price list from "PriceList Z" to "last purchase price" manually at Inventory > Price Lists > Price Lists and it works!
    I even tested the code changing the base price list to "last evaluated price"...
    oPriceList.BasePriceList = -1  '// last evaluated price
    ... and it works too! The Price List is added based on the last evaluated price.
    I'm only having problems with last purchase price... why?

    Thanks for the quick response Petr but my problem isn't solved yet...
    As you can read in my first post, i've changed the code and based the new price list on the "Last Evaluated Price".
    This "Last Evaluated Price" isn't in the OPLN table and the new price list (with last evaluated price based on) is added successfully.
    The problem comes when i try to add a new price list based on the last purchase price.

  • Last purchase price of item per plant

    Good day!
    Need help retrieving the last purchase price of an item
    per plant regardless of the vendor. i know they are in
    EINA and EIPA tables but i couldn't extract them.
    anybody knows a query for this?
    Thank you very much for your help.

    Thanks, Suda, I understand I cannot update the Last Purchase Price itself - should have made myself more clear. 
    What I want to do is change the Price List (field OPLN ListName) selection in the Item Master from one of our created lists to the Last Purchase Price price list.  That way, when we create purchase orders, the item price is filled in with whatever price we last purchased.  I don't want to manually create another last-price price list because I would have to constantly update it.
    Since I can manually change to the Last Purchase Price price list in the Item Master, there must be some way to do this for all items using the Data Import or the DTW?
    Thanks again,
    Shelby

  • 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 wasn't updated after GR with 0 price

    I created Goods Receipt for the item with total 0. When I check last purchase price I see still a price from the previous document and not zero.
    How can I make last purchase price as zero?
    Thanks,
    Olga

    The Goods Receipt PO does not update the 'Last Purchase Price' list. The 'Last Purchase Price' list can only be updated by the following documents:
    AP Invoice
    Goods Receipt (Inventory Transactions)
    Initial Quantity (Inventory Transactions)
    Inventory updates e.g. Stock Posting
    Landed Costs
    Production Order
    Please refer the following WIKI
    [Does a Goods Receipt PO update the Last Purchase Price List?|https://www.sdn.sap.com/irj/scn/wiki?path=/pages/viewpage.action&pageid=36438427]

  • 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

  • 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?

  • 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

  • How can I obtain the last purchase price

    Hi,
    there is a method to obtain the list of last purchase price??
    Thx
    Best Regards

    hi,
    I've tried the PriceList Obj and GetItemPrice but nothing to do....
    I would like obtaining the second Price List row in the Price Lists Form (Inventory\Price Lists\Price Lists).
    If I enable Debug Information I can obtain ListNum but the first two rows have the ListNum set to -2 and -1
    With the PriceList.GetByKey method if I set the parameter with -1 or -2 doesn't work... There is a way to obtain this PriceList?
    Thanks a lot
    Best Regards

  • Last Purchase Price - OITM

    HI,
    We will be trying on the TEST system to do Goods Issues and Receipts to change the Last Purchase Price but because we use FIFO this may not give the result that we want ie in FIFO it is the the earlier price we want i presume?
    I have heard another way of changing the Last Evaluated Price in table OITM as this is also the Last Purchase Price but are unsure the best way to do this?
    Can anyone please suggest a way to update the Last Purchase Price ?
    Thank you,
    MB

    Hi Gordon,
    Do you mean these notes:
    The 'Last Purchase Price' list can only be updated by the following documents:
    u2022     AP Invoice
    u2022     Goods Receipt (Inventory Transactions)
    u2022     Initial Quantity (Inventory Transactions)
    u2022     Inventory updates e.g. Stock Posting
    u2022     Landed Costs
    u2022     Production Order
    If so, then do you think that the simplest and easiest way to update the Last Purchase Price would be by doing Goods Receipts ?
    Just not sure the affect it will have doing Goods Receipt with FIFO...cannot seem to find much about it.
    Best Regards,
    MB

  • 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

  • Query whit ListPrice "Last Purchase Price""

    hi,
    I am making a user query in which I want to use the list price "Last Purchase Price" but i can't because don´t find it on the table "OPLN".someone can help me?
    thanks.

    Hi Mariono
    The Last Purchase Price and Last Evaluated Price are on the item master table OITM.
    Kind regards
    Peter Juby

  • Last Purchase price is not updated

    Hi
    The last purchase price is not updated when posting a GRPO.
    Any Ideas?
    Its 2005 A SP01 PL48
    Thanks
    Franz

    Check this WIKI
    [Does a Goods Receipt PO update the Last Purchase Price List?|https://www.sdn.sap.com/irj/scn/wiki?path=/pages/viewpage.action&pageid=36438427]

  • 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

  • In wich table are stored  the last purchase price of items?

    Hi all,
    My question is in wich table are stored the last purchase price of items and what is the best way to import items price directly to the last purchase price list.
    In ITM1 appears the prices of the list prices but no the last purchase price list.
    Thank you all again.
    Regards.

    Hi
    The last purchase price are not stored anywhere as well as the last evaluated price.
    However if you want to add or update this price you can use DTW in order to update this particular pricelist.
    Hope it helps
    Regards
    George

Maybe you are looking for

  • Windows XP Home installs correctly, but Boot Camp control panel will not

    I put XP Home onto my 13" MPB and everything works except the Boot Camp control panel and the multitouch and special keys. When I put in the disc it loads and starts to install, as it finishes up and installs the control panel, it shuts down and does

  • Dynamically setting the values for the Adapter Configuration in BPEL

    We are configuring the JMS adapter to put into an MQ topic. For this we are giving all the values for the configuration parameters like Factory Properties. JMS connection Factory Transacted Destination Type Username Password Destination Name, etc...

  • Help centering text

    I'm trying to center a line of text in the text area. If the text entered can be displayed on one line, I would like the text centered; otherwise it should use the word wrap. I tried creating a method called center: // Defined outside this method, bu

  • Merge data/result sets that are't parent/child?

    Hi: I've seen a few examples of making a data template so that a BI report can have master/detail data. They make a Q1 data set and a Q2 data set with a bind variable to link the two in a parent/child relationship. But what I need is effectively a UN

  • Unreadable chinese text

    Hi all I recentally downloaded a chinese text file from internet and when i open it using textEdit, the words are in symbols and unreadble. It displays smth like this: "µ⁄"ª≤ø ƒÊÃÏ µ⁄∂˛'¬ ◊™-˙"ÏΩÁ" I am able to type in chinese. May i know how do i so