How to revaluate negative closing stock value in SAP B1?
Hi all,
I am trying to revaluate those items with the negative closing stock value using Inventory Revaluation. I choose Inventory Debit/Credit for the revaluation type and key in the item code, quantity, +ve value in debit/credit, G/L increase and decrease account.
After I added the Inventory Revaluation successfully , I go and check in the Inventory Audit Report for the specified item but found that the item still with the negative closing stock value.
My major concern here is the items with negative closing stock value do not have any in stock quantity. Can I adjust the negative closing stock value of the items with zero quantity?
Thanks.
Best Regards,
Xavier
Hi all.
Just found out why I cannot do the negative stock value revaluation. When I want to do the inventory revaluation for the items of negative stock value with zero quantity, the journal entry will debited to the wrong account, that is 507040-00-000 (Price Difference Account).
Inventory Revalution for item with zero quantity:
[http://img33.imageshack.us/img33/6596/invrevaluation.jpg]
Journal Entry:
[http://img84.imageshack.us/img84/879/81238835.jpg]
Sample of Charts of Accounts:
[http://img31.imageshack.us/img31/2078/coaq.jpg]
When I do the inventory revaluation for the items where the in stock quantity is greater than zero, the journal entry will debited to the correct account, that is 105011-00-000 (Consumables account).
Inventory Revaluation for item with quantity greater than zero:
[http://img819.imageshack.us/img819/5711/invrevalution.jpg]
Journal Entry:
[http://img24.imageshack.us/img24/7136/80015631.jpg]
The items are under the same item group - Consumables
[http://img543.imageshack.us/img543/2347/itemgrp.jpg]
I do not why this will happen when I try to revaluate the items with negative stock value of zero quantity?
Kindly share with me your opions.
Thanks,
Xavier
Similar Messages
-
How to get Opening /Closing stock value of Non Valuated stock materails
Hello,
We would like to know since 95% of our procurement will be for Projects and since the stock is u201CNon-Valuatedu201D stock, is there any method by which we will be in a position to get the details of Opening Stock, Purchases & Closing Stock?
Regards
Sapman manhi
try mb52
enter maerial type for nonvaluated stock
then
execute
you will get output
regards
vijay -
Hi SAP Gurus,
how will get the closing stock value for datewise in month.
Thanks
Shri..Hi,
i am getting values of all the material which is not required.
I required total closing stock date wise with stock value flat figure.Is there any standard report for that.
Thanks
Shri.... -
Negative closing stock on back date
All SAP Gurus,
We have made GR (MIGO) on todays posting date.
And issued the material on yesterday's posting date (past date), (where there was no stock on that date).
System allowed us to issue the material on past date, on which there was no stock.
And now showing closing stock on previous date as negative.
We want to avoid such negative closing stock.
What configuarational changes we need to do?
Regards,hi
This is standard functionality .. u can not do anything in std. as there is no error message available for this
u can do one thing In OMSY u can remove remove the check mark in the ABp (Allow Back Posting) check box for your Company Code, to stop postings in the closed periods.
or in MMRV do not tick posting in previous period
Vishal..... -
Deriving Closing stock value in BPC
Hello Experts,
I want to have closing stock (Quantity & Value) in my BPC report, but in BI stock value and quantity is not stored as on date. I can get only Issue quantity/value and Receipt quantity/Value on daily basis, we can accumulate this value to get monthly values.
Is there a way to get closing stock value from BI/BW.
Regards
Bhagyesh RavangeHi Deepthi,
Difference in both of reports is due to that MC.A is picking the values from stock movements while Z-ALR_87012277 or S-ALR_87012277 is picking the values from the respective G/Ls.
However If anybody make the direct posting in G/L then this update will be reflect in ALR report but it will not be visible for MC.A or any other stock valuation tcode because direct posting in G/L dosn't involve any material movements.
Hope you are getting me....
Kuldeep Dahiya -
Opening and Closing Stock Calculation In SAP BPC 10.0 NW
Hello Experts,
Need your guidance on this calculation.
BI Cube: Receipts and Issues only Available on day basis
BPC Report / Cube Context
Product = Product1, Product2,
Account = receipts, Issues, Opening Stock, Closing stock,
Flow = Other
Audittrail = Input
UOM = QTY
rptcurrency = LC
Category = Actual
TIme = All Periods (Monthly)
Plant = Plant1, Plant2, Plant3, Plant4
In the Cube I don't Have Opening Stock, without Which I cannot calculate Closing stock.
Scenario: If I Enter Manually Opening stock for all products at some starting point, say In Year 2008 Jan. How To take this closing stock of this month automatically to next month opening stock and So on and so forth to following Periods? Is it possible through "Carry Forward Business rule" in this case, as Closing stock is a calculated value using Member dimension Formula. I am having receipts and issues in Account dimension.
Dimension Formula used: Closing Stock = Opening Stock+Receipts- Issues.
Please find attachment of the report screen shot.
Thanking you
PraveenHello Vadim,
1. The Cube storage Type is "Periodic".
2. Acctype of the account dimension is "AST"
3. Time Dimension Is based on Month.
ID
Description
RELEVANT
Base Period
CLOSED
Level
Month Number
Period
TIMEID
Year
Calendar
2006.01
2006 Apr
1
MONTH
1
APR
20060100
2006
2006.Q1
2006.02
2006 May
2
MONTH
2
MAY
20060200
2006
2006.Q1
2006.03
2006 June
3
MONTH
3
JUN
20060300
2006
2006.Q1
2006.04
2006 July
4
MONTH
4
JUL
20060400
2006
2006.Q2
2006.05
2006 August
5
MONTH
5
AUG
20060500
2006
2006.Q2
2006.06
2006 September
6
MONTH
6
SEP
20060600
2006
2006.Q2
2006.07
2006 October
7
MONTH
7
OCT
20060700
2006
2006.Q3
2006.08
2006 November
8
MONTH
8
NOV
20060800
2006
2006.Q3
2006.09
2006 December
9
MONTH
9
DEC
20060900
2006
2006.Q3
2006.10
2007 Jan
10
MONTH
10
JAN
20061000
2006
2006.Q4
2006.11
2007 Feb
11
MONTH
11
FEB
20061100
2006
2006.Q4
2006.12
2007 Mar
12
MONTH
12
MAR
20061200
2006
2006.Q4
2006.Q1
2006 Q1
3
QUARTER
3
Q1
2006
2006.TOTAL
2006.Q2
2006 Q2
6
QUARTER
6
Q2
2006
2006.TOTAL
2006.Q3
2006 Q3
9
QUARTER
9
Q3
2006
2006.TOTAL
2006.Q4
2006 Q4
12
QUARTER
12
Q4
2006
2006.TOTAL
2006.TOTAL
2006
12
YEAR
12
TOTAL
2006
Thank You
Praveen -
Negative closing stock in inventory
Hi Gurus,
Iam getting -ve closing stocks when iam running the report on inventory cube 0IC_CO3.
1.Iam using 0valuated stock as my keyfigure for closing stock
2.I Have checked in MB5B in R/3 side and came to know that in movement type 641 which is related to goods issued some batch numbers are getting repeated in BW side.
For EX:For matrerial code FC35025RT and the batch no 8301 the quanity issued is 36 in R/3 and its showing the same in BW upto PSA, but when loading into the cube its getting loaded as 72 instead of 36.
3.The cube is on built on 3.5.
Please advice.
Regards
Amar.Hi,
Use 2LIS_03_BX, 2LIS_03_BF, 2LIS_03_UM to 0IC_C03 Cube and design the report.
Use :See the steps how to load the data to 0IC_C03.
Treatment of historical full loads with Inventory cube
Setting up material movement/inventory with limit locking time
If it is BI 7 then for BX in in DTP in Extraction Tab you need to select Extacrion mode = NON-Cumulative option.
0VALSTCKVAL " For Value
0VALSTCKQTY " For Qty
0CALMONTH " For Month
Use the above combinations in New Selections in columns and go it.
For Qty Opening:
New Selection, drag and drop following InfoObjects
0VALSTCKQTY " For Qty
0CALMONTH " For Month and restrict with less then or equalto option variable (single value, user input) and set the offeset
" value = -1 bcoz if user will give 12.2009 , so it will display 11.2009 closing stock, this is opening for 12.2009.
For Qty Closing:
New Selection, drag and drop following InfoObjects
0VALSTCKQTY " For Qty
0CALMONTH " For Month and restrict with less then or equalto option variable (single value, user input) .
In the same way build for Value and other Keyfigures on 0IC_C03.
And
Drag & drop
0MATERAIL
0PLANT " Give some Input Variable.
Thanks
Reddy
Edited by: Surendra Reddy on Jun 21, 2010 7:51 AM -
Can you post a ARCreditNote with a Stock value into SAP without a COS value
Hi Guys,
I need some help here I am a XI/PI developer not a FI/CO consultant.
My problem is my customer runs SAP B1 at their branches, now one of the branches made out a AR Invoice at the time of the invoice the stock had a zero value so the invoice looks like below
CUST: 969.00
REV: 850.00 QTY: 1
VAT: 119.00 QTY:1
Now the invoice posted successfully, then a month later they make out a AR Credit Note which looks like this
CUST: 969.00
REV: + 850.00 QTY: 1
VAT: + 119.00 QTY:1
STOCK: + 385.00 QTY: 1
PPV: - 385.00 QTY: 1
COS: 0.00
The credit note I get the following error
Error:
Missing line item for CO-PA characteristic line 0000000900
Now what I want to know is it possible to post this credit note into SAP.
Kind Regards,
CJ Besterendmile said:
Writing to the local variable will set the value at that time, but it's still updating the value of the local variable all the time.
What exactly do you mean by this?
endmile said:
But in this case, I think the simplest answer is the property node.
That's not a valid conclusion. There is no "simplest" answer. It's all context-based. There's nothing "bad" or "evil" about local variables. In fact, they tend to be faster than writing to the "Value" property node. Let's just say that proper use depends on understanding how each operates, and once you know that, each can be used effectively.
I hope this doesn't become another one of those "local variables vs property nodes". -
MB5B-Retrive Closing Stock into our General Report
this is parameswar,
> Using MB5B tcode how to import the Closing Stock value in our General report.
> In which table the closing stock value is saved this is value should be equal to the MB5B
> is there any way to import the that value in our General Report
> Based what kind of TABLE, FIELD- after calculating.for this u will have to create a Z report. Just copy the code of MB5B and add additional columns for closing stock, u will find the data in mbewh and mbew tables.
-
Negative Balance in Opening Stock & Closing Stock
Dear Experts,
Below the query which i used to get the Opening Stock,Purchase,Issue,Return and closing stock. Here i face some problem that i get negative inventory for some items and the same has been checked in inventory audit report but there it is showing correct value.And also i understand that those items which shows negative inventory in Opening and closing is previously got changed in Item group after some transactions.Can any one help me to sort out this issue ?
Declare @FromDate Datetime
Declare @ToDate Datetime
Declare @ItmsGrpNam varchar(100)
select @FromDate = min(S0.Docdate) from dbo.OINM S0 where S0.Docdate >= '[%0]'
select @ToDate = max(S1.Docdate) from dbo.OINM s1 where S1.Docdate <= '[%1]'
select @ItmsGrpNam = max(s2.ItmsGrpNam) from dbo.OITB S2 Where S2.ItmsGrpNam = '[%2]'
Select distinct a.Itemcode, max(a.Dscription) as ItemName, (Select i.InvntryUom from OITM i where i.ItemCode=a.Itemcode) as UOM,a.InvntAct,
(isnull(( Select distinct sum(isnull(inqty,0)) from OINM O1 where O1.itemcode=a.itemcode AND O1.InvntAct = a.InvntAct
and O1.DocDate<=@FromDate ),0)- isnull(( Select sum(isnull(outqty,0)) from OINM O1
where O1.itemcode=a.itemcode AND O1.InvntAct = a.InvntAct and O1.DocDate<=@FromDate),0)) as [Opening Stock],
(isnull((Select distinct isnull(sum(round(TransValue,0)),0) from OINM O1 where O1.itemcode=a.itemcode AND O1.InvntAct = a.InvntAct
and O1.DocDate<=@FromDate ),0)) as [Opening Stock Value],
isnull((Select ISNULL((sum(isnull(inqty,0))),0) from OINM O1 where O1.itemcode=a.itemcode AND O1.InvntAct = a.InvntAct
and O1.docdate>=@FromDate and O1.docdate<=@ToDate and O1.transtype in (20,18)),0) as [Purchase Quantity],
isnull((Select isnull(sum(round(TransValue,0)),0) from OINM O1 where O1.itemcode=a.itemcode AND O1.InvntAct = a.InvntAct
and O1.docdate>=@FromDate and O1.docdate<=@ToDate and O1.InQty>=0 and O1.JrnlMemo not like '%cancellation%'
and O1.transtype in (20,18)),0 ) as [Purchase Value],
isnull((Select sum(isnull(OutQty,0))from OINM O1 where O1.itemcode=a.ItemCode AND O1.InvntAct = a.InvntAct
and O1.ApplObj = '202' and O1.docdate>=@FromDate and O1.docdate<=@ToDate and O1.OutQty>0 and
O1.transtype = '60'),0) as [Production Issue Quantity],
isnull((Select isnull(sum(round(TransValue,0)),0)from OINM O1 where O1.itemcode=a.itemcode AND O1.InvntAct = a.InvntAct
and O1.ApplObj = '202' and O1.docdate>=@FromDate and O1.docdate<=@ToDate and O1.OutQty>0
and O1.transtype = '60'),0) as [Production Issue Value],
isnull((Select sum(isnull(Inqty,0)) from OINM O1 inner join OIGN G1 on O1.BASE_REF = G1.DocNum inner join IGN1 G2 on G1.DocEntry=G2.DocEntry
where O1.itemcode=a.itemcode AND O1.InvntAct = a.InvntAct and O1.ItemCode = G2.ItemCode
and G2.BaseType = '202' and G2.TranType is null and O1.docdate>=@FromDate
and O1.docdate<=@ToDate and O1.Inqty>0 and O1.transtype = '59'),0) as [Goods Receipt Return Quantity],
isnull((Select sum(isnull(Inqty,0)) from OINM O1
inner join OIGN G1 on O1.BASE_REF = G1.DocNum
inner join IGN1 G2 on G1.DocEntry=G2.DocEntry
--inner join OITM a on a.itemcode= o1.ItemCode
--inner join OACT c on c.AcctCode = o1.InvntAct
where O1.itemcode=a.itemcode AND O1.InvntAct = a.InvntAct and O1.ItemCode = a.ItemCode
and G2.LineNum = O1.DocLineNum and G2.BaseType = '202' and g2.TranType is null
and O1.docdate >= @FromDate and o1.DocDate <= @ToDate
and O1.Inqty>0 and O1.transtype = '59'),0)as [Goods Receipt Return Quantity_1],
isnull((Select sum(round(TransValue,0))from OINM O1 inner join OIGN G1 on O1.BASE_REF = G1.DocNum inner join IGN1 G2 on G1.DocEntry=G2.DocEntry
where O1.itemcode=a.itemcode AND O1.InvntAct = a.InvntAct and O1.ItemCode = G2.ItemCode
and G2.BaseType = '202' and G2.TranType is null and O1.docdate>=@FromDate
and O1.docdate<=@ToDate and O1.Inqty>0 and O1.transtype = '59'),0) as [Goods Receipt Return Value],
(isnull((Select distinct isnull(sum(isnull(inqty,0)),0)from OINM O1 where O1.itemcode=a.itemcode AND O1.InvntAct = a.InvntAct
and O1.DocDate<=@ToDate),0)- isnull((Select isnull(sum(isnull(outqty,0)),0) from OINM O1
where O1.itemcode=a.itemcode AND O1.InvntAct = a.InvntAct and
O1.DocDate<=@ToDate),0)) as [Closing Stock],
(isnull (( Select distinct isnull(sum(round(TransValue,0)),0)from OINM O1 where O1.itemcode=a.itemcode AND O1.InvntAct = a.InvntAct
and O1.DocDate<=@ToDate),0)) as [Closing Stock Value],
(Select distinct i.LastPurDat from OITM i where i.ItemCode=a.Itemcode) as 'Last Purchase Date',
(Select distinct b.ItmsGrpNam from OITB b where b.ItmsGrpCod = I1.ItmsGrpCod) as 'Group Name'
from (Select distinct N1.Itemcode, N1.Dscription, isnull((sum(N1.inqty)),0)-isnull((sum(n1.outqty)),0) as OpeningBalance,
isnull((sum(N1.Transvalue)),0) as OpeningValue,n1.InvntAct,0 as INq,
0 as OUT From dbo.OINM N1 inner join OITM i on i.ItemCode = N1.ItemCode
inner join OITB b on b.ItmsGrpCod = i.ItmsGrpCod
inner join OACT c on c.AcctCode = n1.InvntAct
Where N1.DocDate <=@FromDate and i.ItemCode = n1.ItemCode and b.ItmsGrpNam = @ItmsGrpNam and N1.Transtype <> '67'
Group By N1.ItemCode,N1.Dscription,n1.InvntAct
Union
select distinct N1.Itemcode, N1.Dscription, 0 as OpeningBalance,0 as OpeningValue,
n1.InvntAct,sum(N1.inqty) , 0 as OUT From dbo.OINM N1 inner join OITM i on i.ItemCode = N1.ItemCode
inner join OITB b on b.ItmsGrpCod = i.ItmsGrpCod
inner join OACT c on c.AcctCode = n1.InvntAct
Where N1.DocDate >= @FromDate and N1.DocDate<= @ToDate and N1.Inqty >0 and n1.ItemCode = i.ItemCode
and b.ItmsGrpNam = @ItmsGrpNam and N1.Transtype <> '67'
Group By N1.ItemCode,N1.Dscription,n1.InvntAct
Union
select distinct N1.Itemcode, N1.Dscription, 0 as OpeningBalance,0 as OpeningValue,n1.InvntAct,0,sum(N1.outqty) as OUT
From dbo.OINM N1 inner join OITM i on i.ItemCode = N1.ItemCode
inner join OITB b on b.ItmsGrpCod = i.ItmsGrpCod
Where N1.DocDate >= @FromDate and N1.DocDate <=@ToDate
and N1.OutQty > 0 and b.ItmsGrpNam = @ItmsGrpNam and n1.itemcode = i.itemcode and N1.Transtype <> '67'
Group By N1.ItemCode,N1.Dscription,n1.InvntAct)a,dbo.OITM I1 ,OITB b1
where a.ItemCode=I1.ItemCode and I1.ItmsGrpCod = b1.ItmsGrpCod
Group By a.Itemcode ,I1.ItmsGrpCod , b1.ItmsGrpNam,a.InvntAct
Having sum(a.OpeningBalance) + sum(a.INq) + sum(a.OUT) > 0
Order By a.Itemcode
Thanks & Regads,
Bhoopathi.KHi,
Please check SAP notes for why negative values appeared above report.
2003493 - Stock Ageing Report Displays Negative Inventory
Values
1407192 - Negative Stock Handling
Thanks & Regards,
Nagarajan -
Closing Stock/stock value field name in MB5B
Dear Expert,
I want to create a report on closing stock and closing stock value monthwise. Please suggest the field name in which i will get the data monthwise.
Regardshi,
there is no specific field name for them, just refer the t code MC.9, may be you can get the required information you want.
Regards
Manohar -
BW showing Negative Material Valuated stock value !
Experts,
in BW i am i am getting all Negative valuated stock value for all material. can anybody suggest what could be the issue ?
in R/3 if the valuated value is $100, then in bw its showing the same value but Negative.
please helpHi,
I had loaded the infocube not correctly. see http://www.google.de/url?sa=t&rct=j&q=inventory%20management%20how.to&source=web&cd=8&ved=0CHgQFjAH&url=http%3A%2F%2Fwww.sdn.sap.com%2Firj%2Fscn%2Findex%3Frid%3D%2Flibrary%2Fuuid%2Ff83be790-0201-0010-4fb0-98bd7c01e328%26overridelayout%3Dtrue&ei=SSxFT9jtLIf04QTq2IGsAw&usg=AFQjCNET9rFiwqY_VrvvCkCktnPxHNhRvg&sig2=2Q5GFescGLZrCbQJXXggAA&cad=rja
1. load datasource 2lis_03_bx into the infocube
2. compress the request -> check the flag "marker update". You have to refresh the stock (flag is not set).
3. check the actual stock with a query. Compare it with the ERP - transaction MB5B.
4. load the datasource 2lis_03_bf with INIT.
5. compress the request -> check the flag "marker update". Now, DON'T to refresh the stock (flag is set).
6. check the historial stock with a query. Compare it with the ERP - transaction MB5B.
now, daily:
7. load the datasource 2lis_03_bf with DELTA.
8. compress the request -> check the flag "marker update". Now, you have to refresh the stock (flag is not set).
9. check the actual stock with a query. Compare it with the ERP - transaction MB5B.
Sven -
Closing stock by using opening sock
Hi All,
I got opening stock by using this how can I calculate closing stock,pls help me.
REPORT zhzl_material_analysis_gb LINE-SIZE 1000.
tables:mara,mseg,s034.
TYPE-POOLS: slis.
DATA: budat TYPE budat.
DATA: v_fieldcat TYPE slis_fieldcat_alv,
v_t_fieldcat TYPE slis_t_fieldcat_alv.
*Internal Tables for Opening Stock Calculation
DATA : BEGIN OF t_mbew OCCURS 0,
matnr LIKE mbew-matnr,
bwkey LIKE mbew-bwkey,
lbkum LIKE mbew-lbkum,
salk3 LIKE mbew-salk3,
END OF t_mbew.
DATA: BEGIN OF i_mbew OCCURS 0,
mblnr LIKE mseg-mblnr,
mjahr LIKE mseg-mjahr,
menge LIKE mseg-menge,
meins TYPE meins,
bwart LIKE mseg-bwart,
matnr LIKE mseg-matnr,
*REP werks as bwkey
bwkey LIKE mseg-werks,
shkzg LIKE mseg-shkzg,
dmbtr LIKE mseg-dmbtr,
zeile LIKE mseg-zeile,
smbln LIKE mseg-smbln,
smblp LIKE mseg-smblp,
sjahr LIKE mseg-sjahr,
kunnr LIKE mseg-kunnr,
mblnr1 LIKE mkpf-mblnr,
mjahr1 LIKE mkpf-mjahr,
budat LIKE mkpf-budat,
taxkd LIKE knvi-taxkd,
END OF i_mbew.
DATA: BEGIN OF i_mara OCCURS 0,
matnr LIKE mara-matnr,
matkl LIKE mara-matkl,
spart LIKE mara-spart,
END OF i_mara.
DATA: i_makt TYPE TABLE OF makt WITH HEADER LINE.
DATA: BEGIN OF i_collect OCCURS 0,
matnr LIKE mara-matnr,
bwkey LIKE mbew-bwkey,
menge LIKE bsim-menge,
dmbtr LIKE bsim-dmbtr,
END OF i_collect.
DATA: BEGIN OF i_op_stock OCCURS 0,
matnr LIKE mara-matnr,
maktx LIKE makt-maktx,
matkl LIKE mara-matkl,
bwkey LIKE mbew-bwkey,
menge LIKE bsim-menge,
dmbtr LIKE bsim-dmbtr,
spart LIKE mara-spart,
END OF i_op_stock.
*The Selection-Screen Construction
SELECTION-SCREEN: BEGIN OF BLOCK sel_block WITH FRAME.
PARAMETER: p_werks LIKE mseg-werks.
*PlantCompany Code
SELECT-OPTIONS : s_date FOR budat,
p_spart for mara-spart,
*Division
p_bukrs for mseg-bukrs .
SELECTION-SCREEN: END OF BLOCK sel_block .
START-OF-SELECTION.
PERFORM opening_stock.
PERFORM alv.
*FORM opening_stock *
*Calculates stock for date value in the low field of the *
*select-options.
FORM opening_stock.
CLEAR t_mbew.
SELECT * FROM mbew INTO CORRESPONDING FIELDS OF TABLE t_mbew
WHERE bwkey = p_werks .
SORT t_mbew BY matnr.
REFRESH i_mbew.
CLEAR i_mbew.
LOOP AT t_mbew.
i_mbew-matnr = t_mbew-matnr.
i_mbew-bwkey = t_mbew-bwkey.
i_mbew-dmbtr = t_mbew-salk3.
i_mbew-menge = t_mbew-lbkum.
APPEND i_mbew.
CLEAR i_mbew.
ENDLOOP.
SELECT
mseg~mblnr
mseg~mjahr
mseg~bwart
mseg~menge
mseg~matnr
mseg~shkzg
mseg~werks AS bwkey
mseg~zeile
mseg~smbln
mseg~smblp
mseg~sjahr
mseg~kunnr
mkpf~mblnr AS mblnr1
mkpf~mjahr AS mjahr1
mkpf~budat
FROM mseg AS mseg INNER JOIN
mkpf AS mkpf ON
msegmblnr = mkpfmblnr
AND
msegmjahr = mkpfmjahr
APPENDING CORRESPONDING FIELDS OF TABLE i_mbew
WHERE mkpf~budat > s_date-low
AND mseg~bukrs in p_bukrs
AND mseg~werks = p_werks
AND mseg~kzvbr = ' '
AND mseg~bustw NE ' '.
SORT i_mbew BY matnr budat mblnr.
SORT i_mara BY matnr.
SORT i_makt BY matnr.
LOOP AT i_mbew.
IF i_mbew-shkzg = 'S'.
i_mbew-dmbtr = i_mbew-dmbtr * ( - 1 ).
i_mbew-menge = i_mbew-menge * ( - 1 ).
ENDIF.
MODIFY i_mbew TRANSPORTING dmbtr menge.
ENDLOOP.
CLEAR i_collect.
LOOP AT i_mbew.
i_collect-matnr = i_mbew-matnr.
i_collect-bwkey = i_mbew-bwkey.
i_collect-dmbtr = i_mbew-dmbtr.
i_collect-menge = i_mbew-menge.
COLLECT i_collect.
ENDLOOP.
CLEAR: i_collect,i_op_stock.
LOOP AT i_collect.
MOVE-CORRESPONDING i_collect TO i_op_stock.
APPEND i_op_stock.
CLEAR i_op_stock.
ENDLOOP.
CHECK NOT i_op_stock[] IS INITIAL.
LOOP AT i_op_stock.
DELETE i_op_stock WHERE menge = 0.
ENDLOOP.
SORT i_op_stock BY matnr.
SELECT * FROM mara INTO CORRESPONDING FIELDS OF TABLE i_mara
FOR ALL ENTRIES IN i_op_stock
WHERE matnr = i_op_stock-matnr
AND spart in p_spart.
SELECT * FROM makt INTO TABLE i_makt
FOR ALL ENTRIES IN i_mara
WHERE matnr = i_mara-matnr
AND spras = 'EN'.
LOOP AT i_op_stock.
CLEAR i_mara.
READ TABLE i_mara WITH KEY matnr = i_op_stock-matnr.
IF sy-subrc = 0.
i_op_stock-matkl = i_mara-matkl.
i_op_stock-spart = i_mara-spart.
MODIFY i_op_stock TRANSPORTING matkl spart.
ELSE.
DELETE i_op_stock.
ENDIF.
ENDLOOP.
LOOP AT i_op_stock.
CLEAR i_makt.
READ TABLE i_makt WITH KEY matnr = i_op_stock-matnr.
IF sy-subrc = 0.
i_op_stock-maktx = i_makt-maktx.
MODIFY i_op_stock TRANSPORTING maktx.
ELSE.
DELETE i_op_stock.
ENDIF.
ENDLOOP.
ENDFORM.
FORM alv.
CLEAR v_fieldcat.
v_fieldcat-col_pos = 1.
v_fieldcat-fieldname = 'MATNR'.
v_fieldcat-seltext_m = 'Material code'.
APPEND v_fieldcat TO v_t_fieldcat.
v_fieldcat-col_pos = 2.
v_fieldcat-fieldname = 'MAKTX'.
v_fieldcat-seltext_m = 'Description'.
APPEND v_fieldcat TO v_t_fieldcat.
v_fieldcat-col_pos = 3.
v_fieldcat-fieldname = 'MATKL'.
v_fieldcat-seltext_m = 'Material Group'.
APPEND v_fieldcat TO v_t_fieldcat.
v_fieldcat-col_pos = 4.
v_fieldcat-fieldname = 'SPART'.
v_fieldcat-seltext_m = 'Division'.
APPEND v_fieldcat TO v_t_fieldcat.
v_fieldcat-col_pos = 5.
v_fieldcat-fieldname = 'BWKEY'.
v_fieldcat-seltext_m = 'Plant'.
APPEND v_fieldcat TO v_t_fieldcat.
v_fieldcat-col_pos = 6.
v_fieldcat-fieldname = 'DMBTR'.
v_fieldcat-seltext_m = 'Amount'.
APPEND v_fieldcat TO v_t_fieldcat.
v_fieldcat-col_pos = 7.
v_fieldcat-fieldname = 'MENGE'.
v_fieldcat-seltext_m = 'Quantity'.
APPEND v_fieldcat TO v_t_fieldcat.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
it_fieldcat = v_t_fieldcat
TABLES
t_outtab = i_op_stock.
ENDFORM.
Thanks®ds,
Sree.Hi,
Please note that MBEW contains the stock position as of now. MBEWH contains the closing stock of all the previous periods. However if there is no transaction in a particular period you may not find a record in MBEWH for that period.
Please refer to SAP documentation:
[Back To Resultlist]
Material Master (Industry/Retail): Enhancements to Period Closing
Description
In Release 4.5A, the period closing function has been redesigned to eliminate or at least alleviate the following problems:
Long runtime if there are very many stock segments
Locking of all materials while the period closing program is run
Data inconsistencies in stock segments due to incorrect operation of the period closing program by users
The enhancements made to eliminate or alleviate these problems affect the way in which period closing is performed technically and particularly the data design. As a result, the following information is intended primarily for the following persons:
System administrators
Developers (for example, in customer projects)
Other persons in IT departments or systems departments
Runtime
The runtime of the period closing program has been improved substantially since no stock tables (such as MBEW, MARD, or MCHB) are updated any longer for the change in period, unless the change in period is a change in fiscal year. Only the material ledger tables are updated.
If the change in period coincides with the end of a fiscal year, the program also updates the physical inventory indicators and thus those tables relevant to physical inventory management; that is, even in this case, table MBEW in particular is no longer updated.
Locking of materials
The materials are locked by the period closing program only if the material ledger is used.
In the case of a change in fiscal year, no physical inventory transactions can be performed when running the period closing program.
Ease of use
As of Release 4.5A, period closing is performed in inventory management or invoice verification; that is, whenever, for example, a goods movement is made, the period is updated in the relevant stock segments of the material if the material is moved for the first time in this period.
Changes to the interface
There have been no changes to the interface.
Changes in procedure
The implementation of the above enhancements has required the data design to be changed as follows:
Stock tables MBEW, EBEW, QBEW, MARC, MARD, MCHB, MKOL, MSKA, MSSA, MSKU, MSLB, MSPR, and MSSQ now have history tables, for example, MBEWH is the history table for MBEW, and EBEWH the history table for EBEW. For each period, these history tables can contain an entry with the corresponding stock information, and are created for the previous period whenever there is a change in period-relevant information such as unrestricted-use stock. This means that the information for the previous period can no longer be read directly from tables MBEW, EBEW, and so on, but that tables MBEWH, EBEWH, etc. have to be read and interpreted.
The point in time at which the system is upgraded to Release 4.5A is important for interpreting the history tables. If the period has been closed at least once after the upgrade, the stocks for the previous period are contained, for example, in history table MARDH. If this table does not contain a corresponding entry, the previous period stock for the corresponding stock fields is the same as the current stock.
Fields LFMON/LFGJA of the stock tables no longer contain the current period, but one of the following periods, depending on when the upgrade took place:
Period of the last goods movement, invoice verification, price change, or other function that has resulted in period-specific information being updated
Period of the release upgrade if no such function has been performed since the system was upgraded
The current period is still recorded (as prior to Release 4.5A) in table MARV.
Planning
In a future release, it is planned for the data in the material ledger to no longer be updated by the period closing program. This will further increase the speed of the program.
[Back To Resultlist]
Regards
Raju Chitale -
Bapi/function module to get opening or closing stock for a posting date
I am creating a report where i need to get the opening stock value and closing stock value for the given starting date and ending date respectively for the PP report.
The T-code for that is MB5B.
So,can any1 plzz tell me how i can get the stock value for a starting date/ending date...
Is there any BAPI or function module to find this out..
or any logic?
Thanks.Hi Kiran,
You would like to findout opening and closing stock of a particular period and of a particular period....
If we would like to findout opening and closing stock of material A as of 18 / 8 / 2008,
then do like this.
go to MBEW table .. there u get opening stock as on today. Today the date is 20/8/2008. from today's opening stock if we add / subtract the movements which have happened on 19/8/2008 and 18/8/2008 u'll get opening and closing stock as on 18/8/2008.
U get the movements from MKPF ( material doc header) and MSEG (material doc item ) based on posting date. In MSEG u get movement type.
If the movement type is 101, it means the stock is added.
If the movement type is 102, it means the added stock is reversed.
from today's opening stock deduct the stock with moverment type 101 and add the stock with movement type 102.
This will give u opening stock as on 18/8/2008.
To get closing stock of 18/8/2008 ..... the opening stock of 19/8/2008 is 18/8/2008's closing stock. -
Stock value for stock transfer from depot (RG23D) to manufacturing (RG23A)
Dear all,
The forum posts that I found are all relating to the process of how to do stock transfer from depot plant to manufacturing plant.
The question I want to post is relating to the transferred stock value.
When stock first goes into depot plant (RG23D), the excise duties (CVD, Education Cess, Higher Education Cess, Secondary Education Cess) are all inventorized. However, in manufacturing plant (RG23A), they are CENVATABLE and not inventorized.
In the transfer of stock from depot to manufacturing, how can we split out the stock value from depot and take out the excise duties to CENVAT in manufacturing plant?
If using Stock Transfer process (move stock from depot to manufacturing),
1. Create Stock Transfer Order in ME21N using UD order type
no accounting
2. Create DO in VL10B and goods issue
During goods issue, moving average of stock in depot plant, will increase stock with the same value in manufacturing plant and reduce the stock value in depot plant. How can we reduce the stock value transferred to manufacturing plant by the original excise duties amount, and pass this amount into J1IEX? Is it done in this step or later steps?
Dr Stock into manufacturing plant [this value by right, should be reduced as it consists of original excise duties in RG23D?]
Cr Stock from depot plant
3. J1IJ- RG23D selection for excise invoice for delivery at depot
no accounting
4. VF01 for proforma invoice
no accounting
5. MIGO into manufacturing plant (capture excise invoice)- part 1 register. the excise duties can be manually keyed in based on the original RG23D entries when stock is first brought into originating depot plant
no accounting
6. Enter Incoming Excise Invoice by J1IEX
Dr CENVAT Input AED
Dr CENVAT Input BED
Dr RG23A ECess
Dr RG23A SHECess
Cr CENVAT clearing
7. Question: Where to Debit CENVAT clearing? In normal domestic purchase process of raw materials into manufacturing plant, Dr CENVAT clearing will be posted during MIRO time.
If this process is not the correct way to do, please advise the standard SAP recommended way to transfer from depot to manufacturing plant.
Thank you in advance.You have to add the Excise duty condition types as a Delivery cost Pricing condition types in STO Pricing procedure and have used them in STO. In Pricing procedure, there is no concept of Deductible and Non Deductible. So, what ever the Delivery cost condition you add in Pricing procedure, the amount gets loaded on to the Material cost..To avoid this, a negative condition type needs to be inserted in Pricing procedure with a different accrual key.
You have to add One Positive condition and One Negative Condition type for the same. Negative condition type is to reduce the condition value from the Material cost during GI.
Try this scenario in development server and revert back with your observations.
Maybe you are looking for
-
Hi All, We are getting this error in Sender Mail adapter. "exception caught during processing mail message; java.net.ConnectException: A remote host refused an attempted connect operation" It is a (Lotus Notes) Mail to File scenario. Used POP3, and g
-
Ok, I thought the subject line was the extent of what I could type. My trackpad has been working fine for over two years now. But recently if I accidently (or intentionally) drag a picutre that is highlighted on any website, the cursur never lets g
-
Safari setting on iPad "Open New Tabs in Background" is not working
A couple of weeks ago, I decided that I wanted to see the tab bar in Safari, on my iPad, just like on my MacBook. So, I went to... Settings >> Safari ...and I turned OFF the setting "Open New Tabs in Background". Then, the tab bar appeared and every
-
ALR reports showing data mismatch from Detail report(CJI3)
In our scenario WBS element i.e projects is converted through settlement into AUC & later onward AUC is converted into Assets. We are seeing report T-Code CJE0 u2013 12KSTIA(Budget/Actual /commitment / Rem. plan/assigned), in this the field for Actua
-
Need CR Developer 12.0 Product Code
Hi, I have reinstalled Windows XP and do not have the 26 digit Product Code for the CR2008LPs.exe (Crystal Reports: Developer 12.0) that I am attempting to install. I have registered Crystal Reports: Developer 12.0 and received this email on 18 Augus