information on Warehouse stock for particular date
Hi,
I need to develop program which should mimic "MB52" transaction with addition of "key date".i.e. It should give details of warehouse stock for any date.
"MB52 doesn’t handle any movement types and gives only snapshot of stock when we run that report. To get the snapshot of the same stocks on a given key date, the movement types need to be considered and the following rules need to be applied:
(1) From that key date till today, all the issues are to be reversed, i.e. added to the current stock.
(2) From that key date till today, all the receipts are to be reversed, i.e. subtracted from the current stock.
For this purpose I need information for the movement types relevant to each stock field, viz Un-Restricted Stock, Inspection, Blocked, etc.
Without this input, we will not be able to derive the stock as of some given key date.
can you tell me the tables that are to be looked into for achieving the above functionality?
Why don't you just use T.Code MB5B, as this shows stock on a given date.
_________________
www.rosethistle.com
Beyond expectations
Hi ksc
You can use table S031 to capture the stock movement.
THis is the logic to get opening stock in storage location level:
To Get Current Stock:
Select LABST+INSME+SPEME from MARD into CurrentStock where MATNR = Material# and WERKS = Plant and LGORT = SLoc
Alternately you can use S032 table to get the current stock for the material, plant, storage location.
To Get Total Receipt within certain period (backward calculation):
Select sum(MZUBB) from S031into TotalReceipt where MATNR = Material# and WERKS = Plant and LGORT = Sloc and SPMON < = CurrentPeriod and SPMON >= BeginPeriod
To Get Total Issue within certain period (backward calculation):
Select sum(MAGBB) from S031into TotalIssue where MATNR = S_MATNR and WERKS = Plant and LGORT = SLoc and SPMON < = CurrentPeriod and SPMON >= BeginPeriod
OpeningStock = CurrentStock - TotalReceipt + TotalIssue
Regards
Prasad
Hi Prasad,
You are correct.Your logic gives total stock.My requirement is that I have to get output exactly as that of MB52 ,with the addition of key date.Moreover the tables S031,S032 are structured tables.can you suggest me any tables other than above ?My requirement is as follows.
a)unrestricted stock
b)qty.Insp stock
c)Restricted stock
d)blocked stock
e)returns blockstock.
can you throw me some light to find the above ?
regards,
KSC.