I am opening this thread, because although the search, i didn't find a clear answer.
My problem is that, i want to correct a query we have developed, which is calculate the z-field TOTAL stock on posting date in a wrong way.
So the input should be :
and the output the TOTAL stock
The functionality is like the MB5B tcode..
Is there any SAP function to do this or i have to develop one ?
Thanks in advance
I can't help it, this sounds like a masked "spec dumping" attempt. Maybe you can "clear my doubts". Please describe what you have researched so far. Also post the query that gives the wrong result for better analysis.
Since you know that MB5B has the desired functionality, did you try analyzing/debugging how this transaction does it? If not, why not?
The functionality is like the MB5B tcode.. Is there any SAP function to do this or i have to develop one ?
If you want to find the opening & closing stock on a particular date, unfortunately SAP doesn't provide any FMs to cater to this requirement.
Run a SQL trace to check the DB tables which are involved in MB5B, then debug the trxn & figure out a logic.
PS: In one of my previous projects we had developed a custom FM for similar kind of requirement. In that we had made use of combination of LIS structure & standard SAP "stock" tables viz., MARD/MARDH, MCHB/MCHBH etc. to calculate the stock for a particular date!
Thank you all for your answers,
The problem is that the MARDH table (which the program reads) doesn't seem to be right.
The total quantity of 168,900 at the end of 3rd period is correctly added to MBEWH table, but the MARDH table shows this quantity at the end of 4th !
see link for details..
How is this possible ???
I posted to MM, so this thread can be locked.
the link is the follow.
but i think that this issue has to do with ABAPers because The logic how tables are updating concerns us too, and not only MM consultaning
thanks in advance.