Inventory Audit Report with Batch Number

Hi all.
I am trying to build a query that similar to the inventory audit report but with batch number. I want to know which batch number of each item is being charged out in deliveries or goods issue and which batch of item is being received. I am using SAP B1 2007A. Following is the query that I used to generate the inventory report (warehouse, itemcode, description, price, opening balance, receipt, issue, closing)  but I don't know where to get the batch number information for it.
Declare @StrtDate Datetime
Declare @EDate Datetime
Declare @FromDate Datetime
Declare @ToDate Datetime
Declare @Group nvarchar(10)
Declare @Whse nvarchar(10)
Set @FromDate = (Select min(S0.Docdate) from dbo.OINM S0 where S0.Docdate >= @StrtDate)
Set @ToDate = (Select max(S1.Docdate) from dbo.OINM s1 where S1.Docdate <= @EDate)
Set @Whse = (Select Max(s3.Warehouse) from dbo.OINM S3 Where S3.Warehouse = 'QA01')
Select
@Whse as 'Warehouse',
a.Itemcode,
max(a.Dscription) as 'Description',MAX(a.Price) as 'Price',
sum(a.OpeningBalance) as 'OpeningBalance',
sum(a.[IN]) as Receipt,
sum(a.OUT) as Issue,
(sum(a.OpeningBalance) + sum(a.[IN]) - Sum(a.OUT)) as Closing,
MAX(a.Price) * (sum(a.OpeningBalance) + sum(a.[IN]) - Sum(a.OUT)) as ClosingValue
from(
Select
N1.Warehouse,
N1.Itemcode,
N1.Dscription,N1.Price,
(sum(N1.inqty)-sum(n1.outqty)) as 'OpeningBalance',
0 as [IN],
0 as OUT
From dbo.OINM N1
Where
N1.DocDate < @FromDate and N1.Warehouse = @Whse and N1.ItemCode Between '1C2K50NBAC' AND '7S2N40ADAM'
Group By
N1.Warehouse,N1.ItemCode,N1.Dscription,N1.Price
Union All
select
N1.Warehouse,
N1.Itemcode,
N1.Dscription,N1.price,
0 as 'OpeningBalance',
sum(N1.inqty) as [IN],
0 as OUT
From dbo.OINM N1
Where
N1.DocDate >= @FromDate and N1.DocDate <= @ToDate and
N1.Inqty >0
and N1.Warehouse = @Whse
Group By
N1.Warehouse,N1.ItemCode,N1.Dscription,N1.price
Union All
select
N1.Warehouse,
N1.Itemcode,
N1.Dscription,N1.price,
0 as 'OpeningBalance',
0 as [IN],
sum(N1.outqty) as OUT
From dbo.OINM N1
Where
N1.DocDate >= @FromDate and N1.DocDate <=@ToDate and
N1.OutQty > 0
and N1.Warehouse = @Whse
Group By N1.Warehouse,N1.ItemCode,N1.Dscription,N1.price) a, dbo.OITM I1
where a.ItemCode=I1.ItemCode
Group By a.Itemcode
Order By a.Itemcode
I wish to create the report like Inventory audit report merge with the batch number transactions report.
Thanks.

Dear Shobah, it can be possible by some custom report. Try some complementary bi solution for better analysis with SAPB1.

