BSIS Index for G/L Accounts contains Customer items ?

Hello experts,
I have some doubts about what i'm seing in database table BSIS. I always thought that this index table was containing only items with account type 'S' for GL account items.
But it seems that customer items (with account type = D) can also be stored in this index table.
Can anyone confirm if it is the normal behavior ? I'm really confused.
Thanks in advance for any help.
S.

In the master data of the reconciliation account, you have the field SKB1-MITKZ (Reconcil.ID), with value 'D' for a customer reconciliation account.
The documentation of this field is:
Account is reconciliation account                                                                               
An entry in this field characterizes the G/L account as a reconciliation
     account. The reconciliation account ensures the integration of a       
     subledger account into the general ledger.                                                                               
Examples                                                                               
G/L account 140000 is defined as a reconciliation account. In the      
     customer account 4711, the G/L account 140000 is determined as a       
     reconciliation account.                                                                               
In this way, all postings to customer account 4711 are also posted     
     automatically to the G/L account 140000. The G/L account itself is not 
     designed for direct posting. In this way, a reconciliation between     
     subledger and general ledger is always guaranteed.

Similar Messages

  • Postings with Alternative Reconciliation Accounts with Customer Invoice

    Hi Experts,
    In customizing i have defined Alternative reconcillation account for a Reco Account of customer.
    When i post 2 line items in customer invoice,it is picking recon account from customer master for 1st line item and alternative recon account for 2nd line item .
    But it should pick Alternative Reco Account for both line items.
    Kindly guide me which setting should be checked for this ?
    Regards
    Amit

    Hi,
    You defined alternative reconciliation account for customer but you still have some customizing points to check in addition for that.
    Please check OV64 ( IMG -> Sales and Distribution -> Basic Function -> Account Assignment/Costing -> Reconciliation Account determination -> Assign GL Accounts )
    And additionnally: IMG -> Sales and Distribution -> Basic Function -> Account Assignment/Costing -> Reconciliation Account determination -> Define Access Sequence
    In OBXY transaction, you define alternative rec. accounts per special G/L indicatoris, for example in the case of A/R doubtful / bad debt , system will not pick up rec. account from customer ùmaster record, but the one defined in OBXY. This is for FI part
    Hope this can help you
    Regards
    Tarek
    Edited by: Tarek AYACHI on Oct 7, 2011 5:56 PM

  • Custom Item Type Icon not displayed

    I have created a custom Item type from the base File type for PDF files.
    I have asociated a PDF Icon with this type.
    When I create folder object of my new PDF Type, my Icon does not ever seem to show up.
    Why?
    I must change the image associated with each item (secondary tab). to get an Icon to show up.
    Why?
    null

    Stuart,
    According to the help text:
    "Currently, this icon is not used by Oracle Portal. The icon may be used in future releases."
    But, if you want to show it, you can use a procedure in the custom item type to display the icon. Just find the URL to the icon (in Internet Explorer, right click on the icon and select Properties to get the URL) and write a simple procedure to display it. For an example of a custom item type procedure, see the discussion at http://technet.oracle.com:89/ubb/Forum82/HTML/000379.html .
    Regards,
    Jerry
    null

  • Index for a PSA table is not in the "customer" namespace

    Hi,
    While loading data through infosource 0CO_OM_WBS_1 to
    data target 0IMFA_1 loading failes and the reason given is that the system reads data from PSA table /BIC/B0001060000 of 0IM_FA_IQ_9 and the index generated for this table supplied return code 14.
    I found no notes in the subject - with the syntax :
    Index for a PSA table is not in the "customer" namespace.
    thanks in advance for your help.

    Hi,
    I think you need to speak to your basis guys / DBA as index created on PSA table is not in your tablespace. He should be able to help you.
    Vikash

  • Write off an account from Customer for Vendor

    Hi all!
    I need to write off an account from Customer for vendor, because this customer is also Vendor.
    How we do?

    Dear Tien,
    If I understood correctly a Business Partner is both a vendor and a customer for your client and I guess they want to write off the credit and debit with this Business Partners instead of using payments.
    This is possible using a manual Journal Entry, however if you have open documents after you should reconcile the documents with the JEs.
    However, I do not know if this is allowed in your customer's country. I would suggest to consult the accountant before carrying on.
    Kind Regards,
    Marcella Rivi
    SAP Business One Forums Team

  • API for loading Bank account details for the Customer

    Hi,
    Can anyone tell me what is the API that needs to be used for loading bank account information for the Customer?
    Thanks
    GM

    Hi,
    Were you not able to achieve your requirement with Customer Interface Program?
    There is a interface table 'RA_CUSTOMER_BANKS_INT_ALL' which is used to store customer bank account information. Run the program after inserting the records into this table.
    I guess, there is no public API.
    Regards,
    Ram

  • Custom alerts for different mail accounts?

    Is there a way to set up different ringtones/alerts for different Mail accounts?  I'd like to make my personal and business emails ring/vibe differently.
    Thanks.

    Nope, as you look in your settings mail only has one option to change the sound and thats for any mail that is recieved.

  • Business Content or Information for GR/IR Account Report

    Hi All,
    I have an R3 report called GR/IR Account Report by PO Mismatch.
    Is there any business content available for this in BI.
    The below tables are using in the report.
             bsis,                         " Accounting docs by account
             bsas,                         " Cleared accounting docs by acc
             bseg,                         " Accounting doc line item
             ekko,                         " Purchase Order Header,
             ekpo,
             mkpf,                         " Material Document
             lfa1,                         " Vendor details
             ekbe,                         " PO History
             ekkn,                         " PO Acct.Assgnment
             usr21,
             addr3_val,
             ad3_flags,
             stxh.
    Could you please provide me your inputs on this
    Regards
    Srini

    The new additional fields need to be populated are
              ZZAUFNR         Order Number                                  *
              ZZBEDAT         Purchase Order Date                           *
              ZZCRE_FI         FI Doc Created By                             *
              ZZCRE_PO         PO Doc Created By                             *
              ZZEBELN         Purchasing Document Number                    *
              ZZEBELP         Item Number of Purchasing Document            *
              ZZKOSTL         Cost Center                                   *
              ZZMWSKZ         Tax on sales/purchases code                   *
              ZZPROJK      WBS element                                   *
              ZZTXZ01         Short text                                    *
              ZZUSNAM         User name                                     *
              ZZXBLNR         Reference document number                     *
              ZZHWSTE      Tax Amount in Local Currency                 *
              ZZSGTXT      Item Text                                    *
              ZZHKONT      Finance G/L Account                          *
      when '0FI_AP_4'.
    Declare the local data fields to store data temporarily
        data : l_dtfiap_3 like DTFIAP_3,
               mwskz like bsik-mwskz,
               l_ernam like   bapibname-bapibname,
               l_address like bapiaddr3,
               l_bseg  like bseg,
               l_bedat like ekko-bedat,
               l_ps_psp_pnr like prps-pspnr.
        data : gt_return type bapiret2 occurs 0 with header line.
        loop at c_t_data into l_dtfiap_3.
          l_tabix = sy-tabix.
    *Select the tax Code for the particular record from BSAK TABLE
          select single mwskz sgtxt into (l_dtfiap_3-zzmwskz,
                                          l_dtfiap_3-zzsgtxt)
                from bsak
                where bukrs = l_dtfiap_3-bukrs
                  and buzei = l_dtfiap_3-buzei
                  and belnr = l_dtfiap_3-belnr
                  and lifnr = l_dtfiap_3-lifnr
                  and gjahr = l_dtfiap_3-gjahr
                  and zuonr = l_dtfiap_3-zuonr
                  and augbl = l_dtfiap_3-augbl
                and augdt = l_dtfiap_3-augdt
                and bldat = l_dtfiap_3-bldat
                and blart = l_dtfiap_3-blart
                and bschl = l_dtfiap_3-bschl
                and budat = l_dtfiap_3-budat.
          if sy-subrc = 0.
            modify c_t_data from l_dtfiap_3 index l_tabix.
          else.
    *If corresponding Document Number is not present in BSAK check BSIK
    *TABLE
            select single mwskz sgtxt into (l_dtfiap_3-zzmwskz,
                                            l_dtfiap_3-zzsgtxt)
                    from bsik
                    where bukrs = l_dtfiap_3-bukrs
                      and buzei = l_dtfiap_3-buzei
                      and belnr = l_dtfiap_3-belnr
                      and lifnr = l_dtfiap_3-lifnr
                      and gjahr = l_dtfiap_3-gjahr
                      and zuonr = l_dtfiap_3-zuonr
                      and augbl = l_dtfiap_3-augbl
                    and augdt = l_dtfiap_3-augdt
                    and bldat = l_dtfiap_3-bldat
                    and blart = l_dtfiap_3-blart
                    and bschl = l_dtfiap_3-bschl
                    and budat = l_dtfiap_3-budat.
            if sy-subrc = 0.
              modify c_t_data from l_dtfiap_3 index l_tabix.
            endif.
          endif.
          select single hwste into l_dtfiap_3-zzhwste
              from bset
              where bukrs eq l_dtfiap_3-bukrs
                and belnr eq l_dtfiap_3-belnr
                and gjahr eq l_dtfiap_3-gjahr
                and buzei eq l_dtfiap_3-buzei.
    Select Created By and invoice Reference Number from BKPF table
          select single usnam xblnr from bkpf
              into (l_dtfiap_3-zzusnam,l_dtfiap_3-zzxblnr)
                where bukrs = l_dtfiap_3-bukrs
                  and belnr = l_dtfiap_3-belnr
                  and gjahr = l_dtfiap_3-gjahr.
          if sy-subrc = 0.
            modify c_t_data from l_dtfiap_3 index l_tabix.
          endif.
          move l_dtfiap_3-zzusnam to l_ernam.
          refresh : gt_return.
    Get the Fi doc Created By doing the function Module call
          call function 'BAPI_USER_GET_DETAIL'
            EXPORTING
              username = l_ernam
            IMPORTING
              address  = l_address
            TABLES
              return   = gt_return.
          move l_address-fullname to l_dtfiap_3-zzcre_fi.
          if l_dtfiap_3-zzcre_fi is initial.
            move l_ernam to l_dtfiap_3-zzcre_fi.
          endif.
          if not l_dtfiap_3-zzcre_fi is initial.
            modify c_t_data from l_dtfiap_3 index l_tabix.
          endif.
          if l_dtfiap_3-blart eq 'RE'.
    .....Get New Fields from PO linked to FI Document.....................
    Select PO Number from PO Line item from BSEG TABLE
            select buzei buzid ebeln ebelp
              into corresponding fields of l_bseg
              from bseg
             where bukrs eq l_dtfiap_3-bukrs
               and belnr eq l_dtfiap_3-belnr
               and gjahr eq l_dtfiap_3-gjahr.
              if l_bseg-buzei eq l_dtfiap_3-buzei.
    .....Already read this line, therefore ignore it......................
                continue.
              endif.
              if l_bseg-buzid eq 'T'.
    .....Don't read automatically created lines - Tax Line................
                continue.
              endif.
              if not ( l_bseg-ebeln is initial ).
                move l_bseg-ebeln to l_dtfiap_3-zzebeln.   " PO Number
              endif.
              if not ( l_bseg-ebelp is initial ).
                move l_bseg-ebelp to l_dtfiap_3-zzebelp.   " PO Line Item No
              endif.
              if not l_dtfiap_3-zzebelp is initial.
                modify c_t_data from l_dtfiap_3 index l_tabix.
              endif.
            endselect.
    .....Got PO Number from FI Document, Now get PO Details...............
    .....Get Short Text...................................................
    GET PO Line Item text
            select single txz01 into l_dtfiap_3-zztxz01
              from ekpo
               where ebeln eq l_dtfiap_3-zzebeln
                 and ebelp eq l_dtfiap_3-zzebelp.
            if sy-subrc = 0.
              modify c_t_data from l_dtfiap_3 index l_tabix.
            endif.
    .....Get Account Assignment...........................................
            select ps_psp_pnr aufnr kostl sakto
              into (l_ps_psp_pnr,l_dtfiap_3-zzaufnr,
                      l_dtfiap_3-zzkostl,l_dtfiap_3-zzhkont)
                  from ekkn
                   where ebeln eq l_dtfiap_3-zzebeln
                     and ebelp eq l_dtfiap_3-zzebelp.
              if sy-subrc = 0.
                modify c_t_data from l_dtfiap_3 index l_tabix.
              endif.
              select single posid into l_dtfiap_3-zzprojk
                   from prps
                     where pspnr = l_ps_psp_pnr.
              if sy-subrc = 0.
                modify c_t_data from l_dtfiap_3 index l_tabix.
              endif.
            endselect.
    .....Get Name of Person who created PO................................
            clear : l_ernam,l_bedat.
            select ernam bedat into (l_ernam, l_bedat)
                up to 1 rows
                from ekko
                 where ebeln eq l_dtfiap_3-zzebeln.
            endselect.
            move l_bedat to l_dtfiap_3-zzbedat.
            if not l_dtfiap_3-zzbedat is initial.
              modify c_t_data from l_dtfiap_3 index l_tabix.
            endif.
            refresh : gt_return.
            call function 'BAPI_USER_GET_DETAIL'
              EXPORTING
                username = l_ernam
              IMPORTING
                address  = l_address
              TABLES
                return   = gt_return.
            move l_address-fullname to l_dtfiap_3-zzcre_po.
            if l_dtfiap_3-zzcre_po is initial.
              move l_ernam to l_dtfiap_3-zzcre_po.
            endif.
            if not l_dtfiap_3-zzcre_po is initial.
              modify c_t_data from l_dtfiap_3 index l_tabix.
            endif.
          else.
    .....Get new Fields from FI Document..................................
            select buzei buzid ebeln ebelp projk aufnr kostl hkont
              into corresponding fields of l_bseg
              from bseg
             where bukrs eq l_dtfiap_3-bukrs
               and belnr eq l_dtfiap_3-belnr
               and gjahr eq l_dtfiap_3-gjahr.
              if l_bseg-buzei eq l_dtfiap_3-buzei.
    .....Already read this line, therefore ignore it......................
                continue.
              endif.
              if l_bseg-buzid eq 'T'.
    .....Don't read automatically created lines - Tax Line................
                continue.
              endif.
              if not ( l_bseg-ebeln is initial ).
                move l_bseg-ebeln to l_dtfiap_3-zzebeln. " PO Number
              endif.
              if not ( l_bseg-ebelp is initial ).
                move l_bseg-ebelp to l_dtfiap_3-zzebelp. " PO Line Item
              endif.
              move l_bseg-aufnr to l_dtfiap_3-zzaufnr.   " Order Number
              move l_bseg-kostl to l_dtfiap_3-zzkostl.   " Cost Centre
              move l_bseg-hkont to l_dtfiap_3-zzhkont.   " GL Account
              select single posid into l_dtfiap_3-zzprojk
                  from prps
                    where pspnr = l_bseg-projk.
              if not l_dtfiap_3-zzprojk is initial
                or not l_dtfiap_3-zzaufnr is initial
                or not l_dtfiap_3-zzkostl is initial
                or not l_dtfiap_3-zzhkont is initial.
                modify c_t_data from l_dtfiap_3 index l_tabix.
              endif.
            endselect.
    .....Get PO Short Text................................................
            select single txz01 into l_dtfiap_3-zztxz01
              from ekpo
               where ebeln eq l_dtfiap_3-zzebeln
               and ebelp eq l_dtfiap_3-zzebelp.
            if sy-subrc = 0.
              modify c_t_data from l_dtfiap_3 index l_tabix.
            endif.
    .....Get Name of Person who created PO................................
            clear : l_ernam,l_bedat.
            select ernam bedat into (l_ernam, l_bedat)
                   up to 1 rows
                   from ekko
                   where ebeln eq l_dtfiap_3-zzebeln.
            endselect.
            move l_bedat to l_dtfiap_3-zzbedat.
            if not l_dtfiap_3-zzbedat is initial.
              modify c_t_data from l_dtfiap_3 index l_tabix.
            endif.
            refresh : gt_return.
    Get PO Doc Created By
            call function 'BAPI_USER_GET_DETAIL'
              EXPORTING
                username = l_ernam
              IMPORTING
                address  = l_address
              TABLES
                return   = gt_return.
            move l_address-fullname to l_dtfiap_3-zzcre_po.
            if l_dtfiap_3-zzcre_po is initial.
              move l_ernam to l_dtfiap_3-zzcre_po.
            endif.
            if not l_dtfiap_3-zzcre_po is initial.
              modify c_t_data from l_dtfiap_3 index l_tabix.
            endif.
          endif.
        endloop.
    Edited by: Srinivas Gogineni on Apr 19, 2009 11:10 AM

  • How to delete the index of a deleted account

    So here's the deal. I deleted an old Gmail account ( I think it was set up as imap) a few months ago. Last night I'm searching Mail and I find all of these hits, but the mailbox column is blank, I cannot read the message, and I cannot select "Show in Mailbox". I realized these were from my deleted account.
    So I went into ~/library/mail and looked, but I found nothing for the deleted account, the actual messages are gone (which is fine), but the listings are still coming up in searches.
    I turned Spotlight indexing for mail off, and even put ~/library/mail in the Spotlight privacy list.
    No luck.
    I've even rebuilt each mailbox (1 at a time), but still cannot get rid of these old email headings.
    I know there is a way to force Mail to rebuild its index using a keyboard shortcut on Mail start-up, but I can't remember it.
    Any advice would be much appreciated.
    Thanks
    Oh, in addition, I cannot move these to the trash or delete them either - they won't go away
    Message was edited by: J Ashley

    Thanks a lot for all your answers! :)
    I finally got to do something with my little knowledge =P
    I created a new class containing all the data needed for the dataTable (including a "String id").
    And that's what I get:
    <h:column>
         <a:commandLink
              value="#{familyAction.familyDocsByPrj.name}"
              action="#{homeAction.search(familyAction.familydocsByPrj.id)}"
              reRender="rightAppPanel" />
    </h:column>

  • BADI for release to accounting SD document

    Hi to all,
    I need to implement my own code in Release to Accounting (VF02 tcode) . I need to check accounting document (bkpf e bseg) in order to change some fields in header (bkpf) and in position item.
    I need to check this before validation control (OB28) is triggered. I was trying to use BADI . But I wasn't able to find it . Anyone can help?
    Thanks in advance
    Andrew

    Hi Andrew,
    Please check below exits/customer exits, these all are trigger during VF02.
    USEREXIT_NUMBER_RANGE (Module pool SAPLV60A, program RV60AFZZ)
    The internal number range used in the standard system is specified in the billing type table and can be changed in this user exit. This user exit is only called when the billing documents is created.
    USEREXIT_ACCOUNT_PREP_KOMKCV (Module pool SAPLV60A, program RV60AFZZ)
    In this user exit additional fields for account determination that are not provided in the standard system are copied into communication structure KOMKCV (header fields).
    USEREXIT_ACCOUNT_PREP_KOMPCV (Module pool SAPLV60A)
    In this user exit additional fields for account determination that are not provided in the standard system are copied into communication structure KOMPCV (item fields).
    USEREXIT_NUMBER_RANGE_INV_DATE (Module pool SAPLV60A, program RV60AFZC)
    Depending on the number range, table TVFKD is used to set the billing date (country-specific requirments in Italy). USEREXIT_NUMBER_RANGE is automatically deactivated when this user exit is being applied.
    USEREXIT_FILL_VBRK_VBRP (Module pool SAPLV60A, program RV60AFZC)
    This user exit is only called when the billing document is created. It is used to provide the header and the item of the new billing document with deviating or additional data.
    USEREXIT_PRINT_ITEM (Module pool SAPLV61A, program RV61AFZB)
    Printing the item line of a billing document can be supplemented or changed.
    USEREXIT_PRINT_HEAD (Modulpool SAPLV61A, Programm RV61AFZB)
    Printing the header line of a billing document can be supplemented or changed.
    User exits in program RV60AFZD
    Short descriptions of the user exits are contained in the program:
    USEREXIT_RELI_XVBPAK_AVBPAK
    USEREXIT_NEWROLE_XVBPAK_AVBPAK
    USEREXIT_NEWROLE_XVBPAP_AVBPAK
    The following user exits are available in report SAPLV60B for transfer to accounting (function group V60B):
    EXIT_SAPLV60B_001: Change the header data in the structure acchd
    You can use this exit to influence the header information of the accounting document. For example, you can change the business transaction, "created on" date and time, the name of the person who created it or the transaction with which the document was created.
    EXIT_SAPLV60B_002: Change the customer line ACCIT
    You can use this exit to change the customer line in the accounting document. This exit is processed once the ACCIT structure is filled in with data from document header VBRK.
    EXIT_SAPLV60B_003: Change the customer line in costing
    The customer line is filled in differently for costing. You can use exit 003 to influence the ACCIT structure.
    EXIT_SAPLV60B_004: Change a GL account item ACCIT You can add information to a GL account item (such as quantity specifications) with this exit.
    EXIT_SAPLV60B_005: User exit for accruals
    Once all relevant data for accruals was entered in the GL account item, you can add to this data with this exit.
    EXIT_SAPLV60B_006: Change the control line ACCIT
    You can use exit 006 to add information to the control line.
    EXIT_SAPLV60B_007: Change the installment plan
    You can use exit 007 to add information to the installment plan
    parameters in the GL account item.
    EXIT_SAPLV60B_008: Change the transfer structure ACCCR, ACCIT and ACCHD
    After the accounting document is filled in with data, you can use exit 008 to change the document once again.
    EXIT_SAPLV60B_010: Item table for customer lines
    You can use exit 10 to influence the contents of customer lines before they are created.
    EXIT_SAPLV60B_0011: Change the parameter for cash account determination or reconciliation account determination
    You can use this exit to change inbound parameters in order to influence account determination.
    Reddy

  • More than 40 disks attached in Storage Account container

    If I have a storage account container containing more than 40 vhds can and they are not attached to say VM1 can it impact VM1 in question negatively?
    For virtual machines in the Basic Tier, do not place more than 66 highly used VHDs in a storage account to avoid the
    20,000 total request rate limit (20,000/300). For virtual machines in the Standard Tier, do not place more than 40 highly used VHDs in a storage account (20,000/500). For more information, see Virtual
    Machine and Cloud Service Sizes for Azure.

    Hi,
    If you exceed the azure storage quote, and one of the VHDS is attached to VM1, as far as I know, it will impact performance, if all the VHDS is not attached to VM1, I think the VM1 is no business with this storage.
    Best Regards,
    Jambor
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to query the opening balance for an specific account for an spec. date

    Hi all,
    for my user query I need to calculate the opening balance for an cash account for an specific date.
    Any ideas, how can I do this?
    Or may be you know a field in an SBO table that already contains information I need...
    Best Regards,
    Inna

    Hi Inna,
    to find the opening balance for an account or a business partner, please see SAP Note [1114253|https://service.sap.com/sap/support/notes/1114253] :
    Symptom
    How to find the opening balance of a business partner or G/L account.
    Other terms
    Account, customer, supplier, vendor, creditor, debitor, start, initial, first, opening balance, business partner, G/L, SAP Business One
    Reason and Prerequisites
    Consulting
    Solution
    There are several possible approaches:
    Approach 1 - Business Partner Opening Balance:
    1. Go to Business Partners -> Business Partner Master Data -> find the Business Partner
    2. Click on the orange link arrow next to the field 'Account Balance' in the header region of the window.
    3. Untick the boxes next to 'Posting date from', 'Display' and 'Display Unreconciled Trans. Only'.
    4. Click on the button 'Refresh'.
    5. Find 'OB' in the column 'Origin', this is the opening balance journal entry.
    Approach 2 - Business Partner Opening Balance:
    1. Go to Business Partners -> Business Partner Master Data.
    2. Click on the orange link arrow next to the field 'Account Balance' in the header region of the window.
    3. Untick the boxes next to 'Posting date from', 'Display' and 'Display Unreconciled Trans. Only'.
    4. Click on the button 'Refresh'.
    5. Double click on the column header 'Posting Date' to find the earliest transaction on the business partner account. This transaction could be opening balance, verify this with the company accountant.
    Approach 3 - G/L Account Opening Balance:
    1. Go to Financials -> Chart of Accounts -> click on the account name once.
    2. Click on the orange link arrow next to the field 'Balance'.
    3. Untick the boxes next to 'Posting date from', 'Display' and 'Display Unreconciled Trans. Only'.
    4. Click on the button 'Refresh'.
    5. Find 'OB' in the column 'Origin', this is the opening balance journal entry.
    Approach 4 - Business Partner and/or G/L Account Opening Balance:
    1. If using SAP Business One 2005 SP01 or earlier, go to Reports -> Query Generator -> click on 'Execute'.
    2. If using SAP Business One 2007 or later, go to Tools -> Queries -> Query Generator -> click on 'Execute'.
    3. Ignore the red system message in the bottom of the screen.
    4. Click on the pencil icon in the top left of the window, the field with 'SELECT *' will change colour to white, then yellow when activated by clicking in the field.
    5. Copy the query below:
               SELECT T0.[TransId], T0.[Debit], T0.[Credit] , T0.[CreatedBy], T0.[TransType] FROM [dbo].[JDT1]  T0 WHERE T0.[TransType] = '-2'  and T0.[ShortName]  = '[%1]'
    6. Click on 'Save' and give the query an appropriate name and select the appropriate category.
    7. Click on 'Execute'.
    8. Click on 'Existing Values'.
    9. Select the G/L account or the Business Partner name from the list and click on 'OK'.
    10. The system message 'Records retrieved by this query #' (# = number of records) will pop up. Click on 'OK'.
    All the best,
    Kerstin

  • Required replace BSEG with BSAK BSIK BSIS BSAS for report performance

    Hi Experts
    i m optimizing a report in which data is extracting from BSEG , 5 time so i reduses the performance of report
    so i want replace BSEG with BSAK BSIK BSIS BSAS for the same data what I am getting now . this is report of Purchase of item. code is here.
    REPORT  zmm_pur_reg_kanhe LINE-SIZE 1023.
    *& Des         :Purchase Tax Register Report for KANHE
    *& Created on  :12-07-07
    *& Suggested by:Paresh Saini(MM)
    *& Changes By: Lailu Philip
    *& Changed On: 24.09.2007
    *& Changes: New columns for G/L Code Description,VAT Amt,VAT Perc,CST Perc
    *&                         ,SHCESS Amounts,WCT G/L Acc., WCT Amt,Tax Code
    *&                          for Purchase Order,WCT tax code & Percentage.
    *& Request No:  S6DK921577
    Data Declaration
    *& changes: by Vincy on 12.01.2007
    *& changes: display purchase order with vendor type zpsr(get_zpsr)
    *& Request No:  S6DK930821
    TABLES:ekbe, lfa1, faglflexa.",j_1iexcdtl,lfa1,bkpf,bseg.
    TYPE-POOLS: slis.                                 "ALV Declarations
    DATA: fieldcatalog TYPE slis_t_fieldcat_alv WITH HEADER LINE,
           gd_layout    TYPE slis_layout_alv,
           gd_repid     LIKE sy-repid.
    DATA: it_sortcat   TYPE slis_sortinfo_alv OCCURS 1,
           col_pos LIKE fieldcatalog-col_pos .
    TYPES :BEGIN OF wa1_ekbe,
            belnr         TYPE ekbe-belnr,
            budat         TYPE ekbe-budat,
            menge         TYPE ekbe-menge,
            matnr         TYPE ekbe-matnr,
            ebelp         TYPE j_1iexcdtl-ritem1,
            ebeln         TYPE ekbe-ebeln,
            gjahr         TYPE ekbe-gjahr,
            lfbnr         TYPE ekbe-lfbnr,
            lfpos         TYPE ekbe-lfpos,
            bldat         TYPE ekbe-bldat,
            REEWR         TYPE REEWR,
            END OF wa1_ekbe.
    TYPES :BEGIN OF wa2_ekbe,
            belnr         TYPE ekbe-belnr,
            budat         TYPE ekbe-budat,
            menge         TYPE ekbe-menge,
            ebelp         TYPE ekbe-ebelp,
            ebeln         TYPE ekbe-ebeln,
            gjahr         TYPE ekbe-gjahr,
            lfbnr         TYPE ekbe-lfbnr,
            lfpos         TYPE ekbe-lfpos,
            bldat         TYPE ekbe-bldat,
            REEWR         TYPE REEWR,
            awkey(20)         TYPE c,
            MATNR         TYPE MATNR,
            MWSKZ         TYPE EKBE-MWSKZ,
            END OF wa2_ekbe.
    TYPES :BEGIN OF wa1_j_1iexcdtl,
            exnum         TYPE j_1iexcdtl-exnum,
            exdat         TYPE j_1iexcdtl-exdat,
            lifnr         TYPE j_1iexcdtl-lifnr,
            matnr         TYPE j_1iexcdtl-matnr ,
          maktx         TYPE j_1iexcdtl-maktx ,
          capind      TYPE j_1iexcdtl-capind,
            exbas         TYPE j_1iexcdtl-exbas,
            exbed             TYPE j_1iexcdtl-exbed,
            ecs            TYPE j_1iexcdtl-ecs,
            werks             TYPE j_1iexcdtl-werks,
            ritem1        TYPE j_1iexcdtl-ritem1,
            rdoc1             TYPE j_1iexcdtl-rdoc1,
            docyr         TYPE j_1iexcdtl-docyr,
            bedinv        type J_1IBEDINV,
            ecsinv        type J_1IECSINV,
            EXADDINV1     type J_1IEXADDINV1,
            exaddtax1    TYPE j_1iexcdtl-exaddtax1,
            rdoc2         TYPE j_1iexcdtl-rdoc2,
            ritem2        TYPE j_1iexcdtl-ritem2,
            menge         TYPE j_1iexcdtl-menge,
    ADDED FOR RUDRAPUR ON 08.03.2008 BY ASHOK.CH
    *ENDED ON 08.02.2008
            END OF wa1_j_1iexcdtl.
    TYPES :BEGIN OF wa1_lfa1,
            name1         TYPE lfa1-name1,
            ktokk         TYPE lfa1-ktokk,
            werks         TYPE lfa1-werks,
            lifnr         TYPE lfa1-lifnr,
            END OF wa1_lfa1.
    TYPES :BEGIN OF wa1_ekexclf,
            belnr         TYPE ekbe-belnr,
            budat         TYPE ekbe-budat,
            menge         TYPE ekbe-menge,
            ebelp         TYPE ekbe-ebelp,
            ebeln         TYPE ekbe-ebeln,
            gjahr         TYPE ekbe-gjahr,
            awkey(20)     TYPE c,
            exnum         TYPE j_1iexcdtl-exnum,
            exdat         TYPE j_1iexcdtl-exdat,
            lifnr         TYPE j_1iexcdtl-lifnr,
            matnr         TYPE j_1iexcdtl-matnr ,
          maktx         TYPE j_1iexcdtl-maktx ,
          capind      TYPE j_1iexcdtl-capind,
            exbas         TYPE j_1iexcdtl-exbas,
            exbed             TYPE j_1iexcdtl-exbed,
            ecs            TYPE j_1iexcdtl-ecs,
            werks             TYPE j_1iexcdtl-werks,
            ritem1        TYPE j_1iexcdtl-ritem1,
            rdoc1             TYPE j_1iexcdtl-rdoc1,
            docyr         TYPE j_1iexcdtl-docyr,
            name1         TYPE lfa1-name1,
            ktokk         TYPE lfa1-ktokk,
            exaddtax1     TYPE j_1iexcdtl-exaddtax1,
    added for rudrapur on 08.03.2008 by ASHOK.CH
            bedinv        type J_1IBEDINV,
            ecsinv        type J_1IECSINV,
            EXADDINV1     type J_1IEXADDINV1,
    END OF MODIFICATION ON 08.02.2008
            END OF  wa1_ekexclf.
    TYPES :BEGIN OF wa1_bkpf,
            bukrs TYPE bkpf-bukrs,
            belnr TYPE bkpf-belnr,
            gjahr TYPE bkpf-gjahr,
            budat TYPE bkpf-budat,
            tcode TYPE bkpf-tcode,
            awkey TYPE bkpf-awkey,
            END OF wa1_bkpf.
    TYPES :BEGIN OF wa1_bseg,
            bukrs     TYPE bseg-bukrs,
            belnr     TYPE bseg-belnr,     
            gjahr         TYPE bseg-gjahr,
            buzei     TYPE bseg-buzei,
            bschl     TYPE bseg-bschl,
            fwbas     TYPE bseg-fwbas ,     
            pswbt         TYPE bseg-pswbt,
            hkont         TYPE bseg-hkont,
            wrbtr     TYPE bseg-wrbtr,
            ktosl     TYPE bseg-ktosl,
            koart     TYPE bseg-koart,
            shkzg     TYPE bseg-shkzg,
            mwskz     TYPE bseg-mwskz,
            qsskz     TYPE bsis-qsskz,
            dmbtr     TYPE bseg-dmbtr,
            lifnr     TYPE bseg-lifnr,
            matnr     TYPE bseg-matnr,
            flag      TYPE C,
            flag_21   TYPE C,
            END OF wa1_bseg.
    TYPES :BEGIN OF wa1_tax,
            belnr         TYPE bseg-belnr,
            fi_docno      TYPE bseg-belnr,
            gjahr             TYPE bseg-gjahr,
            bukrs         TYPE bseg-bukrs,
            awkey         TYPE bkpf-awkey,
            fwbas         TYPE bseg-fwbas ,
            cst_amt       TYPE bseg-pswbt,
            vat_amt       TYPE bseg-pswbt,
            shcess_amt    TYPE bseg-pswbt,
            gl_accnt      TYPE bseg-hkont,
            gl_desc       TYPE skat-txt50,
            wctglacc      TYPE bseg-hkont,
            wctamt        TYPE bseg-dmbtr,
            taxcode       TYPE t059z-wt_withcd,
            taxperc       TYPE t059z-qsatz,
            total_value   TYPE bseg-wrbtr,
            set_off       TYPE bseg-wrbtr,
            cond_type     TYPE konv-kschl,
            description(20)   TYPE c,
            service_tax       TYPE bseg-wrbtr,
            service_ecess     TYPE bseg-wrbtr,
            service_shcess     TYPE bseg-wrbtr,      "vincy on 31.01.08
            ebelp         TYPE ekbe-ebelp,           "      on 15.04.08
            flag          TYPE c,
            mwskz     TYPE bseg-mwskz,
            END OF wa1_tax.
    DATA:BEGIN OF itab_skat,
           saknr TYPE skat-saknr,
           spras TYPE skat-spras,
           txt50 TYPE skat-txt50,
           END OF itab_skat.
    DATA: iskat LIKE itab_skat OCCURS 0,
           wa_skat LIKE itab_skat.
    DATA : BEGIN OF zbsis OCCURS 0,
             bukrs TYPE bsis-bukrs,
             hkont TYPE bsis-hkont,
             augdt TYPE bsis-augdt,
             augbl TYPE bsis-augbl,
             zuonr TYPE bsis-zuonr,
             gjahr TYPE bsis-gjahr,
             belnr TYPE bsis-belnr,
             buzei TYPE bsis-buzei,
             budat TYPE bsis-budat,
             qsskz TYPE bsis-qsskz,
            END OF zbsis.
    DATA: BEGIN OF zt059z OCCURS 0,
           land1 TYPE t059z-land1,
           witht TYPE t059z-witht,
           wt_withcd TYPE t059z-wt_withcd,
           qscod TYPE t059z-qscod,
           qsatz TYPE t059z-qsatz,
           hkont TYPE bsis-hkont,
           belnr TYPE bsis-belnr,
           END OF zt059z.
    DATA: BEGIN OF it_faglflexa OCCURS 0,      "added by vincy
          ryear TYPE faglflexa-ryear,
          docnr TYPE faglflexa-docnr,
          rldnr TYPE faglflexa-rldnr,
          rbukrs TYPE faglflexa-rbukrs,
          docln TYPE faglflexa-docln,
          prctr TYPE faglflexa-prctr,
          END OF it_faglflexa.
    Final Table***
    TYPES :BEGIN OF wa1_final,
             belnr         TYPE ekbe-belnr,
             fi_docno      TYPE bseg-belnr,
             budat         TYPE ekbe-budat,
             menge         TYPE ekbe-menge,
             rate          TYPE konv-kbetr,
             ebelp         TYPE ekbe-ebelp,
             ebeln         TYPE ekbe-ebeln,
             mwskz         TYPE bseg-mwskz,
             gjahr         TYPE ekbe-gjahr,
             awkey(20)     TYPE c,
             exnum         TYPE j_1iexcdtl-exnum,
             exdat         TYPE j_1iexcdtl-exdat,
             lifnr         TYPE j_1iexcdtl-lifnr,
             matnr         TYPE j_1iexcdtl-matnr ,
           maktx         TYPE j_1iexcdtl-maktx ,
             capind       TYPE string,
             exbas         TYPE j_1iexcdtl-exbas,
             exbed       TYPE j_1iexcdtl-exbed,
             ecs             TYPE j_1iexcdtl-ecs,
             werks       TYPE j_1iexcdtl-werks,
             ritem1        TYPE j_1iexcdtl-ritem1,
             rdoc1       TYPE j_1iexcdtl-rdoc1,
             docyr         TYPE j_1iexcdtl-docyr,
             name1         TYPE lfa1-name1,
             ktokk         TYPE lfa1-ktokk,
             fwbas         TYPE bseg-fwbas ,
             vat_per       TYPE konv-kbetr,
             vat_amt       TYPE bseg-pswbt,
             cst_per       TYPE konv-kbetr,
             cst_amt       TYPE bseg-pswbt,
             shcess_amt    TYPE bseg-pswbt,
             gl_accnt      TYPE bseg-hkont,
             gl_desc       TYPE skat-txt50,
             wctglacc      TYPE bseg-hkont,
             wctamt        TYPE bseg-dmbtr,
             taxcode       TYPE t059z-wt_withcd,
             taxperc       TYPE t059z-qsatz,
             total_value   TYPE bseg-wrbtr,
             total_value1 TYPE bseg-wrbtr,
             excise_tax    TYPE bseg-wrbtr,
             excise  TYPE bseg-wrbtr,
             set_off       TYPE bseg-wrbtr,
             inventorised  TYPE konv-kawrt,
             cond_type     TYPE konv-kschl,
             cond_type2    TYPE konv-kschl,
             description(20)   TYPE c,
             service_tax       TYPE bseg-wrbtr,
             service_ecess     TYPE bseg-wrbtr,
             service_shcess    TYPE bseg-wrbtr,            "vincy on 31.01.08
            END OF wa1_final.
    DATA :it2_ekbe        TYPE TABLE OF wa1_ekbe WITH HEADER LINE,
           it_ekbe        TYPE TABLE OF wa1_ekbe WITH HEADER LINE,
           it1_ekbe       TYPE TABLE OF wa2_ekbe WITH HEADER LINE WITH KEY ebelp ebeln,
           it_j_1iexcdtl  TYPE TABLE OF wa1_j_1iexcdtl WITH HEADER LINE WITH KEY rdoc1 ritem1,
           it_lfa1        TYPE TABLE OF wa1_lfa1 WITH HEADER LINE WITH KEY lifnr,
           it_lfa2        TYPE TABLE OF wa1_lfa1 WITH HEADER LINE WITH KEY lifnr,
           it_bkpf        TYPE TABLE OF wa1_bkpf WITH HEADER LINE,
           it_bseg        TYPE TABLE OF wa1_bseg WITH HEADER LINE WITH  KEY
                                        bukrs belnr gjahr ktosl shkzg koart,
           it1_bseg        TYPE TABLE OF wa1_bseg WITH HEADER LINE WITH  KEY
                                        bukrs belnr gjahr ktosl shkzg koart,
           it_tax         TYPE TABLE OF wa1_tax WITH HEADER LINE WITH KEY awkey ,
           it_ekexclf     TYPE TABLE OF wa1_ekexclf WITH HEADER LINE,
           it_final       TYPE TABLE OF wa1_final WITH HEADER LINE,
           it_final1      TYPE TABLE OF wa1_final WITH HEADER LINE,         "vincy
           wa_ekbe       TYPE wa1_ekbe,
           wa1_ekbe      TYPE wa2_ekbe,
           wa_j_1iexcdtl TYPE wa1_j_1iexcdtl,
           wa_lfa1       TYPE wa1_lfa1,
           wa_lfa2       TYPE wa1_lfa1,
           wa_bkpf       TYPE wa1_bkpf,
           wa_bseg       TYPE wa1_bseg,
           wa_tax        TYPE wa1_tax,
           wa_ekexclf    TYPE wa1_ekexclf,
           PLANT TYPE WERKS_D,
           wa_final      TYPE wa1_final.
    DATA: it_konv TYPE konv OCCURS 0 WITH HEADER LINE ,
           wa_konv TYPE konv,
           invent TYPE p DECIMALS 4,
           invent1 TYPE konv-kawrt.
    DATA:d1 TYPE konv-kposn,
          d2 TYPE ekbe-ebelp.
    DATA: v_belnr TYPE ekbe-belnr,
           v_gjahr TYPE ekbe-gjahr,
           v_awkey(20) TYPE c,
           idx TYPE sy-tabix.
    **********by vincy on 12.01.07***********
    DATA: BEGIN  OF it_ekko OCCURS 0,
           ebeln LIKE ekko-ebeln,
           bukrs LIKE ekko-bukrs,
           bsart LIKE ekko-bsart,
           lifnr LIKE ekko-lifnr,
           belnr LIKE ekbe-belnr,
           END OF it_ekko.
    DATA: BEGIN  OF it_ekpo OCCURS 0,
           ebeln LIKE ekpo-ebeln,
           ebelp LIKE ekpo-ebelp,
           txz01 LIKE ekpo-txz01,
           END OF it_ekpo.
    DATA: BEGIN  OF it_lfa1v OCCURS 0,
           lifnr LIKE lfa1-lifnr,
           name1 LIKE lfa1-name1,
           END OF it_lfa1v.
    DATA: BEGIN  OF s_prctr OCCURS 0,
           low LIKE faglflexa-prctr,
           END OF s_prctr.
    DATA: it_bsegv TYPE TABLE OF wa1_bseg WITH HEADER LINE.
    DATA: it_konv1 LIKE konv OCCURS 0 WITH HEADER LINE.
    DATA:cnt TYPE i,
          awkey1(250).
    DATA: LIFNR TYPE LIFNR,
          NAME TYPE NAME1_GP,
          MTART TYPE MARA-MTART,
          MAKTX TYPE MAKTX,
          TAX_TOT TYPE KWERT.
    ***********end of changes by vincy ************
    Selection Screen
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS: s_werks1 FOR ekbe-werks,
                     s_budat1 FOR ekbe-budat,
                     s_fiscal FOR  ekbe-gjahr,
                     s_lifnr FOR lfa1-lifnr.
    SELECTION-SCREEN END OF BLOCK b1.
    **"changes being by nahid on 16.04.2008
    PARAMETERS : excel AS CHECKBOX DEFAULT 'X'.
    PARAMETERS: infile LIKE rlgrap-filename.
    DATA : zfile TYPE string.
    **"changes ended by nahid on 16.04.2008
    AT SELECTION-SCREEN.
       IF s_werks1 IS INITIAL.
         MESSAGE 'Please Enter Plant details' TYPE 'E'.
       ENDIF.
       IF s_budat1 IS INITIAL.
         MESSAGE 'Please Enter Posting date' TYPE 'E'.
       ENDIF.
       IF s_fiscal IS INITIAL.
         MESSAGE 'Please Enter Fiscal Year' TYPE 'E'.
       ENDIF.
    *start change by nahid on 16.4.08
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR infile.
      CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
        CHANGING
          file_name     = infile
        EXCEPTIONS
          mask_too_long = 1
          OTHERS        = 2.
    zfile = infile.
    *end change by nahid on 16.4.08
    START-OF-SELECTION.
    plant = s_werks1-low.
    MODIFIED FOR RUDRAPUR BY ASHOK.CH ON 13.03.2008
    IF PLANT NE 'RD01'.
       PERFORM get_data.
       PERFORM get_zpsr.                        "vincy
    ENDIF.
    IF PLANT EQ 'RD01'.
        PERFORM get_data1.
    ENDIF.
    *END OF MODIFICATION ON 13.03.2008
       PERFORM build_fieldcatalog.
       PERFORM build_layout.
       PERFORM display_alv_report.
    *start chng by nahid on 16.4.08
    IF excel = 'X'.
        IF NOT infile IS INITIAL.
          PERFORM excel_data.
        ELSE.
          MESSAGE e000(0) WITH 'Please Enter the File Path'.
        ENDIF.
      ENDIF.
    *end by nahid on 16.4.08
    *&      Form  get_data
    FORM get_data .
       SELECT belnr budat menge matnr ebelp ebeln gjahr lfbnr lfpos bldat  REEWR FROM ekbe INTO
       TABLE it_ekbe
       WHERE werks IN s_werks1 AND
            (bewtp EQ 'Q' OR bewtp EQ 'N')     AND
             bewtp IN ('Q' , 'N') AND                 "added N  by vincy on 6.07.2008
             budat IN s_budat1 AND
             gjahr IN s_fiscal .
       IF sy-subrc = 0.               "for 1st ekbe
         IF it_ekbe[] IS NOT INITIAL.
         SELECT exnum exdat lifnr matnr maktx capind exbas exbed ecs werks
         ritem1 rdoc1 docyr bedinv ecsinv EXADDINV1 exaddtax1  rdoc2 ritem2 menge
                FROM j_1iexcdtl INTO TABLE it_j_1iexcdtl FOR ALL ENTRIES IN it_ekbe
                WHERE rdoc1  = it_ekbe-ebeln
                AND ritem1 =  it_ekbe-ebelp AND
                lifnr IN s_lifnr.
         ENDIF.
           IF it_j_1iexcdtl[] IS NOT INITIAL.
           SELECT name1 ktokk werks lifnr FROM lfa1 INTO
                            TABLE it_lfa1 FOR ALL ENTRIES IN it_j_1iexcdtl
                             WHERE lifnr = it_j_1iexcdtl-lifnr.
          ENDIF.
           LOOP AT it_ekbe INTO wa_ekbe.
             wa1_ekbe-belnr        = wa_ekbe-belnr.
             wa1_ekbe-budat        = wa_ekbe-budat.
             wa1_ekbe-menge        = wa_ekbe-menge.
             wa1_ekbe-ebelp        = wa_ekbe-ebelp.
             wa1_ekbe-ebeln        = wa_ekbe-ebeln.
             wa1_ekbe-gjahr        = wa_ekbe-gjahr.
             wa1_ekbe-matnr        = wa_ekbe-matnr.
             wa1_ekbe-lfbnr        = wa_ekbe-lfbnr.
             wa1_ekbe-lfpos        = wa_ekbe-lfpos.
             wa1_ekbe-bldat        = wa_ekbe-bldat.
             v_belnr = wa_ekbe-belnr.
             v_gjahr = wa_ekbe-gjahr.
             CONCATENATE v_belnr v_gjahr INTO v_awkey.
             wa1_ekbe-awkey        = v_awkey.
             APPEND wa1_ekbe TO it1_ekbe.
             CLEAR :wa_ekbe.
           ENDLOOP.
    ************changes by vincy on 29.05.08 for 'FB08' and 'FB60'**************
           LOOP AT s_werks1.
             IF s_werks1-low = 'KN01'.
                s_prctr-low  = 'MUKNHSTM'.
             ELSEIF
              s_werks1-low = 'NS01'.
                s_prctr-low  = 'MUNSKSTM'.
             ELSEIF
              s_werks1-low = 'RD01'.
                s_prctr-low  = 'MURDPSTM'.
             ENDIF.
             APPEND s_prctr.
           ENDLOOP.
           SELECT bukrs belnr gjahr budat tcode awkey FROM bkpf INTO TABLE it_bkpf
                          WHERE bukrs = 'MU51'    AND
                          gjahr IN s_fiscal       AND
                          budat IN s_budat1       AND
                          ( tcode = 'FB60' OR  tcode = 'FB08' ).
          IF it_bkpf[] IS NOT INITIAL.
          SELECT ryear docnr rldnr rbukrs docln prctr FROM faglflexa INTO TABLE it_faglflexa
          FOR ALL ENTRIES IN it_bkpf WHERE rbukrs = 'MU51'   AND
                                           ryear  = it_bkpf-gjahr AND
                                           docnr  = it_bkpf-belnr.
          ENDIF.
          LOOP AT it_faglflexa.
            READ TABLE s_prctr WITH KEY low = it_faglflexa-prctr.
            IF sy-subrc <> 0.
            DELETE it_faglflexa.
            ENDIF.
            CLEAR: it_faglflexa, s_prctr.
          ENDLOOP.
    **************************end of change*************************************
           IF it1_ekbe[] IS NOT INITIAL.
           SELECT bukrs belnr gjahr budat tcode awkey FROM bkpf APPENDING
           TABLE it_bkpf FOR ALL ENTRIES IN it1_ekbe
                          WHERE bukrs = 'MU51'    AND
                          gjahr IN s_fiscal AND
                          awkey = it1_ekbe-awkey.
           ENDIF.
           IF sy-subrc = 0.       "bkpf
             IF it_bkpf[] IS NOT INITIAL.
             SELECT bukrs belnr gjahr buzei bschl fwbas pswbt hkont wrbtr  ktosl koart shkzg mwskz qsskz dmbtr lifnr matnr
                          FROM bseg INTO TABLE it1_bseg FOR ALL ENTRIES IN it_bkpf
                           WHERE belnr = it_bkpf-belnr AND
                                 gjahr = it_bkpf-gjahr AND
                                 bukrs = it_bkpf-bukrs AND
                                 ( bschl = '21' ) AND
                                 lifnr IN s_lifnr.                      "added 21 for miro cancelation
              IF it1_bseg[] IS NOT INITIAL.
              SELECT bukrs belnr gjahr buzei bschl fwbas pswbt hkont wrbtr  ktosl koart shkzg mwskz qsskz dmbtr lifnr matnr
                          FROM bseg INTO TABLE it_bseg FOR ALL ENTRIES IN it1_bseg
                           WHERE belnr = it1_bseg-belnr AND
                                 gjahr = it1_bseg-gjahr AND                    "changed it_bkpf to it1_bseg
                                 bukrs = it1_bseg-bukrs .
              LOOP AT it_bseg.
              it_bseg-wrbtr = it_bseg-wrbtr * -1.
              it_bseg-fwbas = it_bseg-fwbas * -1.
              it_bseg-pswbt = it_bseg-pswbt * -1.
              it_bseg-flag_21 = 'X'.
              MODIFY it_bseg.
              CLEAR it_bseg.
              ENDLOOP.
             SELECT name1 ktokk werks lifnr FROM lfa1 INTO
             TABLE it_lfa2 FOR ALL ENTRIES IN it1_bseg
                          WHERE lifnr = it1_bseg-lifnr.
             ENDIF.
             REFRESH it1_bseg.
             SELECT bukrs belnr gjahr buzei bschl fwbas pswbt hkont wrbtr  ktosl koart shkzg mwskz qsskz dmbtr lifnr matnr
                          FROM bseg INTO TABLE it1_bseg FOR ALL ENTRIES IN it_bkpf
                           WHERE belnr = it_bkpf-belnr AND
                                 gjahr = it_bkpf-gjahr AND
                                 bukrs = it_bkpf-bukrs AND
                                 ( bschl = '31' ) AND                      "added bschl and lifnr by vincy
                                 lifnr IN s_lifnr.
             IF it1_bseg[] IS NOT INITIAL.
             SELECT name1 ktokk werks lifnr FROM lfa1 APPENDING
             TABLE it_lfa2 FOR ALL ENTRIES IN it1_bseg
                          WHERE lifnr = it1_bseg-lifnr.
             SELECT bukrs belnr gjahr buzei bschl fwbas pswbt hkont wrbtr  ktosl koart shkzg mwskz qsskz dmbtr lifnr matnr
                          FROM bseg APPENDING TABLE it_bseg FOR ALL ENTRIES IN it1_bseg
                           WHERE belnr = it1_bseg-belnr AND
                                 gjahr = it1_bseg-gjahr AND                    "changed it_bkpf to it1_bseg
                                 bukrs = it1_bseg-bukrs AND
                                 bschl <> '35'.                                "added bschl to avoid vendor paymnt
            ENDIF.
            SELECT bukrs belnr gjahr buzei bschl fwbas pswbt hkont wrbtr  ktosl koart shkzg  mwskz qsskz dmbtr lifnr
                          FROM bseg APPENDING CORRESPONDING FIELDS OF TABLE it_bseg
                          FOR ALL ENTRIES IN it_bkpf
                          WHERE belnr = it_bkpf-belnr AND
                          gjahr = it_bkpf-gjahr AND
                          lifnr IN s_lifnr AND
                          bukrs = it_bkpf-bukrs AND qsskz IN ('WI', 'WJ').
            ENDIF.
          ENDIF.
           SORT it_bseg BY belnr buzei.
           IF NOT it_bseg[] IS INITIAL.
             SELECT saknr spras txt50 FROM skat
                              INTO TABLE iskat
                              FOR ALL ENTRIES IN it_bseg
                              WHERE saknr = it_bseg-hkont AND spras = 'EN'.
             SELECT  bukrs hkont augdt augbl zuonr gjahr belnr buzei budat qsskz FROM bsis
                               INTO TABLE zbsis
                               FOR ALL ENTRIES IN it_bseg
                               WHERE bukrs = 'MU51' AND hkont = it_bseg-hkont
                               AND belnr = it_bseg-belnr AND gjahr = s_fiscal
                               AND budat IN s_budat1.
           ENDIF.
           LOOP AT it_bseg.
             READ TABLE zbsis WITH KEY hkont = it_bseg-hkont.
             IF sy-subrc = 0.
               it_bseg-qsskz = zbsis-qsskz.
               MODIFY it_bseg.
             ENDIF.
             CLEAR: it_bseg,zbsis.
           ENDLOOP.
           LOOP AT zt059z.
             LOOP AT it_bseg WHERE qsskz = zt059z-wt_withcd.
               zt059z-hkont = it_bseg-hkont.
               zt059z-belnr = it_bseg-belnr.
               MODIFY zt059z.
               CLEAR: it_bseg,zt059z.
             ENDLOOP.
           ENDLOOP.
           CLEAR: wa_bkpf.
    *******Filling Wa.
          LOOP AT it_bkpf INTO wa_bkpf.                     "changes by vincy on 14.04.2008
            LOOP AT it1_ekbe INTO wa1_ekbe .
            READ TABLE it_bkpf INTO wa_bkpf
            WITH KEY awkey = wa1_ekbe-awkey.
             wa_tax-belnr     =    wa_bkpf-belnr.
             wa_tax-gjahr     =    wa_bkpf-gjahr.     
             wa_tax-bukrs     =    wa_bkpf-bukrs.
             wa_tax-awkey     =    wa_bkpf-awkey.
             wa_tax-ebelp     =    wa1_ekbe-ebelp.
             CLEAR: wa_bseg,wa_skat.
             READ TABLE it_bseg WITH KEY bukrs = wa_bkpf-bukrs
                                         belnr = wa_bkpf-belnr
                                         gjahr = wa_bkpf-gjahr  INTO wa_bseg.
             IF sy-subrc = 0.
               wa_tax-fi_docno  =    wa_bseg-belnr.
               wa_tax-mwskz     =    wa_bseg-mwskz.
             CLEAR: wa_bseg.
             READ TABLE it_bseg WITH KEY bukrs = wa_bkpf-bukrs
                                           belnr = wa_bkpf-belnr
                                           gjahr = wa_bkpf-gjahr
                                           flag = ''
                                           ktosl = 'JP4' INTO wa_bseg.
             IF sy-subrc = 0.
               wa_bseg-flag = 'X'.
               MODIFY it_bseg INDEX sy-tabix FROM wa_bseg.
               wa_tax-gl_accnt    =  wa_bseg-hkont.
               READ TABLE iskat INTO wa_skat WITH KEY saknr = wa_bseg-hkont.
               IF sy-subrc = 0.
                 wa_tax-gl_desc = wa_skat-txt50.
               ENDIF.
               wa_tax-set_off     =  wa_bseg-wrbtr.
               wa_tax-fwbas       =  wa_bseg-fwbas.
               wa_tax-cst_amt     =  wa_bseg-pswbt.
               wa_tax-description = 'CST CG Sett off'.
               wa_tax-cond_type   =  'JVCS'.
             ENDIF.
             READ TABLE it_bseg WITH KEY bukrs = wa_bkpf-bukrs
                                           belnr = wa_bkpf-belnr
                                           gjahr = wa_bkpf-gjahr
                                           flag = ''
                                           ktosl = 'VS1' INTO wa_bseg.
             IF sy-subrc = 0.
               wa_bseg-flag = 'X'.
               MODIFY it_bseg INDEX sy-tabix FROM wa_bseg.
               wa_tax-fwbas       =  wa_bseg-fwbas.
             ENDIF.
             READ TABLE it_bseg WITH KEY bukrs = wa_bkpf-bukrs
                                            belnr = wa_bkpf-belnr
                                            gjahr = wa_bkpf-gjahr
                                            flag = ''
                                            ktosl = 'JP7' INTO wa_bseg.
             IF sy-subrc = 0.
               wa_bseg-flag = 'X'.
               MODIFY it_bseg INDEX sy-tabix FROM wa_bseg.
               wa_tax-gl_accnt    =  wa_bseg-hkont.
               READ TABLE iskat INTO wa_skat WITH KEY saknr = wa_bseg-hkont.
               IF sy-subrc = 0.
                 wa_tax-gl_desc = wa_skat-txt50.
               ENDIF.
               wa_tax-set_off     =  wa_bseg-wrbtr.
               wa_tax-fwbas       =  wa_bseg-fwbas.
               wa_tax-vat_amt     =  wa_bseg-pswbt.
               wa_tax-description = 'VAT CG Sett off'.
               wa_tax-cond_type   =  'JVCD'.
             ENDIF.
             CLEAR wa_bseg.
            READ TABLE it_bseg WITH KEY bukrs = wa_bkpf-bukrs
                                       belnr = wa_bkpf-belnr
                                       gjahr = wa_bkpf-gjahr
                                       flag = ''
                                       ktosl = 'JP5' INTO wa_bseg.
              READ TABLE it_bseg WITH KEY bukrs = wa_bkpf-bukrs
                                        belnr = wa_bkpf-belnr
                                        gjahr = wa_bkpf-gjahr
                                        hkont = '0002868001' INTO     wa_bseg.       "vat changed for V0 tax code
             IF sy-subrc = 0.
               wa_bseg-flag = 'X'.
               MODIFY it_bseg INDEX sy-tabix FROM wa_bseg.
               wa_tax-gl_accnt  =  wa_bseg-hkont.
               READ TABLE iskat INTO wa_skat WITH KEY saknr = wa_bseg-hkont.
               IF sy-subrc = 0.
                 wa_tax-gl_desc = wa_skat-txt50.
               ENDIF.
               wa_tax-vat_amt   =  wa_bseg-pswbt.
               wa_tax-set_off   =  wa_bseg-wrbtr.
               wa_tax-cond_type =  'JVRD'.
               wa_tax-fwbas     =  wa_bseg-fwbas.
               wa_tax-description        = 'VAT RM Set off'.
             ENDIF.
             CLEAR: wa_bseg,wa_skat.
             READ TABLE it_bseg WITH KEY     bukrs = wa_bkpf-bukrs
                                             belnr = wa_bkpf-belnr
                                             gjahr = wa_bkpf-gjahr
                                             shkzg = 'H'
                                             koart = 'K'
                                             INTO     wa_bseg.
             IF sy-subrc = 0.
               wa_tax-total_value =  wa_bseg-wrbtr.
             ENDIF.
          START OF MODIFICATION BY ASHOK.CH ON 08.02.2008
            service_tax
             CLEAR wa_bseg.
             READ TABLE it_bseg WITH KEY bukrs = wa_bkpf-bukrs
                                        belnr = wa_bkpf-belnr
                                        gjahr = wa_bkpf-gjahr
                                        flag = ''
                                        ktosl = 'VS8'  INTO     wa_bseg.
             IF sy-subrc = 0.
               wa_bseg-flag = 'X'.
               MODIFY it_bseg INDEX sy-tabix FROM wa_bseg.
               wa_tax-gl_accnt  =    wa_bseg-hkont.
               READ TABLE iskat INTO wa_skat WITH KEY saknr = wa_bseg-hkont.
               IF sy-subrc = 0.
                 wa_tax-gl_desc = wa_skat-txt50.
               ENDIF.
               wa_tax-service_tax =  wa_bseg-wrbtr.
               wa_tax-description = 'Service Tax'.
               wa_tax-cond_type =  'JSRT'.
             ENDIF.
         service_ecess
             CLEAR: wa_bseg,wa_skat.
             READ TABLE it_bseg WITH KEY bukrs = wa_bkpf-bukrs
                                        belnr = wa_bkpf-belnr
                                        gjahr = wa_bkpf-gjahr
                                        flag = ''
                                        ktosl = 'VS9'  INTO  wa_bseg.
             IF sy-subrc = 0.
               wa_bseg-flag = 'X'.
               MODIFY it_bseg INDEX sy-tabix FROM wa_bseg.
               wa_tax-service_ecess =  wa_bseg-wrbtr.
             ENDIF.
    **********changes by vincy on 31.01.08*********************
        service_shcess
             CLEAR: wa_bseg.
             READ TABLE it_bseg WITH KEY bukrs = wa_bkpf-bukrs
                                        belnr = wa_bkpf-belnr
                                        gjahr = wa_bkpf-gjahr
                                        flag = ''
                                        ktosl = 'VSE'  INTO  wa_bseg.
             IF sy-subrc = 0.
               wa_bseg-flag = 'X'.
               MODIFY it_bseg INDEX sy-tabix FROM wa_bseg.
               wa_tax-service_shcess =  wa_bseg-wrbtr.
             ENDIF.
    *************************end of changes***********************
    END OF MODIFICATION ON 08.02.2008
             APPEND wa_tax TO it_tax.
             ENDIF.
             CLEAR :wa_tax,wa_bseg,wa_bkpf,wa_skat.
           ENDLOOP.
           CLEAR wa1_ekbe.
           LOOP AT it1_ekbe INTO wa1_ekbe.
            READ TABLE it_j_1iexcdtl INTO wa_j_1iexcdtl
                                    WITH KEY  rdoc1  = wa1_ekbe-ebeln
                                    ritem1 = wa1_ekbe-ebelp.
    *New query added by Nilesh
            READ TABLE it_j_1iexcdtl INTO wa_j_1iexcdtl
                                    WITH KEY  rdoc1  = wa1_ekbe-lfbnr
                                    ritem2 = wa1_ekbe-lfpos.
             READ TABLE it_bkpf INTO wa_bkpf
             WITH KEY awkey = wa1_ekbe-awkey.
             IF sy-subrc = 0.
             READ TABLE it_bseg WITH KEY bukrs = wa_bkpf-bukrs
                                        belnr = wa_bkpf-belnr
                                        gjahr = wa_bkpf-gjahr.
              IF sy-subrc = 0.
               wa_ekexclf-belnr  =       wa1_ekbe-belnr.
               wa_ekexclf-budat  =       wa1_ekbe-budat.
               wa_ekexclf-menge  =       wa1_ekbe-menge.
               wa_ekexclf-ebelp  =       wa1_ekbe-ebelp.
               wa_ekexclf-ebeln  =       wa1_ekbe-ebeln.
               wa_ekexclf-gjahr  =       wa1_ekbe-gjahr.
               wa_ekexclf-awkey  =       wa1_ekbe-awkey.
               wa_ekexclf-lifnr  =       it_bseg-lifnr.
               wa_ekexclf-matnr  =       it_bseg-matnr .
            READ TABLE it_j_1iexcdtl INTO wa_j_1iexcdtl                 "for records for which either rdoc1 or matnr
                                    WITH KEY  rdoc2  = wa1_ekbe-lfbnr   "not maintained in ekbe by vincy on 16.06.08
                                              menge  = wa1_ekbe-menge.
            IF sy-subrc <> 0 .
            READ TABLE it_j_1iexcdtl INTO wa_j_1iexcdtl
                                    WITH KEY  rdoc1  = wa1_ekbe-ebeln
                                              exdat  = wa1_ekbe-bldat
                                              matnr  = wa1_ekbe-matnr
                                              menge  = wa1_ekbe-menge.
            ENDIF.
             READ TABLE it_j_1iexcdtl INTO wa_j_1iexcdtl
                                     WITH KEY  rdoc1  = wa1_ekbe-ebeln
                                               ritem1 = wa1_ekbe-ebelp.
             IF sy-subrc = 0.
              wa_ekexclf-belnr  =       wa1_ekbe-belnr.
              wa_ekexclf-budat  =       wa1_ekbe-budat.
              wa_ekexclf-menge  =       wa1_ekbe-menge.
              wa_ekexclf-ebelp  =       wa1_ekbe-ebelp.
              wa_ekexclf-ebeln  =       wa1_ekbe-ebeln.
              wa_ekexclf-gjahr  =       wa1_ekbe-gjahr.
              wa_ekexclf-awkey  =       wa1_ekbe-awkey.
               wa_ekexclf-exnum  =       wa_j_1iexcdtl-exnum.
               wa_ekexclf-exdat  =       wa_j_1iexcdtl-exdat.
               wa_ekexclf-lifnr  =       wa_j_1iexcdtl-lifnr.
               wa_ekexclf-matnr  =       wa_j_1iexcdtl-matnr .
               wa_ekexclf-maktx  =       wa_j_1iexcdtl-maktx .
               wa_ekexclf-capind =        wa_j_1iexcdtl-capind.
               wa_ekexclf-exbas  =        wa_j_1iexcdtl-exbas.
              wa_ekexclf-exbed  =        wa_j_1iexcdtl-exbed.
              wa_ekexclf-ecs    =        wa_j_1iexcdtl-ecs.
               wa_ekexclf-werks  =        wa_j_1iexcdtl-werks.
               wa_ekexclf-ritem1 =       wa_j_1iexcdtl-ritem1.
               wa_ekexclf-rdoc1  =         wa_j_1iexcdtl-rdoc1.
               wa_ekexclf-docyr  =       wa_j_1iexcdtl-docyr.
              wa_ekexclf-exaddtax1  = wa_j_1iexcdtl-exaddtax1.
               IF it_bseg-flag_21 = 'X'.
               wa_ekexclf-exbas  = wa_ekexclf-exbas * -1.
               ENDIF.
    MODIFIED BY ASHOK.CH ON 08.03.2008
          IF wa_j_1iexcdtl-WERKS NE 'RD01' .
               wa_ekexclf-exbed  =        wa_j_1iexcdtl-exbed.
               wa_ekexclf-ecs    =        wa_j_1iexcdtl-ecs.
               wa_ekexclf-exaddtax1  = wa_j_1iexcdtl-exaddtax1.
               IF it_bseg-flag_21 = 'X'.
                 wa_ekexclf-exbed  =        wa_ekexclf-exbed * -1.
                 wa_ekexclf-ecs    =        wa_ekexclf-ecs * -1.
                 wa_ekexclf-exaddtax1  = wa_ekexclf-exaddtax1 * -1.
               ENDIF.
         ELSE.
               wa_ekexclf-exbed  =        wa_j_1iexcdtl-BEDINV.
               wa_ekexclf-ecs    =        wa_j_1iexcdtl-ecsINV.
               wa_ekexclf-exaddtax1  = wa_j_1iexcdtl-exaddINV1.
         ENDIF.
    END IF MODIFICATION ON 08.03.2008
              APPEND wa_ekexclf TO it_ekexclf.
              CLEAR :wa_lfa1,wa_j_1iexcdtl,wa1_ekbe.
             ENDIF.
               READ TABLE it_lfa2 INTO wa_lfa2
               WITH KEY lifnr = wa_ekexclf-lifnr.
               IF sy-subrc = 0.
                 wa_ekexclf-name1  =        wa_lfa2-name1.
                 wa_ekexclf-ktokk  =        wa_lfa2-ktokk.
               ENDIF.
               APPEND wa_ekexclf TO it_ekexclf.
             ENDIF.
             ENDIF.
               CLEAR :wa_lfa1,wa_j_1iexcdtl,wa1_ekbe,wa_lfa2,wa_ekexclf.
           ENDLOOP.
           CLEAR wa_ekexclf.
           LOOP AT it_ekexclf INTO wa_ekexclf.
             wa_final-belnr     =       wa_ekexclf-belnr.
             wa_final-budat     =       wa_ekexclf-budat.
             wa_final-menge     =       wa_ekexclf-menge.
             wa_final-ebelp     =       wa_ekexclf-ebelp.
             wa_final-ebeln     =       wa_ekexclf-ebeln.
             wa_final-gjahr     =       wa_ekexclf-gjahr.
             wa_final-awkey     =       wa_ekexclf-awkey.
             wa_final-exnum     =       wa_ekexclf-exnum.
             wa_final-exdat     =       wa_ekexclf-exdat.
             wa_final-lifnr     =       wa_ekexclf-lifnr.
             wa_final-matnr     =       wa_ekexclf-matnr .
             wa_final-maktx     =       wa_ekexclf-maktx .
             wa_final-shcess_amt = wa_ekexclf-exaddtax1.
             IF  wa_ekexclf-capind = 'C'.
               wa_final-capind    =  'Consumables'.
             ENDIF.
             IF  wa_ekexclf-capind = 'A'.
               wa_final-capind    =  'Assets'.
             ENDIF.
             IF  wa_ekexclf-capind = 'T'.
               wa_final-capind    =   'Tools'.
             ENDIF.
             IF  wa_ekexclf-capind = ''.
               wa_final-capind    =   'Raw Material'.
             ENDIF.
             IF  wa_ekexclf-capind = 'N'.
               wa_final-capind    =  'Non Cenvatable'.
             ENDIF.
             IF  wa_ekexclf-capind NE 'C' AND wa_ekexclf-capind NE 'A' AND
                 wa_ekexclf-capind NE '' AND wa_ekexclf-capind NE 'N'.
               wa_final-capind    = wa_ekexclf-capind.
             ENDIF.
             wa_final-exbas     =       wa_ekexclf-exbas.
             wa_final-exbed     =       wa_ekexclf-exbed.
             wa_final-ecs       =       wa_ekexclf-ecs.
             wa_final-werks     =       wa_ekexclf-werks.
             wa_final-ritem1    =       wa_ekexclf-ritem1.
             wa_final-rdoc1     =       wa_ekexclf-rdoc1.
             wa_final-docyr     =       wa_ekexclf-docyr.
             wa_final-name1     =       wa_ekexclf-name1.
             wa_final-ktokk     =       wa_ekexclf-ktokk.
             wa_final-excise    =       wa_final-exbas + wa_final-exbed + wa_final-ecs + wa_final-shcess_amt.
             CLEAR :wa_tax.

    Hi ,
    I think you are using the redundant selects to fetch the data from BSEG.
    First select all the data into an internal table based on  bkpf.
    Now you can distribute the data into whatever tables you want using the loop,read-binary search and append statements..
    Loop at it_bseg.
    read it_bseg where
                        xxxxx
                        xxxxx
                        binary search.
    append wa to it2_bseg.
    endloop              
    This avoid several database fetches..
    Thank you..

  • How to change the reconciliation account in customer master record?

    hi friends,
    i created customer master with wrong reconsiliation account in XD01. i failed when i am trying to change that reconsiliation account in XD02. it was suppressed. how to change the reconcilition account in customer master data?

    Hi,
    Go to this path: Spro>Financial Accounting>Account Receivable & Account Payable>Customer Accounts>Master Data>Preparations for Creating Customer Master Data>Define Account Groups with Screen Layout (Customers)
    Double Click on Your Group, Then Click on Company code Data under Field Status, Then Double click on Account Management, That screen you will find the Reconcilation Account, Select Requred Entry.
    now it will coming Customer master.
    It's useful assigne points as a way to say Thanks
    Regards
    gvr

  • Modify Reconciliation Account of Customer Master Data

    Hi,
    I need to change Reconciliation Account into master data for some customer
    I've already changed the field  status group of customer by customizing, setting into area 'Company code data' the Reconciliation Account as optional entry.
    But that field into master data of customer remain not editable.
    What am I missing?
    Any assistance would be greatly appreciated.
    Best Regards.
    Eric

    Hi,
    If you do not have data for the customer account, you can change directly.
    But, if you already have data posted, this is the procedure of changing recon account, if you have data.
    All Document Items that were created in the old account will be posted in the same old account when you have a payment posting, compensations, etc.
    All document created after the change will be posted in the new account as well as the payment postings, compensations and others. 
    The system will separate the postings in accordance with the moment at the documents were created. 
    You should run balance sheet adjustment program after any reconciliation account change. 
    The system performs any adjustments required due to the change of reconciliation accounts or G/L accounts. The items from the old reconciliation accounts are allocated to the new accounts. 
    Since you cannot post to the reconciliation accounts directly, the postings are made to temporary adjustment accounts. 
    These adjustment accounts should be displayed along with the relevant reconciliation account in the balance sheet. The postings are then reversed after the balance sheet has been created. 
    The program for sorting the payables and receivables makes the necessary adjustments automatically. This means that you have to define the adjustment account numbers and the posting keys for these postings in the system. 
    If you purchase and install the FI-LC Consolidation application and have bought up a previous customer or vendor (thus also taking on his/her payables and receivables), please refer to the note in the report documentation on changed reconciliation accounts. To define the account numbers, select the activity Define adjustment accounts for changed reconciliation accounts in the Accounts Receivable and Accounts Payable Implementation Guide.
    You should only run this program if your new reconciliation account is classified differently from the original in your FS. e.g.. AR to Intercompany accounts. It will just reclassify the existing balance. The line items will not be transferred. If not then no need to run the program at all.
    You can do a test in the development client before you do the change in the production. 
    Good Luck,
    Raghu

Maybe you are looking for