Goods Return - GRPO - PO QUERY

Friends
The following is the requirement for one of my client:-
PROJECT CODE - GOODS RETURN DATE - GOODS RETURN # - GRPO # - GRPO DATE - PO # - po DATE - VENDOR NAME - BASIC - FREIGHT - EXCISE - VAT - CST - G/R DOC TOTAL
I need the above for Document Level
Would appreciate if someone can help me on this.
regards
KARTHIK

GORDON
Following is the query. Everything comes right. I did not get correct Tax Details. Can u pls guide me  where i had made errors in the query
Select  T1.Project AS 'Job Number', T0.DocDate as [Date of Goods Return],T0.DocNum As [Good Return Number],T2.DocNum as [GRPO Number],
T2.DocDate as [GRPO Date],T4.DocNum as [PO Number],T4.DocDate as [PO Date],T0.CardName as 'Vendor Name',T0.DOCTOTAL,
(t0.DOCTOTAL) - (T0.VATSUM) - (T0.TotalExpns) as 'Basic',
t0.totalexpns as 'Freight  & P&F Amt',
Sum(T5.TaxSum) as 'BEDAmt',
Sum(T6.TaxSum) as 'ECeSSAmt',
Sum(T7.TaxSum) as 'HECess Amt',
Sum(T8.TaxSum) as 'AED Amt',
Sum(T9.TaxSum) as 'CST along with Excise Amt',
Sum(T10.TaxSum) as 'CST Amt',
Sum(T11.TaxSum) as 'VAT Amt',
Sum(T12.TaxSum) as 'VAT along with Excise Amt',
SUM(T13.TaxSum) as 'CST on Freight Amt',
Sum(T14.TaxSum) as 'VAT on Freight Amt',
Sum(T15.TaxSum) as 'BED on Freight',
Sum(T16.TaxSum) as 'CESS on Freight',
Sum(T17.TaxSum) as 'HECESS on Freight'       
FROM ORPD T0 Inner Join RPD1 T1 on T0.DocEntry=T1.DocEntry
          Inner Join OPDN T2 on T1.BaseEntry=T2.DocEntry
          Inner Join PDN1 T3 on T2.DocEntry=T3.DOCENTRY
          Inner Join OPOR T4 on T4.DocEntry = T3.BaseEntry
LEFT OUTER JOIN rpd4 T5 ON T5.DocEntry=T0.DocEntry and T0.DocEntry=T5.DocEntry AND T5.staType=-90 AND T1.LineNum=T5.LineNum
                  LEFT OUTER JOIN RPD4 T6 ON T6.DocEntry=T0.DocEntry and T0.DocEntry=T6.DocEntry AND T6.staType=-60 AND T1.LineNum=T6.LineNum
                  LEFT OUTER JOIN RPD4 T7 ON T7.DocEntry=T0.DocEntry and T0.DocEntry=T7.DocEntry AND T7.staType=7 AND T1.LineNum=T7.LineNum
                  LEFT OUTER JOIN RPD4 T8 ON T8.DocEntry=T0.DocEntry and T0.DocEntry=T8.DocEntry AND T8.staType=-80 AND T1.LineNum=T8.LineNum
                  LEFT OUTER JOIN RPD4 T9 ON T9.DocEntry=T0.DocEntry and T0.DocEntry=T9.DocEntry AND T9.staType=13 AND T1.LineNum=T9.LineNum
                  LEFT OUTER JOIN RPD4 T10 ON T10.DocEntry=T0.DocEntry and T0.DocEntry=T10.DocEntry AND T10.staType=4 AND T1.LineNum=T10.LineNum
                  LEFT OUTER JOIN RPD4 T11 ON T11.DocEntry=T0.DocEntry and T0.DocEntry=T11.DocEntry AND T11.staType=1 AND T1.LineNum=T11.LineNum
