Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Find material Stock to given date

Former Member
0 Kudos

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 ?

11 REPLIES 11

Former Member
0 Kudos

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.

former_member181962
Active Contributor
0 Kudos

HI,

YOu can make use of the fm: MB_READ_MATERIAL_STOCKS

Regards,

Ravi

Former Member
0 Kudos

Hi

See the TCODE 'MB5B' program RM07MLBD, and take the logic for this.

regards,

ANJI

ferry_lianto
Active Contributor
0 Kudos

Hi,

Please check this BAPI BAPI_MATERIAL_AVAILABILITY.

Regards,

Ferry Lianto

0 Kudos

Here i am not able to find stock of material and there in no date input parameter in this bapi

0 Kudos

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

raymond_giuseppi
Active Contributor
0 Kudos

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

0 Kudos

Do you know where the Material and Gird wise stock is stored for the given date in AFS

0 Kudos

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

0 Kudos

u cannt use MARDH to get the stock.

u have to use MARD.

cross check MB51 or MB5B.

Regards

prabhu

0 Kudos

resolved