Aging Stock Report - Logic
Dear All,
Anybody can share the Logic/Functional spec for developing the Stock Aging Report based on the receipt for the current stock which is available in trading plant.
Thank You,
Mani.
Hi,
***Logic behind ***
This is define in overall stock on value based, suppose a material is received in Feb-month, same material is received in Jan-2007 , DEC-2007 also.The total value of this inventory is say 90 lakhs, ( 30 lakhs of each month) so system will show inventory aging as below
stock aging less than 30 days, 90 lakhs
stock aging more than 30 days but below 60 days 60 lakhs
stock ageing more than 60 days but below 90 days 30 lakhs
Assuming that no issue taken place if issue is taken place, it will be deducted by default FIFO method. You may have to develop an ABAP report.
Regards,
Biju K
Similar Messages
-
hi
any one can tell me the process of Vendor ageing report
thanks in advanceHi,
Vendor / Customer aging report logic based on payment terms & Base Line Date (BSIK-ZFBDT)
Standard T.Code Vendot OI shortlist Ex:S ALR87012085
Refer: http://wiki.sdn.sap.com/wiki/display/Snippets/VendorAgeingReport
Regards
Viswa -
Regarding Customer ageing report logic in R/3.
Dear
Experts
i have requirement to develop customer ageing report logic for input 30,60,90,180,360
i don' t have any idea hw can i take these values in input& hw can i caluclate the values
i searched in sdn, i did n't get any suitable answer..
Regards
SpandanaHello,
Go to transaction code FDI4
Select Form Type RFFRRD20 Line item analysis
Give your form name and description
Structure (Two axis) - as defaulted
Click on Create
You will have lead column
Delete the rows 2, 3 and 4
Double click on column 1
Enter the customer numbers from 1 to 999999
First column double click (A)
Slelect following values
Due date analysis 1
Days for net due date 0 to 30
Give the short name, medium name and long text for the column.
Repeat this step in next columns like 31 to 60, 61 to 90, 91 to 120 and 121 to 99999 days etc in other columns and select due date analysis 1. (B,C,D,E)
Create one more column by way of formula. To create a new column you need to double click on blue line. Put formula add all five columns you have created above. (F = ABCDE)
You prepare one more column with
Due date analysis 2 (G)
Now you prepare one more column add (F+G) = This will be total open items = over due and not due.
Now go to FDI1 and prepare a report - assign the form created in FDI4 to the report.
Characteristics you need to select are
Account Type (Select Account Type as D for customers)
Currency
Customer
Document Type
Special G/L Ind
Company Code
Change the output types and options according to your requirement.
Refer FDI2 and FDI3 for other standard reports created.
Refer FDI5 and FDI6 for other standard forms created.
Save your report and execute.
Regards,
Ravi -
Agewise Stock Report using FIFO out of 0IC_C03
Hello,
I have a requirement where I need to create agewise stock report using FIFO. I have the stock availability from 0ic_c03.
Can any one plese tell me how to achieve the FIFO based agewise stock. I have various age buckets like 0-30 , 30-60, 60-90 etc.
If the total stock is made up of multiple receipts and I also have few issues, how can I get the balance stock based on FIFO using the GR date.
I would appreciate your help.
Regards
VasunHi,
This InfoCube allows you to evaluate stocks from ERP.
A new feature in this InfoCube is the pre-existing stock key figure Valuated Stock Quantity (0VALSTKQTY) and the associated movement key figures Receipt Quantity Valuated Stock (0RECVALSTCK) and Issue Quantity Valuated Stock (0ISSVALSTCK).
This is made possible by including the InfoObject indicator Evaluation Special Stock (0INDSPECSTK) in the InfoSource Material Stocks (as of SAP BW 3.1 Content) (2LIS_03_BX). The InfoSource used up until now, Transfer BW: Stock (2LIS_40_S278), did not recognize this InfoObject.
Note the Remarks on Filling Non-Cumulative InfoCubes.
The following Basis key figures can be restricted in the query definitions to stock categories (0STOCKCAT), such as project stock, and to stock types (0STOCKTYPE), such as quality inspection:
· Quantity of Valuated Stock (0VALSTCKQTY)
· Receipt Quantity Valuated Stock (0RECVALSTCK)
· Issue Quantity Valuated Stock (0ISSVALSTCK)
In this way, for example, you can evaluate the quantity of valuated project stock (Q).
The newly-included Basis key figures are only updated through the InfoSources 2LIS_03_BX and 2LIS_03_BF.
In this way, none of these Basis key figures can be used in queries that are built up on InfoCubes which were inventory-initialized through InfoSource 2LIS_40_S278. Moreover, the queries 0IC_C03_Q0013 to 0IC_C03_Q0016 cannot be used in the combination of InfoSources 2LIS_40_S278 and 2LIS_03_BF.
Note the following procedures when filling the InfoCube 0IC_C03 for the first time with non-cumulative data from ERP:
1. Create non-cumulatives with the program BW: Initialization of Opening Non-Cumulatives in Transfer Structure (RMCBINIT_BW).
2. Initialize the movements/revaluations with the program RMCBNEUB/RMCBNERP.
3. Post in the InfoCube using the update method Creation of Non-Cumulatives from the InfoSource 2LIS_03_BX.
4. Post in the InfoCube using the update method Initialization of the Delta Process from the InfoSources 2LIS_03_BF and 2LIS_03_UM.
Refer to SAP Note 0643687 (Compression of Non-Cumulative InfoCubes) regarding the subsequent steps for compression.
5. Compression of the request from 2LIS_03_BX with update of the marker.
6. Because in this case you are posting movements and revaluations in the InfoCube that occurred before the non-cumulative creation and which lead to this non-cumulative creation, you must execute a compression without updating the marker. For more information, see InfoCubes.
7. Thereafter, you can transfer new movements and revaluations to the BW system as usual (for performance reasons, we recommend that you regularly compress with updates of the marker, see also InfoCube Compression).
Update Logic
When updating the DataSources 2LIS_03_BX, 2LIS_03_UM and 2LIS_03_BX, the System applies the following logic:
Characteristic Value Calculation
In principle, values are updated with Plant, Material, and Stock Category only. Quantities are updated with these characteristics, as well as with Storage Location, Batch Number, and Stock Characteristic (see also SAP Note 589024: Evaluations in BW with the Characteristics Storage Location and Stck Char.).
Key Figure Value Calculation
The source field for quantities is the field CPQUABU, and for values it is the field CPPVLC.
In the update, the InfoSource fields Stock Characteristic and Stock Category control whether "special stock" key figures are updated, such as Quality Stock or Stock in Transit (only relevant for 2LIS_03_BF and 2LIS_03_UM).
The general key figures (for example, Total Stock), however, can also be restricted in queries to Stock Characteristic and Stock Category, and then deliver the same result (key word: account model versus key figure model).
The values for Stock Characteristic and Stock Category are dealt with on the extractor side in the LMCB1F20 include (routine STA_VERAENDERUNG).
The InfoObject 0INDSPECSTK (field KZBWS) also controls whether the sales order stock / project stock is valuated or non-valuated.
The system valuates the transaction key to decide whether the issue movement key figure or receipt movement key figure is updated. For more information, see SAP Note 492828: Determining the transaction key for 2LIS_03_BF + 2LIS_03_UM.
InfoSources
This InfoCube is based on the following InfoSources:
· 2LIS_03_BX
· 2LIS_03_BF
· 2LIS_03_UM
Characteristics
InfoObject
Description
0MATERIAL
Material
0PLANT
Plant
0STOR_LOC
Storage Location
0BATCH
Batch Number
0STOCKTYPE
Stock Type
0STOCKCAT
Stock Categories
0GN_VENDOR
Vendor
Time Characteristics
InfoObject
Description
0CALDAY
Calendar Day
0CALMONTH
Calendar Year/Month
0CALWEEK
Calendar Year/Week
0CALYEAR
Calendar Year
Key Figures
InfoObject
Description
0RECVS_VAL
Value Received - Valuated Stock
0VALSTCKVAL
Value - Valuated Stock
0ISSVS_VAL
Value Issued - Valuated Stock
0ISSBLOSTCK
Issue Quantity - Blocked Stock
0ISSCNSSTCK
Issue Quantity - Consignment Stock
0ISSQMSTCK
Issue Quantity - Inspection Stock
0ISSTRANSST
Issue Quantity - Stock in Transit
0RECBLOSTCK
Receipt Quantity - Blocked Stock
0RECCNSSTCK
Receipt Quantity - Consignment Stock
0RECQMSTCK
Receipt Quantity - Inspection Stock
0RECTRANSST
Receipt Quantity - Stock in Transit
0QMSTOCK
Inspection Stock
0BLOCKEDSTK
Blocked Stock
0CNSSTCKQTY
Quantity - Consignment Stock
0TRANSSTOCK
Stock in Transit
0ISSSCRP
Issue Quantity - Scrap
0ISSVALSCRP
Issue Value - Scrap
0RECTOTSTCK
Receipt Quantity - Total Stock
0ISSTOTSTCK
Issue Quantity - Total Stock
0TOTALSTCK
Quantity - Total Stock
0ISSVALSTCK
Issue Quantity - Valuated Stock
0RECVALSTCK
Receipt Quantity - Valuated Stock
0VALSTCKQTY
Quantity - Valuated Stock
0VENCONCON
Consumption Value - Vendor Consignment Stock
Units
InfoObject
Description
0LOC_CURRCY
Local Currency
0BASE_UOM
Base Un
Regards,
Hareesh -
Tables req to get date wise stock report
Hi
Pls advise, what are the tables req to get date wise stock report??? i don't want any t codes... i have to do with age analysis ,??
Anyone has answer? pls provide it.
Edited by: UJ on Mar 3, 2010 8:54 AMYou can take below details which help you to get the exact things..
*-- Tables delcaraion
TABLES : mkpf, " Header: Material Document
mseg, " Document Segment: Material
mara, " General Material Data
makt. " Material Descriptions
*-- Types declaration
TYPES: BEGIN OF ty_mkpf,
mblnr TYPE mblnr, " Number of Material Document
mjahr TYPE mjahr, " Material Document Year
blart TYPE blart, " Document type
budat TYPE budat, " posting date
END OF ty_mkpf.
TYPES: BEGIN OF ty_mseg,
mblnr TYPE mseg-mblnr, " Number of Material Document
mjahr TYPE mseg-mjahr, " Material Document Year
zeile TYPE mseg-zeile, " Item in Material Document
matnr TYPE mseg-matnr, " Material Number
bwart TYPE mseg-bwart, " Movement Type (Inventory Management)
dmbtr TYPE mseg-dmbtr, " Amount in Local Currency
menge TYPE mseg-menge, " Quantity
lgort TYPE mseg-lgort, " Storage Location
pbamg TYPE mseg-pbamg, " Quantity
werks TYPE mseg-werks, " Plant
ummat TYPE mseg-ummat, " Receiving/Issuing Material
umwrk TYPE mseg-umwrk, " Receiving/Issuing Plant
umlgo TYPE mseg-umlgo, " Receiving/Issuing Storage Location
END OF ty_mseg.
Further if you want you can play with Movement types. -
Hello Experts !!!!
My Client requires a Stock Age analysis report .
It is a trading company of steel .
my client wants to know that how old my stock is in warehouse or how much is 30 days old ,60 days old ,90 days old.
Below is my query
SELECT T0.ITEMCODE , T0.DSCRIPTION,T2.U_WT,SUM(T0.QUANTITY)AS QUANTITY,T1.DOCDATE,
CASE WHEN Datediff(day, T1.DOCDATE,GETDATE())<30 THEN SUM(T0.QUANTITY) END '<30 Days(Qty)',
CASE WHEN Datediff(day, T1.DOCDATE,GETDATE())<30 THEN SUM(T0.QUANTITY)*T2.U_WT END '<30 Days(MT)',
CASE WHEN Datediff(day, T1.DOCDATE,GETDATE())>30 AND Datediff(day, T1.DOCDATE,GETDATE())<60 THEN SUM(T0.QUANTITY) END '<60 Days(Qty)',
CASE WHEN Datediff(day, T1.DOCDATE,GETDATE())>30 AND Datediff(day, T1.DOCDATE,GETDATE())<60 THEN SUM(T0.QUANTITY)*T2.U_WT END '<60 Days(MT)',
CASE WHEN Datediff(day, T1.DOCDATE,GETDATE())>60 AND Datediff(day, T1.DOCDATE,GETDATE())<90 THEN SUM(T0.QUANTITY) END '<90 Days(Qty)',
CASE WHEN Datediff(day, T1.DOCDATE,GETDATE())>60 AND Datediff(day, T1.DOCDATE,GETDATE())<90 THEN SUM(T0.QUANTITY)*T2.U_WT END '<90 Days(MT)',
CASE WHEN Datediff(day, T1.DOCDATE,GETDATE())>90 AND Datediff(day, T1.DOCDATE,GETDATE())<120 THEN SUM(T0.QUANTITY) END '<120 Days(Qty)',
CASE WHEN Datediff(day, T1.DOCDATE,GETDATE())>90 AND Datediff(day, T1.DOCDATE,GETDATE())<120 THEN SUM(T0.QUANTITY) END '<120 Days(MT)'
FROM PDN1 T0 INNER JOIN OPDN T1 ON T0.DOCENTRY =T1.DOCENTRY INNER JOIN OITM T2 ON T0.ITEMCODE=T2.ITEMCODE
GROUP BY T0.ITEMCODE , T0.DSCRIPTION,T1.DOCDATE,T2.U_WT
but problem is that i am able to track when goods were arrived in warehouse .But i am enable to track how much went out warehouse.
" MY CLIENT WANTS THE REPORT GOODS RECEIPT NOTE WISE REPORT. " that how much qty has been delivered against a particular Goods receipt note. But we havn't provided any reference to delivery of goods receipt note .
Experts Thanx in advance.
Krishna VamsiHello Krishna Vamsi,
Try this:
SELECT T1.ITEMCODE,T1.ItemName,T1.U_WT,SUM(IsNull(T0.INQty,0)-IsNull(T0.OutQty,0)) AS QUANTITY,T0.DOCDATE,
CASE WHEN Datediff(dd, T0.DOCDATE,GETDATE())<30 THEN SUM(IsNull(T0.INQty,0)-IsNull(T0.OutQty,0)) END '<30 Days(Qty)',
CASE WHEN Datediff(dd, T0.DOCDATE,GETDATE())<30 THEN SUM(IsNull(T0.INQty,0)-IsNull(T0.OutQty,0))*T1.U_WT END '<30 Days(MT)',
CASE WHEN Datediff(dd, T0.DOCDATE,GETDATE())>30 AND Datediff(dd, T0.DOCDATE,GETDATE())<60 THEN SUM(IsNull(T0.INQty,0)-IsNull(T0.OutQty,0)) END '<60 Days(Qty)',
CASE WHEN Datediff(dd, T0.DOCDATE,GETDATE())>30 AND Datediff(dd, T0.DOCDATE,GETDATE())<60 THEN SUM(IsNull(T0.INQty,0)-IsNull(T0.OutQty,0))*T1.U_WT END '<60 Days(MT)',
CASE WHEN Datediff(dd, T0.DOCDATE,GETDATE())>60 AND Datediff(dd, T0.DOCDATE,GETDATE())<90 THEN SUM(IsNull(T0.INQty,0)-IsNull(T0.OutQty,0)) END '<90 Days(Qty)',
CASE WHEN Datediff(dd, T0.DOCDATE,GETDATE())>60 AND Datediff(dd, T0.DOCDATE,GETDATE())<90 THEN SUM(IsNull(T0.INQty,0)-IsNull(T0.OutQty,0))*T1.U_WT END '<90 Days(MT)',
CASE WHEN Datediff(dd, T0.DOCDATE,GETDATE())>90 AND Datediff(dd, T0.DOCDATE,GETDATE())<120 THEN SUM(IsNull(T0.INQty,0)-IsNull(T0.OutQty,0)) END '<120 Days(Qty)',
CASE WHEN Datediff(dd, T0.DOCDATE,GETDATE())>90 AND Datediff(dd, T0.DOCDATE,GETDATE())<120 THEN SUM(IsNull(T0.INQty,0)-IsNull(T0.OutQty,0)) END '<120 Days(MT)'
FROM dbo.OINM T0
INNER JOIN dbo.OITM T1 ON T0.ITEMCODE=T1.ITEMCODE
GROUP BY T1.ITEMCODE,T1.ItemName,T0.DOCDATE,T1.U_WT
Thanks,
Gordon -
Hi All,
I have to create a Age analysis report for FI documents
which have line items with posting key 75 & 70 (Asset)
Given logic is
1 Selection screen has parameters - Company code, Key date
2 Need to take all line items with posting key 70 & 75
(BSEG-BSCHL = 70 or 75)
Layout of report is
Asset no 0-30 31-60 61-90 91-120 . 151-360 (days)
80000003 2000.00 3000.00 1000.00 4000.00 7000.0
80000006 1000.00 5000.00 300.00 5000.00 4000.0
Local curency amount should be categorised under the days
diferences between key date (selection screen) & posting date
of the accounting document.
My problem is,
Posting date of the document is not in the BSEG table. It is
in the BKPF table.Therefore I have to extract all FI documents(Not only documents with posting key 75 or 70) within 360 days from Key date in BKPF the table.
I cannot join BSEG & BKPF. Because, BSEG table is a cluster table.
Can you please tell me the way how can i extract the data for this report with out any performance issues.
PraGreat idea, but I dont think it is going to work.
The 1st problem should be, how do you work out the key date... You will need some good code for that.
Have a look at the customer aged debt reports for some help.
After that, if you just want asset documents, do they have their own unique document type, if so, you could use the doc type from BKPF to reduce the number you want to select in BSEG.
Have you looked at any of the standard Asset dep reports, perhaps there is something there you could use. -
I am trying to wright a simple Stock report and i am running into difficulties - any expert advice would be appreciated:
The report should have the following fileds:
Item Group, Item Code, Item Description, In Stock Quantity, Stock Value.
The report should summarise by Item Group with Sub Totals.
I have tried several methods and I failed with all of them:
A Using Report Composer, I managed to Place the first 3 Fields and checked that this worked OK, and then converted this to an XL Reportt Definition. But, this Definition did not give any results when I ran it.
B. I started a new XL Definition using the Advanced Formula builder and managed to place all the fields but was not able to Group the records by using the XL Sub Total function.- this gave me only a total for all the records. I think I have done the procedure correctly but for some reason the SubTotal function within XL reporter does not give the expected result.
C. I have used the Grouping function within the Advanced Formula Builder but this did not work either
I wonder if anybody else experienced this type of problem because I suspect that something is wrong with the XL reporter?
Thank you
RobertHi Gordon
The reason I say that it might be a bug is the fact that when I get the #N/A in the cell I can go to another cell that has the COLUMN TOTAL formula and copy and paste and it seems to work OK. Also, I can put in the Formula manually (if I remember the syntax correctly...)
The frustration I have with the XL reporter is in the fact that it is a good product but to get the right result you need to "Experiment and guess" as to what the result will be. It is more of an "Art" then a preciese "Science". I can now write reports but I still do not understand when and why the report works. Perhaps SAP should give some guidlines of what "Kind" of combination may or may not work.
I do fully understand the construction of relational database tables and the links between them, but the XL reporter does not seem to have a logical approach for the end user to help construct a report so the only practical approach seems to be "trial and error"
One basic helpful hint seems to be that you need to have a Light Dimention Value field in order for a report to work - but I am not sure why this is the case.
Thanks for your remrks, they certaily point me in the right direction
Robert -
Dear Team,
I was previously using Russian J3RFLVMOBVED in Sap ecc6. It was working fine for the last two years for stock valuation quantity & Value wise. From Jan 2012 this report is showing Negative Stock in the report. For this i consulted ABAP for the check the values source (from which table these negative values are arising) in table MBEW & BSIM. These values also didn't existed in the Table mentioned above. Can any one advice me for this problem?
Also can any one provide me alternative report in sap ecc-6 for Stock quantities & Values on specified dates along with the sub locations.
Secondly is there any standard report for Material Aging?
M.YousufHi,
I have checked mb5b its not addressing my issue as its showing valuated stock without location & Batches. I have checked S_POO_07000139, ITS ALSO SHOWING Valuated Stock without Batch Plant & Location wherease MC.1 & other MC Tcodes. They are showing valuated stock without batches material code & Description in a summarized form.
I need this stock report for the stock count on month End in a summarized form.
Please advice any other solution.
M.Yousuf -
Hi all,
We have stock report.There is one problem in the report.We are using
"2LIS_03_BF" and " 2LIS_03_UM " as data source and " 0AFMM_C02" as info source.
When i run the report with material as row its giving me the correct result.But when i pass plant into row then it shows me only few plants. Only option to check the stock at plant level is that i have to select all the records. this is working in the development server but not in produciton... as there are many records... in the production...
i am not able to understand what is the logic behind it... its happening even if i create a new query....
Can you suggest me any option ...
Regards,
Viren.No Solution
-
Reconciliation fo stock report at stock type level
Hi gurus,
I want to compare the stock quantities in a stock report with ECC when I drill down the report at Stock type level. I have tried to do it through MB5B but I found it not appropriate as the stock type calculation in BW as based on some LIS logic. also I found it is not always same as in MB5B.
Please suggest me how can I cpmpare the data at stock type in ECC.
thanks in advance
Regards,
JitendraHi,
Use 2LIS_03_BX, 2LIS_03_BF, 2LIS_03_UM to 0IC_C03 Cube and design the report.
Use :
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 bad drag abd drop following things
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 bad drag abd drop following things
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.
Reconcile BW Vs ECC MB5B
In ECC goto MB5B and give Material and Plant and Date Range corrctly , select radio button Valuated Stock an dexecute and check teh Opening/Closing Stock for that month.
Once you design your report like above then you can check in ECC in MB5B
See the steps.
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.
Thanks
Reddy -
Need conding in debit ageing analysis report.....
Hi Experts,
I am working on BW 3.5.
I have Debit ageing analysis report like 0-30 31-60 61-90 91-180 181-365 >365.
these ageing is calculating on DOCUMENT DATE wise.
Now I want to put one condition in this report.
IF DOCUMENT TYPE = AB then ageing should be calculate on BASE DATE wise.
Is it possible??
plese help to acheive this.....
Thanks in advance.
Venkat.Hi,
Yes you can do it. Use Formula variables on DOCUMENT TYPE & date and do it.
Take DOCUMENT DATE, BASE DATE & DOCUMENT TYPE in formula variables then create formula and check DOCUMENT TYPE = AB based on that write logic informula.
See some material Aging report in.
wiki.sdn.sap.com/wiki/display/profile/SurendraKumarReddy+Koduru
Thanks
Reddy -
Hi
For Inventory Status/Inventory Stock report, system generates report Item Wise/ Warehouse Wise/Item Group Wise.
Customer generates Manual Report for inventory stock / Inventory Status for Item / Or Item Group logic mention below
Report From Date-xx/yy/zz to To Date xx/yy/zz
Item Description ItemOpening Balance ItemReceipts Item Consumption (Only Delivery Of Item as trading business) Item Closing Balance.
We want to generate Report in this way from System, how to generate this report is there any query based report available
or even if we need to designed report. Can i have logic to follow.Hai satish tale
try this query, i included a purchase flow
SELECT T0.itemcode,min(T0.Dscription) as 'Item Description',
max(T1.InvntryUom) as UOM,W1.Whscode,W1.Location as 'Location Code',
C1.Location, (isnull((Select sum(isnull(inqty,0)) from OINM O1 where O1.itemcode=T1.itemcode and O1.Warehouse=W1.Whscode and O1.docdate<'[%0]' and O1.transtype in (59,20,16,67,-2)),0) - isnull((Select sum(isnull(outqty,0)) from OINM O1 where O1.itemcode=T1.itemcode and O1.Warehouse=W1.Whscode and O1.docdate<'[%0]' and O1.transtype in (21,19,60,15,67,-2,13)),0) )as 'Opening Stock',
(isnull((Select sum(isnull(Transvalue,0)) from OINM O1 where O1.itemcode=T1.itemcode and O1.Warehouse=W1.Whscode and O1.docdate<'[%0]' and O1.transtype in (18,-2,67,59,20,16,14,15,13,21,19,60)),0)) as 'Opening Value',
(isnull((Select sum(isnull(inqty,0)) from OINM O1 where O1.itemcode=T1.itemcode and O1.Warehouse=W1.Whscode and O1.docdate>='[%0]' and O1.docdate<='[%1]' and O1.transtype in (-2)),0)- isnull((Select sum(isnull(outqty,0)) from OINM O1 where O1.itemcode=T1.itemcode and O1.Warehouse=W1.Whscode and O1.docdate>='[%0]' and O1.docdate<='[%1]' and O1.transtype in (-2)),0)) as 'OB Quantity',
isnull((Select sum(Transvalue) from OINM O1 where O1.itemcode=T1.itemcode and O1.Warehouse=W1.Whscode and O1.docdate>='[%0]' and O1.docdate<='[%1]' and O1.transtype in (-2)),0) as 'OB Value',
isnull((Select sum(isnull(inqty,0)) from OINM O1 where O1.itemcode=T1.itemcode and O1.Warehouse=W1.Whscode and
O1.docdate>='[%0]' and O1.docdate<='[%1]' and O1.inqty>0 and O1.transtype in (20,18)),0) as 'Purchase Quantity',
isnull((Select avg(calcprice) from OINM O1 where O1.itemcode=T1.itemcode and O1.Warehouse=W1.Whscode and
O1.docdate>='[%0]' and O1.docdate<='[%1]' and O1.inqty>=0 and O1.transtype in (20,18,69)),0) as 'Purchase Rate',
isnull((Select sum(Transvalue) from OINM O1 where O1.itemcode=T1.itemcode and O1.Warehouse=W1.Whscode and
O1.docdate>='[%0]' and O1.docdate<='[%1]' and O1.inqty>=0 and O1.transtype in (20,18,69)),0) as 'Purchase Value',
isnull((Select sum(isnull(inqty,0)) from OINM O1 where O1.itemcode=T1.itemcode and O1.Warehouse=W1.Whscode and O1.docdate>='[%0]' and O1.docdate<='[%1]' and O1.inqty>0 and O1.transtype in (16,14)),0) as 'Sale Return Quantity', isnull((Select avg(calcprice) from OINM O1 where O1.itemcode=T1.itemcode and O1.Warehouse=W1.Whscode and O1.docdate>='[%0]' and O1.docdate<='[%1]' and O1.inqty>0 and O1.transtype in (16,14)),0) as 'Sale Return Rate', isnull((Select sum(Transvalue) from OINM O1 where O1.itemcode=T1.itemcode and O1.Warehouse=W1.Whscode and O1.docdate>='[%0]' and O1.docdate<='[%1]' and O1.inqty>0 and O1.transtype in (16,14)),0) as 'Sale Return Value', isnull((Select sum(isnull(outqty,0)) from OINM O1 where O1.itemcode=T1.itemcode and O1.Warehouse=W1.Whscode and O1.docdate>='[%0]' and O1.docdate<='[%1]' and O1.outqty>0 and O1.transtype in (13,15)),0) as 'sale Quatity', isnull((Select avg(calcprice) from OINM O1 where O1.itemcode=T1.itemcode and O1.Warehouse=W1.Whscode and O1.docdate>='[%0]' and O1.docdate<='[%1]' and O1.outqty>=0 and O1.transtype in (13,15)),0) as 'sale Rate', isnull((Select sum(Transvalue) from OINM O1 where O1.itemcode=T1.itemcode and O1.Warehouse=W1.Whscode and O1.docdate>='[%0]' and O1.docdate<='[%1]' and O1.outqty>=0 and O1.transtype in (13,15)),0) as 'sale Value', (isnull((Select sum(isnull(inqty,0)) from OINM O1 where O1.itemcode=T1.itemcode and O1.Warehouse=W1.Whscode and O1.docdate<='[%1]' and O1.transtype in (59,20,16,14,19,67,-2)),0) - isnull((Select sum(isnull(outqty,0)) from OINM O1 where O1.itemcode=T1.itemcode and O1.Warehouse=W1.Whscode and O1.docdate<='[%1]' and O1.transtype in (21,19,60,15,67,-2,13)),0) )as 'Closing Stock', isnull((select sum(Transvalue) from OINM O1 where O1.itemcode=T1.itemcode and O1.Warehouse=W1.Whscode and O1.docdate<='[%1]' and O1.transtype in (18,-2,67,59,20,16,14,15,13,21,19,60,69,162)),0) as 'Closing Value' FROM OINM T0 INNER JOIN OITM T1 ON T0.ItemCode = T1.ItemCode INNER JOIN OITW T2 ON T1.ItemCode = T2.ItemCode INNER JOIN OITB B1 ON T1.ItmsGrpCod=B1.ItmsGrpCod INNER JOIN OWHS W1 ON T2.WhsCode = W1.WhsCode INNER JOIN OLCT C1 ON W1.Location=C1.Code where ((B1.ItmsGrpNam>='[%2]' and B1.ItmsGrpNam<='[%3]') or ('[%2]'='' and '[%3]'='')) and ((W1.Whscode>='[%4]' and W1.Whscode<='[%5]') or ('[%4]'='' and '[%5]'='')) and ((C1.Location>='[%6]' and C1.Location<='[%7]') or ('[%6]'='' and '[%7]'='')) and W1.Whscode<>'SelectWH' Group by T1.itemcode,T0.Itemcode,W1.WhsCode,W1.Location,C1.Location -
Closing stock report with GRPO
Hai all
Please help me to write this query,
For example
I have query to take closing stock report ,but my requirement is ,i want split up for Closing stock and closingvalue
like, if i have 40 closing stock means i want details how 40 is arrived
for example i run closing stock report as on 2009-03-31
means i want this format
Itemcode ClosingStock Closing value
ITM001 40 460
ITM002 20 210.......
ItemCode GRPOno. VendorCode quantity Rate GRPO Date
ITM001 10001 V0001 10 10 2009-02-01
ITM001 10002 V0002 20 11 2009-03-15
ITM001 10003 V0003 10 14 2009-03-31
ITM002 10021 V0011 10 10 2009-02-11
ITM002 10022 V0015 10 11 2009-03-14Hai Jeyakanthan A
I want small change in your query
SELECT T0.ItemCode,T0.TransType, SUM(T0.InQty)-SUM(T0.OutQty) AS 'Closing Stock',SUM(T0.OpenValue) as 'Balance' FROM OINM T0
*where docdate <= '[%0]'*
GROUP BY T0.ItemCode,T0.TransType
Having
T0.TransType = 20 ORDER BY T0.ItemCode,T0.TransType
I tried this query for taking closing stock for given date, its giving me correct result
SELECT T0.ItemCode, T0.Ref1, T0.CardCode, T0.InQty, T0.Price, T0.DocDate FROM OINM T0 WHERE T0.TransType = 20 AND
(T0.DocDate >= '[%0]' AND
T0.DocDate <= '[%1]') ORDER BY T0.ItemCode, T0.Ref1, T0.CardCode, T0.InQty, T0.Price, T0.DocDate
In this query i want only the GRPO no,date,price.... for closing stock quantity
Edited by: Prasanna s on May 14, 2009 12:39 PM -
Dear All
I am devlop new Stock Report Date wise
my output follows
Material Plant Storagelocaton Saleorder OPenning stock Closing Stock Total
Which Table stored that details?
how will calculated?
Thanks and Regards
Sureshhey
i think the following tables
will be helpful for the report:-
1>MARA
2>MBEWH
3>MSEG
4>VBRP
hope this will help
good luck
harry.
Maybe you are looking for
-
My steam won't launch ever since I updated to Yosemite I don't know what is going on.
Whenever I try to launch it, it says "Steam quit unexpectedly" I have tried redownloading it 5 times and have every software up to date. I also have tried deleting all my steam files and it still doesn't work. Here is a screenshot: I also downloaded
-
My iMac running 10.7.5 crashes when I store a large amount of data like copy and paste a picture. It also has started being painfully slow to open the first page in Safari. Here's is some information a program gathered on my computer. -Thanks! Pro
-
View settings: how to preserve
How do I preserve the zoom settings and placement so when I open the file later, each sheet is at the location and zoom rate where I left off last time?
-
Clone Stamp Tool not cloning transparency correctly
My clone stamp tool is not cloning transparency correctly. I have looked at all opacity, flow, and blending setings. Basically, what I remember from before this problem started, is that cloning a transparent edge, or an area with some degree of tran
-
Hello budding motioners...I thought I would see just how far I could push motion 3d, I have done some great work and really dont want to compromise on the render quality. However I am killing my power mac. The best approch to not crashing I thought w