Clear_document FM not working to clear customer open item.

Hi Experts,
1) I need to develop a report to clear the customer open items, the report has to display whether the Customer open items cleared or not?
     As we do f-30 transaction to clear documents.
   I have developed the report in this ways but its not clearing.
    a) First I have posted the document  through   'BAPI_ACC_DOCUMENT_POST
    I have filled the document in the below way. The Bapi returning OBJ_KEY value also.
LOOP AT it_data INTO wa_data.
****Fill  DOCUMENTHEADER
    wa_docmentheader-doc_type     = 'DA'.   "doc type
    wa_docmentheader-doc_date    =  wa_data-bldat.   "doc. date
    wa_docmentheader-pstng_date  =  wa_data-budat.   "posting date
    wa_docmentheader-comp_code   =  wa_data-bukrs.   "company code
    wa_docmentheader-ref_doc_no  =  wa_data-belnr.   "Reference
    wa_docmentheader-header_txt  =  wa_data-bktxt .  "Header Text
    wa_docmentheader-username    =  sy-uname.        "user name
****Fill  ACCOUNTGL Table
    wa_gl-itemno_acc = l_no.
    wa_gl-gl_account = 2909509----" which i marked in the screen second red color(ACCount).
    wa_gl-alloc_nmbr = wa_data-xref2.
    APPEND wa_gl TO it_gl.
    CLEAR wa_gl.
****Fill  ACCOUNTRECEIVABLE
    wa_receivable-itemno_acc = l_no + 1.
    wa_receivable-customer = wa_data-kunnr.
    wa_receivable-gl_account = wa_data-saknr.
    wa_receivable-alloc_nmbr  = wa_data-xref2.
    APPEND wa_receivable TO it_receivable.
    CLEAR wa_receivable.
****Fill CURRENCYAMOUNT
    wa_currencyamount-itemno_acc = l_no.
    wa_currencyamount-currency = wa_data-waers.
    wa_currencyamount-amt_doccur = wa_data-dmbtr.
    APPEND wa_currencyamount TO it_currencyamount.
    CLEAR  wa_currencyamount.
    wa_currencyamount-itemno_acc = l_no + 1.
    wa_currencyamount-currency = wa_data-waers.
    wa_currencyamount-amt_doccur = wa_data-dmbtr.
    wa_currencyamount-amt_doccur = wa_currencyamount-amt_doccur * -1.
    APPEND wa_currencyamount TO it_currencyamount.
    CLEAR wa_currencyamount.
CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
EXPORTING
documentheader
= wa_docmentheader
IMPORTING
OBJ_TYPE     
=
obj_key      
= lv_obj_key
OBJ_SYS      
=
TABLES
accountgl    
= it_gl
accountreceivable = it_receivable
ACCOUNTPAYABLE
=
ACCOUNTTAX   
=
currencyamount
= it_currencyamount
return       
= it_return.
EXTENSION2   
=
endloop.
2) After posting the document am using Clear_document to clear the document
   am filling the Clear_Document in the below way.
1. a)get belnr, bukrs, gjahr & buzei from bsid table for invoice and append to T_AUSZ1
    b)T_AUSZ1-BUKRS, 'A', OBJ_KEY+0(10)(which you get from BAPI_ACC_DOCUMENT_POST bapi), posting date, posting date year pass it to T_AUSZ2-BUKRS, T_AUSZ2-AKTIO, T_AUSZ2-AUGBL, T_AUSZ2-AUGDT & T_AUSZ2-AUGGJ and append it.
2. a)get BELNR, BUKRS, GJAHR, BLART & BUDAT  from bkpf where awkey = OBJ_KEY(which you get from BAPI_ACC_DOCUMENT_POST bapi)
b) get belnr, bukrs, gjahr & buzei from bsid table where BELNR EQ bkpf-BELNR AND
                      ZUONR EQbkpf-BELNR AND
                      BLART EQ bkpf-BLART AND
                      GJAHR EQ bkpf-GJAHR AND
                      BUDAT EQ bkpf-BUDAT
