Skip to Content
-3

Would you know a function or a bapi that can give me the stock for a material in a specific day?

Jun 02, 2017 at 09:17 PM

261

avatar image

Would you know a function or a bapi that can give me the stock for a

material in a specific day?
i founded a bapi called bapi_material_availability but it doesn't give the
stock in a past day.

i need for storag location with batch

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

5 Answers

Jürgen L
Jun 02, 2017 at 09:57 PM
1

There is no such BAPI or function, there is a transaction with a huge program: MB5B. The stock of a certain day in the past is not stored in a table, the program starts with todays stock and calculates backwards based on the movements.

Share
10 |10000 characters needed characters left characters exceeded
Jürgen L
Jun 03, 2017 at 09:27 AM
1

If you could share the business background for this information then we might have alternative ideas.

I am doing SAP for 20 years and did other systems before, but to know how much stock I had on the second Thursday in March was never a figure to drive our business.

If such information is extremely important for your business and you are concerned about performance then it might be worth to copy the stock information every day at midnight into a Z-table. So you can quickly access the needed information with a single select.

Or you run MB52 report daily and store the list in an archive. Just depends on the requirements, like how often needs someone to know this info, for what reason and if it is enough to read it from a list or if you need to compute it further

Show 2 Share
10 |10000 characters needed characters left characters exceeded

i have create my own function calculation based on table MSEG working fine but very very very slow bad performance

after grows of data now always getting run time error , so i'm locking for alternative solution

0

most of time we have pending sales order we need to enter and completed to invoices in Previous Month before closing the month

without know the availability of material batch it took much time to determine which batch available.

for example : if today is : 05/06/2017 i need to make invoices in 31/05/2017 before closing month 05 /2017

0
Jürgen L
Jun 05, 2017 at 07:42 AM
0

Think again - is your business really that different to any business at any SAP customer world wide? If all customers would need such BAPI to invoices then it was probably available.

From your text it is unfortunately not explained with a reason, just with a wish. Also the logical flow of the business case is not really explained in a way strangers could understand it.

Why is it needed to know the availability of a batch if you want to post an invoice?

Why can't you use GR based Invoice verification?

Show 2 Share
10 |10000 characters needed characters left characters exceeded

what i mean is in time of create delivery and PGI (VL01N) in Previous day for any reason like pending data entry as i explain before the batch determine will not give accurate ATP so need manual calculate to know which bath are available to Post Good Issue

0

Sorry this is even more confusing. Now you even turned from a simple stock quantity into availability check. If you want to post a goods issue then you should actually know what you have put onto a van and not just theoretically determine something.

0
Raghu Govindarajan Jun 12, 2017 at 08:45 PM
0

Looks like they are having business process issues in trying to get users to actually acknowledge picking or PGI when the delivery gets sent out. There are a lot of better ways to solve this issue. For one you can tie the printing of required outputs such as a packing list or bill of lading to the PGI. No PGI -> no documents -> can't ship. You can also change your ATP check control to consider existing deliveries. That way the new deliveries can not be created if there is not enough material to satisfy the old deliveries plus the new ones.

Share
10 |10000 characters needed characters left characters exceeded
Sijin Chandran Jun 14, 2017 at 05:59 AM
0

Hello Ahmed,

Check with the below document.

https://blogs.sap.com/2012/11/30/getting-opening-and-closing-quantities-of-stock-with-accuracy-of-mb5b/

MB5B is a very well tuned program so it should not raise performance concerns.

Thanks,

Sijin

Show 4 Share
10 |10000 characters needed characters left characters exceeded

yes performance seems not to be problem as there are "only" 26 OSS notes for performance and MB5B ;-)

0

Not able to guess even whether u actually "agreed" with my point or "disagreed".

But with my first employer we were easily able to leverage MB5B like this without any performance overhead.

0

I disagreed. MB5B is the performance killer number 1.

But of course it depends on the volume that needs to be read. On the size of your machine, on the number of users working at the same time in a system , etc etc etc.

It is just a fact that MB5B starts with the current stock and reads the material documents backwards to calculate a stock in the past. If I do it for a single material and not looking far into the past then it can be used for analysis, but doing the same thing for a plant with some 10 thousand materials which might have several million material documents can be quite challenging

1

Yes exactly.

With my first employer the amount of material transactions was moderate ( not that high and not that low ).

And the report which we created based on MB5B used to be run in background jobs like many other FICO related reports. And the report was mainly run on month end times. So we never faced any issues instead we got a perfect Stock report :) and of course with Opening and Closing as accurate as MB5B's ;)

0