Query on balance Quantity

Hi SAP Gurus,
i have a requirement to check the balance quantity available in warehouses till current date...
can any body please provide me the query..?
i appreciate your help...
Thanks and Regards,
kaviprashu

Hi Kaviprashu,
If you need this for an addon or application, you really have to [learn about sql|http://www.w3schools.com/sql/default.asp].
Hint: you will need the tables OITM and OITW.
Regards,
Johan

Similar Messages

  • How to query opening balance for all customer or Vendor for an speci. date

    Hi,
    How to query opening balance for all customer or Vendor for an specific date?
    Example:
    put any date and query will show all customer/ Vendor  that date opening/current balance.
    Regards,
    Mizan

    Hi mizan700 ,
    Try this
    SELECT T0.[DocNum] As 'Doc No.', T0.[CardCode] As 'Customer Code',
    T0.[CardName] As 'Customer Name',(T0.[DocTotal]-T0.[PaidSys]) As 'O/S Balance'
    FROM OINV T0 INNER JOIN OCRD T1 ON T0.CardCode = T1.CardCode
    INNER JOIN OCRG T2 on T1.GroupCode = T2.GroupCode
    INNER JOIN INV1 T3 ON T0.DocEntry = T3.DocEntry
    WHERE T0.[DocStatus] ='O'
    AND
    (T0.[DocDate] >='[%0]' AND T0.[DocDate] <='[%1]')
    Regards:
    Balaji.S

  • Need logic for calculate the balance quantity in open sales order

    hi all
    i need logic to calcuclate the balance quantity in open sales order ,
    where i am using VBAK header and VBAP item , and VBFA for document flow tables
    i need to have the balance quantity , for the open sales order
    especially taking with respect to  VBFA-VBTYP_N = M for invoice creation and N for canellation
    any one please help me

    thank you but i am clear abt it
    will you please anyother way to calucaluate the logic ,
    and i need to populate in bukets also for the terms of 5 years
    Edited by: sridhar loganathan on Nov 25, 2008 6:43 AM

  • Auto Email to vendor for followup balance quantity deliver

    Hi All,
    Auto Email to vendor for followup balance quantity deliver,
    I have an requirement that Auto email to vendor for reminder with some fixed days (example : 10 days),
    Please suggest me any configurations for this and suggest me how to proceed on this..
    Thanks

    Hi,
    You can use Urging Reminders to supplier with output type MAHN.
    Here you set all the reminders to vendors based on days set up earlier then delivery date or 10 before delivery date 5 days before delivery date.
    Refer the below docs it may help you..
    Output message type MAHN Dunning - ERP SCM - SCN Wiki
    Reminders and Urging Letters (Expediters) - Purchasing (MM-PUR) - SAP Library

  • Query regarding Asset quantity.

    Dear Experts,
    I have query regarding Asset quantity.
    While creating Goods receipt (MIGO) users give the Material (Asset) quantity but when I check in Asset master or in any sap asset reports system not show the quantity in Asset master or any Asset report. Although I have checked in all SAP Standard reports but quantity not updated in any reports. Let me know if I need to do any configure in Asset.
    I also want to know that how System posts the quantity automatically in Asset master after doing MIGO/MIRO?
    Please provide the best solution.
    Best Regards,
    Vivek

    Hi VIvek
    In Asset Master Data update the unit of measure in Quantity field. When you post through a MIRO document or F-90 whatever the quantity input is updated in the asset master record.
    Kindly award points if correct

  • Balance Quantity updation in schedule table

    Hi,
    I have schedule table like below format:
    Materila Code Schedule No. Schdule Quanity Balance Quantity
    ABC 1 500 500
    ABC 2 300 300
    ABC 3 200 200
    If i received 600 quantity then data should update as below in schedule table:
    ABC 1 500 0
    ABC 2 300 200
    ABC 3 200 200
    Single material contain multiple schedules. Please guide us how to programatically do the above updation.
    I am new to oracle. Please do the needful.

    Use MERGE + analytic SUM:
    SQL> create table tbl as
      2  select 'ABC' Materila_Code,1 Schedule_No,500 Schdule_Quanity,500 Balance_Quantity from dual union all
      3  select 'ABC',2,300,300 from dual union all
      4  select 'ABC',3,200,200 from dual
      5  /
    Table created.
    SQL> variable Received_Quantity number
    SQL> exec :Received_Quantity := 600;
    PL/SQL procedure successfully completed.
    SQL> merge
      2    into tbl t
      3    using (
      4           select  rowid rid,
      5                   :Received_Quantity Received_Quantity,
      6                   sum(Balance_Quantity) over(order by Schedule_No) Running_Total_Balance_Quantity,
      7                   sign(sum(Balance_Quantity) over(order by Schedule_No) - Balance_Quantity - :Received_Quantity) flag
      8             from  tbl
      9          ) s
    10    on (
    11            t.rowid = s.rid
    12        and
    13            s.flag = -1
    14       )
    15    when matched
    16      then
    17        update
    18           set t.Balance_Quantity = greatest(s.Running_Total_Balance_Quantity - s.Received_Quantity,0)
    19  /
    2 rows merged.
    SQL> select  *
      2    from  tbl
      3  /
    MAT SCHEDULE_NO SCHDULE_QUANITY BALANCE_QUANTITY
    ABC           1             500                0
    ABC           2             300              200
    ABC           3             200              200
    SQL> SY.

  • Customer aging query - show balance as of a specific date

    I am working on a query for a vendor aging to show information that is not available in the vendor aging report. However, I want to show the balance that was open at a specific point in time. i.e. today is Aug 17 and i want to show what was due at June 30. All the June invoices have been paid as of Aug 17 so i cannot use docstatus. The aging report gives you the option to select Vendors with a zero balance and reconciled transactions. How do i show that information in a query?

    Hi Vicki,
    I'm trying to do the exact same thing. Get the aging balance at any point in time in verion 2007.
    Have you succeded so far?.
    I use to run a query to get the balance at any point in 2005 like this..
    SELECT     T2.CardCode, T2.CardName , T0.[BatchNum], T0.[TransId], T0.[TransType], T1.[CreatedBy], T1.[RefDate], T1.[DueDate], T1.[MthDate],
    T1.[LineMemo], T0.[Ref1], T1.[BaseRef], T1.[Credit], T1.[Debit], T1.[FCCredit], T1.[FCDebit], T1.[SYSCred],
    T1.[SYSDeb], T1.[SourceLine], T1.[Ref1], T1.[LineType], T1.[TaxDate], T1.[Account], T1.FCCurrency, T1.[ObjType]
    FROM     [dbo].[OJDT] T0
    INNER     JOIN [dbo].[JDT1] T1 ON T1.[TransId] = T0.TransId
    INNER     JOIN [dbo].[OCRD] T2 ON T1.[ShortName] = T2.CardCode
    WHERE     T1.[Account] IN (SELECT AcctCode FROM oact WHERE LocManTran = 'Y' AND GroupMask = 1)
    AND      T1.[RefDate] <= '20091026'
    AND      (T1.[MthDate] > '20091026'
    OR      T1.[IntrnMatch] = 0 )
    ORDER BY T0.[TransType], T1.[RefDate], T2.CardCode, T1.DueDate
    But this baby shows more documents than needed and a lot of work has to be done to place payments on the right invoices to como up with the right balance age.
    I'd appreciate if you could help me out or let me know what have you found so far.
    Best,
    Ricardo Sada

  • Hide/Delete lines from ABAP Query output when Quantity is 0

    Hi all,
    I'm changing an existing abap query. My requirement is to delete the rows from the report output where qantity = 0.
    I tried the following ways.
    1. In SQ01, select the quantity field and check the checkbox for "Display only field <> 0", but this didnt worked as it will 
         supress the zero from display.
    2. I tried to write code in the Infoset SQ02->Edit->Code. I wrote the following code "CHECK vbep-wmeng IS NOT INITIAL".
        Here  the problem is, the code is not executing in the test client. When I open the Infoset in test(i mean development test) 
        client the code is there, but when i execute the program its not working. I tried using "BREAK-POINT", program executions
        does not stop at the break point. There is existing code in the event "START-OF-SELECTION", this code I'm able to see in the
        query program opened through SE38. I edited the existing code and kept a break point in between, and now checked in the
        program in SE38, but the changes are not reflected. I'm able to see old code only(even after save n generate).
    3. Gave search in SCN, google etc.
    Please note.
    1. I'm not using any Logical Database in the Infoset. Its a simple join of 4 tables.
    2. Query is created in the Global Area (cross client) not client specific.
    Can anybody tell me what could be the problem and how can Over the above issues and achive the requirement.
    Thanks in advance.
    Edited by: Mr A on Feb 25, 2010 1:39 AM

    Dear Mr A,
    Can i know how did u solve the issue even i'm facing the same problem.
    Regards,
    Karan Bhasin

  • Query for PO Quantity

    Hi all,
          How to get PO Quantity in order management?
    Thanks,

    Please alter the below query
    (add the required column in the select statement)
    SELECT  poh.segment1 po_blanket_num
    FROM po_requisition_headers_all prh,
    po_requisition_lines_all prl,
    po_line_locations_all poll,
    po_headers_all poh,
    oe_drop_ship_sources oed,
    hr_all_organization_units hr
    WHERE prh.requisition_header_id = prl.REQUISITION_HEADER_ID
    AND hr.organization_id = poh.org_id
    AND prl.line_location_id = poll.line_location_id
    AND poh.po_header_id = poll.po_header_id
    AND oed.line_location_id = poll.line_location_id

  • Query - Opening Balance

    Hello,
    I'm using SAP 8.81 PL 6 and would like to come up with a query that displays the opening of an account at a given date.
    I have checked through the forums and come across the below query which unfortunately displays no results.
    SELECT T0.[TransId],T1.[Line_ID], T1.[Account],T1.[ShortName],
      T1.[Debit], T1.[Credit], T1.[RefDate]
    FROM OJDT T0 INNER JOIN JDT1 T1 ON T0.TransId = T1.TransId
    WHERE T0.[TransType]=-2
    I will appreciate if someone assists with the query. Thank you.
    Rgds,
    Henry

    Hi all,
    Sorry for the ambiguous question. Allow me to clarify.... When you drill down to an account under Chart of accounts, the Opening Balance displays on the top, followed by subsequent transactions whose cumulative total makes up the account balance.
    I came up with the below query to display an account's transactions in a given date range and most importantly to display the Offset Account Name instead of the code
    SELECT T0.RefDate, T2.AcctName, T0.ContraAct, T0.Debit, T0.Credit,(T0.Debit- T0.Credit)Balance,
    Case When T0.ContraAct=T4.AcctCode Then T4.AcctName Else Case When T0.ContraAct=T3.CardCode
    Then T3.CardName Else Null End End 'Offset Account' FROM dbo.JDT1 T0 INNER JOIN dbo.OACT T2
    ON T0.Account = T2.AcctCode LEFT JOIN OCRD T3 ON T3.CardCode=T0.ContraAct LEFT JOIN OACT T4 ON T4.AcctCode=T0.ContraAct
    WHERE T0.RefDate>='%1' and T0.RefDate<='%2' and T4.AcctName LIKE '[%0]%'
    I would further like to improve the above query by displaying the 'opening balance' or the balance of the account on the previous day (i.e. the day prior to T0.RefDate>='%1'). Kindly assist me on this one.
    Regards,
    Henry

  • Opening Balance Quantity

    Hello Experts,
    Initials Quantity of Item in Inventory Module.
    there is two G/L: Account 1.Open Inventory Account at Header label,2.Account Code at Row label
    show i am totally confuse which account map here ?
    Thanks
    Krishna

    Thanks
    But when we add opening balance form then two G/L effect one ladger will be debited second is Credit .
    My inventory Account Debited And second Account is Credited. now i am confuse this credited Account in witch time Debit other wise show always credit Amount ?

  • Query for Balance Sheet comparison Actual/Plan

    Hello,
    I try to create a query in the BEx using the cube 0FIGL_V10 to display the balance sheet and p/l statement in BI. It works fine with comparison actual/actual but I don't know how to make a comparison between actual and plan figures.
    I am using as filter criteria the dimensions value type ([0VTYPE 10 which is actual and 0VTYPE 20 which is plan). But how is it possible to display it in the right line and columns.
    I need to fix this be the end of next week. So please answer as soon as you can.
    Thanks a lot for your help.
    Regards
    Robert

    Hello Sam,
    thanks a lot for you pretty good answer. It works perfectly but there is one thing left, maybe you can answer that too:
    I want to display 3 actual periods but only one plan period. How can I realize this?
    Thanks again for your prompt help.
    Regards
    Robert

  • Query for net quantity

    Hi experts,
    How should my query look like if i want to extract the net quantity on the deliveries (ODLN) and returns (ORDN) documents. Meaning, if i have a delivery quantity of 10 and a return document (which is based on my delivery document) with 2. I should have a line item in my query to have 8 (10-2).
    Thanks in advance,
    Maria

    Hi Maria,
    Please try below.
    SELECT T0.DocNum as 'Delivery No', T0.CardName as 'Customer Name', T1.ItemCode as 'Delivered Item No', T1.Dscription as 'Delivered Item Name', T1.Quantity as 'Delvered Quantity', T3.DocNum as 'Delivery Return No', T3.CardName as 'Delivered Return Customer Name', T2.ItemCode as 'Delivered Return Item No', T2.Dscription as 'Delivered Item Name', T2.Quantity as 'Delivered Return Quantity', (T1.Quantity - T2.Quantity) as 'Actual Item Delivered' FROM ODLN T0  LEFT JOIN DLN1 T1 ON T0.[DocEntry] = T1.[DocEntry] LEFT JOIN RDN1 T2 ON T2.[BaseEntry] = T1.[DocEntry] AND T2.[BaseLine] =  T1.[LineNum] LEFT JOIN ORDN T3 ON T2.[DocEntry] = T3.[DocEntry] WHERE T0.[DocDate]  >=[%3]  AND   T0.[DocDate] <=[%4]
    Hope this helps
    Regards::::
    Atul Chakraborty

  • Query Account Balance Last Month

    Dear All,
    I need your help...I want to make query that show account balance AR at level 4 at end of month of last month. For example this month is March, so I want to show account balance AR at level 4 at end of month Feb.
    Thanks for your help
    Edited by: Ho  We I on Mar 3, 2009 3:47 AM

    Hi Ho,
    Try this out,
    SELECT SUM(Debit-Credit) as Balance from JDT1 WHERE RefDate <= [%0] and Account = [%1]
    Supply the first parameter with end date of the month and the second parameter with the account you want to check.
    Regardless which account you want to query (i wondered why you want to check AR balance by the account, you can get it from Customer Aging Report instead), you can use the query for any accounts
    Hope it helps.
    Cheers,
    Marini

  • Sales Order Balance Quantity in SAP SD Tables.

    Hi All,
                      From which table, balance qty will be referred against Sales Order ?
    So Qty - 100
    Delivered - 30
    Balance Qty - 70
    Thanks,
    Nandish Gowda K M

    Hi Nandish,
    You con't see the open quantity from one field,as per Mr.Raghu said you need to fetch the data from two fields and take the
    difference quantity as open quantity.
    pass the sales document no VBAP - KWMENG
    pass the delivery no LIPS - LFIMG
    difference between the two values can be considered as open quantity.
    Check and revert
    Regards
    Ram

Maybe you are looking for