LEFT OUTER JOIN RPD4 T12 ON T12.DocEntry=T0.DocEntry and T0.DocEntry=T12.DocEntry AND T12.staType=14 AND T1.LineNum=T12.LineNum
LEFT OUTER JOIN RPD4 T13 ON T13.DocEntry=T0.DocEntry and T0.DocEntry=T13.DocEntry AND T13.staType=26 AND T1.LineNum=T13.LineNum
LEFT OUTER JOIN RPD4 T14 ON T14.DocEntry=T0.DocEntry and T0.DocEntry=T14.DocEntry AND T14.staType=25 AND T1.LineNum=T14.LineNum
LEFT OUTER JOIN RPD4 T15 ON T15.DocEntry=T0.DocEntry and T0.DocEntry=T15.DocEntry AND T15.staType=22 AND T1.LineNum=T15.LineNum
LEFT OUTER JOIN RPD4 T16 ON T16.DocEntry=T0.DocEntry and T0.DocEntry=T16.DocEntry AND T16.staType=23 AND T1.LineNum=T16.LineNum
LEFT OUTER JOIN POR4 T17 ON T17.DocEntry=T0.DocEntry and T0.DocEntry=T17.DocEntry AND T17.staType=24 AND T1.LineNum=T17.LineNum
WHERE T0.DocDate >='[%0]' AND  T0.DocDate <='[%1]' AND T0.DocType = 'I'
GROUP BY T1.Project,T0.DocDate,T0.DocNum,T2.DocNum,T2.DocDate,T4.DocNum,T4.DocDate,T0.CardName,t0.DOCTOTAL, T0.VATSUM,T0.TotalExpns
regards
KARTHIK

