Query for stocks on hand
I would like to know if it is possible to create a query that would display the stocks of all items on a specific date and will display the item cost or the purchase price of each item in stock. Let say for example, today is January 14, 2010. I would like to check how many stocks in my inventory last January 8, 2010. Does anybody knows how to create this?
Thank you.
Hi Don Elicor,
Check the below thread, you will be get some idea or Solution.
Inventory Report by Query
Query for Inventory Activity for whse & dates
Item Stock Report
Item Stock Report
Regards,
Madhan.
Similar Messages
-
Query Requirement for Stock on hand.
Hi All,
Actually I am have written a query for showing a running total for an Item with all Sales Order and Purchase Order order by ship date (due date).
SELECT T0.[ItemCode], T0.[ShipDate],t2.[CardCode],t4.[OnHand],-T0.[OpenQty]*t4.[NumInSale] as StockMovt FROM RDR1 T0 INNER JOIN ORDR T2 ON T0.DocEntry = T2.DocEntry INNER JOIN OITM T4 ON T0.[ItemCode]=t4.[ItemCode] WHERE T0.[ItemCode] =[%0] and T2.[DocStatus] ='o'
UNION
SELECT T1.[ItemCode], T1.[ShipDate],t3.[CardCode], t5.[OnHand], T1.[OpenQty] as StockMovt FROM POR1 T1 INNER JOIN OPOR T3 ON T1.DocEntry = T3.DocEntry INNER JOIN oitm t5 ON T1.[ItemCode]=t5.[ItemCode] WHERE T1.[ItemCode]=[%0] and T3.[DocStatus] = 'o' ORDER BY [ShipDate]
What i require is the additional field which shows the cumulative or running total for each record. Can anyone please help in how it can be achived.
Thanks & Regards
ShivaHi Prasanna,
I made some modification to ur query and its perfectly working. I still have the other query...can you please help me.
The out put that you have asked for is as follows
# ItemCode ShipDate CardCode OnHand StockMovt
1 BAS3B 04.06.09 AUCHRA 14,320.00 -108
2 BAS3B 04.06.09 BLUMER 14,320.00 0
3 BAS3B 04.06.09 GREENTsup 14,320.00 0
4 BAS3B 05.06.09 bizzy 14,320.00 -12
5 BAS3B 05.06.09 BROWNT 14,320.00 -120
6 BAS3B 18.06.09 GOODVI 14,320.00 0
7 BAS3B 26.06.09 COLMAN 14,320.00 -15,000.00
8 BAS3B 30.06.09 GREENTsup 14,320.00 3,000.00
9 BAS3B 21.07.09 GREENTsup 14,320.00 5,000.00
10 BAS3B 03.08.09 BEALES 14,320.00 -12
11 BAS3B 05.08.09 ACORN 14,320.00 -6
12 BAS3B 16.08.09 JLEWBS 14,320.00 -120
13 BAS3B 22.08.09 GREENTsup 14,320.00 1,000.00
14 BAS3B 22.08.09 GREENTsup 14,320.00 2,000.00
15 BAS3B 25.08.09 BEALES 14,320.00 -6
16 BAS3B 25.08.09 GREENTsup 14,320.00 2,000.00
17 BAS3B 27.08.09 BEALES 14,320.00 -6
18 BAS3B 27.08.09 ELIZAS 14,320.00 -24
19 BAS3B 01.10.09 GATES 14,320.00 -120
20 BAS3B 15.01.10 GREENTsup 14,320.00 2,000.00
Further to this I need a running total for the stock movement. Basically it nothing but the difference between the last two columns.
Regards
Shiva -
Re:Query for Stock Statement for a particular item..!!!!
Dear SAP Experts,
I need a stock statement query for a particular item which contains:
1.ItemCode
2.Item Description
3.Item Price
4.Opening
5.Receipts
6.Issues
7.Closing
8. Value
The selection criteria are:
1.Warehouse code
2.Item Name
3.Posting Date
Plz give me a good solution for this issue.
With Regards,
RevathyCheck this
Declare @FromDate Datetime
Declare @ToDate Datetime
set @FromDate =
(Select min(S0.Docdate) from OINM S0 where S0.Docdate >='[%0]')
set @ToDate =
(Select max(S1.Docdate) from OINM S1 where S1.Docdate <='[%1]')
select * from
SELECT T0.itemcode,
min(T0.Dscription) as 'Item Description',
min(B1.ItmsGrpNam) as 'Item Group', W1.Whscode, C1.Location,
(isnull((
Select sum(isnull(inqty,0))
from OINM O1
where O1.itemcode=T1.itemcode
and O1.Warehouse=W1.Whscode
and O1.docdate<@FromDate ),0)-
isnull((
Select sum(isnull(outqty,0))
from OINM O1
where O1.itemcode=T1.itemcode
and O1.Warehouse=W1.Whscode
and O1.docdate<@FromDate),0)
) as [Opening Stock],
isnull((
Select sum(isnull(inqty,0))
from OINM O1
where O1.itemcode=T1.itemcode
and O1.Warehouse=W1.Whscode
and O1.docdate>=@FromDate
and O1.docdate<=@ToDate and O1.inqty>0
and O1.transtype in (20,18)),0
) as [Purchase Quantity],
isnull((
Select sum(isnull(outqty,0))
from OINM O1
where O1.itemcode=T1.itemcode and O1.Warehouse=W1.Whscode
and O1.docdate>=@FromDate and O1.docdate<=@ToDate
and O1.outqty>0 and O1.transtype in (21,19)),0
) as [Purchase Return Quantity],
isnull((
Select sum(isnull(outqty,0))
from OINM O1
where O1.itemcode=T1.itemcode and O1.Warehouse=W1.Whscode
and O1.docdate>=@FromDate and O1.docdate<=@ToDate and O1.outqty>0
and O1.transtype in (13,15)),0
) as [sale Quatity],
(isnull
Select sum(isnull(inqty,0))
from OINM O1
where O1.itemcode=T1.itemcode and O1.Warehouse=W1.Whscode
and O1.docdate<=@ToDate),0
isnull((
Select sum(isnull(outqty,0))
from OINM O1
where O1.itemcode=T1.itemcode and O1.Warehouse=W1.Whscode
and O1.docdate<=@ToDate),0)
) as [Closing Stock]
FROM OINM T0
INNER JOIN OITM T1 ON T0.ItemCode = T1.ItemCode
INNER JOIN OITW T2 ON T1.ItemCode = T2.ItemCode
INNER JOIN OITB B1 ON T1.ItmsGrpCod=B1.ItmsGrpCod
INNER JOIN OWHS W1 ON T2.WhsCode = W1.WhsCode
INNER JOIN OLCT C1 ON W1.Location=C1.Code
Group by T1.itemcode, T0.Itemcode, W1.WhsCode, C1.Location
) a
where (a.[Opening Stock]
+a.[Purchase Quantity]
+ a.[Purchase Return Quantity]
+a.[sale Quatity]+a.[Closing Stock]
) !=0
Regards,
Bala -
Serial Numbers for stock on hand.
Hi guys,
I want to migrate stock on hand of finished goods. I also have to migrate serial numbers for these finished goods. But, i cant find a transaction where I can do this!!! Can anyone help pls!?
I tried to do GR in MIGO, but the serial number tab opens up only for GR towards an order.Hello Sandeep,
1. As suggested by Dillibabu, you need to maintain your material with Sr number profile as per the business needs.
Please check the sr number profile usage in T-code OIS1 and OIS2 (Configuration mode - SPRO)
2. There are two option to upload/migrate the data
a. Manual Approch : incase, you have very few data you can think about this approch.
b. LSMW : Use LSMW if you have mass data migration, the object is provided by SAP for goods movement.
Object 0110 Goods movement
Method 0000
Program Name RM07MMBL
Program Type B Batch Input
Take the help from technical guy if you are new to LSMW.
Hope this helps.
Regards,
Arif Mansuri
Reward if answer is helpful. -
Query for Stock Tranfer Mov-311
Dear Experts,
I want to make a query to know value of stock transfer from one storage location to another on certain date or from x date to y date. In MB51 there is no value appears, as there is no financial transaction.
I am preparing query using SQVI, one table I have selected MSEG which other table I select so that value apprears.
My company requirement is this, they want how much material in terms of quantity and value has been transffered from RM Store to WIP Store.
Regards
GRHi G R,
see below table data's from MM60
MARA - Material master
MAKT - Material text
MARC - Material per plant / stock
MARD - Storage location / stock
MSEW - Material Valuation
MARM - Units of Measure for Material
Regards,
Sankaran -
Folks
One of my client need a report as below..
*ITEMNO -- ITEMNAME-- O/S (in RS & QTY) --- PURCHASES (in RS & QTY) -- ISSUES (in RS & QTY) --- CLOSING STOCK (in RS & QTY)*
It should have the provision to select DATEWISE.
Can anybody help me on this??
regards
KARTHIKHi Kartik,
Try the below query....
Declare @FromDate Datetime
Declare @ToDate Datetime
set @FromDate = '2005-01-01 00:00:00.000'
set @ToDate = '2011-01-01 00:00:00.000'
SELECT
T0.TransNum,
T0.TransType,
T0.CreatedBy,
T0.BASE_REF,
T0.DocDate,
T0.DocDueDate,
T0.CardCode,
T0.CardName,
T0.Ref1,
T0.Ref2,
(isnull((Select sum(isnull(inqty,0)) from OINM O1 where O1.itemcode=T1.itemcode and O1.Warehouse=T2.Whscode and O1.docdate< T0.DocDate ),0)-
isnull((Select sum(isnull(outqty,0)) from OINM O1 where O1.itemcode=T1.itemcode and O1.Warehouse=T2.Whscode and O1.docdate< T0.DocDate ),0)) as [Opening Stock],
T0.InQty,
T0.OutQty,
((isnull((Select sum(isnull(inqty,0)) from OINM O1 where O1.itemcode=T1.itemcode and O1.Warehouse=T2.Whscode and O1.docdate< T0.DocDate ),0)-
isnull((Select sum(isnull(outqty,0)) from OINM O1 where O1.itemcode=T1.itemcode and O1.Warehouse=T2.Whscode and O1.docdate< T0.DocDate ),0))+T0.InQty -T0.OutQty )AS [Closing Stock]
FROM OINM T0 INNER JOIN OITM T1 ON T0.ItemCode =T1.ItemCode LEft Outer Join OWHS T2 On T2.WhsCode =T0.Warehouse -
Hi Members,
My customer needs an report "Stock Statement" with selection criteria as Date, ItemGroupwise and warehouse wise with following columns namely.
Itemcode
ItemName
Opening Stock Qty
Receipt Qty
Issue Qty.
Price.
Kindly help me in this regard,
Thanks in advance,
Venkatesh.RHi!
Check these threads
Re: Item Stock Report (2nd page)
Item Stock Report -
Tables used for a Stock-In-Hand Report ?
Hi,
I need to generate a stock in hand report. For this report I only need to consider Purchasing Inventory Stock and not the Sales Order Stock. What tables do I have to use?, if possible the query!
Thanks,
KishanHi Kishan,
Try and use FM 'BAPI_MATERIAL_AVAILABILITY'. I have used this FM in the past for Stock on Hand reports. Only drawback is that it only runs for one material / plant at a time!
You cold also use FM 'AVAILABILITY_CHECK':
Structure to hold ATP Controller: Control Parameters
DATA: BEGIN OF st_atpca.
INCLUDE STRUCTURE atpca.
DATA: END OF st_atpca.
Table to hold ATP: Requirements to be Checked/Considered
DATA: BEGIN OF tbl_atpcs OCCURS 0.
INCLUDE STRUCTURE atpcs.
DATA: END OF tbl_atpcs.
Table to hold ATP Server: ATP data for display
DATA: BEGIN OF tbl_atpds OCCURS 0.
INCLUDE STRUCTURE atpds.
DATA: END OF tbl_atpds.
Table to hold ATP Server: Material Table
DATA: BEGIN OF tbl_atpmat OCCURS 0.
INCLUDE STRUCTURE atpmat.
DATA: END OF tbl_atpmat.
Populate ST_ATPCA
CLEAR st_atpca.
st_atpca-anwdg = '8'. "Calling App - Explaination
st_atpca-azerg = 'T'. "ATP Display Result
st_atpca-rdmod = 'A'. "Read Mode - Totals
st_atpca-xenqmd = 'N'. "Do not read Blocks
Populate TBL_ATPCS
CLEAR tbl_atpcs.
REFRESH tbl_atpcs.
tbl_atpcs-matnr = p_matnr. "Material
tbl_atpcs-werks = p_werks. "Plant
tbl_atpcs-prreg = 'A'. "Checking Rule for Avail Check
tbl_atpcs-chmod = 'EXP'. "ATP: Check mode
tbl_atpcs-delkz = 'VC'. "MRP element indicator
tbl_atpcs-bdter = sy-datum. "Requirements date for the component
tbl_atpcs-xline = '1'.
tbl_atpcs-trtyp = 'A'. "Transaction type - Display
tbl_atpcs-idxatp = '1'.
tbl_atpcs-resmd = 'X'. "Mode for Results of Check - Proposal
tbl_atpcs-chkflg = 'X'.
APPEND tbl_atpcs.
CALL FUNCTION 'AVAILABILITY_CHECK'
TABLES
p_atpcsx = tbl_atpcs
p_atpdsx = tbl_atpds
p_atpmatx = tbl_atpmat
CHANGING
p_atpca = st_atpca
EXCEPTIONS
error = 1
OTHERS = 2.
Would recommend giving both these FM's a go and see if they have what you want.
Cheers,
Pat.
PS. If you find these suggestions helpful, kindly award Reward Points appropriately. -
MM Report on Stock on Hand.
I am looking for a report reflecting the u201CTop 500 materials in a descending stock-on-hand value sequenceu201D as on a specific date. (it should reflect the mat number; description; unit of issue; unit price; SOH value per mat and cumulative value.)
How can I ge this in Invemtory Management.Dear All,
My query regarding stock on hand (MB5B )
1)When mb5b is used I am unable to take stock in a particular storage location.How to acheive this
2)In MB5B all the materials in the plant are being displayed which should not be and only material which are involved in stock trasactions (ie, opening stock,issues, closing stock etc)
Hope I am clear.
How to over come the above problems.
Pls provide your valuable inputs.
Regards, -
Ageing Report(STOCK IN HAND)
Dear All,
Can I have ageing report for stock in hands (Lot based ) in PP/MM
modules.
Kindly give your advises .
Thanks In Advance
Rakesh SehgalHi Rakesh,
pls check below two tcodes
1. MC46 - Slow Moving Items
2. MC50 - Dead stock items
Regards,
Sankaran -
CAN ANYBODY EXPLANIN ME HOW STOCK IN HAND IS CALCULATED? AND IN WHICH TABLE-FIELD STOCK IN HAND IS STORED.i.e. name of table for stock in hand?
pls provide me some input.
regards
simranIts not very clear - can you please explain with examples.
-
Stock in hand against po no.
hi all,
i want to develope a report in which stock in hand(from mb52 tcode) will be displayed against p.o no.format like this
plant material batch stock in hand po/sto no.
my client wants the report in which stock that is placed in storage will be displayed by po sto no.
currently we are using two step sto procedure by usung 351 and 101 movement type.
pls help
regards
sumit bislaMake them understand that this not a logical requirement as you can't establish a link of PO/STO for stock in hand.
Let me tell you why it is so..if suppose you have received goods against 2-3 PO/STO & Now you are issuing goods (stock transfers/Billing/Transfer posting/Goods Issue etc), at that time system does not consider the corrosponding STO/PO against which goods are received.
Inventory of material will decrease based on batch/valuation type which you have selected.
Refer Tcode ME80FN click on Change Veiw & select Purchase Order History with this you can get STO/PO-GRN Qty & Value details.
Last button on Application tool Bar it is in line of filter, total etc icons -
Query for Price difference account when item is not sold but not on stock
Hi Experts!
One of my clients accountant requires a report which will help for what to do with the balance of the price difference account.
At the and of the year there are some postings on this account, but not every item that hadnt been on stock when A/P Invoice arrived were sold. Some item were waistrel and put into a waistrel warehouse, but not sold.Some item were sent back to the supplier, but not sold.
Is it possibble to make a query for knowing where to post the balance of the price difference account? Not all should be post to the Cost of goods sold.
Thank you in advance!Hi,
The query is possible. However, it is a complicated one. It is also need to involve detailed analysis to your transaction histories. You may start from OINM table to check.
Thanks,
Gordon -
Sales Block for order whose quantity exceeds % of available stock on hand
Hello gurus,
I am wondering if there is standard SAP functionality that could enable the following scenario:
For a material in material group XYZ, if a sales order is entered that exceeds 50% of stock on hand, a delivery block is placed on the order. If a sales order is entered that is under 50% of stock on hand, no delivery block is placed on the order.
The number 50% is arbitrary and would be specified based on the material group. As well, this can be based on the material. I'm hoping there is configuration out there that would block the delivery creation if an item on the sales order exceeded a pre-defined % of available, unrestricted stock in the plant. Any help would be greatly appreciated!Hi Andy,
Let me summarise ur question - You have Material - A, B & C all of them belonging to a particular Mat. Group lets say - 444. Lets think if the stock of all the Materials - A, B & C is 100 CS's.
When a Sales order is created for Material - A for Quantity of 60 CS - You want a Delivery block.
If my understanding is yes, I think the requirement is too complex, but achiviable.
Because -
- If this can be achived its possible with only User exits, but the requirment is linked with Availability,
- If we want to implement this in the Save user exit, the code has to go check the stock in availability and if the conditions are met needs to block the delivery,
- you need to consider the stock situations as the re-scheduling will also be happening in the background,
- Wht would happen if there are more than 1 material entered and both are different Material grounps. [Need to consider this scenario as well]
Instead of Delivery block - You can implement the changes to Reject the line if the % crosses. That is reason for rejection. As this is more specific to line item.
Create a Z* table and update it with the Material groups that you are planning to use. And give the %.
Implement the code changes in the Save user exit in MV45AFZZ to check this table for each material group and validate it and then compare the Ordered Quantity with the available stock of that material. Not sure though from where you want to get the stock figures.
I tried, but this might be a start. All the best.
Thank you,
Chaitu... -
SAP has a table that maintains Stock on Hand for each day
SAP has a table that maintains Stock on Hand for each day
do u know which table is that
as i need to find data on stock on handHI Arunraj
if there is any specific time of the day that you want to extract the data, you can copy the data from the order series key figure (assuming that you want to extract the data from the order series keyfigure) to a time series key figure and extract the data from the time series key figure into a cube, etc.
I mention a specific time of the day because the stock situation is likely to change multiple times of the day due to stock movements on account of various reasons. Hence if you can establish a rule or a cut-off time of the stock situation, you can use the above route.
Hope this helps.
Thanks, Sandeep
Maybe you are looking for
-
Error : Modification not possible- while creating source system in BI7
Hi BI Guru's, We are using BI7 and source system ECC6 ,We are about to move to production, When creating the source system in BI PRD system we getting the Error Modification not possible.we created RFC connection, background user and remote connectio
-
How do I get the messages on my macbook to send from my phone number
I have been using my macbook pro for iMessage for at least a year. Yesterday I reset the password because I received a notification that there had been a log in to my iCloud from an outside source. Today I am messaging and the person receiving the iM
-
Object.equals() question.
Lets say i have a class: public class MyClass{ int x; int y; int z; }And i have two objects: one and two... will one.equals(two)return true if the fields for both objects hold the same values? or return true if they both point to the exact same objec
-
Hello, May be in this forum could I have more chances to get a reponse. My problem is: I've used the Server model guide to retrofit one schema's user. When I try to save the Server Model diagram it fails with: ORA-01036: illegal variable name/number
-
Designjet z3200ps - how to prepare/insert 0.8mm 500g cardboard sheet
when I insert a 0.8mm 500g cardboard sheet into the printer it can only be inserted with a bit of forece and it comes out with marks from the transportation rolls. how/where I can prepare the printer for the thick paper (not in the print dialog) whe