and append to T_AUSZ1
c) T_AUSZ1-BUKRS, 'A', OBJ_KEY+0(10)(which you get from BAPI_ACC_DOCUMENT_POST bapi), posting date, posting date year pass it to T_AUSZ2-BUKRS, T_AUSZ2-AKTIO, T_AUSZ2-AUGBL, T_AUSZ2-AUGDT & T_AUSZ2-AUGGJ and append it.
delete duplicates from T_AUSZ2.
3) but am not able to clear the document using Clear_document Function Module
4)I am able to post the document  through BAPI_ACC_DCUMENT_POST
5)Please tell me how to clear the document.

Hi Sunny,
Please see the following :
1. Down Payment Received (2500 INR.) F-29
2. Customer Invoice Posted (2500 INR.) FB70
3. Clear Down Payment (2500 INR) F-39
4. Now Run Automatic Clearing (F.13)
And then check the Customer line item report in FBL5N. It will clear both line items.
Hope this helps.
Kind Regards,
Prakash Kumar

Similar Messages

  • Validation not working when clearing an open item

    Hi SAP Gurus,
    We have a interesting scenario to discuss with you. We are using Legal Dunning Procedure so once legal action is intiated against the customer notifications are sent to the legal department if payments are received.
    Unfortunately this can happen only during the next dunning run which of course can occur in varying time intrevals. Therefore we need a validation to occur if a payment is received from a customer against whom legal action has been initiated.
    We tried using the following fields Date of the legal dunning proceedings, Dunning block, Dunning key, Dunning level but are not able to get the validation to work when attempting to clear the open item. These all work when trying to post a new document but fail when trying to clear a open item. Points will be given for helpful answers.
    Regards,
    Siva

    this is the radio button
    <af:selectOneRadio value="#{bindings.Gender1.inputValue}"
                                                     label="#{bindings.Gender1.label}"
                                                     required="#{bindings.Gender1.hints.mandatory}"
                                                     shortDesc="#{bindings.Gender1.hints.tooltip}"
                                                     id="sor5">
                <f:selectItems value="#{bindings.Gender1.items}" id="si7"/>
              </af:selectOneRadio>
    i use this sample
    http://download.oracle.com/otn_hosted_doc/jdeveloper/11gdemos/ADF_Insider_Essentials/ADF_Insider_Essential_YesNoRadio/ADF_Insider_Essential_YesNoRadio.html

  • EBS posting to clear customer open items - Function not working?

    Hello SAPers
    I have an issue I just canu2019t seem to resolve! We are receiving MT940 statements and receive customer invoice reference details with field: 86 as follows:
    :61:090910C1500,00FOSB1000270 //100909050      0        035315
    :86:DEPOSIT
    Remitter:1000270 MISSION AUSTRALIA   Ref:1200000017
    Immediately following the BTC FOSB the bank quotes the customer number however I am not using this as standard SAP should identify the customer by document number within the note to payee field?
    I am using a 2 step process in posting to the clearing account and customer. Config as follows:
    Pst Type 1
    40     Bank
    50     Clearing
    Pst type 2
    40     Clearing
    15     BLANK          DZ     3      15
    I have also set up a string to look for the documents ^(12########)$. When we load the statement the first posting is successful however the second does not post to the customer or clear based on the invoice reference. I am using algorithm 020. The error that occurs is F5 102 Customer does not exist in company code xxxx. It actually does exist in the company code.
    I have loaded the EBS to the buffer and simulated the search on BELNR and it picks up the document?
    I am sure this is standard and a CMOD is not required on this type of functionality? What have I not done to allow posting to the customer based on document number or to post on account where it is not cleared?
    Any assistance on this issue is appreciated? Thanks in advance.

    Function Module for GL open Items
    how to clear customer open items by another  customer open item
    Function Module for GL Open Items
    Reward points..

  • Clearing customer open items

    Hello!
    Can anybody help to find a way how to clear customer open items when there is no reference number in use for customer. In electronic bank statemen there is only billing document number in TXT field. How to configure "Make Global Settings for Electronic Bank Statement" and "Define Search String for Electronic Bank Statement" for that purpose.
    With all the best,
    Merlin

    Hello,
    IMG => Financial Accounting => Bank Accounting => Business Transactions => Payment Transactions => Electronic Bank Statement => Make Global Settings for Electronic Bank Statement
    Give your chart of Accounts
    1. Create your account symbols
    Create freely definable account symbols. Make sure that you are able to identify them when you are configuring in future steps.
    2. Assigning Accounts to Account Symbols
    Here you need to assign the account symbols to GL Accounts or you need to use masking logic. You must have designed your accounts in such a way that the end digits will work for posting the entries to FI. Account Modifier you use as + and use your local currency, if you do not have any foreign currency postings.
    3. Create Posting Rules
    Create freely definable posting rules.
    4. Define Posting Rules (This is the most important configuration for your FI Postings / Clearings)
    a) For all the payments you need to create the entries for posting area 1
    b) For all the receipt you need to create the entries for posting area 1 and 2
    c) Use the document type DZ in case if you want to clear the items. Use Posting type 8. If the invoice number is there in the reference field of bank statement, automatically the same will be selected by the system and cleared.
    d) If you want just only entries to be posted use posting type 1.
    e) If you want to clear the check, then use the posting type 4.
    f) Configure according to the entries to be posted.
    g) If you are going for clearing something the offsetting debit / offsetting credit (as the case may be) need not be given.
    5. Create Transaction Type
    Create freely definable Transaction Type
    Select the transaction type and assign the external transactions to your posting rules.
    For outgoing check use 13 as Interpretation Algorithm and 1 as the processing type.
    Remaining all case use 1 (Standard algorithm) and 5 as the processing type.
    Please also go through the below mentioned note in case if you are required to use further available interpretation algorithms or processing types.
    6. Assign Bank Accounts to Transaction Types:
    You need enter the Bank Key / Bank Account / Transaction type here.
    You can get the the bank key and bank account details from table T012K (Go to SE16)
    Further supplementary notes may be useful to you:
    There are different programs to upload electronic bank statement.
    FF.5 or FF_5.
    I think your case Multicash format you are using.
    You need have three files in FF.5 and two files in FF_5
    You can prepare a Z program in order to truncate the electronic bank statement into two or three part files and save them on the application server.
    1. Take all the external codes list from bank.
    2. Take any available documentation from the Bank describing the relevance of the external codes.
    3. Make sure that your Chart of Accounts (Bank Accounts) last digits logic is appropriate to meet the requirements.
    4. Based on this decide the Account Symbols that are required to be created.
    5. Make sure that the masking rules are configured properly.
    6. Decide the posting rules that needs to be created.
    7. Link up your external symbols provided by the bank with Posting rules and give proper algorithms for posting and clearing logic.
    6. Concentrate on the posting areas to be posted while uploading the bank statement.
    Further explanation would help you to understand the functionality when uploaded the electronic bank statement.
    Main purpose of uploading the bank statement into SAP is to make your Bank Main Account and physical bank statement balance in sync.
    You do not have any traditional Bank Reconciliation Statement (BRS) report in SAP.
    SAP is normally you maintain bank main account and bank sub account. Whenever you make a payment through F-53 or F-58 or F110, the entry would be:
    Vendor Account Dr
    To Bank Sub Account
    The ending digits of the sub-account would be important in configuring the masking rule. Based on this masking rule when you upload the bank statement the entry the system would pass is:
    Bank Sub Account Dr
    To Bank Main Account
    It depends on the configuration, either the sub account will be cleared by the system automatically or you need to run F.13 to clear the sub accounts.
    At the time of receipts, you have different accounting entries unlike payments. It needs to post to two posting areas. 1. GL Accounting 2. Sub-Ledger Accounting
    The entries would system itself pass is:
    Bank Main Account Dr
    To Bank Sub Account
    Bank Sub Account Dr
    To Cutomer account.
    Clearing logic mentioned for your posting rules and the alogrithm used for your external bank symbols will also play pivotal role in clearing the accounts.
    Ideally you will use
    FF67 / FF.5 / FF_5 for uploading manual or electronic bank statement
    FEBA / FEBA_BANK_STATEMENT is used for furthe rprocessing.
    GO THROUGH SAP NOTE 48854
    Please go through SAP Note. 48854. You will get an idea regarding the functionality of the algorithms.
    Though this note is in relevant to GB specific, you will find this very useful.
    description follows below regarding the normal procedure for maintaining table T028G. Due to the different bank codes and posting rules, pre-Customizing is not possible at this point.
    The following processing types are available - unless stated otherwise, you should use the interpretation algorithm: '000 - No interpretation' in each case.
    1. '00': There is no processing. The entry line is ignored.
    2. '01': A validation is made whether an entry exists for the transferred check number in the check table (PAYR). The check number and payment document number are transferred for further processing. Interpretation algorithm: outgoing check processing '011'-'013'; the update in the check file is via the interpretation algorithm.
    3. '02': Transfer of the ending balance to the electronic bank statement
    4. '03': Transfer of the opening balance to the electronic bank statement
    5. '04': Clearing via the allocation number which is delivered with the bank statement. No interpretation algorithm.
    6. '05': Clearing of BACS payments or BACS bank collection. The reference text field is first read to ascertain whether it involves payments initiated by users or bank collection via BACS. Providing it does involve a cash transaction initiated by the user, the payment document numbers concerned are determined via the reference number and transferred as a reference to further processing. Interpretation algorithm: '000 - No interpretation' or '019 - Reference number DME'.
    Note
    To differentiate between the two procedures in table T028G, you have to maintain two separate entries.
    Example: the bank uses bank code '62' for cash receipts and for BACS bank collection.
    Ext. Transaction +/- sign Posting rule Int. Algorithm Processing type 62 + GB62 001 5
    62 SAPBACS + GB63 000 5
    7. '06': Bank costs or interest revenues
    Recommended interpretation algorithm: '000 - No interpretation'
    8. '07': Total amount of cash disbursements
    9. '08': Total amount of cash receipts
    10. '09': Items not paid
    Recommended interpretation algorithm: '000 - No interpretation'
    Regards,
    Ravi

  • Function module to clear customer open items

    Hi ,
    I have a requirement in FI module to clear the customer open items through Function Modules.  The standard functionality is done through the tcode f-28 / f-32.
    Please let me know if there is any program or Function Module to clear the customer open items.(without using BDC).
    Thanks in advance.

    Function Module for GL open Items
    how to clear customer open items by another  customer open item
    Function Module for GL Open Items
    Reward points..

  • Charge off difference whening clearing customer open item with bank receipt

    Hi,
    Our company users will use F-32 to clear customer open item with bank receipt, sometimes, our invoice is 100 RMB issue to customer, the customer finally pay 99.98, then in F-32, we use charge off difference to post 0.02 difference to a account.
    The user then want to control this, saying for example, if the customer pay only 90, whening using charge off differnce, the system will pop up a error message.
    Can this be done in SAP, or we need to use user exit, then which user exit?
    Thanks.

    Dear,
    This is done through customer tolerance group using transaction OBA3. Here enter the maximum amount in Loss under the Permitted Payment Differences. you are able to hold tolerance for customer clearing.
    Is this what you wanted?
    Regards,
    Chintan Joshi.

  • How to clear customer open items by another  customer open item

    Hi Guru's
    I have a problem, we need to assign  and clear the open items of one customer with another customer from same company code. is it possible?
    for eg: I have a customer X whose Debit balance is USD1000 and Cusomer Y is having Credit balance is 1000. Customer Y is agreed to settle the amount to customer X.
    since customers are not related , we dont maintain any relationship in SAP. how do we post and clear the open items?
    please let me know the procedure.
    regs
    kumar

    Hi,
    When the moment you finish choose open item for 1st customer and then you have to press F7 (Charge off diff.) new screen comes then press F6 (Choose Open Items), then enter required data for 2nd customer (such as customer code, doc number, etc). You can post partially, and residually for this clearing posting.
    Good luck.
    -dwih-

  • Error while clearing Customer open items

    Hi,
    When I am trying to clear the Customer open items via F-30 I am getting following error -
    +Profit center 9000/SEA001 does not exist for 08.04.2011
        Message no. KM026
    Diagnosis
        The desired profit center SEA001 is not in the master data table for the specified date.
    Procedure
        Check your entry.
        Note: The profit center is usually derived from the original account assignment object (cost center, order, and so on) or other information (such as the material number).
        If necessary, create the desired profit center for the appropriate time
        frame.+
    First of all SEA001 is not a Profit Center. It's a material. Correct PC is attached to this material SEA001 and I also checked the validity period of the PC and it's OK.
    Can someone please advice how to nail down this issue?
    Thanks,
    Sanjay

    Found the reason.
    Actually there was a substitution to fill the PC from XREF3 for document splitting and SD module was passing the material in XREF3 hence the system was thowing the error.
    Gaurav - thanks for your input. Your reply pointed out towards substitution.
    Infact thanks everyone for the inputs.
    Regards,
    Sanjay

  • Customer open item clearing based on the customer PO no in Sales order

    Hi,
    Is it possible to clear customer open item based on teh customer PO number eneterd in the sales order BSTKD.
    Points will assigned for any useful answer.
    Thanks
    Vamsi

    Hi this i spossible and cleared.Thanks

  • BAPI or FM or Class for Customer open items CLEAR (F-32)

    Hi Everyone,
    Is there any BAPI or FM to CLEAR customer open items (F-32).
    Thanks,
    NK

    Hi,
    For clearing open items you can use BAPI_ACC_DOCUMENT_POST.
    but need to write extra code in BTE
    check this function module SAMPLE_INTERFACE_RWBAPI01.
    need to update below four fields of table accit.
    REBZG (document no against u want to clear)
    REBZJ (fiscal year)
    REBZZ (line item)
    REBZT
    to update these field use BTE.
    Thanks,
    Avadhut.

  • To clear vendor open item in foreign currency

    Would like to seek for advise.
    I am not able to clear vendor open item due to document currency is
    difference, eg.GBP with RM.refer to attachment- I would like to offset
    document number 200000384,200000200,1500000000 with 200000387.
    We try to clear the vendor open item by using t-code F-44 and F-51 but
    not able to clear as it prompt error message difference is too large
    for clearing.

    no answer reply so have to close for no solution.

  • Clear Customer Line Items

    Experts,
    Is there anyway we can clear customer open items ? - I am looking for a similar transaction like f-44 like we have for clearing vendor open line items.
    All answers would be duly appreciated and rewarded with points.
    Thanks,
    Nandita

    FB1D                 Clear Customer
    FBA3                 Clear Customer Down Payment
    F-32                 Clear Customer
    F-39                 Clear Customer Down Payment
    VVR

  • Customer open item not cleared

    Hi experts
    For a customer open item,when deposited cheque in bank trough t code ff68
    the line item remains as open but not cleared.
    thanks in advance

    Hello,
    After the end of the process you should check the results in order to identify if the account informations were found in order to clear the item.
    Regards,
    REnan

  • How to clear vendor open items with customer open items in APP?

    Hi Experts,
    Our vendor is our customer - in this scenario how to clear vedor open items against customer open items. I have defined vedor is customer means I have given customer number in vendor master record, selected chek box 'clear with customer'.  Still problem is not solved, hence I am requesting you to help me in this regard.
    Thank you very much,
    Regards,
    Ganesh.

    Hi
    In FBCJ after payment you have clear manually vendor balance in F-44.
    If you want SPL GL in FBCJ then write a Substitution .
    1. step 001 - Special G/L Substitution
    2. Prerequisite - Transaction code = 'FBCJ'
    3. Substitution posting key -- Exit (need help from abap) exit name
                                              G/L Exit (need help from abap) exit name
                                              Special G/L Ind Exit (need help from abap) exit name
    you can't do this without ABAP help
    Best Of Luck
    Tanmoy

  • EBS: Automatic clearing of customer open items

    Hi Experts,
    I am setting up the electronic bank statement with format MT940 structured with field 86.  As part of the scope, business is requesting to ensure that customer open items gets cleared automatically when the bank statement is uploaded through transaction FF.5.  Because bank statement contains entries relating to payments by customers into the bank account.
    But here the problem is that customers will provided ONLY the name.  They do NOT provide either the invoice reference number (XBLNR) or our accounting document number (BELNR).
    I have searched a lot and found out that I can use the BAdI FIEB_CHANGE_BS_DATA to get the SAP customer number from the customer name given in Notes to Payee fields of MT940.  Kindly correct me if I am mistaken.
    Now from the derived customer number, I need to find out the related open items which match with the amount given in MT940.  So, how does the system know which open items can be cleared for the given amount.  Because the paid amount (by the customer) can be for an individual invoice or for a couple of invoices together.  Do I need to use the enhancement user exit FEB00001 to specify the system to use fields "Distribute by age" and "Automatic search" field in transaction F-32 ?
    Or is there any other better way of achieving this objective of automatic clearing of open items.  Asking our customers to provide the invoice reference number is not an alternative since it has already been tried a lot for long without any result.  So, business has requested for the set up in our system to ease this process of automatic clearing of open items.
    Thanks you so much for your time to help me on this.  I will be waiting for your kind responses.
    Regards,
    Sridhar

    Hi Experts,
    I got this resolved by using the enhancement FEB00001.  If the field "Distribute by age" is activated through this enhancement, then system will be able to match the paid amount and the combination of open items for automatic clearing.  If there is no exact match, then automatic clearing through FF.5 is not possible as indicated in SAP Note 124655.
    There is no more necessity to use BAdI FIEB_CHANGE_BS_DATA.  Complete relevant logic can be maintained directly in the enhancement itself.
    Have a nice day.
    Regards,
    Sridhar

Maybe you are looking for

  • How to read Excel file in java

    Respected sir/madam I want to read the values from Excel file in Java program. How can I do that. When I searched over the net I came to know that you can treat Excel file as a Database and write the code as u write for making DB connections . I did

  • I can't view my photo library after upgrading to version 9.1.3.. How do I fix?

    I recently updated my iphoto to verson 9.1.3. Now when I open up the application, it says "Your photo library will not be readable by previous versions of iPhoto after the upgrade." It then gives me a option to click upgrade. Once I click it, It says

  • User exit - VA01 - Adding new line items while Sales Order Creation

    Hi All , I have a requirement where : in VA01 , i have to add new line items using USER EXIT or BADI. The scenario is : we maintain Characteristics for Material. When we select a particular characteristics, Factor and length will be displayed in a Po

  • Tricky query needing clever SQL...

    A table called alt_websearch_log records the time it takes to complete each search performed on a website. I am therefore able to write something like this: select to_char(search_date,'DD/MON/YYYY'), count(*), avg(searchtime_secs), max(searchtime_sec

  • How to install oracle10g in opensuse11.0(LUNIX)

    How to install oracle10g in opensuse 11(lunix) operating system.if Anybody have concerned information or steps then Please mail me the steps or write the answer?