<?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: Program termination bkpf, bseg in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-termination-bkpf-bseg/m-p/4492298#M1063171</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Lakshman, please can you help me with this code?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a problem. &lt;/P&gt;&lt;P&gt;When I enter input in S_CPUDT 03.09.2008 and in S_GSBER 02 I get desired output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But when I enter 04.09.2008 and 07 for another document I dont get data from bseg, just from bkpf.&lt;/P&gt;&lt;P&gt;Also, when I enter in S_CPUDT 03.09.2008 - 04.09.2008 and in S_GSBER 02 - 07&lt;/P&gt;&lt;P&gt;I got data only from bkpf for both entries and no data at all from bseg??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please have a look at this code...&lt;/P&gt;&lt;P&gt;I appreciate a lot..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tables: bkpf,bseg,bsid.&lt;/P&gt;&lt;P&gt;data: it_bkpf type table of bkpf with header line,&lt;/P&gt;&lt;P&gt;wa_bkpf type bkpf,&lt;/P&gt;&lt;P&gt;it_bseg type table of bseg with header line,&lt;/P&gt;&lt;P&gt;wa_bseg type bseg,&lt;/P&gt;&lt;P&gt;it_bsid type table of bsid with header line,&lt;/P&gt;&lt;P&gt;wa_bsid type bsid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select-options: s_cpudt for bkpf-cpudt,&lt;/P&gt;&lt;P&gt;                s_gsber for bseg-gsber.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from bkpf into table it_bkpf&lt;/P&gt;&lt;P&gt;where cpudt in s_cpudt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from bseg into table it_bseg&lt;/P&gt;&lt;P&gt;for all entries in it_bkpf where&lt;/P&gt;&lt;P&gt;        bukrs = it_bkpf-bukrs and&lt;/P&gt;&lt;P&gt;        belnr = it_bkpf-belnr and&lt;/P&gt;&lt;P&gt;        gjahr = it_bkpf-gjahr and&lt;/P&gt;&lt;P&gt;        gsber in s_gsber.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from bsid into table it_bsid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at it_bkpf into wa_bkpf.&lt;/P&gt;&lt;P&gt;clear it_bsid.&lt;/P&gt;&lt;P&gt;read table it_bsid with key belnr = wa_bkpf-belnr.&lt;/P&gt;&lt;P&gt;if it_bsid-xref1 is initial.&lt;/P&gt;&lt;P&gt;delete table it_bkpf from wa_bkpf.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at it_bseg into wa_bseg.&lt;/P&gt;&lt;P&gt;clear it_bsid.&lt;/P&gt;&lt;P&gt;read table it_bsid with key belnr = wa_bkpf-belnr.&lt;/P&gt;&lt;P&gt;if it_bsid-xref1 is initial.&lt;/P&gt;&lt;P&gt;delete table it_bseg from wa_bseg.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*write: / 'Zaglavlje'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at it_bkpf into wa_bkpf.&lt;/P&gt;&lt;P&gt;  write: wa_bkpf-cpudt, wa_bkpf-usnam.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*skip 1.&lt;/P&gt;&lt;P&gt;*write: / 'Stavka'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at it_bseg into wa_bseg.&lt;/P&gt;&lt;P&gt;  write:/ wa_bseg-gsber, wa_bseg-belnr, wa_bseg-wrbtr.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: nihad omerbegovic on Sep 5, 2008 9:53 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 05 Sep 2008 07:52:52 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-09-05T07:52:52Z</dc:date>
    <item>
      <title>Program termination bkpf, bseg</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-termination-bkpf-bseg/m-p/4492285#M1063158</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 want to write out a simple report that returns me one field from BKPF and one from BSEG. When I execute this I got program termination, please help...Any idea what is wrong..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tables: bkpf,bseg.&lt;/P&gt;&lt;P&gt;data: it_bkpf type table of bkpf with header line,&lt;/P&gt;&lt;P&gt;      wa_bkpf type bkpf,&lt;/P&gt;&lt;P&gt;      it_bseg type table of bseg with header line,&lt;/P&gt;&lt;P&gt;      wa_bseg type bseg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select-options: s_cpudt for bkpf-cpudt,&lt;/P&gt;&lt;P&gt;                s_gsber for bseg-gsber.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from bkpf into table it_bkpf&lt;/P&gt;&lt;P&gt;         where cpudt in s_cpudt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from bseg into table it_bseg&lt;/P&gt;&lt;P&gt;         where gsber in s_gsber.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at it_bkpf into wa_bkpf.&lt;/P&gt;&lt;P&gt;data t_xref1 like bsid-xref1 value ''.&lt;/P&gt;&lt;P&gt;select xref1 into t_xref1 from bsid where&lt;/P&gt;&lt;P&gt;  belnr = wa_bkpf-belnr.&lt;/P&gt;&lt;P&gt;  if t_xref1 = ''.&lt;/P&gt;&lt;P&gt;    delete table it_bkpf from wa_bkpf.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;endselect.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at it_bseg into wa_bseg.&lt;/P&gt;&lt;P&gt;data t1_xref1 like bsid-xref1 value ''.&lt;/P&gt;&lt;P&gt;select xref1 into t1_xref1 from bsid where&lt;/P&gt;&lt;P&gt;  belnr = wa_bseg-belnr.&lt;/P&gt;&lt;P&gt;  if t1_xref1 = ''.&lt;/P&gt;&lt;P&gt;    delete table it_bseg from wa_bseg.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;endselect.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot for any help...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nihad&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Sep 2008 08:45:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-termination-bkpf-bseg/m-p/4492285#M1063158</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-04T08:45:46Z</dc:date>
    </item>
    <item>
      <title>Re: Program termination bkpf, bseg</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-termination-bkpf-bseg/m-p/4492286#M1063159</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;can u please tell exactly at which line it is giving dump?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Aparna Gaikwad&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Sep 2008 08:47:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-termination-bkpf-bseg/m-p/4492286#M1063159</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-04T08:47:39Z</dc:date>
    </item>
    <item>
      <title>Re: Program termination bkpf, bseg</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-termination-bkpf-bseg/m-p/4492287#M1063160</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It gives dump before first loop &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at it_bkpf into wa_bkpf.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nihad&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Sep 2008 08:51:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-termination-bkpf-bseg/m-p/4492287#M1063160</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-04T08:51:18Z</dc:date>
    </item>
    <item>
      <title>Re: Program termination bkpf, bseg</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-termination-bkpf-bseg/m-p/4492288#M1063161</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI DUDE,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tables: bkpf,bseg.&lt;/P&gt;&lt;P&gt;data: it_bkpf type table of bkpf with header line,&lt;/P&gt;&lt;P&gt;wa_bkpf type bkpf,&lt;/P&gt;&lt;P&gt;it_bseg type table of bseg with header line,&lt;/P&gt;&lt;P&gt;wa_bseg type bseg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select-options: s_cpudt for bkpf-cpudt,&lt;/P&gt;&lt;P&gt;s_gsber for bseg-gsber.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from bkpf into table it_bkpf&lt;/P&gt;&lt;P&gt;where cpudt in s_cpudt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from bseg into table it_bseg&lt;/P&gt;&lt;P&gt;where gsber in s_gsber.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at it_bkpf into wa_bkpf.&lt;/P&gt;&lt;P&gt;data t_xref1 like bsid-xref1 value ''.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;THE ERROR IS IN THE BELOW LINE,wRITE SELECT SINGLE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select xref1 into t_xref1 from bsid where&lt;/P&gt;&lt;P&gt;belnr = wa_bkpf-belnr.&lt;/P&gt;&lt;P&gt;if t_xref1 = ''.&lt;/P&gt;&lt;P&gt;delete table it_bkpf from wa_bkpf.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endselect.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at it_bseg into wa_bseg.&lt;/P&gt;&lt;P&gt;data t1_xref1 like bsid-xref1 value ''.&lt;/P&gt;&lt;P&gt;select xref1 into t1_xref1 from bsid where&lt;/P&gt;&lt;P&gt;belnr = wa_bseg-belnr.&lt;/P&gt;&lt;P&gt;if t1_xref1 = ''.&lt;/P&gt;&lt;P&gt;delete table it_bseg from wa_bseg.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endselect.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Sep 2008 08:51:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-termination-bkpf-bseg/m-p/4492288#M1063161</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-04T08:51:51Z</dc:date>
    </item>
    <item>
      <title>Re: Program termination bkpf, bseg</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-termination-bkpf-bseg/m-p/4492289#M1063162</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Time Out Dump ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
