Routine to compare a clearing doc number with AC doc number in AR

Hi All,
I need to write a routine to look up the following for new DSO built above  the existing DSO.
Look up on the delta between AR DSO to new  Payment DSO.
-     Filter items with status = c and doc type = zl,rv
-     For each document  number  ,check  that clearing doc = a/c doc no. and doctype = u201CDZu201D
-     Subtract orig invoice amount with residual to get payment(look for discount ).
Please help

Hi Denise,
Try:
SELECT sales_doc
               date_doc
INTO TABLE t_ods
FROM /BIC/ZODS
FOR ALL ENTRIES IN RESULT_PACKAGE
WHERE sales_doc EQ RESULT_PACKAGE-NAST(10).
IF sy-subrc EQ 0.
    SORT t_ods BY sales_doc.
ENDIF.
LOOP RESULT_PACKAGE ASSIGNING <result_fields>.
     READ t_ods INTO w_ods WITH KEY sales_doc = <result_fields>-nast(10).
     BINARY SEARCH.
     IF sy-subrc EQ 0.
         <result_fields-date> = w_ods-date_doc.
     ENDIF.
ENDLOOP.
Regards.

Similar Messages

  • Documents number is cleared automatically with clearing doc. ALE-extern

    Hi Mr./Mis.
    I'm  from China, I found that when I posted one invoice and planned to clear it manually, but I failed to do this due to it was cleared automatically with clearing doc. ALE-extern, could you advise the reason and the solution, thank you in advance.

    I have that behaviour in a system where IDOC FIDCC1 is generated to be sent to other system

  • U00BFTransaction to clear customer number with its equivalent vendor number?

    Dear Gurus,
    Our client has many customers that are vendors at the same time, obviously with different vendor numbers BUT same Fiscal number. Each customer has its vendor number associated in the master data; and each vendor has its correspondent customer number associated in its master data.
    Now, how can I clear vendor invoices with customer invoices? Invoices that become from the same Fiscal number?
    Which is the transaction to do that?
    Any help will be rewarded.
    Thanks a lot

    Hello,
    Please, try this link Automatic open item clearing for vendor/customers
    Regards,
    Eli

  • Compare data in R/3 with data in a BW Cube after the daily delta loads

    Hi Friends,
    How can I compare data in R/3 with data in a BW Cube after the daily delta loads? Are there any standard procedures for checking them or matching the number of records?

    Hi Sunil,
    If you want to check the records daily instead of checking the data in R/3 manually ......
    You can try this...
    If you have staging DSO(level 1) that means whatever data is in source system load it to Staging DSO without any routines or any modifications.
    Now load this DSO data to Cube or DSO(level 2) as per your requirement with routines etc.
    Now Staging DSO contains Source system data.
    Now the level 2 Cube or DSO contains BW data with some modifications.
    Now create a Multiprovider based on level 1 and level 2 data targets.
    Now create a report on which keyfigures you want to test the data.
    In Multiprovider there is a field called 0infoprovider in data packet dimension.
    you can drag this infoprovider to the columns and restict your keyfigures with level 1 and level 2 data targets.
    In the first column you can see the level 1 DSO data ( source system data),in the 2nd column you can see the BW data.
    Now create a formula which gives the diffrence b/n level 1 and level2.
    that is R/3 data - BW data.
    If the diffrence is zero both R/3 and BW data are same.
    if the diffrence is not eqaul to zero check whether any routine is there or not.

  • Utilities - open items/cleared items enhancement with HKONT from DFKKOPK

    Hi friends,
    My client needs item level GL Acccount ( HKONT ) from DFKKOPK table for both Opne & Cleared Items. So i enhanced both Datasource( 0FC_OP_01 and 0FC_CI_01) with this new field HKONT which gets data from different table i.e., DFKKOPK. Now i have encountered one problem. The link between these talbes is only OPBEL(FICA doc no).By doing so we are getting item level records but we are not able to figure out the distribution of 'Contract(VTREF)' values across these records.
    For examle for doc no : 900000031212 there are 3 records at DFKKOP base table. But in DFKKOPK table it has 19 records with different sub G/L Accounts. After the execution of CMOD code, in RSA 3 , 3 records are replaced by these 19 records successfully with new sub G/L values but some fields like Contract , Division , cleareding reason etc..are showing only the first records values for all these 19 records. But this gives reports wiith wrong contract and dividion values.
    So my question is " how to bring these SUb G/L account(HKONT) values from DFKOPK table .
    Waiting for good replies,
    Murthy

    We had a requirement to retrieve "aging of receiveables" by customer. Basically, it goes thru each record and depending on the due date places the amounts in the following buckets (example). 0-30 day Overdue, 31-60 days Overdue, 61-90 days overdue, 30+ days overdue, 60+ days overdue) etc all the way to 6+ years overdue.
    There are also cooresponding buckets for coming due analysis. For example, what is: 0-30 days coming due, 31-60 days coming due, 30+ days coming due, etc...
    To do this, first I needed to be able be able to produce an open items statement at any given time in the past. Now, this seems impossible because of how the items go from open to cleared all the time. And an item that was open one month ago, may not be open anymore.
    What I did was first remove any selections on item status. Then compare the posting date with teh key date in the past, if the posting date is less than or equal to the key date, keep the record.
    Then compare the clearing date with the key date. First, keep all that are #. (This keeps all records still open from that posting date/key date)
    Then, add another check for all items that were cleared after the key date (GT Key Date). This gives you the open items on that date.
    Hope that makes sense. Let me know if you want clarification.
    /smw

  • How to reverse the clearing doc

    Hi Experts,
    i done sample invoice for vendor and customer, this inter co payment transaction i cleared as well with f110. But this is not a original invoice so that i want to do reverse vendor and customer invoice If i am giving any doc no (cust invoice no, vendor invoice no or cleared doc no for cust or vendor).
    System giving the message doc already cleared. its not triggered for reverse. Regarding this situation how can i reverse the doc. Please give me a suggestion for this.

    Hi,
    The document type which you want to reverse will have the Reversal document type in  OBA7
    Like customer Invoice Document type will be DR so in OBA7 double click on DR you will see the reversal document type assigned there.
    So check the number range assigned to that document type in FBN1,
    That will be having the external number range assignment TICK.
    If you want you can remove that tick or assigned any internal number range to that document type.
    Hope this will solve your issue
    Regards,
    Shayam

  • Relation accounting document number and clearing document number

    Hi everyone,
    What is the relation between accounting document number and clearing document number.

    For every accounting document when it is posted it should be available in BKPF Doc header table.. Once that document is closed or cleared..there is any entry made to BSAK for Vendors (Cleared Items) or BSAD for Customers (Cleared Items).
    Eg: When a invoice is generated for a PO it gets created and is still not cleared or is not closed , it makes an entry in BSIK. Once it is closed it is available in BSAK.
    Same is the case with Sales order..

  • HI Team, Recently One week back I bought a new iphone 5 from India. They have given me a used mobile which has a different IMEI number when compared to the IMEI number present on the box. Please let me know how to proceed further

    HI Team, Recently One week back I bought a new iphone 5 from India. They have given me a used mobile which has a different IMEI number when compared to the IMEI number present on the box. Please let me know how to proceed further

    When you went back to the place where you purchased this phone, & asked them, what did they say?
    No one here can help you with this, nor can/will Apple. You need to take this up with whoever you purchased this phone from.

  • Document type KR is not picking to Clear GL account with T-code F-03

    Hi all,
    My client wants to clear GL account Cash-in-Transit which is open item managed. He has posted two items. One is with KR document type like Intercompnay adjustment account debit (40) and Cash-in-Transit account credit (50). Second item is with SA document type like Cash-in-Transit accont debit (40) and Intercompany adjustment account credit (50). He did not give vendor number and appropriate posting key (31) while postings. With document type KR, he posted with posting keys 40 and 50. Now while clearing the GL account through T-code F-03, system is picking only SA document type. The system is not picking document type KR. He wants to clear the items with each other. I have checked the document type settings. Check boxes Intercompany postings and trading partner are active in both above document types.
    How can the GL account be cleared ? Are any configuration settings missing ? Kindly advice as soon as possible.
    Thanks in advance.
    Regards,
    K.S.K

    Hi,
    First of all..why would system need a Exchange gain/Loss Account..If your local currency is INR and you posted a debit and a credit document both in INR..then there is no question of a foreign exchange gain/loss account..
    BUT, if you have posted the document in any currency other than INR, ie: your local currency...then the system would need a exchnage gain/loss account when you try to clear the debits and credits.. i am giving an example below to explain better..
    You posted a debit of 100 USD @ 40 = Rs. 4000.00
    You posted a Credit of 100 USD @ 42 = Rs. 4200.00
    Now, if you clear this debit and credit then there is no difference in 100 USD, as the debit and credit is netting off.. but if you see INR there is a difference of Rs. 200.00 which system posts to Exchange gain/loss account..which we maintain in OB09.
    Hope it is clear to you now..
    Regards,
    SAPFICO.

  • Invoice wise cleared item in Clearing doc.

    Hi Guru,
    I am clearing the line item of a customer individually, around 10 line items at one item. But when I am viewing the cleared doc. in FB03 it shows me only one cleared line item with the sum of all 10 line items.
    Gurus please help me asap.
    Will assign very good points.
    Thanks
    Rajeev

    Boss, You are right. Only one doc. will be created for all the line items so cleared but that doc. must contain all the 10 line items which are cleared. In my case that doc. shows only one line item which is sum of all the 10 line items.
    Rajeev

  • Reversal of clearing doc without touching other clearing doc

    Hi,
    My client wants to reverse a particular payment document of particular vendor without reversing the total clearing document.
    The clearing document is part of other clearing which has other vendor payments also.
    So, when the user is resetting and reversing in FBRA, the system is giving the error that it involves other clearing document.
    But they dont want to reverse other clearing documents. They just want to reverse one clearing doc.
    So as a solution I just reset it and made it open. And asked the user to put a manual debt entry , so that credit entry can be cleared. The reason for reversal of clearing document is it was a wrong payment.
    Please help how to reset and reverse clearing doc with reversing other clearing docs.
    Best Regards,
    Tapan Patro

    Resolved

  • Clearing doc contain no line item ?

    Dear Gurus,
    In which trx clearing doc contain no line item.when i perform trx in F-44,F-32 and F-51 clearing doc contain line item with same busines area.
    Pls help.
    *assign full marks
    Regrds
    Mahesh

    Hi
    " Transfer posting with clearing" is the transaction for account clearing without creating any posting. Did you select that in T-codes mentioned below?
    Jayaram

  • No Clearing Doc in BSAD, Is it possible?

    Hi Experts,
    I hv 2 entries in BSAD, like,
    AUGBL--BELNR--
    BLART
    1) 10000000--901000001--
    RX
    2) 10000000--901000002--
    RX
    There is NO clearing doc.for the above 2 entries!
    the other values r,
    VBRK-FKSTO = ' '
    BKPF-STBLG = ' '
    BSAD-XRAGL = ' '
    BSAD-XZAHL = ' '
    i.e. they r NOT reversed and NOT cancelled!
    Then, What is this scenario?
    thanq.
    Message was edited by:
            Sridhar

    Hi Murali,
    OK , fine.
    I guess one more entry shuld (suppose to) b there along with these 2 entries, i mean BSAD shuld look like, as
    AUGBL--BELNR--
    BLART
    <i><b>1) 10000000--100000000--
    AB</b></i>
    2) 10000000--901000001--
    RX
    3) 10000000--901000002--
    RX
    So, I am guessing some how the 1st entry was missed, which suppose to b exist!
    Bcoz of this absence of 1st entry, my report is picking the first 2&3 entries, which shuld not b wanted as per my ABAP code(Functional spec)! thats my worry, actually! If there wuld hv existence of 1st entry in BSAD, my ABAP code do not pick the 2&3 rd entries.
    Pls. let me know ur opinon on my guess?
    thanq.
    Message was edited by:
            Sridhar

  • Clearing doc

    A payment was posted to clean the invoice 1900158825. At the same time a Overpayment was applied. But after bank reconciliation we found that there is no an overpayment this was an error in the deposit slip. So, in order to reflect the correct postings in customer account we need to reset and reverse the clearing doc 3400079309. But the system doesnu2019t let us to do this.
    It is the message of the error: Document 1000 3400079309 is not purely a clearing document

    Please follow the note  313344.
    The procedure is as follows:
    1.  You pay invoices with checks (manually or automatically), and you
         use check management.
    2.  You void the check (FCH8). As a result, the clearing is reset and
         the payment document is reversed. The invoices are open again. The
         payment document is cleared by the reverse document.
    3.  You reset the cleared items of the reversal (FBRA). Then the partner
         line in the payment document is open again.
    4.  You again clear the payment document with the old invoices manually
         (F-44). As a result, a new clearing document which consists
         generally only of a document header without any line items is
         generated as of R/3 Release 4.0. This clearing document is not a
         payment document. Also, the original payment document cleared again
         is no longer a payment document from the R/3 point of view. This is
         the reason you can no longer branch to the cleared invoices from the
         document display (FB03).
    5.  You reset voiding of the check (FCHG).
    Solution
    You can see the check again via 'Environment > Check information'
    (FCH1). The original payment document to which you can branch via
    'Accomanying documents' or 'Payment document' is still in the check. If
    you try to display the cleared invoices via 'Environment > Payment
    usage' then the system displays the error message F0604 'Document & & &
    is not a clearing document'.
    To list all items involved for the clearing transaction, you can use
    Transaction FBRA (Goto > Accompanying items). Then specify the clearing
    document posted here manually.
    Regards
    Ravinagh Boni

  • Reverse the Clearing Document Number

    ab01     1     50     1010810     UNVERFID DEP RECIPT 25,062.00-                              
    ab01     2     40     1012149     D A 10512634040103-S       686.00                              
    ab01     3     40     1012149     D A 10512634040103-S    2,500.00                         
    ab01     4     40     1012149     D A 10512634040103-S    2,556.00                         
    ab01     5     40     1012149     D A 10512634040103-S   16,000.00      1100016984     
    ab01     6     40     1012149     D A 10512634040103-S    2,700.00                              
    ab01     7     40     1012149     D A 10512634040103-S      620.00     
    Hi guys the  when i post the Document in the company Code Ab01 when i am try to Reverse the Document  i got the messageclearing Document number is there
    when i Try to reverse the Clearing Document Number in 2009  same number is avilable in the 2008 fiscal year. its not possible.we are not closed the fisacal year 2008
    please Solve this problem

    Dear Rao,
    It is not possible to reverse any clear documents with using of FB08. First we need to reset with FBRA and reverse the same transaction with FB08. or you can also do wih uing FBRA also to reverse the same.
    Best Rgds
    Mani

Maybe you are looking for