Similar Messages

  • QUERY FOR GOODS RETURN -- GRPO -- PO HISTORY

    HI Folks
    I need to write a query for the following requirement.
    Goods Return
    It's Base GRPO (no & date)
    and it's PO (date & no)
    The above fields should be in the same query.
    Can anyone help me on this please.
    regards
    karthik

    Hi
    Select  T0.Project AS 'Job Number', T0.DocDate as [Date of Goods Return],T0.DocNum As [Good Return Number],T2.DocNum as [GRPO Number],
    T2.DocDate as [GRPO Date],T4.DocNum as [PO Number],T4.DocDate as [PO Date],T0.CardName as 'Vendor Name',SUM(t1.linetotal) as ' Basic'  
    FROM ORPD T0
              Inner Join RPD1 T1 on T0.DocEntry=T1.DocEntry
              Inner Join OPDN T2 on T1.BaseEntry=T2.DocEntry and T1.BaseType='20'
              Inner Join PDN1 T3 on T2.DocEntry=T3.DocEntry
              Inner Join OPOR T4 on T4.DocEntry = T3.BaseEntry and T3.BaseType ='22'
    GROUP BY T0.Project , T0.DocDate,T0.DocNum,T2.DocNum,
    T2.DocDate ,T4.DocNum ,T4.DocDate ,T0.CardName
    *When i run this query the BASIC amt is calculated by Multiplying basic * no of line items. Can anybody guide me where changes has to be made. And also i am going to add Freight,Excise,CST & VAT at document level in thus query.*
    regARDS
    KARTHIK

  • Status of Goods Return

    Hi
    How exactly is the status of a Goods return controlled / automatically set by B1?
    I.e.: I created a new one based on a GRPO and it has been closed immediately after saving it, automagically. Actually, theses Goods are going back and they will return (reworked) and I planned to do a GRPO then based on the Goods return issued now. However, this will not be possible anymore.
    When does B1 close / leave open a Goods Return?
    How is a Goods Return usually 'balanced'/closed?
    Thanks
    Franz

    Paul,
    This seems not to be entirely correct.
    I have several Goods Return that have an open status. This is true for all the documents that are not based on an GRPO or alike, for instance. In these cases when the reworked goods return a GRPO can be based on the Goods Return. However, this seems only to be possible if the Goods Return is not based on any other document.
    In my case, the flow of the ggods can not completly followed because B1 automatically closes Goods Retuns that are based on
    an other document, i.e. a GRPO.
    What I would like to do to completely be able to follow the goods flow in B1:
    Purchase Order -> GRPO -> Goods Return -> GRPO
    But only these are possible:
    Purchase Order -> GRPO -> Goods Return
    or:
    Goods Return -> GRPO
    Franz

  • Problem of Query of Module Purchase Order, Good Receipt PO, Good Return

    Hi,
    I would like to seek for assistance regarding double entries of documents,  I have used the query and found out lately the it has a problem, Please refer to thread "Query of Module Purchase Order, Good Receipt PO, Good Return" for details.
    You help is very much appreciated.
    Regards,
    Clint

    Hi Clint,
    Try this one:
    SELECT DISTINCT 'GRPO' AS TYPE, T1.DOCNUM
    'GRPO/RET#', T3.DOCNUM 'PO#',T1.CARDCODE,
    T1.CARDNAME , T1.DOCDATE, T0.ITEMCODE, T0.QUANTITY,
    T0.PRICE, T0.LINETOTAL
    FROM DBO.PDN1 T0
    INNER JOIN DBO.OPDN T1 ON T1.DOCENTRY = T0.DOCENTRY
    LEFT JOIN DBO.POR1 T2 ON T0.BASEENTRY = T2.DOCENTRY
    INNER JOIN DBO.OPOR T3 ON T2.DOCENTRY = T3.DOCENTRY
    WHERE T1.DOCNUM = '[%0]' AND T0.ITEMCODE IS NOT NULL
    UNION ALL
    SELECT DISTINCT 'RETR', T1.DOCNUM,T3.DOCNUM,
    T1.CARDCODE, T1.CARDNAME , T1.DOCDATE, T0.ITEMCODE,
    T0.QUANTITY, T0.PRICE, T0.LINETOTAL
    FROM PDN1 T0
    INNER JOIN OPDN T1 ON T1.DOCENTRY = T0.DOCENTRY
    LEFT JOIN RPD1 T2 ON T0.TRGETENTRY = T2.DOCENTRY
    INNER JOIN ORPD T3 ON T2.DOCENTRY = T3.DOCENTRY
    WHERE T1.DOCNUM = '[%0]' AND T0.ITEMCODE IS NOT NULL
    If you still have duplicates, let me know any differences in those lines.
    Thanks,
    Gordon

  • Query of Module Purchase Order, Good Receipt PO,  Good Return

    Hi,
    Like to ask assistance regarding Module Purchase Order, Good Receipt PO,  Good Return under Purchasing A/P.
    I have a hard time to linking the tables above:
    PO Module have table : OPOR and OPOR1
    GRPO have table : OPDN and PDN1
    Good Return have table : ORPD and RPD1
    Its very mind bubling linking this 6 tables can anyone please can assist regarding the situation, a query that shows that they are connected to each other.
    Thank very much!
    Clint

    Clint,
    Like Suda said, this query assumes your have normal business practise.
    One more thing to mention, the lower part of union all needs some other change.  Here is the complete query:
    SELECT     DISTINCT 'GRPO' AS TYPE, T1.DOCNUM "GRPO/RET#", T3.DOCNUM PO#,T1.CARDCODE, T1.CARDNAME , T1.DOCDATE, T0.ITEMCODE, T0.QUANTITY, T0.PRICE, T0.LINETOTAL, T0.TOTALFRGN, T0.RATE
    FROM         PDN1 T0
    INNER JOIN OPDN T1 ON T1.DOCENTRY = T0.DOCENTRY
    LEFT JOIN POR1 T2 ON T0.BASEENTRY = T2.DOCENTRY
    INNER JOIN OPOR T3 ON T2.DOCENTRY = T3.DOCENTRY
    WHERE    T1.DOCNUM LIKE '[%0]'
    UNION ALL
    SELECT     DISTINCT 'RETR', T1.DOCNUM,T3.DOCNUM, T1.CARDCODE, T1.CARDNAME , T1.DOCDATE, T0.ITEMCODE, T0.QUANTITY, T0.PRICE, T0.LINETOTAL, T0.TOTALFRGN, T0.RATE
    FROM         PDN1 T0
    INNER JOIN OPDN T1 ON T1.DOCENTRY = T0.DOCENTRY
    LEFT JOIN RPD1 T2 ON T0.TRGETENTRY = T2.DOCENTRY
    INNER JOIN ORPD T3 ON T2.DOCENTRY = T3.DOCENTRY
    WHERE    T1.DOCNUM LIKE '[%0]'

  • Goods Return from GRPO to backdate with error.

    Dear all,
    I've got a problem from copying Goods Return from GRPO to the backdate, for example, GRPO Posting Date is '2011-12-11' and Return Posting Date is '2011-11-11', the system threw the below error:
    Reconciliation date must be on or after the last posting date for transactions selected for reconciliation   [Message 3821-3]
    I am using B1 8.82 PL00, the error never come before in older versions of B1.
    Please help me,
    Many thanks,
    Doan

    Hi Doan,
    Thanks for your answer.
    You're right, I can backdate the DocDate, but what matters is the posting date because of VAT reports.
    This way, the VAT is due on a previous date, and now it cannot be issued correctly and VAT reports are all wrong.
    This never happened before 8.82, why now?...
    Regards,
    Jorge

  • GRPO cosed without any Goods return or A/P invoice entered

    I raise a GRPO and incoming excise invoice. I don't know if we did something but now GRPO status is closed without A/P invoice entered. I also did not enter a Goods return document. How do I know why the status is showing as closed??
    And how do i enter A/P invoice now?? Is the only way now is to enter a goods return and enter start from GRPO again??
    Thanks.
    - Krishna

    Hi Prasanna,
    I have tried this instead of entering manual journal entries.
    1. Created a Goods Return with exact quantities and prices.
    2. Created an outgoing excise
    3. Manually close the Goods return document
    That seems to reverse all the transactions automatically. The only problem I have now is the amount that it is posting is quite different from the amount in the document (Amount in the document is Rs 56000 and amount posted is Rs 85600). I am not sure if it is because of this type of transaction or some other reason. Because if I do a Goods return from the GRPO, it posts the amount correctly.
    I tried 2-3 entries, there is no correlation. It is posting very arbitrarily.

  • Query for Good receipt PO Minus Good Return

    Hi Experts,
    How to write a query which is Good Receipt PO, minus out Good Return?
    Below is the Good Receipt PO which i only can do.
    SELECT T1.DocDate AS 'Posting Date', T1.DocNum AS 'Document Number', T1.U_CUSTPONO AS 'Customer PO No', T0.ItemCode AS 'Item No.', T1. U_DONO AS 'Supplier DO NO.' ,T0.Dscription AS 'Item/Service Description', T0.Quantity AS 'Quantity', T0.unitMsr AS 'UOM' , T0.WhsCode AS 'WhseCode'
    FROM  [dbo].[PDN1] T0  INNER  JOIN [dbo].[OPDN] T1  ON  T1.DocEntry = T0.DocEntry  WHERE T1.DocDate>=[%0] AND T1.DocDate <=[%1] ORDER BY T1.DocDate
    Thanks.
    Regards,
    Danny

    Hai Danny Gan 
    Try This
    SELECT T1.DocDate AS 'Posting Date', T1.DocNum AS 'Document Number', T1.U_CUSTPONO AS 'Customer PO No', T0.ItemCode AS 'Item No.', T1. U_DONO AS 'Supplier DO NO.' ,T0.Dscription AS 'Item/Service Description', T0.Quantity AS 'Quantity', T0.unitMsr AS 'UOM' , T0.WhsCode AS 'WhseCode'
    FROM dbo.PDN1 T0 INNER JOIN dbo.OPDN T1 ON T1.DocEntry = T0.DocEntry WHERE T1.DocDate>=%0 AND T1.DocDate <=%1 and T0.TargetType <> 21  ORDER BY T1.DocDate
    Edited by: Prasanna s on Apr 7, 2009 1:28 PM

  • Copy to Goods Receipt PO function on Goods Return

    In current version 2007A there is no Copy to Goods Receipt PO function on Goods Return document. There is only Copy to A/P Credit Memo. This list should contain all available target documents.

    Yes, you can.  You just need to go to add A/P invoice and click on Copy From button.  Then select multiple GRPO to copy.  However, you will be warned that only target FX rate can be used if you have BP currency instead of LC.
    Thanks,
    Gordon

  • Goods Return can't copy to AP Credit Memo

    Hi,
    We had customer who is operating in computer gadget. The store keeper is returning stock to supplier by issuing Goods Return with old unit price. When suppliers issues AP credit memo to the customer, the unit price differs. Customer is copying Goods Return to AP credit memo and put in new price but when add AP credit memo, the following error message appears:
    "Amount to credit is greater than credit balance"
    Customer is curious why system allows to add AP Invoice if unit price differs from GRPO but disallow to add AP credit memo if unit price differs from Goods Return.
    Customer is now running on 2005A PL23 and we are tested in PL34. Same result.
    Any idea how to resolve?
    Regards
    Thomas

    Hi  Thomas,
    Please also make sure that the Expense and Stock account is defined under Administration -> Setup -> Financials -> G/L account Determination ->
    Purchasing tab -> Variance Account (Expense and Stock account).
    Hope it is helpful!
    Regards,
    Ivy

  • Goods Return or AP Credit Memo Creation if AP Reserve Inv created

    Hi All,
    Can anyone tell me how to create good return or ap credit note if ap reserve invoice is used. GRPO created with reference to ap reserve invoice always closed.
    Regards

    Hi,
    We cannot create neither Goods Returns based on GRPO which is based on A/P Reserve
    Invoice, nor Credit Memo based on A/P Reserve Invoice on which GRPO is
    based.
    To cancel GRPO based on A/P Reserve Invoice, create Goods Returns NOT
    based on any document whith exactly the same data as in GRPO that should
    be cancelled. Next, Copy this return to AP Credit memo.
    If you have created a payment based on AP reserve invoice, cancel it, it should reopen the AP reserve invoice document status in 2007 A. Then you can easily create AP credit memo.
    Please try in test environment first.
    Regards
    Preety Goel
    SAP Business One Forums Team

  • Cost of Goods Sold Turnover Ratio query

    Has anyone written a Cost of Goods Sold Turnover ratio query?  The formula would be Cost of goods sold/(beginning inventory+ending inventory/2) within a specified date range at the item key level.
    Thank you for any assistance
    Gary

    Hi Gary,
    We, at our end have scheduled a PROFITABILITY STATEMENT on a monthly basis to management.
    The logic behind that is as follows :
    we batch manage the items on first in first out basis.
    By designing view for GRPO and corresponding batch related tables we retrieved the GRN information with the batches created in system and joined them with sale related information from within another view.
    So our management is getting item group wise and batch wise profitability for a particular period.
    let me know if you want those views.
    thanking you
    Malhaar

  • Goods Receipt Against A Goods Return - Not Working

    Hi,
    i have been trying to work through the Purchase goods return process for a client and am having issues with the flow.
    This is the process :-
    Create Purchase Order for 1 item,  Qty = 21
    Goods Reciept linked to Purchase Order - Qty = 21 this is 100% (Purchase Order Closes)
    Goods Return linked to Goods Receipt - Qty = 1
    Goods Receipt replacement item from supplier - attempted to link to Goods Return - none available - find goods return closed !!!
    How can i link the new goods receipt with the original Purchase Order/Goods Receipt/Goods Return if the goods return is closed.
    I'm using 2007A SP01 PL05
    Thanks
    Barry

    Dear Mr Mason,
    The scenario you described:
    Return closed automatically after being added
    is system behaviour.
    It is not possible to link the new GRPO to the goods return.
    The only suggestion I can give you is writing the GRPO and goods return numbers in the remark of the new GRPO.
    Regards,
    Marcella Rivi
    SAP Business One Forums Team

  • Issue Price Difference Acct. in JE of goods return

    Dear all,
    There is issue in price difference account(Defined as Material Purchase Gain A/c in warehouse)
    in good return journal entry,
    Eloborating problem : User booking subcontracting grpo for qty 1470.024 with price also for 1470.024,
    JE for GRPO is Sub Contracting Charges A/c Dr to Sub Contracting Charges Clearing A/c Cr.
    ie.,
    Sub Contracting Charges a/c Dr -11,92,189.46
    Sub Contracting Charges Clearing A/c Cr -11,92,189.46
    Now they partially do good return for qty 811 with price 1470.024,
    JE for  Goods return is
    Material Purchase Gains A/c Dr -11,78,900.46 
    Sub Contracting Charges a/c Dr -13,289
    Sub Contracting Charges Clearing A/c Cr -11,92,189.46
    Actually sub contracting charges a/c should have been debited to 11,92,189.46,
    Why it is hitting Material purchase gains a/c ?
    Pl clarify it.
    Edited by: Jeyakanthan A on May 21, 2009 3:26 PM

    Hai!
    As per my understanding,
    Stock Acc always in Asset Draw, Price Diff Acc in Expense Draw.
    For Example..
    1.I am purchasing a item of 10 qty each 1 rupee through GRPO.
    2.It will post a JE like stock acc INR 10 Debit and GRNI Acc 10 Credit.
    3.After that i have transfered my 5 qty to some other warehouse.
    4.I am booking a AP invoice with that GRPO as base, now i have changed my price to 2 rupee.
    5.It will post a JE like stock acc INR 5(51 which like in warehouse) debit, GRNI Acc INR 10 debit, price Diff Acc INR 5 Debit (51 go as expence) and Vendor INR 20 Credit.
    Regards,
    Thanga Raj.K

  • Price Difference account when Creating Goods Return

    Hello experts,
    I got below case:
    1) Create a GRPO
    2) Created Landed Cost document
    3) Create a Goods Return (realized the lot number entered on the GRPO) was incorrect.
    When I create the latter document, this impacts the Price Difference account for the same amount increased on the Landed Cost document?.
    The Accrual Landed Cost account it is the one that should get hit.
    Any suggestions? is this how it is suppose to behave?

    Hi,
    Are you working with 8.8 version? If yes,
    then check Note no. :   1554871 regarding the issue reported by you and confirm whether the issue is similar to the one mentioned by you here in the thread.
    If not, please check Note No. :   1161695 and see if the same is the scenario.
    You can update us with the version and patch if further tests needs to be done.
    Kind Regards,
    Jitin
    SAP Business One Forum Team

Maybe you are looking for

  • When I open a pdf file in Firefox and then save, how do I set the initial directory to be closer to what I want instead of a temp directory?

    When I choose to save a pdf file directly when using Firefox, it works perfectly. However, when I choose to open a pdf instead and then save it, the save directly displayed will always be a temp directory and it would be more convenient for me to cho

  • MC.2 report

    Hi Gurus, Kindly help on below. On report MC.2, what does this report includes in the calculation? GR and GI only? If that so, why can we see the values in MB5B. Please advice on what are the scope of this report. Thank you.

  • CHAR conversion to NUM.

    dear all, in BI7, how can i convert my CHAR into NUM datatype? data from external source is coming in as CHAR and i want to change it to type NUM. how can i do that in the update rule? thanks.

  • Error SCAC 50012

    Buildfile: C:\Oracle\Middleware\jdeveloper\bin\ant-sca-compile.xml scac: [scac] Validating composite "C:\JDeveloper\mywork\DairyEvent\DairyEvent\composite.xml" [scac] Setting BPELC option 'classpath' to C:\Oracle\Middleware\jdeveloper\jdev\extensions

  • Console connection v40Z

    Can someone plz tell me whats the right combination of connector and cable to connect to a serial port for the v40Z server from a laptop? Thanks.