Similar Messages

  • Trigger Inventory Audit Report With A Fixed Set Of Selection Parameters

    Hi All,
    Can we trigger Inventory audit Report with fixed warehouse selection ?
    Thanking you
    Malhaar

    hi,
    the answer is no. but every time we run the Inventory Audit report it will save the last selection criteria. let say last time you run the inventory audit report your selection criteria was WH 02, so the next time you run the inventory audit report, it will display your last selection criteria, in out example its WH 02.
    regards,
    Fidel

  • Stock Report with Batch Number

    Hi ,
    My Client requires stock report with Batch numbers .required report format is
    Item Code,BatchNumber,OpenQty,OpenVal,PurchaseQty,PurchaseVal,SalesQty,SalesVal,ClosQty,CloseVal
    I tried using query on wiki for stock report but that query is written in 2007 and Batch tables and OINM table is changes in 8.81.
    http://wiki.sdn.sap.com/wiki/display/B1/SAPB1SQLH-INItemInventoryOpeningandClosingStockper+warehouse
    can any one help with stock report- batches.
    Thanks,
    Preeti

    HI,
    use below query as basis and mofiy the fields required. it shows linking in batch and transaction tables:
    SELECT distinct T0.ItemCode,T0.ItemName ,T0.DocDate ,T0.DocType ,T0.DocNum,T0.LocCode ,t4.DistNumber as [BatchNumber], T1.Quantity ,T5.CalcPrice as [Price]  
    FROM  [OITL] T0 
              INNER  JOIN [ITL1] T1  ON  T1.[LogEntry] = T0.[LogEntry] 
              INNER JOIN  OBTN T4 on T1.MdAbsEntry=T4.AbsEntry
              INNER  JOIN [OITM] T2  ON  T2.[ItemCode] = T0.[ItemCode]   
              Inner JOin OINM T5 on T0.ItemCode =T5.ItemCode and T0.LocCode = T5.Warehouse  and T0.AppDocNum = T5.BASE_REF
    Thanks,
    Neetu

  • Stock Report with batch number and its Charactristc values

    Our material are batch managed and Char values are entered at the time of GR. We need to prepare stock report showing batches for the material, their stock and characteristics values.
    Like to know what tables we should use to find the char values. I could not find value in table CAWN

    Hi,
    For characteristcis link and values use below tables:
    Characteristics :
        CABN                   Characteristics ( o.a. batch/vendor)   
        CABNT                 Characteristics description
        CAWN                  Characteristics  ( o.a. material)
        CAWNT                Characteristics description
        AUSP                   Characteristic Values
       Class types and objects :
        TCLAO                 Several class types for object
        TCLA                    Class types ( vb. lfa1 => v10 en 010)
        TCLAT                  Class type text
        TCLT                    Classifiable objects
        TCLC                   Classification status
       Links :
        INOB                    Link between Internal Number and Object
        KLAH                  Class header data  
        KSSK                  Allocation Table: Object (vb.matnr) to Class 
        KSML                  Characteristics for a class (internal number)
    for batch stock 0 use tables ilken MCHB, MCHA etc,
    hope this helps
    Reg
    Dheeraj

  • Sales report with Batch number & expiry dates

    Hello friends,
    would any one please help me to frame this query to achieve the above ..
    my query is as bellow, but I want to add the batch number & expiry dates along with the other information.....
    SELECT T0.[DocNum], T0.[DocDate], T0.[CardCode], T0.[CardName], T0.[NumAtCard], T1.[ItemCode], T1.[Dscription], T1.[Quantity] FROM OINV T0  INNER JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry WHERE T1.[ItemCode] >=[%0] AND  T1.[ItemCode] <=[%1] AND  T0.[DocDate] >=[%2] AND  T0.[DocDate] <=[%3]
    So which table to join to get the batch & expiry...
    Rgds
    Suman

    HI
    Batch table is OIBT, IBT1,OBTN
    SELECT distinct T0.[DocNum], T0.[DocDate], T0.[CardCode], T0.[CardName], T0.[NumAtCard], T1.[ItemCode], T1.[Dscription], T1.[Quantity], T4.[ExpDate] FROM OINV T0  INNER JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry inner join
    IBT1 T2 on T1.ItemCode = t2.ItemCode and T0.objtype=T2.basetype and T2.baseentry=T1.Docentry inner join
    oitm T3 on T1.Itemcode=T3.Itemcode inner join OIBT T4 on T1.Itemcode=T4.Itemcode  WHERE T1.[ItemCode] >=[%0] AND  T1.[ItemCode] <=[%1] AND  T0.[DocDate] >=[%2] AND  T0.[DocDate] <=[%3]
    group by T0.[DocNum], T0.[DocDate], T0.[CardCode], T0.[CardName], T0.[NumAtCard], T1.[ItemCode], T1.[Dscription], T1.[Quantity],T4.[ExpDate]
    Thanks
    Mohammad Imran

  • Production Report with batch number

    Dear Experts,
    I don't know how to include the batch number for the finished goods in the following query ,
    SELECT T0.[DocNum] as Prod#, T0.[ItemCode],T0.[CmpltQty], T1.[ItemCode], T1.[IssuedQty], T2.[BatchNum],T0.[Comments] as Remark FROM OWOR T0  INNER JOIN WOR1 T1 ON T0.DocEntry = T1.DocEntry left join  IBT1 T2 on  T2.[BsDocEntry] = t0.docentry and T1.[LineNum] = T2.[BsDocLine] WHERE T2.[BsDocType]  = '202' and   T2.[BaseType] = '60' and T0.[Status] IN ('r','l') and T0.[CmpltQty] <> '0' and T0.[DocNum]=[%0%] GROUP BY T0.[DocNum], T0.[ItemCode],T0.[CmpltQty], T1.[ItemCode], T1.[IssuedQty], T2.[BatchNum],T0.[CardCode],T0.[OriginNum],T0.[Comments] order by T0.[DocNum]
    Help me Please.

    Dear sir,
    The query is working
    SELECT T0.[DocNum] as Prod#,T0.[OriginNum] as SalesOrd#,T0.[DueDate],T0.[PlannedQty] as PlanQty,case when (T3.[BaseType] = '59' and  T3.[Direction] = '0' and T0.[ItemCode] = T3.[ItemCode] ) then  'Received' end as Direction,T0.[ItemCode], T3.[Quantity], T3.[BatchNum], case when (T2.[BaseType] = '60' and T2.[Direction] = '1' and T1.[ItemCode] = T2.[ItemCode] ) then 'issued' end Direction, T2.[Quantity], T2.[ItemCode], T2.[BatchNum] FROM OWOR T0  INNER JOIN WOR1 T1 ON T0.DocEntry = T1.DocEntry left  join IBT1 T2 on T2.[BsDocEntry]  = t0.docentry and T2.[BsDocLine]  =  T1.[LineNum] left  join IBT1 T3 on T3.[BsDocEntry]  = t0.docentry and T0.[ItemCode] = T3.[ItemCode] WHERE T2.[BsDocType]  = '202' and  (T0.[Status] = 'R' OR T0.[Status] = 'L' )
    Thankyou for the same

  • Inventory Audit Report - Not followed FIFO and Batch management

    I have created an Item say XYZ, with Batch management and valuation methode FIFO.
    Then I have created a batch say 1 with posting of opening balance transaction with posting date as 1st April 2009.
    Now when I post an A/R Invoice with posting date as 19th May 2009 in which I have selected above batch.
    I have also posted some more purchase transaction for same item before 19th May 2009 that is the date of sales invoice.
    Now when I see Inventory Audit Report, system has not picked up the cost column as per Batch selection in A/R Invoice, and also not as per FIFO, but it has followed the system date of transaction for deriving cost as per FIFO.
    Can anybody throw light on this ?
    BR
    Samir Gandhi

    Dear Samir Gandhi,
    Irrespective of posting date you use for document posting, with FIFO Method system will arrange all the inventory posting in layers with First inventory posting will form the base for first inventory movement out and so on
    Example:
    1st Entry:(Opening Balances)
    posting date : 01/04/09    Item : XYZ    quantity : 5   Unit cost price : 100
    2nd Entry: Purchase
    posting date : 01/05/09    Item : XYZ    quantity : 5   Unit cost price : 105
    3rd Entry: Purchase
    posting date :25/04/09    Item : XYZ    quantity : 5   Unit cost price : 90
    Layers created :
    1.    Item : XYZ    quantity : 5   Unit cost price : 100
    2.     Item : XYZ    quantity : 5   Unit cost price : 105
    3.     Item : XYZ    quantity : 5   Unit cost price : 90
    4th Entry : Sales
    Item : XYZ    quantity : 8  
    So here cost of goods sold will be : ( 5x100)+ ( 3x105) = 815
    and it wont be  ( 5x100)+ ( 3x90) =770 if that's what you are expecting
    Regards,
    Mukesh

  • Inventory Audit Report - Zero quantity but with value

    Hi All,
    Our client are using FIFO costing, due to some backdated transaction we get 0 Qty but the value is not 0 when running Inventory Audit Report base on posting date (system date is fine) at the month end. I understand that the system calculate the cost base on system date and this is system behavior.
    So, i just wanted to seek for advice from any expert in accounting especially on costing, will this 0 Qty with value report be accepted by auditor and will it caused any legal issue or this accounting practice is acceptable?
    Thanks.

    Dear Mr Kong,
    From what you said it looks like opening a message for this issue is the appropriate action this time.
    The stock group will give you an update on this issue.
    Kind Regards,
    Marcella Rivi
    SAP Business One Forums Team

  • Inventory report with Batch details

    Hi,
    Is there a report that has inventory on hand with batch detail in B1 2007?
    Thanks,
    Olga

    Dear Rahul,
    I have generated a batchwise stock summary report as on any date on SAP B1 8.82.
    If required the transaction details can also be generated from this.
    Please mail me @ [email protected] if you need this report.
    Thanks,
    Nabyendu

  • Inventory audit report and Inventory GL balance - Not matching

    Team
    I taken the report from Inventory audit report , this is not matching with inventory charts of accounts balance.
    What may be the error
    How to close old topics, how to provide the points for good suggestion. My points also not increased , what I need to do increase my points.
    Thanks
    Anantha Desai

    Hi,
    1. Please check if any manual JE posted to that GL account
    2. How to close old topics
    There are two way close discussions:
    ----> If you got right answer, you can choose "correct answer" option in replies.
    ----> If you get an idea or suggestions, you can choose "Helpful answers" and need to close manually by choosing "Assumed answered:.
    how to provide the points for good suggestion
    Please choose "helpful answer" and "Like" option for good suggestions
    My points also not increased , what I need to do increase my points.
    Points will be increased, if you provide right suggestions, ideas and answers to other member discussion.
    Refer this document for further details:
    http://scn.sap.com/community/support/blog/2013/04/03/how-to-close-a-discussion-and-why
    Thanks & Regards,
    Nagarajan

  • Transaction value in inventory Audit Report

    Hi,
    I have received some quantities say 100 without any price in the Goods receipt.But when i run the inventory Audit report it is showing some value in transaction value field.Where as when i check the item cost the item cost is 0 even then system is picking up transaction value
    What may be the problem.Due to this i am unable to reconcile the inventory transactions with the inventory G/L
    Please help
    Thank You
    Md.nazeer Shaikh

    Hi Nazeer,
    Check the following lthread
    Inventory Audit Report Issue in value
    Inventory Audit Report - Zero quantity but with value
    Inventory Audit report
    Regards
    Jambulingam.P

  • Inventory Audit Report and Inventory G/L Account discrepancy

    Good Day!
    Hi Everybody. I had experienced a discrepancy between the Inventory Audit Report and Inventory G/L Account.
    Before everything else, our client does not have any PO, GRPO. Only A/P Invoice and A/P Credit Memos so there are no difference being posted.
    There were also no transactions posted directly in Inventory G/L Account but from observation, there is a minor difference. This only happened with two transactions in AP Invoice with Negative Quantity.
    The AP Invoice is composed of a single item, the unit price is 180.00 x -58 pcs quantity. Total amount is -10,440.00.
    G/L Account posting is
    Inventory 10,440.00
    A/P                       10,440.00  
    In the FIFO layering, the item cost is 200.00 (based on the current stock value) and the current stock quantity before posting is 80 pcs . Since this is a negative quantity A/P Invoice, it seems that the cost of the item when the transaction will be posted is  200 (based on the current stock value) so when I view the Inventory Audit Report amount, it says the inventory cost/posting is -11,600 (200 x -58).
    But on actual G/L Account, the posting is -10,440.00 from A/P Invoice, that's why the inventory discrepancy occurs. It seems that SAP B1's Inventory Audit Report confuses the FIFO cost posted versus G/L Account's posted based on the document. Since the document is A/P Invoice, SAP B1 assumes that the transaction will post the amount as the additional inventory cost and posting the inventory cost into Inventory G/L Account. However, since this is a negative document, the system is releasing the items, thus, FIFO kicks in. The Inventory Audit Report catches the amount based on FIFO costing. The problem is that the Inventory Audit Report is more accurate than the Inventory G/L Balance.
    Any suggestion to fix this guys?

    HI,
    i'my afraid you're in the wrong place. This is the Chinese forum. Please go to SAP Business One Application for help.
    Best

  • Error while running Inventory Audit Report

    Hi All,
    While running the inventory audit report based on posting date, we get the message,'The report returns too many records for this action and may cause SAP Business One to stop responding for a long time or shut down. Do you want to continue?' Continue, cancel (buttons).'
    I have checked SAP Note 1624660 and also  https://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=98238470
    however, no correct solution is provided.
    What are the other options that we may use to run this report?? shorten the date range or run by system date??
    Any inputs will be appreciated!!
    Thanks,
    Joseph

    Hi!
    It would be better if you narrow down your selection like,
    More Range of Date with Single Warehouse
    Less Range of Date with Multi Warehouse
    More Range of Date with Single Item Group
    and more....
    I have faced a similar issue on Customer Aging for which SAP Support has replied, SAP B1 is a 32 Bit application and when the virtual memory consumption goes beyond a limit (1 GB) ;SAP will close. And they said  this is the limitation for all 32 bit applications.

  • Difference between G/L Balance and Inventory Audit Report

    Hi All,
            while checking the G/L ledger for Inventory account and the Inventory Audit report, there is a difference between the amounts posted. The closing balance till 31/03/09 is fine but afterwards the balance is not matchin at all. I hav tried to check between various posting dates but still there are differences. Any suggestions why there are differences and how should i check them??
    Thanks in advance,
    Joseph

    The GL account and the Inventory audit report will not tie for a couple of reasons:
    - You have posted directly (JE) to your Inventory account.  These amount since they are NOT tied to a Item in a transaction will not appear in the Inventory audit report.  The Inventory account(s) should be treated like a control account (enthough they
    cannot be set as one in SAP B1) and should not be posted to directly outside of the Item Inventory Transaction (GRPO, AP Inv, AR INV, DN, AR CM, AP CM, etc...) I have alos seen these posting when GL determinations are setup incorretly or when users use the inventory account in Stock Posting (staock taking) transactions
    - you have legacy issues resulting in audit report entries relating back to pre SP01 2005 days.
    To get these details analyzed by SAP for free along with the recomended corrections please contact your partner for a free Inventory Verification analysis   Your partner can take a copy of your DB backup and create a support message under SBO-MM-IVC and SAP support will analyse these differenes and show you the recommended changes.
    hope this helps

  • Inventory Audit Report

    We used the Inventory Audit Report to determine inventory value ending in a specific period.  It seems to work okay but it lists every single item in our inventory.
    We are looking for more of a summary report.  The only option we have for this is by product category.  However, we want it a little more detailed than this.
    So, is there any way to show the report summarized by our Style #'s?  We have have colors and sizes associated with each style.  We do not need to know total for each color and size.
    We just want the total for each Style #, which is the first four digits of our Item Code.  Theses first four digits are unique for each Style.  Can a Query be built to just show this summary?
    So...would have the following info...
    Style #...Total Items...Total Cost...Most Recent Item Cost
    Can something like this be built?
    Thanks!!!
    Mike

    To backdated the history is the most challenge task to complete.  Please be patient to check the query results from below:
    SELECT  Distinct SubString(t0.ItemCode,1,4) 'Style #', Sum(T0.InQty - T0.OutQty) 'Total Items', Sum(T0.InQty - T0.OutQty) *Avg(Case When T1.LastPurPrc = 0 then t2.AvgPrice else T1.LastPurPrc end) 'Total Cost',  Sum(T0.TransValue) 'Check', Avg(Case When T1.LastPurPrc = 0 then T2.avgprice else T1.LastPurPrc end) 'Most Recent Item Cost'
    FROM  OINM t0
    Inner Join OITM T1 on T1.ItemCode =T0.ItemCode
    Inner Join OITW T2 on T2.ItemCode = t0.ItemCode
    WHERE     T0.DocDate <= '[%0\]' and T0.InQty != T0.OutQty
    Group By SubString(t0.ItemCode,1,4)
    Order By SubString(t0.ItemCode,1,4)
    I have to get data from OINM table in which to get history quantity is fine but may not be able to find the old value easily.
    Thanks,
    Gordon

