A/r Invoice report query based on posting date selection criteria

Hi experts,
I am trying to write a query to get the A/r invoice report including Docnum, Docdate, cardname, project, linetotal, taxcode, taxtotal.
and i tried the below query
SELECT T0.[DocNum], T0.[DocDate], T0.[CardCode], T0.[CardName],T1.[LineTotal] FROM OINV T0  INNER JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry WHERE T0.[DocDate] >=[%0] AND  T0.[DocDate] <=[%1]
In this query ,
1) i am unable to sum up the linetotal( total before tax) 
2) also unable to fetch the sum of taxamount.
3) its more important , the above query will  me docnum , when i try to open that doc, it opens the 2007 docments. whereas the other details are correct like docdate, amount and all.
example:   from date: 1/04/2011    to date: 28/07/2011
Docnum    Docdate  cardname   linetotal.... etc
    2              1/04/11   XYZ              5000
when i click the 2 (docnum)  it opens me the 04/04/2007  documents.
how to limit the doc within the periods given?
thanks in advance
Dwarak

Hi Rahul/Gordon,
thanks for your query's .
additionally,   i want this query without the A/r invoices whichever having credit memo as target doc. 
and
i have selection criteria as  T0.[U_Sec_Category] = '[%2]'  and this has 3 values like  1)CIM 2)BIN 3)DMP
among these  CIM should be seen only only user1  and BIN & DMP only by user2.
can u plz get me this
thanks,
Dwarak

