04-12-2007 2:57 PM
I have been asked to customize the standard report transaction MB5L. I have created ZPROGRAM for the report. I have an input field for date to get material stock till that date.How can i calculate material stock till the given date ?
04-12-2007 3:03 PM
get the data into an internal table... take one more and move only material and stock quantity to this table....
now loop at itab2.
collect itab2.
endloop.
loop at itab2.
read table itab1 with key matnr = itab2-matnr.
if sy-subrc = 0.
move required data..........
endif.
endloop.
04-12-2007 3:04 PM
HI,
YOu can make use of the fm: MB_READ_MATERIAL_STOCKS
Regards,
Ravi
04-12-2007 3:08 PM
Hi
See the TCODE 'MB5B' program RM07MLBD, and take the logic for this.
regards,
ANJI
04-12-2007 3:10 PM
Hi,
Please check this BAPI BAPI_MATERIAL_AVAILABILITY.
Regards,
Ferry Lianto
04-12-2007 3:19 PM
Here i am not able to find stock of material and there in no date input parameter in this bapi
04-12-2007 3:25 PM
Hi Sentil ,
Basically , you can do it by using MBEWH , MSEG+MKPF
i.e : You can search for the material stock in MBEWH for 03/2007 and you can check the material movements from MSEG+MKPF for the given date 04/04/2007 .
Hope this helps
Caglar
04-12-2007 3:57 PM
Basically you will have to use
An "historical" table with stock at end of periods
- MBEWH Material Valuation: History
- MARDH Material Master Storage Location Segment: History
etc.
A "flow" table for movement before last period recorded and date asked for
- MSEG/MKPF Document Segment: Material
- BSIM Secondary Index, Documents for Material
<i>(Use MSEG/MKPF for quantities and BSIM for valuations its easier than matching the two files, valuation can vary without movement in MSEG and some movement in MSEG don't reflect in accounting)</i>
Regards
04-12-2007 4:36 PM
Do you know where the Material and Gird wise stock is stored for the given date in AFS
04-23-2007 8:03 AM
I dont know the exact answer, but you can look for information for some AFS Table in <a href="https://websmp205.sap-ag.de/~sapdownload/011000358700007231962002E.pdf">Data Reduction and Archiving Recommendations for Apparel & Footwear (AFS) Custopers</a>
Regards
04-23-2007 8:13 AM
u cannt use MARDH to get the stock.
u have to use MARD.
cross check MB51 or MB5B.
Regards
prabhu
04-28-2009 7:34 PM