Query for last 5 Purchase Price for items
Dear All
I was trying to write a query in which
i want to display Items with last 5 purchase price
itemcode UOM Last Purchase Price II Last Pur Price III Last Pur Price IV Last Pur Price V Last Pur Price
but not getting right result because of future posting and post date entries as I am considering Max(DocNum) for Query.
SELECT distinct a.ItemCode, a.invntryUom
, (select Price from PCH1 where itemcode=a.itemcode and
docentry=(select max(docentry) from PCH1 where itemcode=a.ItemCode)) as 'II Pur. Price'
, (select Price from PCH1 where itemcode=a.itemcode and
docentry=(select max(docentry) from PCH1 where itemcode=a.ItemCode and docentry<(select max(docentry) from PCH1 where itemcode=a.ItemCode))) as 'II Pur. Price'
, (select Price from PCH1 where itemcode=a.itemcode and
docentry=(select max(docentry) from PCH1 where itemcode=a.ItemCode and docentry<(select max(docentry) from PCH1 where itemcode=a.ItemCode and docentry<(select max(docentry) from PCH1 where itemcode=a.ItemCode)))) as 'III Pur. Price'
, (select Price from PCH1 where itemcode=a.itemcode and
docentry=(select max(docentry) from PCH1 where itemcode=a.ItemCode and docentry<(select max(docentry) from PCH1 where itemcode=a.ItemCode and docentry<(select max(docentry) from PCH1 where itemcode=a.ItemCode and docentry<(select max(docentry) from PCH1 where itemcode=a.ItemCode))))) as 'IV Pur. Price'
, (select Price from PCH1 where itemcode=a.itemcode and
docentry=(select max(docentry) from PCH1 where itemcode=a.ItemCode and docentry<(select max(docentry) from PCH1 where itemcode=a.ItemCode and docentry<(select max(docentry) from PCH1 where itemcode=a.ItemCode and docentry<(select max(docentry) from PCH1 where itemcode=a.ItemCode and docentry<(select max(docentry) from PCH1 where itemcode=a.ItemCode)))))) as 'V Pur. Price'
, Max(b.docentry) as 'MaxDocEntry'
FROM OPCH INNER JOIN
PCH1 b ON OPCH.DocEntry = b.DocEntry INNER JOIN
OITM a ON b.ItemCode = a.ItemCode
group by a.ItemCode, a.invntryUom
order by a.ItemCode
Please help me on this.
Regards
Anubha Paliwal
Hi........
Try this......
SELECT Top 5 T0.[DocNum], T1.[ItemCode], T1.[Dscription], T1.[Price], T3.[ItmsGrpCod],
T3.[ItmsGrpNam] FROM OPCH T0 INNER JOIN PCH1 T1 ON T0.DocEntry = T1.DocEntry
INNER JOIN OITM T2 ON T1.ItemCode = T2.ItemCode INNER JOIN OITB T3 ON
T2.ItmsGrpCod = T3.ItmsGrpCod WHERE T3.[ItmsGrpNam] ='[%0]' ORDER BY T0.[DocDate] desc
Regards,
Rahul
Similar Messages
-
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.
ThanksSo.. 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 -
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 !! -
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 -
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
WibisanaDear 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 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 -
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 AMHai ...
please help me in this query,my question is not clear or?? -
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 -
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 youdear
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 -
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 PMYou 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. -
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 -
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 -
How to obtain last purchased price of an item
How can i obtain the last purchased price of an item? There seems to be an 'LastPurPrc' field in the OITM table, but this does not seem to be exposed in the DI api. The last purchased pricelist is an 'internal' pricelist so cannot be used in the pricelists selection. Is there another way then just retrieving the value with a direct database Sql query?
Hi,
There is, but is long :-D.
You could check the purchase invoices by key in descendant order and check if the lines had the item, then check the price in the line to get the purchase price.
Hope it helps,
-M -
Creating inbound delivery for the purchase order line items
Hi Experts,
Please let me know how can I create inbound delivery for the purchase order line items? Say, I have a purchase order with 5 line items in it. I wanted to create an inbound delivery for only 2 line items at this point of time. Which SAP Standard transaction I have to use and what all data I need to populate? I would appreciate any help on this and will reward the right answer. Please let me know.
Thank you in advance.
with regards,
Muthu Ganapathy.Hi,
While creating the inbound delivery (VL31N), intially all the items will be shown, see the advance shipping notfication - from the vendor for which he has send confirmation & rest items you can delete simply & save. & next time when the vendor sends rest advance shipping notifcation (confirmation), you can receive them.
Hope this answers your query.
Regards
Irfan. -
Purchase Price for the Material
Hello World of SAP,
Hallo Welt von SAP,
Is there any report in standard SAP for Material Purchasing Price?
Basically I'm using table EINA and EINE to check that purchase price,
if the MAP price i check in MBEW.Dear Nikamz,
Material net price in PO is store in info record , you can use ME1M or ME1P, you can take a look in it.
Regards,
w1n
Maybe you are looking for
-
I am having trouble syncing my iPod touch. Not all the songs I purchased are being loaded from iTunes. Search the web and tried different settings to no avail. iPod touch and iTunes are up to date. I did a restore on the device and still not working.
-
i was messing around and created a program that inside a JFrame there is a crosshair image that follows your mouse pointer and if you click the mouse, it leaves a red dot on that spot. The problem is that in order for the crosshair image not to creat
-
Flash MX 2004 component dataSource
I need to edit a menu bar Flash component that was bundeled with Flash MX 2004. I like to be able to change the COLOR of the menu bar buttons. I am not sure how to edit this dataSource component in Flash CS4. The xml document assosiated with the Flas
-
Working with AE lower third creates master clip. How do I turn this off?
I've imported an AE lower third and I see in the bin instance that it has an asterisks next to it's name with the word Master. Each instance of the lower third throughout my timeline is to be different but if I change one instance it replaces the te
-
HT1695 my internet is not connecting in my "iphone 4s" what is the solution please help
my internet is not connecting in my "iphone 4s" what is the solution please help