Similar Messages

  • A/R invoice Report Query selection by Items.

    Dear All,
    I need a A/R invoice  Report Query selection by Items.
    Thanx in advance!!!!!!!!

    Hi,
            Try this......
    Declare @Itemcode nvarchar(50)
    set @Itemcode = (select (T1.iTEMCODE) FROM INV1 T1 WHERE T1.ITEMCODE='[%0]')
    SELECT T0.DocNum, T0.DocStatus, T0.DocDate as 'Posting date',
    T0.TaxDate as 'Document Date', T0.CardCode as 'Customer Code',
    T0.CardName as 'Customer Name', T1.ItemCode, T1.Dscription as 'Item Name',
    T1.Quantity,T1.Price,T1.VatSum AS TAX,T1.LineTotal as Total
    FROM OINV T0
    INNER JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry
    where T1.ItemCode =@Itemcode 

  • Vendor Balance Report Day wise based on Posting date

    Hi Guru's,
    I am creating vendor balance reprot day wise based on posting date .
    In my report i want to show  TDS(With hold tax ) amount where can i get that field name how can retrive the data using bsik and bsak .
    I Donot want to display reversal documents in the displaying list .How can i remove reversal entries .
    Regards
    Nandan.

    Hi Nandan,
    check these tables:
    A399
    T059O
    T059ZT
    Regards,
    Santosh Kumar M

  • Inventory Report Based On Posting Date

    Hai All
    Can any one help me with the subject "Inventory Report Based On Posting Date"
    Please
    with regards
    Shankar

    hi,
    Visit this link,already answered.
    Difference between posting & system date in Inventory Audit Report
    Jeyakanthan

  • Aging report on top of Posting Date

    Dear All,
    We have one standard report Days Overdue Analysis (0FIAR_C03_Q005). The values for ranges (0-30,31-60 and all ) are getting calculating based on Net Due date.
    But I want to calculate that based on posting date.
    Can anyone plz tell how we can do this?
    I really appreciate your input on this.
    Regards,
    Rishit

    Hi Rishit:
    I did a similar custom report for Dispute Aging at my client site using Dispute creation date for aging calculations. I also had to change the buckets to 1 - 10, 11 - 30, 31 -90 instead of the standard 1 - 30, 31 - 60, 61 - 90 etc.
    All i did was copy the standard query, change the offset values to meet my user requirements and then change the characteristic for the due date variable to use document creation date instead of net due date. That is where ever i saw net due date characteristic i simply replaced it with document created date characteristic and used the same variable that was used on net due date in the standard query. I dont recall having to create duplicate variables because if i remember right, the variables on date characteristics are usually usable across different date characteristics.You might be able to do the same with posting date instead of net due date.
    Hope this helps.
    Let me know if you need more details.
    MP.

  • Query based on a date range

    I want to query based on a date range. I wrote the following EJB QL:
    "select object(a) from ActionItems as a where a.dueDate
    between ?1 and ?2"
    But when I deployed the application to Oracle's EJB server, I got the following error:
    Auto-deploying biogen.jar (No previous deployment found)... Invalid type for expression (a.dueDate BETWEEN ?1 AND ?2)
    EJB QL statement : 'select object(a) from ActionItems as a where a.dueDate between ?1 and ?2'
    EJB QL method : public abstract java.util.Collection ActionItemsLocalHome.findByDueDateRange(java.sql.Date,java.sql.Date) throws javax.ejb.FinderException
    at com.sun.ejb.ejbql.parser.EjbQLParser.parse EjbQLParser.java:218)
    at com.sun.ejb.ejbql.EjbQLDriver.parse(EjbQLDriver.java:86)
    at com.sun.ejb.sqlgen.SQLGenerator.generateSQLForEjbQLQueries(SQLGenerator.java:704)
    It works fine for a number range, but does not work for a date range.
    Any one has an idea on how to write a correct EJB QL for a query based on date range?
    Thanks.
    Jingzhi

    Re-posted. Please help!

  • Month Year values based on Posting Date

    In my super huge extra large InfoCube (0CFM_C10) I got a lot of data. I take Posting Date, some KFG and CalMonth/Year. Unfortinally CalMonth/Year duplicates records, if I drop it off the columns/rows I get valid data by Posting Date.
    My question is this - is it possible to create some MonthYear Calculated KFG/field/formula or smthng. based on Posting Date? In other words I need Month/Year in rows/ columns or free characteristics...
    Edited by: Gediminas Berzanskis on Mar 18, 2008 10:18 AM

    Dear,
    When canceling a payment which was created in previous posting periods,
    we  get system message "Date deviates from permissible range",so
    the workaround is changing back the posting period to the previous one
    and try to cancel the payment.
    However,another system message pops up when we try to cancel payment
    after changing back the posting period,which is the "creation date" or
    "posting date".
    In this scenario, you should select the second option from the
    cancellation options window, which is the 'Creation date'. I would like
    to explain more below.
    Posting Date- means the posting date of the cancellation document, it's
    not the posting date of the incoming payment that you wanna perform the
    cancellation. In your case, selecting this 'posting date' option, system
    deems that you want to post this cancellation document on its own
    posting date.
    Creating Date- means the posting date/creation date of the incoming
    payment, it makes sense that the system works fine if you select this
    option. If you cancel the incoming payment and check the JE generated,
    you will find that the posting date of this cancellation document is
    actually recorded as the posting date of the incoming payment.
    Wish it helps you.If you have any problems,please kindly let me know.
    Thanks and best regards,
    Apple

  • SQ01 query on LDB BRF with selection criteria on BSEG

    Dear all,
    we built an inofset on LDB BRF (BKPF - BSEG) and a query with selection criteria based on both BKPF and BSEG tables.
    My proble : when the query select a posting fullfilling header data selection criteria but not line item criteria, it still displayed the header data in the layout.
    We set up a filter on the account to hide results where account is blank but we loss the filter exporting the result on access. So if anyome has a better idea, we'll be very thankfull.
    Br,

    Hi Rick,
    What Edan proposed will work as logical AND (both filters on dates will be checked simultaneously).
    Here is a solution.
    You’ll have a user entry variable on 0CALDAY.
    - Create a new variable on 0CALDAY, customer exit, mandatory, not ready for input. This variable should return the date entered in user entry variable.
    - Create a structure in columns.
    - New selection (let’s name it chg). Put there your KF and your Change date char. Restrict it by the user entry var. Hide it.
    - New selection (let’s name it crt). Put there your KF and your Created on date char. Restrict it by the customer exit var. Hide it.
    New formula (let’s name it FilteredAmount):
    ( 'chg' <> 0 ) * 'chg' + ( 'crt' <> 0 ) * 'crt'
    Create a condition:
    FilteredAmount <> 0.
    Best regards,
    Eugene

  • Stock report for a period (based on posting date)

    Hi Experts,
    We have a requirement as under:
    1) We want a report for a period say from 01.04.2011 to 30.09.2011 (closed period for both MM and FI postings). Report is being taken on a later date say 01.12.2011.
    2) The report should say the status of stock as of 30.09.2011 only even of being taken in the month of December
    3) I tried to take the desired report through MB5B for the period 30.09.2011 to 30.09.2011 (selection date fields) on 20th december, 2011 and noticed that if same report with the same selection criteria is taken at two different times, output data is not the same whereas MM and FI posting periods are already closed.
    Can anybody suggest alternative SAP standard report where output will remain the same if report with same selection criteria is taken at different intervals ELSE in case of change we should be able to see the documents posted in between if back dated entries have been posted after opening MM /FI period.
    thanks

    sure it speaks the same, but it mentions as well the reasons (1) and has much more information (2)  and a solution.(3)
    1)
    user starts transaction MB5B for a very large number of materials or for all materials in a plant
    During the runtime of transaction MB5B, goods movements are posted in parallel:
               - The results of transaction MB5B are incorrect.
               - Each run of transaction MB5B returns different results for the same combination of "material + plant".
    Example: Transaction MB5B should process 100 materials with 10,000 MM documents each. The system takes approximately 1 second to read the material master data  and it takes approximately 1 hour to read the MM and FI documents. A goods movement for a material to be processed is posted approximately 10 minutes after you start transaction MB5B. The stock for this material before this posting has already been determined. The new MM document is also read, however. The stock read before the posting is used as the basis for calculating the stocks for the start and end date.
    Even for an old and closed period, MB5B starts today and calculates backwards  any movement to finally get the stock for  the time your specified in your selection.
    2)
    The SAP standard release does not include a solution
    so you have to understand that there is no real alternative transaction in SAP
    3) and then they provide a large section with a workaround that can be developed by an experienced programmer within 3 to 5 days.
    So how shall anyone here be able to tell you an alternative report?
    if someone does, then it is an owndeveloped z-report which is not available in your sap system.
    if you know that people want lookup period closing stocks at any time in future, then either schedule MB52 at month end and store the list somewhere (and do not allow backposting)
    or have an Abaper create a stock report based on the history tables MARDH, MCHBH, MBEWH etc.
    And even here you may encounter an issue at some day, if you start archving special stocks or material masters, because then the stock figures from the historic tables are gone and you cannot rebuilt a reliable stock report .

  • View GR report based on posting date

    Hi,
    Is there any report to view GR on PO by enter posting date?
    Because i check ME2M,only can enter delivery date.
    Thank you.

    Hi,
    Check MB51 with 101 movement type and posting date.
    Regards,
    Bharat

  • Query for todays Posting Date

    Currently my query is as follows, I want to create report that pulls produciton orders that are either planned or released where the post date is today...as my understanding getdate() does not work...may I get some assistance?
    SELECT T0.[DocNum], T0.[PostDate], T0.[DueDate], T0.[ItemCode], T0.[PlannedQty]
    FROM OWOR T0
    WHERE T0.[PostDate] = GetDate() AND
    T0.[Status] = 'p' OR
    T0.[Status] = 'r'
    Thank you
    Sarith

    Hi Sarith,
    Try:
    SELECT T0.DocNum, T0.PostDate, T0.DueDate, T0.ItemCode, T0.PlannedQty
    FROM OWOR T0
    WHERE DateDiff(dd,T0.PostDate,GetDate()) = 0 AND T0.Status in ('p','r')
    Thanks,
    Gordon

  • Expense reports with respect to posting date

    Hi Folks,
    Kindly let us know if any statndard reports are available to extract trip details with respect to the trip posting date (prrw).
    Thanks,
    Nandagopal C

    Hi Folks,
    The posting date is maintained in the table PTRV_Doc_header. Using the table we have created a  query to fetch the posted trips according to  posting date.
    Thanks,
    Nandagopal C

  • Currency translation - based on posting date

    Hi everyone..
    im again posting this topic bcos im in need of a solution for my problem as early as possible.please excuse me.
    Problem related to currency conversion:
    Im taking a report from sales order and billing cube,and the report is coming fine,but when i apply the currency conversion type,it is not giving the correct conversion.
    In report,im using exchange rate on document posting date.
    So if i compare the value in R/3 with the reporting value,the difference comes.
    For the currency conversion type i used, i checked in rrc2,it is like this.
    Exch rate type:M-standard translation at avg rate
    Source curr:from data record
    Tgr curr:selection with translation
    Time ref:Varoiable time reference:A-To the exact day
    Special Infoobj:Posting date object
    So what could be the problem for the wrong translation.the difference is about 1.2 rs per dollar.
    i will be verymuch thankful to u,if u could give some solution for this problem...
    thansk & regards
    sudha

    Hi
    Please check if you are transferring exchange rates maintained in R/3 to BW on daily basis or as & when change happens on R/3 side.
    If not then you can do that in RSA1->source systems-> here select your R/3 system ->right mouse click-> Transfer global settings-> in next screen put check box ON for currencies and then using update tables option button. For daily scheduling, go to top menu ->Program-> Excute in background-> here you can schedule this as daily job.
    Hope this helps
    Regards
    Pradip

  • Add a flag column in the Query based on Cancel date

    hi Guys,
    I have a Characterstic object 0canceldate and it gets the cancellation date of the sales order. Based on that date i need to add a column in the report like if 0canceldate has ahappened or populate then show Yes or No in the coumn like a flag.
    Can anybody help me how i can do that?

    SELECT d.NAME
          FROM
            (SELECT jta.NAME
              FROM apps.jtf_terr_values_all jtva,
              apps.jtf_terr_qual_all jtqa,
              apps.jtf_terr_all jta ,
              apps.hz_party_sites ps,
              apps.hz_locations hl
            WHERE jtva.terr_qual_id     = jtqa.terr_qual_id
            AND jtqa.terr_id            = jta.terr_id
            AND jtva.low_value_char     = hl.postal_code
            AND jtqa.org_id             = jtva.org_id
            AND jta.org_id              = jtqa.org_id
            AND ps.location_id          = hl.location_id
            AND hl.country             in( 'CA', 'US')) D;
            UNION
            SELECT jta.NAME
              FROM apps.jtf_terr_values_all jtva,
              apps.jtf_terr_qual_all jtqa,
              apps.jtf_terr_all jta,
              apps.hz_party_sites ps,
              apps.hz_locations hl
            WHERE jtva.terr_qual_id     = jtqa.terr_qual_id
            AND jtqa.terr_id            = jta.terr_id
            AND ps.location_id          = hl.location_id
            AND jtqa.org_id             = jtva.org_id
            AND jta.org_id              = jtqa.org_id
            AND hl.country              = 'US'
            AND hl.postal_code BETWEEN jtva.low_value_char AND jtva.high_value_char
            )d;

  • Report to get correct posting date of material document?

    I have material number (matnr) and plant (werks). Which report do I use to get posting date of material document (mkpf-budat) ? Thanks!

    Hi,
    Use MB51 or MB5B as per your convenience.U will get the Matl Doc,Mov Type & Posting Date.
    Award points if helpful
    Thanks & Regards
    Saeed Arif

Maybe you are looking for

  • Title in SP01?

    Hi Experts, User is executing particular BackGround Job in SM36 for a month at a particular time. When user is checking in SP01 Spool,Title is displaying as Automatic Generated                                              (Ex:LIST1S  <Report><User_Na

  • Importing packages at the same level

    Hi, I have two packages A at B (with some classes) in the same level. How do i import the classes from one packages to other.......

  • Severe screen damage on a 30" ACD

    A very sad day indeed: Last night a framed picture fell off the wall and hit the screen of my 30" ACD in 2 parts leaving profound scratches in both places. One is so deep that background light leaks awfully through it, the other doesn't present light

  • Closed captions

    My searches haven't turned up any way to include closed captions.  Not possible? thanks, Paz

  • WD ABAP + Workflow ?

    Hi pple, Is there any standard SAP ABAP Web Dynpro Application which is integrated with Workflows? I mean, is there any Standard Workflow that calls ABAP Web Dynpro Application? Actually, I am able to call the ABAP WD Application using SWFVISU applic