<?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: Read FI Document efficiently in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-fi-document-efficiently/m-p/2223429#M477562</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;always avoid a select statement inside a loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;first select from ekpo.&lt;/P&gt;&lt;P&gt; select from ekbe for all entries in it_ekpo.&lt;/P&gt;&lt;P&gt;select from mseg /mkpf  for all entries in it_ekbe.&lt;/P&gt;&lt;P&gt;select from bseg for all entries in it_mseg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now &lt;/P&gt;&lt;P&gt;loop  at it_ekpo.&lt;/P&gt;&lt;P&gt;read table  it_ekbe where ebeln = it_ekpo-ebeln and ebelp = it_ekpo-ebelp.&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;move this value to an in tab.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read table it_mseg..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read it_bseg..&lt;/P&gt;&lt;P&gt;modify intab...&lt;/P&gt;&lt;P&gt;endloop...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 09 May 2007 17:23:32 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-05-09T17:23:32Z</dc:date>
    <item>
      <title>Read FI Document efficiently</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-fi-document-efficiently/m-p/2223428#M477561</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a question here, I am now creating a report for Goods Receipt(GR) and Invoices Receipt(IR) based on PO selection. I know that from EKBE table we can get all the GR/IR history for each PO item, but I am required to get GR/IR amount/quantity from FI document, which is BSEG table, because I need to get the amount based on G/L account. May I know what is the efficient way in order to get this? I am currently using SAP R/3 v4.7&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I am doing now is:&lt;/P&gt;&lt;P&gt;1. looping in the PO data.&lt;/P&gt;&lt;P&gt;1. read EKBE data using FM 'ME_READ_HISTORY', &lt;/P&gt;&lt;P&gt;2. loop in the ekbe data returned from the FM, &lt;/P&gt;&lt;P&gt;3. read Material Document, &lt;/P&gt;&lt;P&gt;4. get accounting document by using FM 'FI_DOCUMENT_RECORD'&lt;/P&gt;&lt;P&gt;5. get amount and quantity from BSEG table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And what I am doing now causing performance problem when transported to Testing Evironment, please tell me what is the efficient way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 May 2007 16:56:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-fi-document-efficiently/m-p/2223428#M477561</guid>
      <dc:creator>zheng_yingjie</dc:creator>
      <dc:date>2007-05-09T16:56:23Z</dc:date>
    </item>
    <item>
      <title>Re: Read FI Document efficiently</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-fi-document-efficiently/m-p/2223429#M477562</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;always avoid a select statement inside a loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;first select from ekpo.&lt;/P&gt;&lt;P&gt; select from ekbe for all entries in it_ekpo.&lt;/P&gt;&lt;P&gt;select from mseg /mkpf  for all entries in it_ekbe.&lt;/P&gt;&lt;P&gt;select from bseg for all entries in it_mseg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now &lt;/P&gt;&lt;P&gt;loop  at it_ekpo.&lt;/P&gt;&lt;P&gt;read table  it_ekbe where ebeln = it_ekpo-ebeln and ebelp = it_ekpo-ebelp.&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;move this value to an in tab.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read table it_mseg..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read it_bseg..&lt;/P&gt;&lt;P&gt;modify intab...&lt;/P&gt;&lt;P&gt;endloop...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 May 2007 17:23:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-fi-document-efficiently/m-p/2223429#M477562</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-09T17:23:32Z</dc:date>
    </item>
    <item>
      <title>Re: Read FI Document efficiently</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-fi-document-efficiently/m-p/2223430#M477563</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;BSEG is a cluster table. Make sure you are using full key to access.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 May 2007 15:37:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-fi-document-efficiently/m-p/2223430#M477563</guid>
      <dc:creator>alison_lloyd</dc:creator>
      <dc:date>2007-05-10T15:37:29Z</dc:date>
    </item>
  </channel>
</rss>

