on 03-20-2009 4:06 AM
Hi Experts,
I have a sitution to calculate Opening stock for a particular date.
please help me with the necessary Fields & Tables required.
Appriciate If any Sample coding available.
Thanks & regards,
Venkat.
Hi Venkat,
To Calculate Opening Stock & Closing stock there are different procedures.
It just depends of\n the client requirements & usage of the material.
For example, we have different types of stocks, like, Through Pipeline, Special, Unristricted, quality, safety,
and many types of stocks.... so all these types are indicated in MSEG tabe in SOBTZ field,...
Now Comimg to your Query, You need to calculate OPENING & CLOSING STOCK.
We have a similiar standard report in MB5B Tcode..
to get the same results in your report do like this...
For valuated stock go to the MARDH, MBEWH, MCHBH tables But I Prefer MBEWH.
here in MBEWH give the month & year and you get the result in LBKUM field...
For Special stock, You need to go to another table like MKOLH,,(I forgot still 2 more) and
give the month & year inputs and you will get the result in SLABS field.
and remaining MB5B refers to its deetails lists with different Movement types,
whcih you can get clearly from MSEG Table...
Hope you can write the select Queries accordingly.
Thanks & Regards,
Dileep .C
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
Its tricky requirement and the prog will have Optimization issue in later stage as well.
Anyways .
Tables are
MSEG , MKPF ... use Debit / Credit indicator ( Do not go woth any static Movement types ) and u have to consider all stock related table
MBEW , EBEW etc..., to get the stcok on particular date .
Please refer to Std. Tcode FBL5N for reference.
Br, Parthi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Venkat,
If you want to find the Stock for a particluar date, It is not available in any table as I know,
Rather you need to do calculations like this.
Select the stock (Menge) till date from MSEG and add all with different movement types,
Its a logic need to ask to your functional consultant,
like 101 added to stock, 601 sales, 102 rejeted, 602 added back to stock,... transfers, 261,,, like this.
But take a little time, get all these by using MKPF & MSEG tables... thats it.
Thanks & regards,
Dileep .C
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
AFAIK there are no tables which can directly give you stock on a particular date. MARD/MARDH, MCHB, MCHBH etc. provide you with period stocks & not daily stocks.
I think you can use the std. SAP report MB5B for this purpose as suggested in some post. But i am not sure whether it can help.
BR,
Suhas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
other wise
You could try calling transaction MB5B from within your Z.. program. MB5B
will give you the stock on a specific date
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
It may help both of you to look at MARDH (Stock History). Bearing in mind
that this table is only updated if the stock position is different at month
end when the material posting period is closed (as I understand it).
Regards,
Anki Reddy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
-> S031
-> S032 tables
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Table: MARD
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
96 | |
9 | |
8 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.