Automatic Clearing & Electronic Bank Statement

Hi,
During EBS processing, open items are automatically being cleared but only based on amounts. I've configure in OB74 that criteria for clearing should be amount & value date.  It seems that EBS does not read the settings in OB74? Where is the correct path to set this up?
Does EBS really allows upload of bank statement even if ending and beginning balance are not equal? Is there a way to control this?
Thanks,
Chaikaru

Hi Chaikaru,
OB74 is not the path for EBP processing. OB74 is used for account clearing in F.13 or F13E.
You need to go to the path:-
SPRO > Financial Accounting (New) > Bank Accounting > Business Transactions > Payment Transactions > Electronic Bank Statement
You need to define interpretation algoritham. Please go through the below one:-
OSS Note 494777 - Customer enhancements in electronic bank statement
OSS Note 597428 - El.accnt statement: Customer-specific interpret.algorithms
OSS Note 549277 - FAQ: Electronic account statement
OSS Note 414233 - Accnt statement:customer-specific interpretation algorithms
Regards,
Gaurav

Similar Messages

  • Customer Clearing on Electronic Bank Statement

    Hi,
    I am facing a problem to clear the customer open items.
    Let me explain the situation.
    The is an invoice on the Customer Account. The entry is:
    Customer A/c    Dr.   100
    Sales A/c          Cr    100
    Now, I have received a bank statement, when I posted the receipt. When I posted electronic bank statement, the entry the system is going to post is:
    Bank Main Account Dr. 100
    Bank Sub Account Cr. 100
    There is still a debit lying in the Customer and there is a credit lying in the Bank Sub Account. How can I clear these two accounts with each other.
    Any valid inputs will be highly appreciated.
    Thanks in advance.
    Regards,
    Ravi

    Why post to the clearing account? You can directly post to the customer account.
    Debit Bank
    Credit customer
    For this you have to create a posting rule which will be linked to the external code (BAI code if you are getting the bank statement in BAI format) and the posting rule should have 'standard algorithm' assigned to it.
    Then while uploading the bank statement you have to give the range of customer invoice numbers against BELNR or XBELNR. The system will automatically identify the customer based on the invoice number on Record type 16 appearing in Bank statement and clear the open item and generate the above accounting entry.
    For a detailed description of how the EBS works, please see the thread titled EBS posted by Sheena Mehta and answered by me.

  • Electronic bank statement customer payment and invoice(s) clearing

    Hi there,
    I am configuring electronic bank statements and wanting to "increase the hit rate" of automatic clearing. For this, I have configured postings, posting rules, etc. and I am testing on a bank statement we receive from the bank (this is ABN Amro in Germany) and all works fine. I see it with FEBA and the line items are posted to GL ok. I then configured the define search string for electronic statements to search in the note to payee our invoice numbers, which also are our document numbers, that the customers pay. I linked the search string use to algo 20 Document number search. I also changed the external transaction type assignment so that the appropriate posting rule refers to algo 20 too. When I use the simulation prog FEBSTS, it shows me all the documents found in the note to payee of all the items, and displays the document numbers found that match the note to payee for the few cases I have set-up for testing. All this look to me very good.
    My question is as follows. Despite the above, when I get to FEBA to post/clear the posting area 2 of the matching cases, SAP links to FB05 and asks me to select line items first of all, expecting that I enter either the customer id, or the document numbers. I don't understand this, and I don't understand why it does not get automatically to the matched documents and clear them automatically. I very probably am missing something, but I don't know what and I am somwhat stuck.
    I would very much appreciate some hints as to what to do to make this work.
    I thank you in advance.
    Jean
    PS. We are running SAPKH47025
    Message was edited by:
            Jean Weyrich

    Thks Ramesh for the hint but this did not change, although I changed this table so that it looks for BELNR only for all account type D.
    When I hit save on the FEBA_bank statement line item to clear (in Posting Area 2)SAP brings me to the FB05 screen asking for either customer id or document no (invoice). If I feed this then it would clear the invoices I have prepared. What I would like is that SAP finds out these invoices by itself using the search I have configured which seems to work ok from the simulation transaction FEBSTS. Well when I say it works ok, this is because I see the invoice numbers that have been mapped, have been found. I also see in the Cat column the field BELNR, I see however that the column Partner remains empty (should that be filled with the customer number ?), and lastly I see that the last column Partner Type is a D for customer which looks OK.
    If by any chance you have another path to drive me that would be great. Many thks

  • Statistics on automatic processed payments by the electronic bank statement

    Hi fellow sap knowledge hungering colleagues.
    I have set up the EBS application in my company and it has now run for 4 month with ok success.
    I now have to do a follow-up on the project and therefore I'm interested in seeing how many payments have been automatic processed by the EBS application.
    I cant seem to find any characteristics on the payment documents that separates the ones that have been automatically processed and those that have been post processed in the FEBA transaction. When each statement is imported you get a sum up on how many pay-ments where automatically processed but is it possible to see overall statistics for all the statements and if not is it possible to recall the statistics for each imported statement?

    Hi,
    the bank normally includes the details provided by the customer in the bank statement.
    depending upon the information provided, the user can clear the customer line items. In order to auto clear using EBS, you can use enhancement FEB00001. You can have your logic to auto clear.
    also refer the Note 494777 - Customer enhancements in electronic bank statement.
    Thanks

  • Automatic Import of Electronic Bank Statements (EBS)

    Hi SAP Gurus,
    We want to solve the following issue:
    Daily we receive multiple Electronic Bank Statements by means of banking Communication Software (BCS).
    Those EBS files are stored on our SAP Application Server, filetype = SWIFT MT940 format,
    and the file name contains a date and time stamp.
    File name example: MT940.90910077527_20101124_210421_167660
    Currently the import of these EBS-files is done manually via transaction FF_5 (program: RFEBKA00).
    We want to automate this import process.
    Every time a new EBS-files arrives (in a specific directory) on the application sever
    a signal (including the filename) should be send to SAP, so SAP knows there is a new EBS-file available for import.
    SAP now runs program RFEBKA00, with the provide filename, in the background.  
    Any ideas how to do this?
    Some tech. info:
    Windows Server 2003 R2 SP2 64-bit
    Oracle 10.2.0.4
    SAP R/3 Enterprise 47x200  
    Thanks,
    Roger Vanaubel

    Hi
    I think there are several ways to do it. In our case, we have a program which concatenates all received files into a single file and which launches RFEBKA00. It runs at fixed time, outside the working hours of accounting clerks. It is possible to trigger the program at file receipt, but there are problems if somebody is working in FEBA at the same time RFEBKA00 is working on the same bank account: then RFEBKA00 stops without doing all postings.
    If you trigger RFEBKA00 at file receipt, you may have several jobs running in parallel, and if 2 bank statements received in separate files are for the same account, you will have the same problem.

  • BAI file clearing cheque outgoing sub account - Electronic Bank Statement

    Hi,
    I am facing problem with clearing the cheque when uploaded bank statement through FF_5 (electronic)
    If I use the following file, there is no problem in clearing the cheque (this prepared by me for test purpose)
    01,EBSTest,EBSTest,101005,0944,1,99,99,2,,,,,,,/
    02,EBSTest,609242,1,101005,0944,GBP,,,,,,,,,/
    03,0077503702,GBP,010,200000,,,015-100000,,,045-100000,,,/
    16,475,100000,Z,,,Check #150000,,,,,,,,,/
    49,100000,99,,,,,,,,,,,,,/
    98,100000,1,99,,,,,,,,,,,,/
    99,100000,1,99,,,,,,,,,,,,/
    The following is the real file (where it is failing to recognise the cheque number)
    16,475,52378,0,GB84197,0000000027827/
    88,YOUR REF=027827,CHECK NO=00027827,REMARK=RPS BATCH 26390434 027827 SECTION 1
    88, ITEMS 027827
    I tested interpretation algorithms 11 and 13, but still not use.
    Can you please tell how can I clear the items in sub account (cheque outgoing account) based on the cheque number when I upload the bank statement.
    Any valid suggestions will be highly apprecicated.
    Regards,
    Ravi

    Thank you very much for your answer.
    I tested with leading exactly same as FCHN but still somehow it is not working. Changing the electronic bank statement manually may not be possible due to security concern. They the bank statement is week and it has high volume of entries.

  • Electronic Bank statement

    Hi,
    We are planning to use F110 transaction to generate the automatic payment advice(with payment orders) and it will be sent to Bank.Once the payment is made,I understand that the Bank will send the electronic Bank statement based on which we can clear  the vendor open items.We like to simulate the clearing process based on the electronic Bank statement.
    Can any of the forum members provide a sample electronic bank statement.It will help us is understanding the clearing process.
    Thanks in millions,
    Leo

    hi
    i have seen your posting at forum in service.sap.com REGARDING ELECTRONIC BANK RECONCILATION.
    In the reply you made regarding EBR you have mentioned about two options for f110. Actually our banker requires a unique identifier for eact electronic transaction. i have configured DME and getting text file for each APP run. however i was wondering how clearing will be done while receiving advice at day end and statement at month end.
    Your reply seems to match my comapanies scenario however you are requested to more clarify about your forum reply.
    what is option no. 2
    2- Close Vendor and post to an Out of balance sheet account. When receiving bank statement you have to post to this Out of balance sheet account(which is then closed) and bank account. In this way you have a clear picture for your bank accounts.
    How setting of this is done. R u talking about payment order.
    what is account gour of Out of balance sheet account.
    what is entry passed when you do app run.
    what is the way to do bank recon and payment advice upload.
    thanks
    s ap

  • Customer enhancements in electronic bank statement

    Hello Guys,
    I have the following requirement for electronic Bank statement regarding customer incoming payments operations:
    I need to clear Customer open items based on the bank data: the system should find the customer code based on his bank account number and clear the open items for this customer based on the amount and other text elements.
    Do you know if I can use an existing function module or program to do so?
    Thank you in advance for your help
    Best regards
    Pascal.

    Why post to the clearing account? You can directly post to the customer account.
    Debit Bank
    Credit customer
    For this you have to create a posting rule which will be linked to the external code (BAI code if you are getting the bank statement in BAI format) and the posting rule should have 'standard algorithm' assigned to it.
    Then while uploading the bank statement you have to give the range of customer invoice numbers against BELNR or XBELNR. The system will automatically identify the customer based on the invoice number on Record type 16 appearing in Bank statement and clear the open item and generate the above accounting entry.
    For a detailed description of how the EBS works, please see the thread titled EBS posted by Sheena Mehta and answered by me.

  • Electronic bank statement in Foreign Currency

    Hi,
    We have set up the system so as to create a payment order when automatic payment program is run. Now, we have a scenario, where house bank is in local currency - SEK. This is used to pay the invoices in foreign currencies USD, DKK etc using automatic payment program. The electronic bank statement  we receive from the bank has transactions in different currencies. We convert this  to multicash format using DME engine, mapping the amounts in local currency to the statement and item file.
    When  try to clear the invocies by importing this multicash statement, following error message is generated.
    Message no. F5794 i.e. XXX  is not a payment order for currency XXX. Correction required.
    Any ponters to solve the issue.
    Appreciate the help in this regard!
    Thanks
    /Vartika

    Hi Narasimhulu,
    Thanks for your reply.
    The thing is, payment orders are in a foreign currencies - USD , EUR etc. The clearing account is in local currency SEK. The bank statement has amounts both in order currency as well as local currency for every order. But when we are clearing using multicash, we are trying to pass the amounts in local currencies for each order. This is because,  as far as i understand, it is the currency in multicash statement file that is used for clearing . And there can be only one record in  multicash statement file. So we have to use the local currency for clearing.
    EBS:
    1  Payment order 1 - 1000 USD = 7000 SEK
    2  Payment order 2 -2000 EUR = 18000 SEK
    Multicah Statement File :
    25000 SEK
    Multicash Item File :
    Payment order 1 -   7000 SEK
    Payment order 2 -  18000 SEK
    Or is there any other way of handling it ?
    Many thanks again!
    Regards,
    Vartika

  • Error in Electronic bank statement

    Hi Guys,
    am trying to do Electronic bank statement, statement is generating but automatic clearing with GL (Main Bank and Bank clearing account) is not happening.
    T.code: FEBAN
    error shown under this transaction... i did not get any error log...how do i rectify this error...
    but under this t.code, i can able to post the line item by manual entry but its not happening automatically
    could anybody tell me how to rectify this error
    Thanks in advance
    Regards
    Elan

    HI Elan,
    If the documents are not posted through Bank Statement processing then the same document items is shown in the text of  "Elec. Posting Incomplete" . After you double clicking the same then you get the list of documents which shown the status of Entered instead of Posted. that means the documents are not posted into the system.
    For posting those incomplete documents you may reprocess the bank statement through the t.code FEBAN.
    You have to enter the details of the Co.code, House Bank, Acct ID, Stmt No and stmt date etc and then press execute button to get the entered statement to do the reprocess.
    Select one of the red colour openitem , goto the select items in the menubar and then click on post.. If you have multiple items which are in red colour then also you have to post all the line items by selecting each and every item. There is no option option to post all at the same time.
    Hope it will rectifies your problem..
    Thanks

  • Electronic bank statement config- account determination

    Hi,
    I want to post the following entry through electronic bank statement upload.
    Bank Main GL account DR
    TO Bank collection clearing account(Sub account)
    In the posting rule I have given debit posting key& account symbol for main account posting. But credit side i did not give posting key and account symbol. I have selected the option Clear credit GL account.
    However system is not picking credit GL account automatically eventhough algaritham is matching to clear automatically.
    Some peoples in team  are advising to add House bank and account ID fields in the create/bank/interest tab of Collection clearing account GL. Some other experts are advising to maintain credit side  posting key & account symbol also in the posting rule itself.
    Please let us know what should be done to propose credit GL and clear automatically by the system .
    Regards,
    Seetha  Ramaiah
    91-8978977978

    In the posting rule, you need to maintain an account symbol for the credit side.  Since you have selected the clear credit GL account option, you need to leave the posting key blank on the credit site.
    Regards,
    Shannon

  • GL account issue with Electronic Bank Statement

    Hi Gurus,
    I need your help and advice with the following issue. We are using ECC 6.0 and have implemented electronic bank statement. It is working fine but we havea new requirements.
    Presently all the incoming ACH (ACH in) are being posted to one GL account set- up for such payments +++++++++1. Going forward, we want to post customer incoming ACH payments to seperate GL account and all the other incoming ACH's should keep on posted to the old account +++++++++1. I do not have exposure to configuring EBS and not sure how should I configure this.
    I would really apreciate if you can guide me with step by step details to do this set-up.
    Thanks,
    Best Regards,
    Shalu

    Usually ACH in or outgoing, the corresponding bank will send you a code.
    so once you get into the config item for EBS
    1. you create account symbols( ACHPAY and ACHPAY2) and assign accounts (++++1 and a debit account ++++2) respectively
    2. Create posting keys, usually this is mimicked with a Z attached to the bank code for ACH payments (EX: 675 is the BAI code for ACH, create a posting key with Z675)
    3. create rules for the same posting keys like debit and credit account symbols, doc types, what kind of postings it should post( clearing entry or posting to GL)
    4. Create a transaction type and in the following step create external transaction types (usually bank BAI codes) and map them to posting rules and the processing types
    5. finally map bank accounts to transaction types

  • Electronic Bank Statement (EBS)

    Hi All,
    My Client is implemented Electronic Bank Statement using BAI format.
    GL Accounts set up is wrong (all bank accounts should be clearing type accounts (Open Item managed, except Operating Account (Main bank account))),but these accounts are not set up as open item management.
    How can I handle this issue and is it possible to create new accounts or any other alternative solution? Any help is appreciated.
    I will assign points.
    Thanks,
    Rau

    HI
    Before executing the programe RFSEPA02 ask your ABAP person to convert the programe to Zprograme as below so that this problem will solve you
    *ZFI_OPEN_ITEM_MANAGE-TO APPLY OPEN ITEM MANAGE TICK
    *& Report  ZFI_OPEN_ITEM_MANAGE
    REPORT  ZFI_OPEN_ITEM_MANAGE MESSAGE-ID FH LINE-SIZE 80.
    THIS IS NOT A STANDARD PROGRAM.
    IT IS ONLY INCLUDED FOR CONVENIENCE IN CASE IT WILL BE NEEDED.
    ONLY USE IT AFTER CONSULTING WITH SAP. S6DK909852
    *REPORT RFSEPA02 MESSAGE-ID FH LINE-SIZE 80.
    INCLUDE FSACHCDF.
    INCLUDE FSACHCDV.
    TABLES: BSIS,
            BSAS,
            BSEG,
            BKPF,
            GLT0,
            T001.
    DATA: BEGIN OF T_BSXX OCCURS 100.
            INCLUDE STRUCTURE BSIS.
    DATA: END OF T_BSXX.
    DATA: BEGIN OF T_LISTE OCCURS 300,
            GJAHR    LIKE BKPF-GJAHR,
            BELNR    LIKE BKPF-BELNR,
            SORT     TYPE I,
            TABLE(4) TYPE C,
            TYPE     TYPE C,
            OK       TYPE C,
          END OF T_LISTE.
    DATA: D_MAX         LIKE SY-TFILL VALUE '100',
          D_BELNR       LIKE BSEG-BELNR,
        D_TFILL       LIKE SY-TFILL.        "<<<< DELETE - NOTE 70203
          D_TFILL       LIKE SY-TFILL,     "<<<< INSERT - NOTE 70203
          D_STORNO      TYPE C.            "<<<< INSERT - NOTE 70203
    DATA: BALANCE_ITEMS   LIKE GLT0-HSL01,
          BALANCE_ACCOUNT LIKE GLT0-HSL01.
    *>>>> BEGIN OF INSERTION - NOTE 66156 <<<<
    DATA: XGLEDTAB LIKE GLEDTAB OCCURS 1 WITH HEADER LINE.
    DATA: BEGIN OF BK_METHODE,
            HWAE1 LIKE T001-WAERS,
            HWAE2 LIKE T001-WAERS,
            HWAE3 LIKE T001-WAERS,
            CURT1 LIKE X001-CURT2,
            CURT2 LIKE X001-CURT2,
            CURT3 LIKE X001-CURT2,
          END OF BK_METHODE.
    DATA: BEGIN OF T_BALANCE_ITEMS_HW OCCURS 1,
            WAERS1 LIKE T001-WAERS,
            VALUE1 LIKE GLT0-HSLVT,
            WAERS2 LIKE T001-WAERS,
            VALUE2 LIKE GLT0-HSLVT,
            WAERS3 LIKE T001-WAERS,
            VALUE3 LIKE GLT0-HSLVT,
          END OF T_BALANCE_ITEMS_HW.
    DATA: BEGIN OF T_BALANCE_ACCOUNT_HW OCCURS 1,
            WAERS1 LIKE T001-WAERS,
            VALUE1 LIKE GLT0-HSLVT,
            WAERS2 LIKE T001-WAERS,
            VALUE2 LIKE GLT0-HSLVT,
            WAERS3 LIKE T001-WAERS,
            VALUE3 LIKE GLT0-HSLVT,
          END OF T_BALANCE_ACCOUNT_HW.
    DATA: BEGIN OF T_BALANCE_ITEMS_TW OCCURS 1,
            WAERS LIKE GLT0-RTCUR,
            VALUE LIKE GLT0-TSLVT,
          END OF T_BALANCE_ITEMS_TW.
    DATA: BEGIN OF T_BALANCE_ACCOUNT_TW OCCURS 10,
            WAERS LIKE GLT0-RTCUR,
            VALUE LIKE GLT0-TSLVT,
          END OF T_BALANCE_ACCOUNT_TW.
    *>>>> END OF INSERTION - NOTE 66156 <<<<
    DATA: NUM_BSEG_SELECT LIKE SY-TFILL,
          NUM_BSEG_UPDATE LIKE SY-TFILL,
          NUM_BSIS_INSERT LIKE SY-TFILL,
          NUM_BSIS_SELECT LIKE SY-TFILL,
          NUM_BSIS_UPDATE LIKE SY-TFILL,
          NUM_BSAS_INSERT LIKE SY-TFILL,
          NUM_BSAS_SELECT LIKE SY-TFILL,
          NUM_BSAS_UPDATE LIKE SY-TFILL.
    CONSTANTS: CHAR_I     TYPE C VALUE 'I',
               CHAR_S     TYPE C VALUE 'S',
               CHAR_U     TYPE C VALUE 'U'.
    *PARAMETER:     P_BUKRS  LIKE BSEG-BUKRS OBLIGATORY.
                                           "<<<< DELETE NOTE - 62751
    *PARAMETER:     P_SAKNR  LIKE BSEG-HKONT OBLIGATORY.
                                           "<<<< DELETE NOTE - 62751
    *>>>> BEGIN OF INSERTION - NOTE 62751 <<<<
    PARAMETERS:     P_BUKRS  LIKE BKPF-BUKRS OBLIGATORY.
    PARAMETERS:     P_SAKNR  LIKE SKA1-SAKNR OBLIGATORY
                                      MATCHCODE OBJECT SAKO.
    *>>>> END OF INSERTION - NOTE 62751 <<<<
    SELECT-OPTIONS P_BELNR  FOR  BSEG-BELNR.
    SELECTION-SCREEN SKIP 1.
    SELECTION-SCREEN BEGIN OF BLOCK B01 WITH FRAME TITLE TEXT-B01.
    PARAMETERS:    P_LISTE  AS CHECKBOX DEFAULT 'X'.    " list protocol on
    SELECTION-SCREEN END OF BLOCK B01.
    INITIALIZATION.
      CALL FUNCTION 'POPUP_DISPLAY_TEXT'
           EXPORTING
                POPUP_TITLE    = ' '
                TEXT_OBJECT    = 'RFSEPA02'
           EXCEPTIONS
                TEXT_NOT_FOUND = 1
                OTHERS         = 2.
    *{   DELETE         DMUK903910                                        1
    LEAVE PROGRAM.
    *}   DELETE
    AT SELECTION-SCREEN ON P_SAKNR.
      PERFORM CHECK_ACCOUNT.               " locked for posting?
      PERFORM CHECK_ACCOUNT2.              "<<<< INSERT - NOTE 66156
    PERFORM ENQUEUE_ACCOUNT.             "<<<< DELETE - NOTE 65191
    START-OF-SELECTION.
      PERFORM ENQUEUE_ACCOUNT.             "<<<< INSERT - NOTE 65191
      PERFORM CHECK_AUTHORITY_SKA1_BUK.
      PERFORM CHECK_AUTHORITY_SKA1_BES.
    PERFORM CHECK_ACCOUNT_BALANCE.       "<<<< DELETE - NOTE 66156
      PERFORM CHECK_ACCOUNT_BALANCE_2.     "<<<< INSERT - NOTE 66156
    *--- BSIS -
      CLEAR D_BELNR.
      CLEAR T_LISTE. REFRESH T_LISTE.
      CLEAR T_BSXX.  REFRESH T_BSXX.
      DO.
        PERFORM SELECT_ITEMS USING 'BSIS' D_TFILL.
        IF D_TFILL EQ 0.
          EXIT.
        ENDIF.
        LOOP AT T_BSXX.
          PERFORM BKPF_UPDATE.             "<<<< INSERT - NOTE 70203
          PERFORM BSEG_UPDATE.
          PERFORM BSXX_UPDATE USING 'BSIS'.
        ENDLOOP.
        PERFORM WRITE_LIST_PROTOCOL.
        COMMIT WORK.
      ENDDO.
    *--- BSAS -
      CLEAR D_BELNR.
      CLEAR T_LISTE. REFRESH T_LISTE.
      CLEAR T_BSXX.  REFRESH T_BSXX.
      DO.
        PERFORM SELECT_ITEMS USING 'BSAS' SY-TFILL.
        IF SY-TFILL EQ 0.
          EXIT.
        ENDIF.
        LOOP AT T_BSXX.
          PERFORM BSEG_UPDATE.
          PERFORM BSXX_UPDATE USING 'BSAS'.
        ENDLOOP.
        PERFORM WRITE_LIST_PROTOCOL.
        COMMIT WORK.
      ENDDO.
      PERFORM WRITE_PROTOCOL.
    END-OF-SELECTION.
      PERFORM CHANGE_ACCOUNT.
      PERFORM DEQUEUE_ACCOUNT.
    TOP-OF-PAGE.
      ULINE.
      WRITE:/   SY-VLINE,
             2  TEXT-001,
             25 P_SAKNR INTENSIFIED OFF,
             80 SY-VLINE.
      WRITE:/   SY-VLINE,
             2  TEXT-002,
             25 P_BUKRS INTENSIFIED OFF,
             80 SY-VLINE.
      ULINE.
      IF P_LISTE = 'X'.
        WRITE:/          SY-VLINE,
                  2(10)  TEXT-S01 COLOR COL_HEADING,
                  12     SY-VLINE,
                  13(4)  TEXT-S02 COLOR COL_HEADING,
                  17     SY-VLINE,
                  18(62) TEXT-S03 COLOR COL_HEADING,
                  80     SY-VLINE.
      ENDIF.
    *&      Form  SELECT_ITEMS
    FORM SELECT_ITEMS USING TABLE TYPE C
                            FILL  LIKE SY-TFILL.
      SELECT * FROM (TABLE) INTO TABLE T_BSXX
                            UP TO D_MAX ROWS
                           WHERE BUKRS EQ P_BUKRS
                             AND HKONT EQ P_SAKNR
                             AND BELNR IN P_BELNR
                             AND XOPVW EQ SPACE.
      FILL = SY-DBCNT.
    *--- PROTOCOL -
      LOOP AT T_BSXX.
        PERFORM SAVE_PROTOCOL USING T_BSXX-BELNR T_BSXX-GJAHR
                                    1 TABLE CHAR_S 1.
      ENDLOOP.
      SORT T_BSXX BY MANDT BUKRS BELNR GJAHR.
    ENDFORM.                               " SELECT_ITEMS
    *&      Form  BSEG_UPDATE
    FORM BSEG_UPDATE.
      SELECT SINGLE * FROM BSEG WHERE BUKRS = T_BSXX-BUKRS
                                AND   GJAHR = T_BSXX-GJAHR
                                AND   BELNR = T_BSXX-BELNR
                                AND   BUZEI = T_BSXX-BUZEI.
      IF BSEG-KTOSL = 'MVA' OR BSEG-KTOSL = 'VVA'.
        MESSAGE A145(FH) WITH BSEG-HKONT.
      ENDIF.
      IF BSEG-KOART = 'M'.
        MESSAGE A144(FH) WITH P_SAKNR BSEG-BSCHL.
      ENDIF.
      UPDATE BSEG SET XOPVW = 'X'
                WHERE BUKRS EQ T_BSXX-BUKRS
                  AND GJAHR EQ T_BSXX-GJAHR
                  AND BELNR EQ T_BSXX-BELNR
                  AND BUZEI EQ T_BSXX-BUZEI.
    *--- PROTOCOL -
      PERFORM SAVE_PROTOCOL USING T_BSXX-BELNR T_BSXX-GJAHR
                                  2 'BSEG' CHAR_U SY-DBCNT.
    ENDFORM.                               " BSEG_UPDATE
    *&      Form  BSIS_UPDATE
    FORM BSXX_UPDATE USING TABLE TYPE C.
      T_BSXX-XOPVW = 'X'.
      IF D_STORNO = 'X' AND TABLE = 'BSIS'."<<<< INSERT - NOTE 70203
        T_BSXX-XSTOV = SPACE.              "<<<< INSERT - NOTE 70203
      ENDIF.                               "<<<< INSERT - NOTE 70203
      UPDATE (TABLE) FROM T_BSXX.
    *--- PROTOCOL -
      PERFORM SAVE_PROTOCOL USING T_BSXX-BELNR T_BSXX-GJAHR
                                  1 TABLE CHAR_U SY-DBCNT.
    ENDFORM.                               " BSIS_UPDATE
    *&      Form  CHECK_ACCOUNT_BALANCE
    FORM CHECK_ACCOUNT_BALANCE.
      DATA:   D_GJAHR LIKE BSEG-GJAHR.
    Account balance
      PERFORM READ_T001 USING P_BUKRS.
      PERFORM READ_CURRENT_YEAR CHANGING D_GJAHR.
      PERFORM READ_GLDB USING P_BUKRS P_SAKNR D_GJAHR.
      PERFORM READ_BSIS USING P_BUKRS P_SAKNR.
      IF BALANCE_ITEMS NE BALANCE_ACCOUNT.
        MESSAGE E099.
      Summe der Einzelposten stimmt nicht mit Kontensaldo überein. ->
      ENDIF.
    ENDFORM.                               " CHECK_ACCOUNT_BALANCE
    *&      Form  READ_T001
    FORM READ_T001 USING BUKRS LIKE T001-BUKRS.
      SELECT SINGLE * FROM T001 WHERE BUKRS = BUKRS.
      IF SY-SUBRC <> 0.
        MESSAGE E001 WITH BUKRS.
      ENDIF.
    ENDFORM.                               " READ_T001
    *&      Form  READ_CURRENT_YEAR
    FORM READ_CURRENT_YEAR CHANGING GJAHR LIKE T009B-BDATJ.
      CALL FUNCTION 'DATE_TO_PERIOD_CONVERT'
           EXPORTING
                I_DATE         = SY-DATUM
                I_PERIV        = T001-PERIV
           IMPORTING
                E_GJAHR        = GJAHR
           EXCEPTIONS
                T009_NOTFOUND  = 1
                INPUT_FALSE    = 1
                T009B_NOTFOUND = 1.
    ENDFORM.                               " READ_CURRENT_YEAR
    *&      Form  READ_GLDB
    FORM READ_GLDB USING XBUKRS LIKE GLT0-BUKRS
                         XSAKNR LIKE GLT0-RACCT
                         XGJAHR LIKE GLT0-RYEAR.
      SELECT * FROM GLT0
               WHERE RLDNR = '00'
               AND   RRCTY = '0'
               AND   RVERS = '001'
               AND   BUKRS = XBUKRS
               AND   RYEAR = XGJAHR
               AND   RACCT = XSAKNR.
        PERFORM CALCULATE_BALANCE.
      ENDSELECT.
    ENDFORM.                               " READ_GLDB
          FORM CALCULATE_BALANCE                                        *
    FORM CALCULATE_BALANCE.
      DATA: BALANCE  LIKE GLT0-TSL01.
      BALANCE_ACCOUNT = BALANCE_ACCOUNT + GLT0-HSLVT.
      DO GLT0-RPMAX TIMES
         VARYING BALANCE FROM GLT0-HSL01 NEXT GLT0-HSL02.
        BALANCE_ACCOUNT = BALANCE_ACCOUNT + BALANCE.
      ENDDO.
    ENDFORM.                               " CALCULATE_BALANCE
    *&      Form  READ_BSIS
    FORM READ_BSIS USING BUKRS LIKE BSIS-BUKRS
                         SAKNR LIKE BSIS-HKONT.
      SELECT * FROM  BSIS
             WHERE  BUKRS = BUKRS
             AND    HKONT = SAKNR.
        IF BSIS-SHKZG = 'S'.
          BALANCE_ITEMS = BALANCE_ITEMS  + BSIS-DMBTR.
        ELSE.
          BALANCE_ITEMS = BALANCE_ITEMS  - BSIS-DMBTR.
        ENDIF.
      ENDSELECT.
    ENDFORM.                               " READ_BSIS
    *&      Form  CHANGE_ACCOUNT
    FORM CHANGE_ACCOUNT.
      SKB1       = *SKB1.
      SKB1-XOPVW = 'X'.
      OBJECTID    = T001-KTOPL.
      OBJECTID+4  = SKB1-SAKNR.
      OBJECTID+14 = SKB1-BUKRS.
      UPD_SKB1    = 'U'.
      UTIME       = SY-UZEIT.
      UDATE       = SY-DATUM.
      USERNAME    = SY-UNAME.
      PERFORM CD_CALL_SACH.
      CALL FUNCTION 'GL_ACCOUNT_IN_COMPANY_UPDATE'
           EXPORTING
                I_SKB1 = SKB1.
      COMMIT WORK.
    ENDFORM.                               " CHANGE_ACCOUNT
    *&      Form  ENQUEUE_ACCOUNT
    FORM ENQUEUE_ACCOUNT.
      CALL FUNCTION 'ENQUEUE_EFSKB1'
           EXPORTING
                BUKRS          = P_BUKRS
                SAKNR          = P_SAKNR
           EXCEPTIONS
                FOREIGN_LOCK   = 1
                SYSTEM_FAILURE = 2.
      CASE SY-SUBRC.
        WHEN 1.
          MESSAGE E042 WITH P_SAKNR P_BUKRS.
        WHEN 2.
          MESSAGE E038 WITH P_SAKNR P_BUKRS.
      ENDCASE.
    ENDFORM.                               " ENQUEUE_ACCOUNT
    *&      Form  DEQUEUE_ACCOUNT
    FORM DEQUEUE_ACCOUNT.
      CALL FUNCTION 'DEQUEUE_EFSKB1'
           EXPORTING
                BUKRS          = P_BUKRS
                SAKNR          = P_SAKNR
           EXCEPTIONS
                SYSTEM_FAILURE = 1.
    ENDFORM.                               " DEQUEUE_ACCOUNT
          FORM WRITE_LIST_PROTOCOL                                      *
          writes list protocol                                          *
    FORM WRITE_LIST_PROTOCOL.
      DATA: TEXT(62)   TYPE C,
            SAVE_BELNR LIKE BKPF-BELNR.
      DESCRIBE TABLE T_LISTE LINES SY-TFILL.
      CHECK P_LISTE = 'X'.
      CHECK SY-TFILL > 0.
      SORT T_LISTE BY GJAHR BELNR SORT TYPE.
      LOOP AT T_LISTE.
        CHECK T_LISTE-OK = 1.
        CASE T_LISTE-TABLE.
          WHEN 'BSEG'.
            CASE T_LISTE-TYPE.
              WHEN CHAR_S.
                TEXT = TEXT-BE1.
              WHEN CHAR_U.
                TEXT = TEXT-BE2.
            ENDCASE.
          WHEN 'BSIS'.
            CASE T_LISTE-TYPE.
              WHEN CHAR_S.
                TEXT = TEXT-XX1.
                REPLACE '&TAB' WITH T_LISTE-TABLE INTO TEXT.
              WHEN CHAR_U.
                TEXT = TEXT-XX2.
                REPLACE '&TAB' WITH T_LISTE-TABLE INTO TEXT.
              WHEN CHAR_I.
                TEXT = TEXT-XX3.
                REPLACE '&TAB' WITH T_LISTE-TABLE INTO TEXT.
            ENDCASE.
          WHEN 'BSAS'.
            CASE T_LISTE-TYPE.
              WHEN CHAR_S.
                TEXT = TEXT-XX1.
                REPLACE '&TAB' WITH T_LISTE-TABLE INTO TEXT.
              WHEN CHAR_U.
                TEXT = TEXT-XX2.
                REPLACE '&TAB' WITH T_LISTE-TABLE INTO TEXT.
              WHEN CHAR_I.
                TEXT = TEXT-XX3.
                REPLACE '&TAB' WITH T_LISTE-TABLE INTO TEXT.
            ENDCASE.
        ENDCASE.
        AT NEW BELNR.
          ULINE.
          WRITE:/       SY-VLINE,
                  2     T_LISTE-BELNR COLOR COL_KEY,
                  12    SY-VLINE,
                  13    T_LISTE-GJAHR COLOR COL_KEY,
                  17    SY-VLINE.
        ENDAT.
        IF SAVE_BELNR <> T_LISTE-BELNR.
          WRITE: 18(62) TEXT COLOR COL_NORMAL INTENSIFIED OFF,
                    80  SY-VLINE.
          SAVE_BELNR = T_LISTE-BELNR.
        ELSE.
          WRITE:/       SY-VLINE,
                 12     SY-VLINE,
                 17     SY-VLINE,
                 18(62) TEXT COLOR COL_NORMAL INTENSIFIED OFF,
                 80     SY-VLINE.
        ENDIF.
      ENDLOOP.
      ULINE.
    ENDFORM.                               " WRITE_LIST_PROTOCOL
          FORM WRITE_PROTOCOL                                           *
          writes normal protocol                                        *
    FORM WRITE_PROTOCOL.
      DATA: TEXT(62)   TYPE C.
    *- selected items-----
      IF NOT ( NUM_BSIS_SELECT = 0  ).
        TEXT = TEXT-NX1.
        REPLACE '&TAB' WITH 'BSIS' INTO TEXT.
        WRITE:/        SY-VLINE,
                2(58)  TEXT COLOR COL_KEY INTENSIFIED ON,
                60(1)  SY-VLINE,
                61(19) NUM_BSIS_SELECT COLOR COL_NORMAL INTENSIFIED OFF,
                80     SY-VLINE.
      ENDIF.
      IF NOT ( NUM_BSAS_SELECT = 0 ).
        TEXT = TEXT-NX1.
        REPLACE '&TAB' WITH 'BSAS' INTO TEXT.
        WRITE:/        SY-VLINE,
                2(58)  TEXT COLOR COL_KEY INTENSIFIED ON,
                60(1)  SY-VLINE,
                61(19) NUM_BSAS_SELECT COLOR COL_NORMAL INTENSIFIED OFF,
                80     SY-VLINE.
      ENDIF.
      IF NOT ( NUM_BSEG_SELECT = 0 ).
        WRITE:/       SY-VLINE,
                2(58) TEXT-NB1 COLOR COL_KEY INTENSIFIED ON,
                60(1)  SY-VLINE,
                61(19) NUM_BSEG_SELECT COLOR COL_NORMAL INTENSIFIED OFF,
                80     SY-VLINE.
      ENDIF.
    *- changed items-----
      IF NUM_BSIS_UPDATE > 0.
        TEXT = TEXT-NX2.
        REPLACE '&TAB' WITH 'BSIS' INTO TEXT.
        WRITE:/        SY-VLINE,
                 2(58) TEXT COLOR COL_KEY INTENSIFIED ON,
                60(1)  SY-VLINE,
                61(19) NUM_BSIS_UPDATE COLOR COL_NORMAL INTENSIFIED OFF,
                80     SY-VLINE.
      ENDIF.
      IF NUM_BSAS_UPDATE > 0.
        TEXT = TEXT-NX2.
        REPLACE '&TAB' WITH 'BSAS' INTO TEXT.
        WRITE:/        SY-VLINE,
                 2(58) TEXT COLOR COL_KEY INTENSIFIED ON,
                 60(1)  SY-VLINE,
                 61(19) NUM_BSAS_UPDATE COLOR COL_NORMAL INTENSIFIED OFF,
                 80     SY-VLINE.
      ENDIF.
      IF NUM_BSEG_UPDATE > 0.
        WRITE:/        SY-VLINE,
                 2(58) TEXT-NB2 COLOR COL_KEY INTENSIFIED ON,
                60(1)  SY-VLINE,
                61(19) NUM_BSEG_UPDATE COLOR COL_NORMAL INTENSIFIED OFF,
                80     SY-VLINE.
      ENDIF.
      ULINE.
      ADD NUM_BSIS_SELECT TO NUM_BSAS_SELECT.
      IF NUM_BSAS_SELECT = 0.
        ULINE.
        WRITE:/       SY-VLINE,
                2(78) TEXT-NSB COLOR COL_NEGATIVE,
                80    SY-VLINE.
        ULINE.
      ENDIF.
    ENDFORM.
    *>>>> BEGIN OF INSERTION - NOTE 66156
    *&      Form  CHECK_ACCOUNT_BALANCE_2
    FORM CHECK_ACCOUNT_BALANCE_2.
      DATA:   D_GJAHR LIKE BSEG-GJAHR.
    Account balance
      PERFORM READ_T001 USING P_BUKRS.
      PERFORM READ_CURRENT_YEAR CHANGING D_GJAHR.
      PERFORM READ_CURRENCY_T001A USING P_BUKRS.
    Transaktionswährung & Hauswährung
      PERFORM READ_GLDB_2 USING P_BUKRS P_SAKNR D_GJAHR.
      PERFORM READ_BSIS_2 USING P_BUKRS P_SAKNR.
    BEGIN OF INSERTION
      LOOP AT T_BALANCE_ITEMS_TW WHERE VALUE = 0.
        DELETE T_BALANCE_ITEMS_TW.
      ENDLOOP.
      LOOP AT T_BALANCE_ACCOUNT_TW WHERE VALUE = 0.
        DELETE T_BALANCE_ACCOUNT_TW.
      ENDLOOP.
      LOOP AT T_BALANCE_ITEMS_HW WHERE VALUE1 = 0
                                 AND   VALUE2 = 0
                                 AND   VALUE3 = 0.
        DELETE T_BALANCE_ITEMS_HW.
      ENDLOOP.
      LOOP AT T_BALANCE_ACCOUNT_HW WHERE VALUE1 = 0
                                   AND   VALUE2 = 0
                                   AND   VALUE3 = 0.
        DELETE T_BALANCE_ACCOUNT_HW.
      ENDLOOP.
    END OF INSERTION
      IF T_BALANCE_ITEMS_HW[] <> T_BALANCE_ACCOUNT_HW[] OR
         T_BALANCE_ITEMS_TW[] <> T_BALANCE_ACCOUNT_TW[].
        PERFORM DEQUEUE_ACCOUNT.
        MESSAGE E099.
      Summe der Einzelposten stimmt nicht mit Kontensaldo überein. ->
      ENDIF.
    ENDFORM.                               " CHECK_ACCOUNT_BALANCE_2
    *&      Form  READ_GLDB_2
    FORM READ_GLDB_2 USING XBUKRS LIKE GLT0-BUKRS
                           XSAKNR LIKE GLT0-RACCT
                           XGJAHR LIKE GLT0-RYEAR.
      DATA: TYPE(3) TYPE C,
            CURT    LIKE BK_METHODE-CURT1.
      DATA: RESULT LIKE T_BALANCE_ACCOUNT_TW OCCURS 1 WITH HEADER LINE.
      CLEAR T_BALANCE_ACCOUNT_TW.
      CLEAR T_BALANCE_ACCOUNT_HW.
    Transaktionswährung
      CLEAR RESULT. REFRESH RESULT.
      CLEAR XGLEDTAB. REFRESH XGLEDTAB.
      TYPE = 'TW'.
      XGLEDTAB-RLDNR      = '00'.
      APPEND XGLEDTAB.
      PERFORM READ_LEDGER TABLES RESULT XGLEDTAB
                                  USING XBUKRS XSAKNR XGJAHR TYPE.
      LOOP AT RESULT.
        T_BALANCE_ACCOUNT_TW-WAERS = RESULT-WAERS.
        T_BALANCE_ACCOUNT_TW-VALUE = RESULT-VALUE.
        APPEND T_BALANCE_ACCOUNT_TW.
      ENDLOOP.
    1. Hauswährung
      CLEAR RESULT. REFRESH RESULT.
      CLEAR XGLEDTAB. REFRESH XGLEDTAB.
      TYPE = 'HW1'.
      CURT = BK_METHODE-CURT1.
      XGLEDTAB-RLDNR      = '00'.
      APPEND XGLEDTAB.
      PERFORM READ_LEDGER TABLES RESULT XGLEDTAB
                                  USING XBUKRS XSAKNR XGJAHR TYPE.
      READ TABLE RESULT INDEX 1.
      T_BALANCE_ACCOUNT_HW-WAERS1 = RESULT-WAERS.
      T_BALANCE_ACCOUNT_HW-VALUE1 = RESULT-VALUE.
    *2. Hauswährung
      IF BK_METHODE-CURT2 <> SPACE.
        CLEAR RESULT. REFRESH RESULT.
        CLEAR XGLEDTAB. REFRESH XGLEDTAB.
        TYPE = 'HW2'.
        CURT = BK_METHODE-CURT2.
        IF CURT = '30'.
          XGLEDTAB-RLDNR      = '00'.
          XGLEDTAB-CURRNUMBER = '3'.
        ELSE.
          CALL FUNCTION 'G_GIVE_LEDGERS_FOR_GLT0'
               EXPORTING
                    BUKRS  = XBUKRS
                    CURTP  = CURT
               TABLES
                    LEDTAB = XGLEDTAB.
          DESCRIBE TABLE XGLEDTAB LINES SY-TFILL.
          IF SY-TFILL GT 1. SORT XGLEDTAB. ENDIF.
          READ TABLE XGLEDTAB INDEX 1.
        ENDIF.
        PERFORM READ_LEDGER TABLES RESULT XGLEDTAB
                                    USING XBUKRS XSAKNR XGJAHR TYPE.
        READ TABLE RESULT INDEX 1.
        T_BALANCE_ACCOUNT_HW-WAERS2 = RESULT-WAERS.
        T_BALANCE_ACCOUNT_HW-VALUE2 = RESULT-VALUE.
      ENDIF.
      IF BK_METHODE-CURT3 <> SPACE.
    *3. Hauswährung
        CLEAR RESULT. REFRESH RESULT.
        CLEAR XGLEDTAB. REFRESH XGLEDTAB.
        TYPE = 'HW3'.
        CURT = BK_METHODE-CURT3.
        IF CURT = '30'.
          XGLEDTAB-RLDNR      = '00'.
          XGLEDTAB-CURRNUMBER = '3'.
        ELSE.
          CALL FUNCTION 'G_GIVE_LEDGERS_FOR_GLT0'
               EXPORTING
                    BUKRS  = XBUKRS
                    CURTP  = CURT
               TABLES
                    LEDTAB = XGLEDTAB.
          DESCRIBE TABLE XGLEDTAB LINES SY-TFILL.
          IF SY-TFILL GT 1. SORT XGLEDTAB. ENDIF.
          READ TABLE XGLEDTAB INDEX 1.
        ENDIF.
        PERFORM READ_LEDGER TABLES RESULT XGLEDTAB
                             USING XBUKRS XSAKNR XGJAHR TYPE.
        READ TABLE RESULT INDEX 1.
        T_BALANCE_ACCOUNT_HW-WAERS3 = RESULT-WAERS.
        T_BALANCE_ACCOUNT_HW-VALUE3 = RESULT-VALUE.
      ENDIF.
      APPEND T_BALANCE_ACCOUNT_HW.
      SORT T_BALANCE_ACCOUNT_TW.
    ENDFORM.                               " READ_GLDB_2
    *&      Form  READ_BSIS_2
    FORM READ_BSIS_2 USING BUKRS LIKE BSIS-BUKRS
                           SAKNR LIKE BSIS-HKONT.
      CLEAR T_BALANCE_ITEMS_HW. REFRESH T_BALANCE_ITEMS_HW.
      CLEAR T_BALANCE_ITEMS_TW. REFRESH T_BALANCE_ITEMS_TW.
      SELECT * FROM  BSIS
             WHERE  BUKRS = BUKRS
             AND    HKONT = SAKNR.
        IF ( BSIS-PSWSL IS INITIAL OR BSIS-PSWBT IS INITIAL ) AND
             BSIS-XARCH NE 'X'.
          SELECT SINGLE * FROM BSEG WHERE BUKRS = BSIS-BUKRS
                                    AND   BELNR = BSIS-BELNR
                                    AND   GJAHR = BSIS-GJAHR
                                    AND   BUZEI = BSIS-BUZEI.
          IF SY-SUBRC <> 0.
            MESSAGE A500(FE) WITH 'BSEG nicht gefunden'.        "#EC NOTEXT
          ENDIF.
          BSIS-PSWSL = BSEG-PSWSL.
          BSIS-PSWBT = BSEG-PSWBT.
        ENDIF.
        IF BSIS-SHKZG = 'S'.
          T_BALANCE_ITEMS_HW-WAERS1 = BK_METHODE-HWAE1.
          T_BALANCE_ITEMS_HW-WAERS2 = BK_METHODE-HWAE2.
          T_BALANCE_ITEMS_HW-WAERS3 = BK_METHODE-HWAE3.
          T_BALANCE_ITEMS_HW-VALUE1 = BSIS-DMBTR.
          T_BALANCE_ITEMS_HW-VALUE2 = BSIS-DMBE2.
          T_BALANCE_ITEMS_HW-VALUE3 = BSIS-DMBE3.
          T_BALANCE_ITEMS_TW-WAERS  = BSIS-PSWSL.
          T_BALANCE_ITEMS_TW-VALUE  = BSIS-PSWBT.
        ELSE.
          T_BALANCE_ITEMS_HW-WAERS1 = BK_METHODE-HWAE1.
          T_BALANCE_ITEMS_HW-WAERS2 = BK_METHODE-HWAE2.
          T_BALANCE_ITEMS_HW-WAERS3 = BK_METHODE-HWAE3.
          T_BALANCE_ITEMS_HW-VALUE1 = - BSIS-DMBTR.
          T_BALANCE_ITEMS_HW-VALUE2 = - BSIS-DMBE2.
          T_BALANCE_ITEMS_HW-VALUE3 = - BSIS-DMBE3.
          T_BALANCE_ITEMS_TW-WAERS  = BSIS-PSWSL.
          T_BALANCE_ITEMS_TW-VALUE  = - BSIS-PSWBT.
        ENDIF.
        COLLECT T_BALANCE_ITEMS_HW.
        COLLECT T_BALANCE_ITEMS_TW.
      ENDSELECT.
      SORT T_BALANCE_ITEMS_TW.
    ENDFORM.                               " READ_BSIS_2
    *&      Form  CHECK_ACCOUNT2
          Check some things for XOPVW
    FORM CHECK_ACCOUNT2.
      TABLES: TBSL, T030.
      DATA: CHECK_BSCHL LIKE BSIS-BSCHL OCCURS 10 WITH HEADER LINE.
    Belege schon archiviert?
      SELECT * FROM BSIS WHERE BUKRS EQ P_BUKRS
                         AND   HKONT EQ P_SAKNR
                         AND   XARCH EQ 'X'.
        MESSAGE E146.
       Es sind schon Belege archiviert worden. Änderung ist nicht möglich
      ENDSELECT.
    Vorgangsschlüssel MVA und VVA sind nicht erlaubt.
      SELECT * FROM T030 WHERE KTOPL = T001-KTOPL
                          AND  ( KTOSL = 'MVA' OR KTOSL = 'VVA' ).
        IF T030-KONTS = P_SAKNR OR T030-KONTH = P_SAKNR.
          MESSAGE E145(FH) WITH P_SAKNR.
       Konto wird in Kontenfindung für Vorgang MVA oder VVA verwendet
        ENDIF.
      ENDSELECT.
    Buchungsschlüsseln dürfen nicht für KOART = M sein
      SELECT BSCHL INTO TABLE CHECK_BSCHL FROM BSIS
                                          WHERE BUKRS EQ P_BUKRS
                                          AND   HKONT EQ P_SAKNR.
      SORT CHECK_BSCHL.
      DELETE ADJACENT DUPLICATES FROM CHECK_BSCHL.
      LOOP AT CHECK_BSCHL.
        SELECT SINGLE KOART INTO TBSL-KOART FROM TBSL
                                            WHERE BSCHL = CHECK_BSCHL.
        IF SY-SUBRC NE 0.
          MESSAGE E143(FH) WITH CHECK_BSCHL.
         Verwendeter Buchungsschlüssel & ist nicht mehr in der Kontenfindu
        ELSEIF TBSL-KOART = 'M'.
          MESSAGE E144(FH) WITH P_SAKNR CHECK_BSCHL.
          Konto & kann nicht geändert werden -> Langtext
        ENDIF.
      ENDLOOP.
    ENDFORM.                               " CHECK_ACCOUNT2
    *>>>> END OF INSERTION - NOTE 66156 <<<<
    INCLUDE FSACHCDC.
    INCLUDE EPA00F00.
    *&      Form  READ_CURRENCY_T001A
    FORM READ_CURRENCY_T001A USING P_BUKRS LIKE T001-BUKRS.
      TABLES: X001.
      CALL FUNCTION 'FI_CURRENCY_INFORMATION'
           EXPORTING
                I_BUKRS                = P_BUKRS
           IMPORTING
                E_X001                 = X001
           EXCEPTIONS
                CURRENCY_2_NOT_DEFINED = 1
                CURRENCY_3_NOT_DEFINED = 2
                OTHERS                 = 6.
      BK_METHODE-HWAE1 = T001-WAERS.
      BK_METHODE-HWAE2 = X001-HWAE2.
      BK_METHODE-HWAE3 = X001-HWAE3.
      BK_METHODE-CURT1 = '10'.
      BK_METHODE-CURT2 = X001-CURT2.
      BK_METHODE-CURT3 = X001-CURT3.
    ENDFORM.                               " READ_CURRENCY_T001A
    *&      Form  READ_LEDGER
    FORM READ_LEDGER TABLES   RESULT      STRUCTURE T_BALANCE_ACCOUNT_TW
                              XGLEDTAB    STRUCTURE GLEDTAB
                     USING    XBUKRS      LIKE      GLT0-BUKRS
                              XSAKNR      LIKE      GLT0-RACCT
                              XGJAHR      LIKE      GLT0-RYEAR
                              TYPE        TYPE      C.
      DATA: BALANCE LIKE GLT0-TSLVT.
      DATA:    I_GJAHR     LIKE GLT0-RYEAR.
      STATICS: I_RECURSIV  TYPE I.
      CHECK I_RECURSIV < 2.
      CLEAR RESULT. REFRESH RESULT.
      READ TABLE XGLEDTAB INDEX 1.
      SELECT * FROM GLT0
               WHERE RLDNR = XGLEDTAB-RLDNR
               AND   RRCTY = '0'
               AND   RVERS = '001'
               AND   BUKRS = XBUKRS
               AND   RYEAR = XGJAHR
               AND   RACCT = XSAKNR.
        CASE TYPE.
          WHEN 'TW'.
            RESULT-WAERS = GLT0-RTCUR.
            RESULT-VALUE = GLT0-TSLVT.
            DO GLT0-RPMAX TIMES
               VARYING BALANCE FROM GLT0-TSL01 NEXT GLT0-TSL02.
              RESULT-VALUE = RESULT-VALUE + BALANCE.
            ENDDO.
          WHEN 'HW1'.
            RESULT-WAERS = BK_METHODE-HWAE1.
            RESULT-VALUE = GLT0-HSLVT.
            DO GLT0-RPMAX TIMES
               VARYING BALANCE FROM GLT0-HSL01 NEXT GLT0-HSL02.
              RESULT-VALUE = RESULT-VALUE + BALANCE.
            ENDDO.
          WHEN 'HW2' OR 'HW3'.
            IF XGLEDTAB-CURRNUMBER = '3'.
              GLT0-HSLVT   = GLT0-KSLVT.
              GLT0-HSL01 = GLT0-KSL01. GLT0-HSL02 = GLT0-KSL02.
              GLT0-HSL03 = GLT0-KSL03. GLT0-HSL04 = GLT0-KSL04.
              GLT0-HSL05 = GLT0-KSL05. GLT0-HSL06 = GLT0-KSL06.
              GLT0-HSL07 = GLT0-KSL07. GLT0-HSL08 = GLT0-KSL08.
              GLT0-HSL09 = GLT0-KSL09. GLT0-HSL10 = GLT0-KSL10.
              GLT0-HSL11 = GLT0-KSL11. GLT0-HSL12 = GLT0-KSL12.
              GLT0-HSL13 = GLT0-KSL13. GLT0-HSL14 = GLT0-KSL14.
              GLT0-HSL15 = GLT0-KSL15. GLT0-HSL16 = GLT0-KSL16.
            ENDIF.
            IF TYPE = 'HW2'.
              RESULT-WAERS = BK_METHODE-HWAE2.
            ELSE.
              RESULT-WAERS = BK_METHODE-HWAE3.
            ENDIF.
            RESULT-VALUE = GLT0-HSLVT.
            DO GLT0-RPMAX TIMES
               VARYING BALANCE FROM GLT0-HSL01 NEXT GLT0-HSL02.
              RESULT-VALUE = RESULT-VALUE + BALANCE.
            ENDDO.
        ENDCASE.
        COLLECT RESULT.
      ENDSELECT.
      IF SY-SUBRC = 0.
        CLEAR I_RECURSIV.
      ELSE.
        ADD 1 TO I_RECURSIV.
        I_GJAHR = XGJAHR - 1.
        PERFORM READ_LEDGER TABLES  RESULT
                                    XGLEDTAB
                            USING   XBUKRS
                                    XSAKNR
                                    I_GJAHR
                                    TYPE.
      ENDIF.
    ENDFORM.                               " READ_LEDGER
    BEGIN OF INSERTION - NOTE 70203
    *&      Form  BKPF_UPDATE                   P30K137533
    FORM BKPF_UPDATE.
    *--- Stornovormerkung löschen? -
      CLEAR D_STORNO.
      SELECT SINGLE * FROM BKPF WHERE BUKRS = T_BSXX-BUKRS
                                AND   GJAHR = T_BSXX-GJAHR
                                AND   BELNR = T_BSXX-BELNR.
      IF BKPF-STBLG NE SPACE.
        D_STORNO = 'X'.
      ENDIF.
    ENDFORM.                               " BKPF_UPDATE
    END OF INSERTION - NOTE 70203
    If you find solution to your answer donot forget to reward points
    Regards

  • EBS - Electronic Bank Statement Multiple Posting Rule for One External Transaction Type NTRF

    hello SAP Gurus,
    I'm configuring EBS - Electronic Bank Statement. My requirement is for Bank External Transaction Type NTRF <for Incoming Payment> I want to assign 2 posting rules for Posting Area 2 that is Sub-Ledger posting viz. <1> For the payments received from Customer which should clear the Customer Open item since it is bill to bill exactly matching the open line item and <2> For the payments which should not clear the Customer Open item since i know that they are not bill to bill and only partial against the original line item
    Is this possible? if yes then how?
    Currently, SAP allows only one assignment like one external transaction type NTRF => one Posting Rule <either clear the sub-ledger-system picks FB05 or just post on Sub-ledger so that not to clear - system uses FB01 >
    Journal for Posting Area 2:
    Bank Clearing Account Dr
       To Customer Account Cr  <either set this to clear with original invoice / or just post on customer so as to clear/handle it manually later on once paid fully>
    So, what is the solution; how can i differentiate my incoming whether fully payment or partial payment; since bank statement always tag it to external transaction type NTRF always for any incoming payments !
    regards,
    `raj. 

    Hi,
    You cannot create separate rule with sub ledger postings while executing electronic bank reconciliation.The reason is your bill to bill transfers should posted to bank sub ledger account first and then you can write a BDC to clear sub ledger account.Otherwise use F.13 to clear the sub ledger account.
    Regards
    Chrishantha

  • Electronic bank statement upload

    Hi SAP GURUS,
    I have some doubts in ELECTRONIC bank statement.
    After uploading the statement in FF_5.
    How the open items will get cleared? and on based on which parameters it will get clear?
    Where do we maintain these parameters like based on the my Assignemnt field and reference fields , header text. like
    the parameters where do we maintain for clearing the open items.
    Regards
    Sai

    Hi
    Just check this settings
    Fin Accing>Bank Accing>Business transaction>Payment transaction>ELE Bank Stat>Making Global Settings for ele bank Stat.
    Assign Bank Accounts to transaction types.
    Hope this will be help full
    Regards
    Arun Mulgund

Maybe you are looking for

  • Keyboard is not very responsive

    The keyboard on my ideapad U530 is not as responsive as I would like for it to be.  I have to hit the keys quite hard, which of course slows down my speed and affects the accuracy of my input.    Is there a way to change the amount of pressure that I

  • How to install SP for WAS

    Hi I installed WAS 6.40. The version.txt says "Cluster-Version: 6.30   PatchLevel 70836.32". Which SP do I have? I need to upgrade to J2EE engine 6.40 to install the EP. I have downloaded the *.sar files for SP04 and SP09. I understand from the forum

  • ACS and CAR integration

    Hi, Is it possible to integrate ACS and CAR with DB-2 Database and if yes, are there any limitations or issues related to that? Does CAR or ACS loose any functionality in such integration? I am not looking for detailed process of the integration at t

  • Capturing RTP sent by JMF with Wireshark

    The post was originally at http://forums.sun.com/thread.jspa?threadID=5331241. I am using http://java.sun.com/javase/technologies/desktop/media/jmf/2.1.1/solutions/RTPConnector.html as a template in my program. I see the packets sent back and forth u

  • Last Updated By

    Hi, Does anyone know whether Oracle contains a log file that keeps track of changes made at both the table and record level? Will the log file allow me to determine who made the last changes & when the changes were made? Thanks!