select * from bkpf into table it_bkpf
where cpudt in s_cpudt.

select * from bseg into table it_bseg
where gsber in s_gsber.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This queries are work very slow, because not uses indexes and key-fields.&lt;/P&gt;&lt;P&gt;Add some additional conditions into queries.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Sep 2008 08:53:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-termination-bkpf-bseg/m-p/4492289#M1063162</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-04T08:53:02Z</dc:date>
    </item>
    <item>
      <title>Re: Program termination bkpf, bseg</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-termination-bkpf-bseg/m-p/4492290#M1063163</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Select the entries from BSEG table based on the entries in &lt;/P&gt;&lt;P&gt;it_bkpf table entries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Raju.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Sep 2008 08:55:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-termination-bkpf-bseg/m-p/4492290#M1063163</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-04T08:55:41Z</dc:date>
    </item>
    <item>
      <title>Re: Program termination bkpf, bseg</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-termination-bkpf-bseg/m-p/4492291#M1063164</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I havent solved this yet..:(&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any peace of code will be great...I am stuck with this,  selects take long time really...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am waiting for any help guys...thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: nihad omerbegovic on Sep 4, 2008 11:44 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Sep 2008 09:39:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-termination-bkpf-bseg/m-p/4492291#M1063164</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-04T09:39:59Z</dc:date>
    </item>
    <item>
      <title>Re: Program termination bkpf, bseg</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-termination-bkpf-bseg/m-p/4492292#M1063165</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Don't fetch data from table BSID in the loop of it_bkpf or it_bseg. Use 'for all entries'. This will reduce database hits and thus will increase performance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Aparna Gaikwad&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Sep 2008 09:45:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-termination-bkpf-bseg/m-p/4492292#M1063165</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-04T09:45:16Z</dc:date>
    </item>
    <item>
      <title>Re: Program termination bkpf, bseg</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-termination-bkpf-bseg/m-p/4492293#M1063166</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to take fields from bkpf and bseg only where bsid-xref1 is not empty....Any helpfull code???&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Sep 2008 09:57:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-termination-bkpf-bseg/m-p/4492293#M1063166</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-04T09:57:35Z</dc:date>
    </item>
    <item>
      <title>Re: Program termination bkpf, bseg</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-termination-bkpf-bseg/m-p/4492294#M1063167</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi nihad,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tables: bkpf,bseg,bsid.&lt;/P&gt;&lt;P&gt;data: it_bkpf type table of bkpf with header line,&lt;/P&gt;&lt;P&gt;wa_bkpf type bkpf,&lt;/P&gt;&lt;P&gt;it_bseg type table of bseg with header line,&lt;/P&gt;&lt;P&gt;wa_bseg type bseg,&lt;/P&gt;&lt;P&gt;it_bsid type table of bsid with header line,&lt;/P&gt;&lt;P&gt;wa_bsid type bsid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select-options: s_cpudt for bkpf-cpudt,&lt;/P&gt;&lt;P&gt;s_gsber for bseg-gsber.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from bkpf into table it_bkpf&lt;/P&gt;&lt;P&gt;where cpudt in s_cpudt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from bseg into table it_bseg&lt;/P&gt;&lt;P&gt;for all entries in it_bkpf&lt;/P&gt;&lt;P&gt;where bukrs = it_bkpf-bukrs and&lt;/P&gt;&lt;P&gt;belnr = it_bkpf-belnr and&lt;/P&gt;&lt;P&gt;gjahr = it_bkpf-gjahr and&lt;/P&gt;&lt;P&gt;gsber in s_gsber.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from bsid into table it_bsid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at it_bkpf into wa_bkpf.&lt;/P&gt;&lt;P&gt;clear it_bsid.&lt;/P&gt;&lt;P&gt;read table it_bsid with key belnr = wa_bkpf-belnr.&lt;/P&gt;&lt;P&gt;if it_bsid-xref1 is initial.&lt;/P&gt;&lt;P&gt;delete table it_bkpf from wa_bkpf.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at it_bseg into wa_bseg.&lt;/P&gt;&lt;P&gt;clear it_bsid.&lt;/P&gt;&lt;P&gt;read table it_bsid with key belnr = wa_bkpf-belnr.&lt;/P&gt;&lt;P&gt;if it_bsid-xref1 is initial.&lt;/P&gt;&lt;P&gt;delete table it_bseg from wa_bseg.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Lakshman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Sep 2008 10:00:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-termination-bkpf-bseg/m-p/4492294#M1063167</guid>
      <dc:creator>Lakshmant1</dc:creator>
      <dc:date>2008-09-04T10:00:51Z</dc:date>
    </item>
    <item>
      <title>Re: Program termination bkpf, bseg</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-termination-bkpf-bseg/m-p/4492295#M1063168</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you all guys, this is solved.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nihad&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Sep 2008 10:16:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-termination-bkpf-bseg/m-p/4492295#M1063168</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-04T10:16:12Z</dc:date>
    </item>
    <item>
      <title>Re: Program termination bkpf, bseg</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-termination-bkpf-bseg/m-p/4492296#M1063169</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys, just one more question please...&lt;/P&gt;&lt;P&gt;How can I add in this report a field KNA1-KUNNR? what is peace of code for this?&lt;/P&gt;&lt;P&gt;I can't read kunnr from any of those tables I already have in report...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to have customer number in report output as well...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Nihad&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Sep 2008 06:46:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-termination-bkpf-bseg/m-p/4492296#M1063169</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-05T06:46:19Z</dc:date>
    </item>
    <item>
      <title>Re: Program termination bkpf, bseg</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-termination-bkpf-bseg/m-p/4492297#M1063170</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Nihad,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;KUNNR is avialable in BSID table, you can use IT_BSID table for displaying KUNNR related to BELNR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Lakshman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Sep 2008 06:50:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-termination-bkpf-bseg/m-p/4492297#M1063170</guid>
      <dc:creator>Lakshmant1</dc:creator>
      <dc:date>2008-09-05T06:50:49Z</dc:date>
    </item>
    <item>
      <title>Re: Program termination bkpf, bseg</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-termination-bkpf-bseg/m-p/4492298#M1063171</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Lakshman, please can you help me with this code?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a problem. &lt;/P&gt;&lt;P&gt;When I enter input in S_CPUDT 03.09.2008 and in S_GSBER 02 I get desired output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But when I enter 04.09.2008 and 07 for another document I dont get data from bseg, just from bkpf.&lt;/P&gt;&lt;P&gt;Also, when I enter in S_CPUDT 03.09.2008 - 04.09.2008 and in S_GSBER 02 - 07&lt;/P&gt;&lt;P&gt;I got data only from bkpf for both entries and no data at all from bseg??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please have a look at this code...&lt;/P&gt;&lt;P&gt;I appreciate a lot..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tables: bkpf,bseg,bsid.&lt;/P&gt;&lt;P&gt;data: it_bkpf type table of bkpf with header line,&lt;/P&gt;&lt;P&gt;wa_bkpf type bkpf,&lt;/P&gt;&lt;P&gt;it_bseg type table of bseg with header line,&lt;/P&gt;&lt;P&gt;wa_bseg type bseg,&lt;/P&gt;&lt;P&gt;it_bsid type table of bsid with header line,&lt;/P&gt;&lt;P&gt;wa_bsid type bsid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select-options: s_cpudt for bkpf-cpudt,&lt;/P&gt;&lt;P&gt;                s_gsber for bseg-gsber.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from bkpf into table it_bkpf&lt;/P&gt;&lt;P&gt;where cpudt in s_cpudt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from bseg into table it_bseg&lt;/P&gt;&lt;P&gt;for all entries in it_bkpf where&lt;/P&gt;&lt;P&gt;        bukrs = it_bkpf-bukrs and&lt;/P&gt;&lt;P&gt;        belnr = it_bkpf-belnr and&lt;/P&gt;&lt;P&gt;        gjahr = it_bkpf-gjahr and&lt;/P&gt;&lt;P&gt;        gsber in s_gsber.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from bsid into table it_bsid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at it_bkpf into wa_bkpf.&lt;/P&gt;&lt;P&gt;clear it_bsid.&lt;/P&gt;&lt;P&gt;read table it_bsid with key belnr = wa_bkpf-belnr.&lt;/P&gt;&lt;P&gt;if it_bsid-xref1 is initial.&lt;/P&gt;&lt;P&gt;delete table it_bkpf from wa_bkpf.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at it_bseg into wa_bseg.&lt;/P&gt;&lt;P&gt;clear it_bsid.&lt;/P&gt;&lt;P&gt;read table it_bsid with key belnr = wa_bkpf-belnr.&lt;/P&gt;&lt;P&gt;if it_bsid-xref1 is initial.&lt;/P&gt;&lt;P&gt;delete table it_bseg from wa_bseg.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*write: / 'Zaglavlje'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at it_bkpf into wa_bkpf.&lt;/P&gt;&lt;P&gt;  write: wa_bkpf-cpudt, wa_bkpf-usnam.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*skip 1.&lt;/P&gt;&lt;P&gt;*write: / 'Stavka'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at it_bseg into wa_bseg.&lt;/P&gt;&lt;P&gt;  write:/ wa_bseg-gsber, wa_bseg-belnr, wa_bseg-wrbtr.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: nihad omerbegovic on Sep 5, 2008 9:53 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Sep 2008 07:52:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-termination-bkpf-bseg/m-p/4492298#M1063171</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-05T07:52:52Z</dc:date>
    </item>
    <item>
      <title>Re: Program termination bkpf, bseg</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-termination-bkpf-bseg/m-p/4492299#M1063172</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You should open a new thread for this new question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, nobody specifically pointed out the major problem of your code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;select * from bkpf into table it_bkpf
where cpudt in s_cpudt.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You always want to give BUKRS when accessing BKPF, then the system will use secondary index "5" for quick access via CPUDT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After this select the entries from BSEG using "for all entries" on BUKRS, BELNR, GJAHR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Sep 2008 08:01:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-termination-bkpf-bseg/m-p/4492299#M1063172</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2008-09-05T08:01:11Z</dc:date>
    </item>
    <item>
      <title>Re: Program termination bkpf, bseg</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-termination-bkpf-bseg/m-p/4492300#M1063173</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Thomas I have opened a new thread for this problem as well...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lakshman, I wait for your reply you must have idea &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Sep 2008 08:29:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-termination-bkpf-bseg/m-p/4492300#M1063173</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-05T08:29:35Z</dc:date>
    </item>
  </channel>
</rss>

