OPENING STOCK ISSU

Dear All
One of my client had feeded the opening stock at wrong unit price,now he realised that,so to rectify i suggest him to nullfy the entry by entering qty in minus with same wrong unit price but here it is considering the current cost even giving the unit price manually in opening stock.
I kindly suggest hw to resolve this.
Regards
M Auditya

Hi Auditya,
    You can see the JE of First time entered Opening Balance, Also you can see JE which you had rectified by Minus Qty.
    There should be one Inventory G/L, It was Debited at first OB transaction by 100 INR,
    And second should be Suspense G/L, It was Credited by 100 INR,
Now,
    When you rectified OB by minus Qty. at that time bellow JE may be done,
     Suspense A/c. was Debited by 110 INR
     And Inventory A/c. was Credited by 110 INR,
So you have to pass one manual JE with reference to above transaction like -
     Suspense A/c. will Credited by 10 INR and Inventory A/c. will Debited by 10 INR
After that all now you have to add new actual OB for that item
Regards,
Siddique Shaikh.

Similar Messages

  • Opening stock and closing stock required

    hi experts,
                  i am preparing daily report for material consumption .where i am getting BOM consumption for each material .
    material    opening-stock      issues      closing-stock
    material1
    item1       1000                    1                    999
    item2        10                       2                      8
    material2
    item1        999                   2                    997
    item2        20                     3                     17
    material3
    item1       997                   2                     995
    item3       30                    5                        25
    this is a report for daily consumption of material.
    but i want report for each material like this
    item1             1000           5ie(221)         995
    item2               20              3                         17
    item3              30                5                      25
    what is the logic for getting thsi output.
    thanks
    mani

    check this sample code.
    https://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=15856
    Regards
    Peram

  • Issue with opening stock balance in 2LIS_03_BX in BW

    HI GURUS,
    for some of the material we are not getting correct inventory stock available in BW report.
    where we have customised KF for inventory stock-non cumulative (based on difference of stock receipt and issued).
    The stock qty is  not considering the opening stock balance and hence this is coming as -ve in BW report.
    and but i checked the data in cube stock issued = stock received so ideally the stock should be zero .Also i have seen that i am not able to see stock intilized data in cube .
    also i ran the report for posting date on which stock intilization was done in BW and stock for material is coming as zero
    so hence all material where we have problem are those which has opening stock balance in  BX data source.
    we have also checked in R3 in t code MB51/52 and the stock available is zero but BW report shows -ve stock.
    Note that this problem is not for all stocks and also marker update settings are correct.We have also checked settings in RSDV .they are maintained relative to time..
    Please share your thoughts on this issue..
    thanks
    nilesh

    Have you compressed requests other than BX load and BF init load? If not run the infocube with 0RECORDTP = 1. This will give you the inital stock setup by the BX load. By default, when you run the non-*** infocube you will get records with RECORDTP '0' only. Whenever compression is done, the reference points get changes and records get written with RECORDTP '1'. If subsequent BF delta loads are also compressed i guess it would be difficult to differentiate. We have an OSS note on the importance of RECORDTP. Please check in service market place.
    One important point to note is that the BF init shoud have been done for the same selections as the BX load as the load (BF init) brings in movements for the stock already setup by BX. If there are differences in the selections for the 2 loads initially or setups were done on different days for these datasources, you could endup with issues.

  • Opening Stock + InwardQty + OutwardQty + Price and Closing Balance

    Hi Members,
    needs an SQL query for the " Stock Statement " From OINM Table to display opening stock , InwardQty as 'Receipts', OutwardQty as 'Issue', Price using Date and WareHouse as selection criteria.
    Kindly Help me in this regard,
    Thanks and Regards,
    Venkatesh.R

    used function in sql

  • Opening Stock and Closing Stock fields and Calculation

    Hi,
    My report requirement is to display the material, opening stock for the lower date, closing stock for the higher date and the in between all stock operations..how to fetch the opening stock and closing stock for a particular material ???.. what are the tables and fields for calculating them??..
    Thanks,
    Sri

    this is the code i wrote..
    I had selected the data for the date entered and the previous date(l_date) also..
    previous date for the opening stock.
    now i am getting only receipts and issues correctly.. opening stock and the remaining
    balance fields are not coming properly..please help me..
    here rmenge for receipts,imenge for issues.
    REPORT  ZSTOCK no standard page heading line-size 180.
    types: begin of ty_date,
           budat type budat,
           end of ty_date,
           begin of ty_mard,
            matnr type matnr,
            lgort type lgort_d,
            labst type labst,
            UMLME TYPE UMLMD,
            INSME TYPE INSME,
            EINME TYPE EINME,
            SPEME TYPE SPEME,
            RETME TYPE RETME,
           end of ty_mard,
           begin of ty_makt,
            matnr type matnr,
            maktx type maktx,
           end of ty_makt,
           begin of ty_mbew,
           matnr type matnr,
           bwkey type bwkey,
           lbkum type lbkum,
           salk3 type salk3,
           end of ty_mbew,
           begin of ty_mkpfmseg,
            mblnr type mblnr,
            budat type budat,
            bwart type bwart,
            matnr type matnr,
            lgort type lgort_d,
            shkzg type shkzg,
            dmbtr type dmbtr,
            menge type mseg-menge,
           end of ty_mkpfmseg,
           begin of ty_opstock,
           matnr type matnr,
           rdmbtr type dmbtr,
           idmbtr type dmbtr,
           bdmbtr type dmbtr,
           bmenge type menge_d,
           end of ty_opstock,
           begin of ty_output,
            mblnr type mblnr,
            budat type budat,
            matnr type matnr,
            maktx type maktx,
            bwart type bwart,
            lgort type lgort_d,
            shkzg type shkzg,
            rmenge type mseg-menge,
            rdmbtr type dmbtr,
            imenge type mseg-menge,
            idmbtr type dmbtr,
            dmbtr type dmbtr,
            bdmbtr type dmbtr,
            bmenge type menge_d,
           end of ty_output.
    data: t_date type standard table of ty_date initial size 0,
          t_mard type standard table of ty_mard initial size 0,
          t_makt type standard table of ty_makt initial size 0,
          t_mkpfmseg type standard table of ty_mkpfmseg initial size 0,
          t_opstock type standard table of ty_opstock initial size 0,
          t_out type standard table of ty_output initial size 0,
          w_date type ty_date,
          w_mard type ty_mard,
          w_makt type ty_makt,
          w_mkpfmseg type ty_mkpfmseg,
          w_opstock type ty_opstock,
          w_out type ty_output,
          g_matnr type mara-matnr,
          g_lgort type t001l-lgort.
    selection-screen begin of block b1 with frame.
    parameters:p_werks type t001l-werks obligatory memory id pw.
    select-options:s_lgort for g_lgort no-extension no intervals.
    select-options: s_matnr for g_matnr.
    parameters:p_date type mkpf-budat obligatory.
    selection-screen end of block b1.
    at selection-screen.
    perform sub_validate_date.
    start-of-selection.
    data: l_date type sy-datum,
          l_row type i.
    refresh t_date.
    select budat from mkpf into table t_date.
    sort t_date.
    delete adjacent duplicates from t_date.
    clear w_date.
    read table t_date into w_date with key budat = p_date.
    l_row = sy-tabix.
    l_row = l_row - 1.
    clear w_date.
    read table t_date into w_date index l_row.
    l_date = w_date-budat.
    select    k~mblnr
              k~budat
              s~bwart
              s~matnr
              s~lgort
              s~shkzg
              s~dmbtr
              s~menge
              into table t_mkpfmseg
              from mkpf as k inner join mseg as s
              on kmblnr = smblnr and
                 kmjahr = smjahr
              where k~budat between l_date and p_date and
                    s~matnr in s_matnr and
                    s~werks = p_werks and
                    s~lgort in s_lgort.
    if t_mkpfmseg is not initial.
    sort t_mkpfmseg by budat ascending
                       matnr ascending.
    select     matnr
               lgort
               labst
               umlme
               insme
               einme
               speme
               retme
               from mard
               into table t_mard
               for all entries in t_mkpfmseg
               where matnr = t_mkpfmseg-matnr and
                     werks = p_werks and
                     lgort in s_lgort.
    select    matnr
              maktx
              from makt
              into table t_makt
              for all entries in t_mkpfmseg
              where matnr = t_mkpfmseg-matnr.
    endif.
    loop at t_mkpfmseg into w_mkpfmseg where budat = l_date.
       loop at t_mard into w_mard where matnr = w_mkpfmseg-matnr.
          w_opstock-matnr = w_mkpfmseg-matnr.
          if w_mkpfmseg-shkzg = 'S'.             " Receive
               w_opstock-rdmbtr = w_mkpfmseg-dmbtr.
               w_opstock-bmenge = w_mard-labst + w_mard-insme + w_mard-speme
                                    + w_mard-einme +               w_mard-retme
                                    - w_mkpfmseg-menge.
          elseif w_mkpfmseg-shkzg = 'H'.         " Issue
               w_opstock-idmbtr = w_mkpfmseg-dmbtr.
               w_opstock-bmenge = w_out-bmenge + w_mkpfmseg-menge.
          endif.
              w_opstock-bdmbtr = w_out-rdmbtr - w_out-idmbtr.
                   append w_opstock to t_opstock.
                  clear w_opstock.
       endloop.
    endloop.
    loop at t_mkpfmseg into w_mkpfmseg where budat = p_date.
       loop at t_mard into w_mard where matnr = w_mkpfmseg-matnr.
         clear w_makt.
         read table t_makt into w_makt with key matnr = w_mkpfmseg-matnr.
         if sy-subrc = 0.
          w_out-budat = w_mkpfmseg-budat.
          w_out-matnr = w_mard-matnr.
          w_out-maktx = w_makt-maktx.
          w_out-lgort = w_mard-lgort.
          w_out-mblnr = w_mkpfmseg-mblnr.
          w_out-bwart = w_mkpfmseg-bwart.
          w_out-shkzg = w_mkpfmseg-shkzg.
            if w_mkpfmseg-shkzg = 'S'.             " Receive
               w_out-rmenge = w_mkpfmseg-menge.
               w_out-rdmbtr = w_mkpfmseg-dmbtr.
               w_out-imenge = 0.
               w_out-bmenge = w_mard-labst + w_mard-insme + w_mard-speme
                                    + w_mard-einme + w_mard-retme
                                    - w_mkpfmseg-menge.
            elseif w_mkpfmseg-shkzg = 'H'.         " Issue
               w_out-imenge = w_mkpfmseg-menge.
               w_out-idmbtr = w_mkpfmseg-dmbtr.
               w_out-rmenge = 0.
               w_out-bmenge = w_out-bmenge + w_mkpfmseg-menge.
            endif.
               w_out-bdmbtr = w_out-rdmbtr - w_out-idmbtr.
                   append w_out to t_out.
                  clear w_out.
    endif.
       endloop.
    endloop.
    write: / 'Material' , 12 'Description' ,40 'Location', 50 'Opening stock',70 'MvT',
              83 'Receipts' , 102 'Issues', 118 'Amount',135 'Balance Quan', 155 'Balance Amount'.
    loop at t_out into w_out.
       write: / w_out-matnr, 12 w_out-maktx, 40 w_out-lgort.
       clear w_opstock.
       read table t_opstock into w_opstock with key matnr = w_out-matnr.
       if sy-subrc = 0.
         write: 45 w_out-bmenge.
        endif.
       write: 70 w_out-bwart,75 w_out-rmenge,92  w_out-imenge,
             110 w_out-bdmbtr, 130 w_out-bmenge, 150 w_out-bdmbtr.
    endloop.
    *&      Form  SUB_VALIDATE_DATE
    FORM SUB_VALIDATE_DATE.
        select budat
               from mkpf
               into table t_date
               where budat = p_date.
        if t_date is initial.
           message e001(zks) with 'select another date range'.
        endif.
    ENDFORM.                    " SUB_VALIDATE_DATE
    Edited by: Sri on Feb 18, 2009 8:31 AM

  • How to create a query to see Opening stock and closing stock as on particul

    Hi All,
    How to create a query to see Opening stock and closing stock as on particul.
    Regards
    Albaik

    Hi,
    In BI 0IC_C03 will provide u the  required information and also having standard queries provided by the SAP.
    Plz find the list of Queries provided by the SAP.
    =======================================================================================================
    Inventory turnover      0IC_C01_Q0001
    Range of coverage - quantity      0IC_C01_Q0002
    Range of Coverage - Value      0IC_C01_Q0003
    Range of coverage of finished goods - quantity      0IC_C01_Q0004
    Range of Coverage of Finished Goods - Value      0IC_C01_Q0005
    Range of coverage of raw materials - quantity      0IC_C01_Q0006
    Range of Coverage of Raw Materials - Value      0IC_C01_Q0007
    Obsolete Stock on Hand      0IC_C01_Q0008
    Period-dependent requirement coverage      0IC_C01_Q0009
    Value of stock on hand      0IC_C01_Q0010
    Quantity of stock on hand      0IC_C01_Q0011
    Material consumption      0IC_C01_Q0012
    Material Movements      0IC_C01_Q0013
    Consignment stock: receipts and issues      0IC_C01_Q0014
    Valuated stock: receipts and issues      0IC_C01_Q0015
    Material stock and movements      0IC_C01_Q0016
    Material Movements (Healthcare)      0IC_C01_Q0020
    Material Consumption (Healthcare)      0IC_C01_Q0021
    Material Availability      0IC_C01_Q0022
    Inventory Turnover Frequency (Value)      0IC_C01_Q0023
    Consignment Stock Received and Issued per Unit      0IC_C01_Q0024
    Material Consumption (Quantity)      0IC_C02_Q0001
    Valuated Stock Receipts and Issues (Quantity)      0IC_C02_Q0002
    Range of Valuated Stock (Quantity)      0IC_C02_Q0003
    Inventory Turnover      0IC_C02_Q0004
    Receipt and Issue Consignment Stock at Customer      0IC_C03_Q0001
    Receipt and Issue Quality Inspection Stock      0IC_C03_Q0002
    Vendor Consignment Stock Receipt and Issue      0IC_C03_Q0003
    Receipt and Issue Stock in Transit      0IC_C03_Q0004
    Receipt and Issue of Blocked Stock      0IC_C03_Q0005
    Valuated Stock      0IC_C03_Q0006
    Stock in Quality Inspection      0IC_C03_Q0007
    Stock in Transit      0IC_C03_Q0008
    Blocked Stock      0IC_C03_Q0009
    Vendor Consignment Stock      0IC_C03_Q0010
    Consignment Stock at Customer      0IC_C03_Q0011
    Stock Overview      0IC_C03_Q0012
    Stock Overview (as of 3.1 Content)      0IC_C03_Q0013
    Quantities of Valuated Project Stock (as of 3.1 Content)      0IC_C03_Q0014
    Valuated Stock (as of 3.1 Content)      0IC_C03_Q0015
    Quantities of Valuated Sales Order Stock (as of 2.1 Cont.)      0IC_C03_Q0016
    Inventory Turnover      0IC_C03_Q0017
    Days' Supply      0IC_C03_Q0018
    SUS: Vendor Consignment Stock      0IC_C03_Q0019
    Scrap      0IC_C03_Q0020
    Inventory Aging      0IC_C03_Q0021
    Stock Overview - extended      0IC_C03_Q0022
    Demand Supply Match      0IC_C03_Q0023
    Warehouse Stock Analytics – Inventory Turnover      0IC_C03_Q0024
    Warehouse Analytics - Obsolescence and Variance      0IC_C03_Q0025
    Stock Overview: Materials      0IC_C03_Q0030
    Average Stock Value Over Time      0IC_C03_Q0031
    Stock Overview Over Time      0IC_C03_Q0032
    Range of Coverage Over Time      0IC_C03_Q0033
    ==================================================================================================
    Regards
    Ram.
    Edited by: Ramakanth Deepak Gandepalli on Jan 18, 2010 8:06 AM

  • Regaring opening stock and closing stock in MM

    hi guys,
    can any body plzz tell me what exactly do u mean by
    1) opening stock (OS)
    2) closing stock (CS)
    3) credit indicator
    4) debit indicator
    in MM, i actually checked bseg table for documentation of these fields but could not understand can any one plzz help me.
    thanks very much
        pavan

    Hello Pavan
    What exactly do you wish to know the definitions or calculation.
    Opening stock : It is the initial stock available for a particular material at a particular plant/sloc (when the sku was created).
    Closing stock : It is the current stock available, basically Opening stock + receipts - issue.
    Credit/Debit indicator : Basically, they indicate whether the stock was received at the location or issued from the location.
    Regards
    Anurag

  • MB5B -- Opening stock and closing stock

    Hi experts ,
    What is mean for opening stock adn closing stock ?
    In case of I input the same data of selection dHow they are calculated in MB5B ?
    For some material , the closing stock is 0, but why the closing value is not 0 ?
    BR , shubin
    Edited by: Shubin Tan on Nov 20, 2009 4:46 AM

    Opening stock:-stock at the beginning of the day
    Closing Stock:- Stock at the end of GI and GRs
    Reports like MB5B (Stock on posting date) can offer negative results              
    when executed for dates previous to the goods receipt, but this is only           
    a reporting issue: if the program is correctly executed for the complete          
    period (month/year), it should never show negative values.                                                                               
    The reason for the system behaviour you describe is that at the time of           
    a goods issue, the system only validates whether sufficient stock is              
    available in the posting period and not on that specific posting date.            
    So as described, if you specify a previous date, the stock for that               
    date may be negative, but actually your stock value is always correct.                                                                               
    If you are posting the goods issue in the previous period, the system             
    will issue an error message. But if the postings occur in the same                
    period with different dates, the system will not issue any error and              
    the stocks will be shown in negative.                                             
    Regards
    V V

  • Inventory management opening stock querry

    Hi,
    In the material movement report, it needs Opening stock, closing stock and the End Value.
    Can you please guide how I could Calculate.
    Though I calculate it by valuated stock and -1  day interval, but not getting proper value.
    Iz that necessery to append the field LABST(opening stock) and LBKUM (end Value),
    then remodeling the inventory cube 0ic_c03.
    So what will be the cmod include progame for that?
    regards,
    Balaram

    HI balaram,
    for enhancing the datasource refer the below How to - doc
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f0eade6c-692a-2c10-ac86-80f6b2157791?QuickLink=index&overridelayout=true
    I have a note from the forums on the opening and Closing balance , may be you can give a try
    0VALSTCKQTY gives  Closing Balance.
    0VALSTCKQTY + Issues - Receipts = Opening Balance
    Regards,
    Sathya

  • Opening stock

    hi friends,
                    i have to submit a report containing opening stock, reciepts, issues and closing stock for a particular period,containing quantity and value in local currency.can anybody help me in this regarded. helpful answers will be rewarded

    Hi
    U can use MB5A & MB5B and u will get all the data as required by you.
    Reward if useful.
    Arun

  • Opening stock Balance Table

    Hi,
    I am writing FS for the following fields
    In selection screen i am selecting
    Material
    Posting date
    Plant
    Output
    Opening stock stock
    GR
    Issue
    Balance
    Closing Stock
    My problem is from which table to fetch  opening stock qty  which belongs to 3months back
    For example i am running this report from Jan09 to March 09 so my query i want opening stock for the month of Jan09 and subsequently reduction in stock after each issue.so from which table i can get this information.
    Need your expertise help
    Regards
    Vivek

    Hi Vivek,
    To Calculate Opening Stock & Closing stock there are different procedures.
    It just depends of\n the client requirements & usage of the material.
    For example, we have different types of stocks, like, Through Pipeline, Special, Unristricted, quality, safety,
    and many types of stocks.... so all these types are indicated in MSEG tabe in SOBTZ field,...
    Now Comimg to your Query, You need to calculate OPENING & CLOSING STOCK.
    We have a similiar standard report in MB5B Tcode..
    to get the same results in your report do like this...
    For valuated stock go to the MARDH, MBEWH, MCHBH tables But I Prefer MBEWH.
    here in MBEWH give the month & year and you get the result in LBKUM field...
    For Special stock, You need to go to another table like MKOLH,,(I forgot still 2 more) and
    give the month & year inputs and you will get the result in SLABS field.
    and remaining MB5B refers to its deetails lists with different Movement types,
    whcih you can get clearly from MSEG Table...
    Hope you can write the select Queries accordingly.
    If you want to find the Stock for a particluar date, It is not available in any table as I know,
    Rather you need to do calculations like this.
    1. Select the stock (Menge) till date from MSEG and add all with different movement types,
    Its a logic need to ask to your functional consultant,
    like 101 added to stock, 601 sales, 102 rejeted, 602 added back to stock,... transfers, 261,,, like this.
    But take a little time, get all these by using MKPF & MSEG tables... thats it.
    Or----
    2.Tables are MSEG , MKPF ... use Debit / Credit indicator ( Do not go woth any static Movement types ) and u have to consider all stock related table
    MBEW , EBEW etc..., to get the stcok on particular date .
    Please refer to Std. Tcode FBL5N for reference.
    Thanks & regards,
    Dileep .C

  • Opening stock for stock provided to vendor

    Hi Gurus,
    I m trying to get opening stock for stock at subcontracter. I m using 0TOTALSTCK in the Query and I'm getting wrong values as compare with MB5B. I dont know how to show the opening stock and closing stock in the Query for this special stock (the indicator is "O").
    MB5B is showing opening stock when you select the special stock and enter the date, but in my Inventory Cube and Query i see something else. I checked the initilisaiton and movements in the cube, everything is OK.
    But still my Query is getting wrong values.
    Could you help me to find out?
    Thanks,
    Zeynep

    hii
    In BW cube does not have the field of Opening stock or closing stock as it works on the function module at the background.
    U will get the closing stock in the query designer as the TOTSTOCk field name. Also u have the receipt & issue field there. So u can calculate the Opening Stock figure by using the Formulae & these available fields.
    Thanks
    Neha

  • Closing and Opening Stock

    I have a table with daily transactions. The table consists of location-id, product-id, dates,Quantity and type, where type defines what is the type of transaction. type=1 is opening stock on 1-Apr-14, type=2 received stock on daily basis and type=3 is
    dispatched stock on daily basis. I want to show opening and closing stock on daily basis. ((Opening stock on 1-Apr-14)+(received Stock on 1-Apr-14)-(Dispatched Stock on  on 1-Apr-14))=Closing Stock of 1-Apr-14. Then this closing stock will be used
    as opening stock of 2-Apr-14 and so-on.

    can you show some sample data from the table?
    Please Mark This As Answer if it solved your issue
    Please Mark This As Helpful if it helps to solve your issue
    Visakh
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • 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.K

    Hi,
    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

  • Query:Opening STock value

    hi all,
    we want to get the value of opening stock
    opening stock value on 1st of each month.
    for e.g
    Goods are received and issued upto 10th of september.stock is updated.
    on 10th sep we want to get the opening stock for 1st sep.
    report fileds that client want are:
    Month Opening        Received                Issued               Qty        Value         Qty    Value          Qty      Val                
    120         200            50     70                40       30                
    How to get such report.
    Thanks
    Neetu

    I started query Profiler,clicked on run....
    but it is showing many lines.
    how i can find the appropriate sql query.
    For eg. I started SQL profiler,then i run sap-->>Inventory Adut report.
    from where to get the query running behind Inventory adit report in SQL profiler
    Thanks,
    Neetu

Maybe you are looking for

  • IPhone 4 - iOS 5 upgrade - LOST ALL CONTACT DETAILS

    I upgraded to  iOS 5 and now I can't get to any of my contact details. What I have - The list of my contacts is displayed under the contacts option, but when I touch any contact name it takes me back to the home screen. Can't make any phone calls. Bu

  • How can I plug my soundboard into my Mac?

    I am using a fairly old soundboard and want to get sound from the board onto my apple computer. However, this soundboard only has audio inputs and outputs.

  • Org unit of a position

    Hi all, I want to find out the organizational unit for the given position in OM. Also, i want to find out the manager of this position. Any solution....? Regards, Shanthi

  • " Routing Chaining Failure ".Why i am facing this error? and How to Resolve it??

    Forefront TMG detected a proxy server loop. There may be a problem in the configuration of the Forefront TMG Web chaining policy. Alternatively, in Enterprise Edition, when CARP is enabled and there are intermittent interruptions of intra-array conne

  • LOOKING FOR: Auto BPM counter (no tap)

    Hello there, I'm looking for an app which can hear the Beats Per Minute (bpm) of a song and automatically calculate them, WITHOUT the use of a touch-screen tapper. Do you know any ? Thanks in advance! - Tyrexionibus