on 07-19-2018 3:32 AM
SAP Bushiness One 9.2 and possibly 9.3
I would like to get the sell price ( NOT the last sold price ) for a given item / BP
from the SQL tables. Obviously I need the price after all the special prices etc have been applied. Does anyone know of a table where this is kept please ?
Thanks Sergei. I guess I will have to use a DI call to get the price. That is not the most efficient way for my project but it will make sure I get the correct price always.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That is not stored in a table, SAP calculates it on the fly. You can trace item choose event via profiler and check all queries that executes to the DB. Discounts store in OSPP, SPP1 and SPP2 tables. The main query that takes this discounts is (got it with the profiler)
SELECT T0.[CardCode]
, T0.[ItemCode]
, T0.[ListNum]
, T0.[SrcPrice]
, T0.[Discount]
, T0.[Price]
, T0.[Currency]
, T0.[AutoUpdt]
, T1.[LINENUM]
, T1.[ListNum]
, T1.[Discount]
, T1.[Price]
, T1.[Currency]
, T1.[AutoUpdt]
, T2.[SPP2LNum]
, T2.[UomEntry]
, T2.[Amount]
, T2.[Discount]
, T2.[Price]
, T2.[Currency]
, T3.[UomEntry]
FROM [dbo].[OSPP] T0
LEFT OUTER JOIN [dbo].[SPP1] T1 ON T0.[CardCode] = T1.[CardCode]
AND T0.[ItemCode] = T1.[ItemCode]
AND T1.[FromDate] <= CONVERT(DATETIME, ''20180719'', 112)
AND (T1.[ToDate] IS NULL OR T1.[ToDate] >= CONVERT(DATETIME, '20180719', 112) )
LEFT OUTER JOIN [dbo].[SPP2] T2 ON T1.[CardCode] = T2.[CardCode]
AND T1.[ItemCode] = T2.[ItemCode]
AND T1.[LINENUM] = T2.[SPP1LNum]
AND (
(T2.[UomEntry] = -1 AND T2.[Amount] <= 1.000000 )
OR
(T2.[UomEntry] = -1 AND T2.[Amount] <= 1.000000 )
)
LEFT OUTER JOIN [dbo].[ITM9] T3 ON T0.[ItemCode] = T3.[ItemCode]
AND T3.[PriceList] = 5
AND T3.[UomEntry] = -1
WHERE T0.[Valid] = (@P1)
AND (T0.[ValidFrom] IS NULL OR T0.[ValidFrom] <= (@P2) )
AND (T0.[ValidTo] IS NULL OR T0.[ValidTo] >= (@P3) )
AND T0.[ItemCode] = (@P4)
AND (T0.[CardCode] = (@P5) OR T0.[CardCode] = (@P6) )
AND (T2.[Amount] IS NULL OR (T2.[UomEntry] = (@P7)
AND T2.[Amount] IN(
(SELECT MAX(U0.[Amount])
FROM [dbo].[SPP2] U0
WHERE U0.[CardCode] = T2.[CardCode]
AND U0.[ItemCode] = T2.[ItemCode]
AND U0.[SPP1LNum] = T2.[SPP1LNum]
AND U0.[UomEntry] = T2.[UomEntry]
AND U0.[Amount] <= (@P8) ))
)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
NOT the last sale price as indicated in my question. I need the the SAP default selling price such as the "unit price" when you start a new AR Invoice on the screen.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Explain your scenario last sale price you can get from invoice table and you can get from price lists also.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.