Query Modification for Invoice Outstanding

Hi ,
Can anybody modify this code by DocNum. This query displays the same invoice 2 times when the invoice is having more than 1 item. How to get the report without invoice number repeat.
SELECT T0.[DocNum], T0.[DocDate], T0.[CardName], T1.[OpenSum] ,T1.[VatSum],
T0.WTSum AS 'TDS Amount',
T0.DocTotal,
(T0.DocTotal-T0.[PaidToDate]) as 'BalanceDue',
(SELECT CASE
WHEN T1.TargetType='14' THEN 'A/R CreditMemo'
Else ' '
End) as 'Target Type'
FROM OINV T0  INNER JOIN INV1 T1 ON
T0.DocEntry = T1.DocEntry 
WHERE T0.[DocDate] BETWEEN '[%0]' AND '[%1]' 
Regards
Srini

Hi Srini,
Try this first:
SELECT T0.DocNum, T0.DocDate, T0.CardName, SUM(T1.OpenSum) 'Open Sum',SUM(T1.VatSum) 'Vat Sum',
T0.WTSum AS 'TDS Amount',
T0.DocTotal,
(T0.DocTotal-T0.PaidToDate) as 'BalanceDue'
FROM OINV T0 INNER JOIN INV1 T1 ON
T0.DocEntry = T1.DocEntry
WHERE T0.DocDate BETWEEN '[%0\]' AND '[%1\]'
GROUP BY T0.DocNum, T0.DocDate, T0.CardName,
T0.WTSum,
T0.DocTotal,T0.PaidToDate
Thanks,
Gordon