Maybe you are looking for

  • Error while opening modal (skillbuilder plugin)  page on page load

    Hi all, I'm using 4.2.1. ( on 11GR2 ), theme 25. Skillbuilder Modal page plugin v2 Modal pages are working great, on all kinds of events, but if I try to open one via a D.A. on page load it fails with "Uncaught TypeError: Object load has no method 's

  • Apex Memory Problem

    Sometimes, when I open page with report I receive the next error. report error: ORA-04030: out of process memory when trying to allocate 123404 bytes (QERHJ hash-joi,kllcqas:kllsltba) After redirecting, everything looks correct. It makes some trouble

  • BUG - Drag and drop an image, only working at the 2nd try

    I use the last version of JDeveloper : 11g R1 : 11.1.1.2.0 I try to drag and drop an image in a facet of a panelsplitter. Once the page is loaded, the first time I try to drag the image, it does not work : the image does not follow the mouse. When I

  • Connecting mcbook pro to LCD

    I bought all the required cables to link my Mcbook to the TV. Once i do it i see only the background on the TV and nothing else. I tried adjusting the resolution on my computer but it doesn t really work. I was wondering if there was any configuratio

  • How to do batch printing in BI 7.0?

    Hi, can any one explain me how to do batch printing with BI 7.0 ? Regards blusky