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: 

Inventory details for a particular date

Former Member
0 Kudos

All,

I need to get all the inventory details from MBEW/MBEWH table for a particular date. Since these tables store data only period wise, getting the data for a particular date (or for certain months alone) is not easy. So, I am querying MKPF and MSEG for all material documents (and other details such as material number, plant, company code...) posted for a particular date (BUDAT field). Based on MKPF/MSEG data (material number, plant) I am querying MBEW/MBEWH for data.

Can some one confirm if this is a good idea? Will material document numbers be updated in MKPF/MSEG for all inventory related movement? Will MBEW/MBEWH reflect data as per this inventory movements?

Thanks in advance,

Keerthi

3 REPLIES 3

brad_bohn
Active Contributor
0 Kudos

That's exactly what MB5B provides - have you reviewed that transaction/program?

Former Member
0 Kudos

I guess I should have been clearer on my requirements. I pull out data from sap tables, upload it in sql server and write sql query on this data for reports. So, looking at sap transactions every now and then for comparison might not be possible. But yes, I did go through the transaction MB5B, MB5L, MB52, MC.9....and MB5B is the closest one to my requirement.

What I want ,is inventory details for a particular time frame (has no connection with sap period), irrespective of material type, material movement etc. I just want to know the value of all the material lying around in the plant.

The first idea was to go to MKPF/MSEG get the material document, material number, year...and query MBEW/MBEWH table. But there could be material with no material document number generated (that is, no movement at all) lying around. Which means, my inventory count could go wrong because there isnt a corresponding record in MKPF/MSEG.

The second idea was to hit MARA table, get all the material created for my particular time frame and then go to MBEW/MBEWH table. Again, there is a possibilty that some material might have been created long while ago, and is remaining in plant, untouched - which leads me back to the same problem of wrong inventory count.

Can someone confirm if these possibilites could happen??? And what is the best solution out???

brad_bohn
Active Contributor
0 Kudos

OK, so why don't you just follow the logic of MB5B for your requirement? Or, at a minimum, enhance MB5B so that you can wrap the program call in a function, retrieve the tabular results, and then return the results to your application?