Similar Messages

  • Table for 2way,3way matching .query to generate invoice with 2 ways matchin

    hi
    table for 2way,3way matching .query to generate invoice with 2 ways matching
    plz help me
    thanks

    Hello John, I put the (1,2,3) list in the query to show it works with multiple invoices.
    You should comment out the conditions:
    select a.invoice_no, b.child, sum(a.amount) from invoice_detail a,
    select
    child,
    decode (instr(scbp,'.'),0,scbp,
           substr(scbp, 1, instr(scbp,'.') -1)
           ) starting_child
    from (
    select ltrim(sys_connect_by_path(child,'.'),'.') scbp,
    child from
    element_relation
    start with child in (select element_id from invoice_detail /* where invoice_no in (1,2,3) */)
    connect by child = prior parent
    ) b
    where a.element_id = b.starting_child
    /* and a.invoice_no in (1,2,3) */
    group by a.invoice_no,b.child
    order by 1,2to show it works for all invoices
    regards, Tony

  • Query Authorization for acessing , modification

    Hai
    I created the InfoCube and Query . I want give query auhtorization and query access and query modifications to some superusers.
    How can i give tht authorization to superuser. Pls tell me in step-by-step.
    I will assing th points
    kumar

    Hi,
    You have to provide authorization for The Query & Cube.
    1. Add the query/Workbook to the role in PFCG.
    2. Create/ Assign Authorization profile.
    3. Assign Authorization objects S_RS_COMP & S_RS_COMP1
    4. Provide desired authorization for Diaplsy,Execute etc.
    Regards
    SS

  • Tax Amount throug query rowwise for a/r invoice

    Hi Experts,
    can anyone pls tell me how to get the tax amout and tax code for row level for a/r invoice through query generator for A/R iNVOICE.
    Note: I dont want to hardcore it
    Thanks & Regards,
    Mukesh Agrawal

    mukesh,
    SELECT M.DocNum,M.DocDate,
    (SELECT Sum(TaxSum) FROM INV4 where statype=-90 and DocEntry=M.DocEntry) as 'Excise Duty',
    (SELECT Sum(TaxSum) FROM INV4 where statype=-60 and DocEntry=M.DocEntry) as 'Education Cess',
    (SELECT Sum(TaxSum) FROM INV4 where statype=7 and DocEntry=M.DocEntry) as 'SHEd Cess',
    (SELECT Sum(TaxSum) FROM INV4 where statype=1 and DocEntry=M.DocEntry) as 'VAT'
    FROM OINV M LEFT OUTER JOIN INV1 L on L.DocEntry=M.DocEntry LEFT OUTER JOIN INV4 T
    on T.DocEntry=L.DocEntry and L.LineNum=T.LineNum 
    Where (M.DocDate >= '01-jun-08' AND M.DocDate <= '30-jun-08')
    GROUP BY M.DocNum,M.DocDate,M.DocEntry
    Hope it will solve the problem.
    Jeyakanthan

  • Modification for ECS for invoice and ASN functionality in SUS

    Hello Experts:
    Currently I am implementing SRM 5.0 with SUS integration in ECS. I have found some references that specify that if my requirement is to have the creation of Invoices and ASN in SUS, in order to transfer these to EBP I need to do some development on my own. I have to questions regarding this:
    1.- The references only talks about Materials, is it possible to do this kind of implementation also for Invoices and ASNs of Services??
    2.- Any of you could provide me with some general steps of the activities to be done in order to accomplish this requirement if I am using XI.
    Thanks for all the information you can provide me.
    Hugo

    Hi
    SRM-SUS integration is mainly used for service procurement where the document flow is PO> PO Response> Confirmation/Service Entry-->Invoice.
    ASN doesn't carry any meaning for service procurement. You might use ASN if you are procuring direct materials.This is covered by MM-SUS integration.
    Also pl. remember that SRM-SUS integration with ECS scenario is supported only to a limited extent by SAP. This means that your SUS confirmations when they come to SRM do not get replicated to ECC backend.
    Thanks
    Sanjeev

  • N-Step workflow for invoice

    1. Is there a way to implement n-step (more than 2 )approvals for invoices? Can I use the same BADI for n-step approval for shoupping cart?
    2. If a vendor is not on supplier portal is there a way send a offline RFQ and get the bid somehow in the system without having vendor being created in the system?

    Hi
    <b>Please go through this -></b>
    <u>It is possible to copy the standard workflow and make you custom workflow acordingly.You just have to copy standards workflow and all subworkflow under this as well.You have to take care of attributes of workflow in same way as standard workflow.</u>
    <u>Implementing a BADI - BBP_WFL_APPROV_BADI using SE18 Transaction is also feasible solution.</u>
    Invoice rejected in the invoice workflow.
    Re: Invoice Workflow : Dialog work item created
    Re: Sample Code needed for N-step approval SC BADI
    Re: Invoice BUS2205 Workflow
    Approval workflow is ambiguious- for Invoice WF
    <b>Please refer to these links as well.</b>
    <u>N-step Approval workflow</u>
    http://help.sap.com/saphelp_srm40/helpdata/en/17/40a86c773d6c41801d78af1a34b90f/content.htm
    <u>N-step Dynamic approval</u>
    http://help.sap.com/saphelp_srm50/helpdata/en/17/40a86c773d6c41801d78af1a34b90f/frameset.htm
    <u>SRM Business Workflow</u>
    http://help.sap.com/saphelp_srm50/helpdata/en/8b/4fa9585db211d2b404006094b92d37/frameset.htm
    <u>Dynamic Modification - Workflow</u>
    http://help.sap.com/saphelp_srm50/helpdata/en/84/dda441e79ead5fe10000000a1550b0/frameset.htm
    <u>Item-based Approval for Shopping carts</u>
    http://help.sap.com/saphelp_srm50/helpdata/en/a3/a6a34098022a54e10000000a1550b0/frameset.htm
    <u>Business Add-Ins</u>
    http://help.sap.com/saphelp_srm50/helpdata/en/bc/6129383d5ec70ce10000009b38f8cf/frameset.htm
    Do let me know incase you face any issues in Design / coding of this N-level Approval workflow.
    <u>For the 2 point, it is not sure. I don't think there is any way to send offline RFQ.</u>
    Hope this will help.
    Regards
    - Atul

  • Aprroval for Invoice have due date greater than 100 days

    Hi all!
    I would like to create query to approve for Invoice have due date greater than 100 days.
    SELECT 'true' from OINV  where max(datediff(day, OINV.docduedate, getdate()))>100 and OINV.docstatus ='O' and  cardcode = $[$4.0.0] group by cardcode
    It's not working. Can you help me!
    Thanks!

    Hi Tien,
    Hopefully not trying to teach you how to suck eggs here, but it looks like the query is doing too much. There shouldn't be a need to perform a "GROUP BY" in a query to dictate if an approval is to be triggered or not, only the criterai to make it happen.
    For examle, the following code will send a transaction for approval if the customers code equals a specific reference.....
    SELECT 'TRUE' FROM ORDR T0 WHERE ${ORDR.CardCode} = 'ABC001'
    If you're wanting a query to just return a boolean answer based on the date criteria, you might want to try adapting your query to something like.......
    SELECT 'true' from OINV where max(datediff(day, ${OINV.docduedate}, getdate()))>100 and ${OINV.docstatus} ='O' and  cardcode = ${$4.0.0}
    (As an additional tip, in order to test a query that you're wanting to use as either a formatted search or approval type selection, when in the transaction, if you locate the relevant saved query under "Tools > Queries > User Queries" etc, where you have references to specific fields e.g. ${ORDR.CardCode}, this will pick up the values from the current record and give you a what if scenario. I tend to have just a "Temp" query I use for WIP type queries of this nature.)
    Note - You need to replace the bracket's "{}" with square ones, I've used the others as the forum posts as a http reference.
    Hope this helps!
    Julian

  • Required sample coding for invoice billing for script

    Hi,
            Required sample coding for invoice billing for script in form and endform.
         please help me its very urgent issue. thanks in advance.
    thanks&regards
    sirish

    Hi Sirish,
    these are some of the links where u can find ur solution plz check...
    <u>
    SAP SCRIPT
    SAP SCRIPT
    https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_all&query=invoicebillingfor+script&adv=false&sortby=cm_rnd_rankvalue</u>
    regards,
    Sana M.

  • The document is not relevant for invoice lists

    Hi SD Experts,
    When i am creating invoice list (T.Code:VF21),I got the error that"the document is not relevant for invoice lists". i entered  invoice list type per billing document type (transaction OVV7).
    I already did those settings in the IMg. But still its not working, i really appericiated that you look into the query.
    Please advise.
    Thanks
    Tulasi

    Hi GTNRNR, 
    -- Check in  Customer Master Record (XD01) in billing tab the invoicing list Dates & Invoicing dates fields
    --Go to T.Code OVT0 & check these fields are included in your account group
    --Maintain the Copy controls for Proforma Invoice (F8) to Invoice list(LR) in VTFF
    --in header Copying Req 016
    --check mark on copy item numbers
    --Pos/neg qty is +
    ---Go to VF21 and enter the billing document No & Billing Type as LR & Execute
    Let me know if your problem is resolved.
    Regards
    Pradeep

  • PO Shipment Status Closed For Invoice

    friends
    I am entering purchase order and after approval i am entering receiving. After that i am matching this po with my ap-invoice and paying as well. But in po shipments its showing staus "Closed For Invoice" and i want to show my po status "approved and closed". Please guide me how i can get this.
    purhcase order>shipment>status (Tab) status clolumn is showing Closed For Invoice . i want to close status.
    regards

    You can close the PO from the PO Summary screen from Tools > Control after query on the PO. But you necessarily don't have to do this as you can't update or receive on this PO.

  • PAAPINVW -- how to fetch values for invoice line level details

    My requirement is such that we define one of our account segments at invoice line dff's while creating the invoice against a project. So the ccid would need to driven from this invoice line dff, to be complete and valid.
    Project Supplier Invoice Account Generator (PAAPINVW) has already defined attributes for Invoice Header DFF's and Invoice Distribution level DFF's; but Invoice line level DFF's have not been defined.
    Also there are no attributes that would help me query the invoice line to fetch these details.
    Working on this workflow in R12. Has anyone tried to fetch any sort of details from invoice lines, using any existing attributes in PAAPINVW; or has anyone done something in accordance to this??
    Looking for suggestions.. have anyone faced a similar situation before??

    Hi user;
    Pelase check below note cause and solution part please,which at least can gives u some ideas
    Projects Supplier Invoice Account Generation Error: APP-SQLAP-97734: The System Cannot Generate Distributions [ID 823787.1]Regard
    Regard
    Helios

  • Add a field in the Search Criteria in POWL for Invoice

    Hi,
    I am trying to add a field  or change Selection Parameters in Search criteria POWL for Invoice. But for SC, PO and Confirmation I can do it from DB Criteria. But for Invoice  I implemented these BADI's  and its not triggering.
    /SAPSRM/BD_POWL_CHNG_CUF_SRCH
    /SAPSRM/BD_POWL_CHNG_SELCRIT
    Any idea why its not trigeering? Am I missing anything?  I appreciate your help.
    Thanks,
    Carl
    Edited by: Shears80 on Sep 28, 2011 9:40 PM

    Hi Cral ,
    Add a field in the Search Criteria in POWL for Invoice
    append the custom attributes in this structure
    /SAPSRM/S_SEARCH_RESULT_INV
    goto tcode  sm30  /SAPSRM/V_SRC_CR enter the filed for  BO/ BUS2121(select the business object based on the requirement)
    the creation type must  be suitable  for the type
    criterion name : zzfield
    criterion name : parameter
    structure : /SAPSRM/S_SEARCH_RESULT_INV
    field name : zzfield
    this are the feeder class for invoice .
    /SAPSRM/CL_CLL_POWLT_INV_PROF
    /SAPSRM/CL_CLL_POWLT_INV
    /SAPSRM/CL_CLL_POWLT_INV_S
    based on the powl query you need to do the enhancement in the feeder class .
    Thanks & Regards
    Pradeep Kumar Dondeti

  • Error while running a query-Input for variable 'Posting Period is invalid

    Hi All,
    NOTE: This error is only cropping up when I input 12 in the posting period variable selection. If I put in any other value from 1-11 I am not getting any errors. Any ideas why this might be happening?
    I am getting the following error when I try and run a query - "Input for variable 'Posting Period (Single entry, mandatory)' is invalid" - On further clicking on this error the message displayed is as follows -
    Diagnosis
    Variable Posting Period (Single Value Entry, Mandatory) is used as a lower limit (X) and an upper limit () in an interval selection. This limit has the value #.
    System Response
    Procedure
    Enter a different value for variable Posting Period (Single Value Entry, Mandatory). If the value of the other limit is determined by another variable, you can change its value also.
    Procedure for System Administration

    OK.
    Well, if the variable is not used in any interval selection, then I would say "something happened to it".
    I would make a copy of the query and run it to check if I get the same problem with period 12.
       -> If not, something is wrong in the original query (you can proceed as below, if changes to original are permitted).
    If so, then try removing the variable completely from the query and hardcode restriction to 12.
       -> If problem still persists, I would have to do some thinking.
    If problem is gone, then add the variable again. Check.
       -> If problem is back, then the variable "is sick". Only quick thing to do, is to build an identical variable and use that one.
    If problem also happens with the new variable, then it's time to share this experience with someone else and consider raising an OSS.
    Good luck!
    Jacob
    P.S: what fisc year variant are you using?
    Edited by: Jacob Jansen on Jan 25, 2010 8:36 PM

  • Does anyone know of an app that is for invoicing that can be accessed from more than one iPad at a time?

    I have a roofing business with my husband and we both have iPads we need a invoicing program app that we both can use and see the same material on both iPads is there any apps that anyone knows of that can do this?

    You'll need a program that can open and edit the invoices. You can search the app store for "invoices" and see what you can find - perhaps there is a cloud-based one that would allow you to store the invoices on their server.
    Or if the apps are fairly simple, you could open them in a Word Processing app that does sync two ways with the cloud and do your work on them - and then store the receipts in Dropbox/iDisk/Sugarsync. Loading the actual documents onto those services is very easy and self-explanatory once you sign up for them.

  • SAP QUERY report for vendor line items

    Hi
    I have created a SAP QUERY report for vendor line items with fields vendor no.,vendor name,amount,company code and period.But there is one line item i donot know from wher system is getting it picked with is not in that vedor account,when i compare with fbl1n.I checked the document number too...the same doc number is twice in my query report.One with correct amount and another with wrong one.How do i chk.Where did i go wrong in creating query.I used logical database KDF.
    Please advise.

    i chked...how do we get the amount displayed in query...it just displays amount no debit credit symbol... i have selected BSEG-DMBTR field but no -/+ sign,how is it done in query,please suggest.

Maybe you are looking for

  • URGENT:how to generate multiple spools in a single program

    Hi,        i am currently showing a report which contains different sections using pure write staemnt. now the user wants when he runs the same program  there he should be  able create multiple spools. iMean one section(paragraph) in one spool  ..ano

  • How to change the property of the fields on screen while using BDC

    Hello, I am working on a program where I am using BDC call transaction method to update vendor master data using Fk02. I need to call the transaction in mode 'E'. As per the requirement I don't want user to see all the fields available on that screen

  • Problem after installing iTunes 10.3

    After I installed iTunes 10.3 as an update my HDD has seemed considerably slower in general, all applications run slower, even after running Onyx and Disk Utility. Rebooting takes over a minute longer, (I have no network or power issues) . How do I r

  • IE 5.5 and Applets

    Hi I have done a quite a lot of java applications but not applets. No trying to cover this I get problems with CLASSPATH I think. When running my test applet with just one task in init() add a Jlist I get the NoClassFoundException javax.swing.JList w

  • REP-1211 ERROR

    WHEN I EXECUTE THE EXECUTABLE COMPARED_CNTS2B.REP, I GET THE FOLLOWING ERROR REP-1211 OBJECT-NAME IS LARGER THAN ITS ENCLOSING OBJECT. THE ERROR MANUAL SAID THAT THE OBJECT IS LARGER THAN ITS ENCLOSING OBJECT. THE MOST LIKELY CAUSE IS THAT YOU HAVE A