<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Ledger Report in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/ledger-report/m-p/3847441#M924997</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the reply sir.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But sir we are talking of over 10 million records in the table bseg. Is there any alternative way of minimizing performance by accessing those tables excluding BSEG. The parameters are bukrs, budat ang gjahr. I currently using the query to bseg table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 20 May 2008 02:21:03 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-05-20T02:21:03Z</dc:date>
    <item>
      <title>Ledger Report</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/ledger-report/m-p/3847439#M924995</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi experts, i'm new in ABAP programming. Can anybody give me a better query of the following condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. sum amount(DMBTR) in this row if document type is KZ. Include amount if document number exist in BSAS, BSIS, BSAK and BSIK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. sum amount(DMBTR) in this row if document type is KR. Include amount if document number exist in BSAS, BSIS, BSAK and BSIK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. sum amount(DMBTR) in this row if document type is DR. Include amount if document number exist in BSAS, BSIS, BSAD and BSID.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4.sum amount(DMBTR) in this row if document type is DZ. Include amount if document number exist in BSAS, BSIS, BSAD and BSID.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;5.sum amount(DMBTR) of all other document types. Include amount if document number exist in BSAS, BSIS, BSAK and BSIK, BSAD and BSID.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;6. sum amount(DMBTR) if document number exist in BSAS, BSIS but not in BSAK, BSIK, BSAD and BSID.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any satisfactory reply will be given points.&lt;/P&gt;&lt;P&gt;Please guys i really need your help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 May 2008 06:09:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/ledger-report/m-p/3847439#M924995</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-19T06:09:22Z</dc:date>
    </item>
    <item>
      <title>Re: Ledger Report</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/ledger-report/m-p/3847440#M924996</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My feeling is that you are probably better off describing the business requirement than the proposing these various table reads... my instinct is that your report may well work better if you were to start with BKPF (document header) and then the corresponding BSEG entries... the data in the BSI* and BSA* index tables comes from these two sources so if your business requirement is something like "&lt;EM&gt;for documents in company code XYZ posted to SAP between 01.01.2008 and 31.01.2008, provide cleared and open item totals for the following document types&lt;/EM&gt;" then you should find that a select from BKPF via the BUKRS+CPUDT key followed by an efficient access into BSEG will probably give you the data you need... but try rephrasing your question and you should get some more relevant assistance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To help you along your way, it's worth noting that the table names you mentioned follow a certain pattern - all of them start "BS" and the 3rd character is "I" if the item is uncleared (e.g. the AUGDT clearing date will be empty) or "A" if the item is cleared... and the 4th character is based on the "account type" (field KOART) in BSEG e.g. "K" = Kreditor... thus BSIK = Open vendor items, and BSAD = cleared debtor items.  So rule 4, for example, could be rephrased as "&lt;EM&gt;4. if BKPF-BLART (document type) is DZ and BSEG-KOART = 'D' or BSEG-KOART = 'S' then add BSEG-DMBTR to sum4&lt;/EM&gt;".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 May 2008 07:03:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/ledger-report/m-p/3847440#M924996</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-19T07:03:58Z</dc:date>
    </item>
    <item>
      <title>Re: Ledger Report</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/ledger-report/m-p/3847441#M924997</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the reply sir.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But sir we are talking of over 10 million records in the table bseg. Is there any alternative way of minimizing performance by accessing those tables excluding BSEG. The parameters are bukrs, budat ang gjahr. I currently using the query to bseg table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 May 2008 02:21:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/ledger-report/m-p/3847441#M924997</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-20T02:21:03Z</dc:date>
    </item>
    <item>
      <title>Re: Ledger Report</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/ledger-report/m-p/3847442#M924998</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's why I suggest going through BKPF to restrict your initial selection first - and then you go to BSEG for the document numbers you have identified.  There is a BKPF index on BUKRS + BSTAT + BUDAT so you should be able to bring the matching document list down very fast, then you can do blocks of selects back to BSEG for the document number (BUKRS&lt;EM&gt;BELNR&lt;/EM&gt;GJAHR) you have identified, and sum the results.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And if you have 10 million records in BSEG, then it's quite likely you have nearly the same number of records split between the BSI* and BSA* tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 May 2008 02:35:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/ledger-report/m-p/3847442#M924998</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-20T02:35:56Z</dc:date>
    </item>
  </channel>
</rss>

