Item Price in report for every transaction

Hi Guys.i am using the below queries for Stock report and i am getting the desired output  except the price calculation.
In that query it is calculated like max(price) or avg(price) but instead of that i need the item price for that particular transaction  and also i need the prices for opening stock , goods issue, goods receipt and closing stock seperately in each column .
pls provide me the updated query.
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 >='[%0]')
Set @ToDate = (Select max(S1.Docdate) from dbo.OINM s1 where S1.Docdate <='[%1]')
Set @Group = (Select Max(s2.ItmsGrpCod) from dbo.OITB S2 Where S2.ItmsGrpNam = 'Group B')
Set @Whse = (Select Max(s3.Warehouse) from dbo.OINM S3 Where S3.Warehouse = '03'  )
Select
@Whse as 'Warehouse',     
a.Itemcode,
max(a.Dscription) as 'Description',MAX(a.Price) as 'Price',
sum(a.[Opening Balance]) as [Opening Balance],
sum(a.[IN]) as [Receipt],
sum(a.OUT) as [Issue],
((sum(a.[Opening Balance]) + sum(a.[IN])) - Sum(a.OUT)) as Closing,
( MAX(a.Price) *  ((sum(a.[Opening Balance]) + 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 [Opening Balance],
0 as [IN],
0 as OUT
From dbo.OINM N1
Where
N1.DocDate < @FromDate 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 [Opening Balance],
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 [Opening Balance],
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 and
I1.ItmsGrpCod = @Group
Group By
a.Itemcode
Having sum(a.[Opening Balance]) + sum(a.[IN]) + sum(a.OUT) > 0
Order By a.Itemcode
Regards,
Vamsi

Hi Gordon,
We are maintaining different Price Lists  so is it possible to give the input in the query to select the report based on which price list???
Or else  is it better to create an udf in item master data for Standard price of the item and display it in report??
And i have another doutb that while i run the inventory audit report  and the query it is showing different values .. why is it so??
pls give me the solution for the same,
thanks in advance..

Similar Messages

  • Reference and Assignment Synchronization Report for FBL5N Transaction

    is ther any standard report for ...Reference and Assignment Synchronization Report for FBL5N Transaction.

    Hi,
    FBL5N is a standard TCode which is used to see Open, Cleared and All line items of customer as per company code.Line items means whatever transaction has been posted to the customer.
    These line items may be related to invoices raised against the customer, payments received from customer and advance receipt from customer.
    Hope you have understood
    Regards
    Tapan

  • Err in PO creation-Sales document item is not defined for this transaction

    Dear Consultants the errror  occurs when we process  Individual Purchase Order scenario.
    Err in PO creation-Sales document item is not defined for this transaction  
    Thanks&Regards,
    SanthaRam

    This error because the item category is not determined correctly in the sales order.
    Check the item category in Sales order line item, for Individual Purchase order scenario its TAB.
    If its not TAB, then check the assignement for Item category in VOV4.
    This thread is more of the SD part, so also put it in SD forum for better solutions.
    Regards,
    Sheetal

  • Mail Alert to Managing Director for every transaction for customer & vendor

    Dear Gurus,
    Please let me know how & where to do setting for mail alert to Managing Director for every transaction for customer & vendor,
    Like for Customer: Sales Order, PGI, Invoice, Payment receipt................
           for Vendor: Purchase Order, GR, Miro, Outgoing Payment for Vendor,
    Thanks in advance,
    Sai

    Hi Sai
    If you want to set the mail alert to Managing Director for every transaction for customer & vendor Like for Customer Sales Order, PGI, Invoice , PO  then maintain at  all levels  output type and at all levels for those output types  assign the authorization as Managing Director
    But for what purpose you want to assign the authorization member at all levels, what is your requirement?
    Regards
    Srinath

  • Report for every 1 hour

    I wanted to take out a report for every one hour, the count, i used trunc(x_date,'hh24') to take the report, but the problem is, for few hours there wont be any count, so i have to substitute with zero there, any ideas ?,

    Hi,
    If you want to make sure all hours appear in the result set, even if they don't appear in the table, then outer-join to a table (or, in the example below, a sub-query) where you know they do exist.
    For example, if your table_x has columns entry_dt and amt, and you want results for every hour of the day, you can do somehting like this:
    WITH     all_hours     AS
         SELECT     TO_CHAR ( SYSDATE + (LEVEL / 24)
                   , 'HH24'
                   )     AS hr
         FROM     dual
         CONNECT BY     LEVEL     <= 24
    SELECT       a.hr
    ,       COUNT (entry_dt)     AS cnt
    ,       NVL ( AVG (amt)
               , 0
               )               AS avg_amt
    FROM           all_hours  a
    LEFT OUTER JOIN      table_x    x      ON   a.hr = TO_CHAR (entry_dt, 'HH24')
    GROUP BY  a.hr
    ORDER BY  a.hr
    ;COUNT never returns NULL, so you don't have to use NVL with COUNT.
    For other aggregate functions (such as AVG) you do need to use NVL to get 0 instead of NULL.
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only), and the results you want from that data.
    Explain, using specific examples, how you get those results from that data.
    Always say what version of Oracle you're using.

  • Java code for database synchronization for every transaction

    we have 10 stores each one have their own database . transaction happens in stores. If at all any transaction happen first this transaction update should happen it's own data base.After that immediately this updation should happen for central database. All stores can connect to this central database. After updation happen in this central data base this updation should happen for rest of all stores .
    this updation should happen for every transaction. Please help me for above scenario.

    So you have 11 instances of a database and you want that any changes to one of them should be replicated to the other 10?
    Sorry, there isn't a "code snippet" for that. Google for "reliable database replication" to see what you are getting yourself into.

  • How to get the Price variance report for PO's?

    Hi all,
    Please help me by giving the exact T Code which gives the price variance for the PO's,which must be
    showing the difference between the GR value and the price(std.price) maintained in the material master.
    Waiting for your suggestions.
    Regards
    Mangalraj.S

    Hi,
    Take an easy way, you can go to the PO with t-code ME23N, at tab page PO history of the item detail, you can find the price variance for the item.
    Or you can use t-code MB5S to display the multi-POs' price variance report!
    Cheers
    Tao

  • Dyamic execution of report for every month and data through mail.

    Dear Friends,
    We are using ECC6.00 With EHP4. My requirement is to send the list of pending notifications with the list details as appearing in transaction QM10. Every month i am supposed to change the from date and to date for example 01.07.2010 to 31.07.2010 for the month July.
    How can i make system calculate the from and to date for every month and send mail.
    I can schedule the  job using SM36 but how to make system calculate the from and to date dynamically for every month. i.e., for august system should calculate date 01.08.2010 to 30.08.2010 automatically as the next month is reached.
    Experts help required.
    Regards,
    M.M

    1. You need to create a variant.
    2. In this blank out the date and give all the required values which will filter for the Pending nofitications like notificaiton type, status, etc.
    3. Then click save.
    4. When you click save it will give you an option to save as variant.
    5. Now in the Variant Attributes screen give the variant name/meanting
    6. In the below you will get a "objects for selection screen)
    7. In the same you will get the filed name calle d" notification date"/
    8. Here Move the curson to the righ side you will find the selection variable, change to D-Dyanamic date calcuation  and after that right side you will see one more column for the name of variable(input using only f4)
    9. Here press f4,
    10. then  ypou get a pop up for selection varaible. there first Put "I: for current date and also 'I" for hte Current date +/- ??? days
    in this give 30 days.
    11. You can also use other function her.e
    Now once the variant is created then you have to schedule a job for this program + variant in the sm36 and in the distribution list
    you need to mention the email
    check and let me know for the feedback
    reg
    dsk

  • Maximum open Cursors Excedded error - for every transaction

    Hi All,
    I am getting the maximum opn cursors exceeded error suddenly for every single db transaction i am trying to make in my application. this did not happen previously during my developemnt and testing phase.
    I have a question here that i tried to google but failed to get satisfactory answer.:-
    When we use a cursor in the stored procedure to fetch data, how to make oracle automatically close the cursors once the stored proc finishes executin. Or is there something i have to follow other with my current open cursors limit to ensure this problem does not happen?
    Thanks,
    Chaitanya

    Hi Justin,
    My oracle stored procs are called by java framework. In each place i was closing the connection object but there were a few places where i was not closing the resultset object which directly pointed to my oracle cursor.
    I have closed the objects in such places and tried again but still i am getting the same error. Mit it be an instance where the oracle db is not allowing me to connect to it at all. Something like restarting it would help? Restarting the server where the oracle software is hosted.
    Please excuse my blatant ignorance in this issue.
    Thanks,
    Chaitanya

  • Sales document item is not defined for this transaction in Pur.Order

    hi,
    At the time of convertion of pr to po one error message received.
    Sales document item 46 000010 is not defined for the transaction
    Message no. V1198
    Diagnosis
    You have tried to carry out a business transaction for this sales and distribution document item which, for this item, is not allowed.
    This may be due to the fact that this item is not part of a make-to-order production with cost management in the sales order.
    Procedure
    Please check your entries.
      this is MAKE TO ORDER SCENARIO  THIS ERROR IS FOR RAW MATERIAL  CONVERTION  AGAINST SALES ORDER.

    Hi,
    Check in material master MRP3 view there is field called strategy group where you have option to define the planning strategy like make to order/make to stock & like.
    Regards
    Ravi Shankar.

  • Err in PO creation-Sales document item is not defined for the transaction

    Hi,
    I am getting the following error while creating PO
    "Sales document item 30000183 000100 is not defined for the transaction
    Message no. V1 198
    Diagnosis
    You have tried to carry out a business transaction for this sales and distribution document item which, for this item, is not allowed.
    This may be due to the fact that this item is not part of a make-to-order production with cost management in the sales order."
    I have used an item category which is copy of TAB and the sales order line item is attached to WBS element.
    can any one guide me what needs to be done.
    thanks

    If you want the sales order creation to initiate a PO creation automatically, check if the "Create PO Automatically" button is ticked on for the item category in Transaction flow tab in tcode VOV7
    This will solve your problem, provided your configuration for PO on the MM side is fine.
    Reward if this helps.

  • Agewise Reports for Vendors - Transaction Code?

    Agewise reports for Vendors are needed.
    What would be the best way and the Transaction code?

    Hi Bhatia,
    Transaction code F.42 via Information systems > Accounting > Financial accounting > Vendor accounts > Account balances ; you may find the balances and movements for different periods by varying the reporting periods and years.
    Hope this helps.
    Please assign points as way to say thanks

  • CATSSHOW report for CADO transaction

    Hello Friends.
    I made a copy of standard CATSSHOW report used for CADO transaction I need to add a Profit center field to the Selection Screen in receiver parameters  and the report should display the output based on profitcenter Hierarchy Instead of cost center hierarchy.
    There is no profit center field in the CATSDB table from which the output is fetched.
    Please any Suggestions?
    Regards
    Pavan

    >
    Pavan Kumar wrote:
    > Hello Friends.
    > There is no profit center field in the CATSDB table from which the output is fetched.
    > Regards
    > Pavan
    Thats b'coz you charge time to a Cost Center! you can probably link it up to a Profit Center via CSKS( Cost Center Master Data).
    ~Suresh

  • Price change report for  a given date range in inforecords

    hi,
    Can any body suggest how we can get price changes in inforecords for given date range. is there any standard sap tcode or  fuction module.

    Hi,
    If you are referring to the changes in the condition record (for eg. for PR00), then you may go through the foll path:
    Execute VK13 for any condition type - once inside the detail screen, from the menu path, choose Environment -> Changes -> change report. This will take you to a new selection screen where you can define the period you want to see the change record as well as the condition type for which you want to track the changes. Beware, this is a complex report for SAP and it will take definitely longer time to complete. So, it is better to specify short time periods and specific condition types and execute this in background.
    Hope, this helps!
    S. Siva

  • Profit & Loss Report for Every month

    Hi,
    Can anyone tell me is it possible to get the report on Profit & Loss Report to every month for each PROJECT? If possible please let me know the T.Code.
    Regards,
    Mohan.

    Hi
    try this tcodes
    S_ALR_87013572 - Project results
    CJIF - Results Analysis
    Also F.08 is not balance sheet report because we don't assign Financial statement version there
    Regards
    Tanmoy

Maybe you are looking for

  • Want to open a new browser window and display the html file in locale disk.

    Hi, I want to open a new browser window and display the html file in local drive. The below html applet work in local system successfully. But i deploy the same in web server (Tomcat) and try the same in client machine it does not work. Please help.

  • BPM Help

    Hi everyone. I found this document <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/5474f19e-0701-0010-4eaa-97c">Step-By-Step Approach for Implementing XI Scenarios</a> and

  • Have had ELPH100HS for 2 years. I can't transfer pictures because "support devise not found." Also c

    I've had ELPH100HS for 2 years. Up until now, everytime I transferred pictures to my computer, a camera icon would appear when I connected the camera via USB to the PCU.  But, recently, the icon is missing, but I hear the bleep (connecting sound) I a

  • Passing byte Arrays broken in 1.4?

    I have an application that I am porting from 1.2.2 to 1.4. Code that used to work fine is now broken. All byte arrays that are passed through the JNI have each element set to 0. Is this a known bug, or has something changed in the JNI API? Here is a

  • Change measurement tab on rental object

    Hello experts, My requirement is to gray-out or eliminate certain fields on the measurement tab (MEASFRO and MEASTO) for buildings and rental objects. The output displays on SAP standard ALV output display. Please advise if it is possible to do this