<?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 Read Table BSEG in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-bseg/m-p/1215895#M134826</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to filter the data from BSEG table for a given period.  Since, there is no document date in BSEG, I have done the following.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First : I have taken the data from BKPF table for a given period into an internal table IT_BKPF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then,  Looping at IT_BKPF, i am reading the table BSEG for BELNR field.  But the system gives the following error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;" Field BELNR is unkown. It is in neither in one of the specified tables not defined by "DATA statment. "DATA" statement"  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have declared the tables BSEG, BKPF.&lt;/P&gt;&lt;P&gt;My code is given below for your reference.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT IT_BKPF.&lt;/P&gt;&lt;P&gt;READ TABLE BSEG WITH KEY BELNR = IT_BKPF-BELNR.&lt;/P&gt;&lt;P&gt;IF SY-SUBRC = 0.&lt;/P&gt;&lt;P&gt;MOVE : BSEG-BUKRS TO IT_GROSS-BUKRS,&lt;/P&gt;&lt;P&gt;       BSEG-BELNR TO IT_GROSS-BELNR,&lt;/P&gt;&lt;P&gt;       BSEG-DMBTR TO IT_GROSS-DMBTR,&lt;/P&gt;&lt;P&gt;       BSEG-SHKZG TO IT_GROSS-SHKZG.&lt;/P&gt;&lt;P&gt;APPEND IT_GROSS.&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;Pls let me know what is the error and how to solve the same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A S VINCENT&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 20 Mar 2006 05:29:01 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-03-20T05:29:01Z</dc:date>
    <item>
      <title>Read Table BSEG</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-bseg/m-p/1215895#M134826</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to filter the data from BSEG table for a given period.  Since, there is no document date in BSEG, I have done the following.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First : I have taken the data from BKPF table for a given period into an internal table IT_BKPF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then,  Looping at IT_BKPF, i am reading the table BSEG for BELNR field.  But the system gives the following error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;" Field BELNR is unkown. It is in neither in one of the specified tables not defined by "DATA statment. "DATA" statement"  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have declared the tables BSEG, BKPF.&lt;/P&gt;&lt;P&gt;My code is given below for your reference.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT IT_BKPF.&lt;/P&gt;&lt;P&gt;READ TABLE BSEG WITH KEY BELNR = IT_BKPF-BELNR.&lt;/P&gt;&lt;P&gt;IF SY-SUBRC = 0.&lt;/P&gt;&lt;P&gt;MOVE : BSEG-BUKRS TO IT_GROSS-BUKRS,&lt;/P&gt;&lt;P&gt;       BSEG-BELNR TO IT_GROSS-BELNR,&lt;/P&gt;&lt;P&gt;       BSEG-DMBTR TO IT_GROSS-DMBTR,&lt;/P&gt;&lt;P&gt;       BSEG-SHKZG TO IT_GROSS-SHKZG.&lt;/P&gt;&lt;P&gt;APPEND IT_GROSS.&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;Pls let me know what is the error and how to solve the same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A S VINCENT&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Mar 2006 05:29:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-bseg/m-p/1215895#M134826</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-20T05:29:01Z</dc:date>
    </item>
    <item>
      <title>Re: Read Table BSEG</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-bseg/m-p/1215896#M134827</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;your immediate problem is that you are trying to do a read of an internal table BSEG rather than doing a select from the database table BSEG.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Mar 2006 05:35:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-bseg/m-p/1215896#M134827</guid>
      <dc:creator>former_member186741</dc:creator>
      <dc:date>2006-03-20T05:35:49Z</dc:date>
    </item>
    <item>
      <title>Re: Read Table BSEG</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-bseg/m-p/1215897#M134828</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;select *  from bseg into  table it_bseg&lt;/P&gt;&lt;P&gt;          for all entries of it_bkpf&lt;/P&gt;&lt;P&gt;          where belnr = it_bkpf-belnr&lt;/P&gt;&lt;P&gt;       .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT IT_BSEG.&lt;/P&gt;&lt;P&gt;MOVE : IT_BSEG-BUKRS TO IT_GROSS-BUKRS,&lt;/P&gt;&lt;P&gt;IT_BSEG-BELNR TO IT_GROSS-BELNR,&lt;/P&gt;&lt;P&gt;IT_BSEG-DMBTR TO IT_GROSS-DMBTR,&lt;/P&gt;&lt;P&gt;IT_BSEG-SHKZG TO IT_GROSS-SHKZG.&lt;/P&gt;&lt;P&gt;APPEND IT_GROSS.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Mar 2006 05:37:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-bseg/m-p/1215897#M134828</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-20T05:37:22Z</dc:date>
    </item>
    <item>
      <title>Re: Read Table BSEG</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-bseg/m-p/1215898#M134829</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you would probably be better off doing something like:&lt;/P&gt;&lt;P&gt;select BSEG&lt;SUB&gt;BUKRS BSEG&lt;/SUB&gt;BELNR BSEG&lt;SUB&gt;DMBTR BSEG&lt;/SUB&gt;SHKZG inTO corresponding fields of table IT_GROSS&lt;/P&gt;&lt;P&gt;from bseg&lt;/P&gt;&lt;P&gt;for all entries in it_bkpf&lt;/P&gt;&lt;P&gt;where bseg~belnr = it_bkpf-belnr.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Mar 2006 05:38:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-bseg/m-p/1215898#M134829</guid>
      <dc:creator>former_member186741</dc:creator>
      <dc:date>2006-03-20T05:38:59Z</dc:date>
    </item>
    <item>
      <title>Re: Read Table BSEG</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-bseg/m-p/1215899#M134830</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vincent ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; try the below code , the other thing that you have to do before running the below code is .&lt;/P&gt;&lt;P&gt;1.) did u define internal table properly&lt;/P&gt;&lt;P&gt;2.) did you do "select * from bkpf into it_bkpf&lt;/P&gt;&lt;P&gt;check this and run the below code , i think this should sove your problem &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Do reward points if found useful.&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="-----------------------------" /&gt;&lt;P&gt;  select * from bseg into table it_gross &lt;/P&gt;&lt;P&gt;for all entries in it_bkpf&lt;/P&gt;&lt;P&gt;where belnr = it_bkpf&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="-------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Mar 2006 05:42:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-bseg/m-p/1215899#M134830</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-20T05:42:47Z</dc:date>
    </item>
    <item>
      <title>Re: Read Table BSEG</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-bseg/m-p/1215900#M134831</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Vincent,&lt;/P&gt;&lt;P&gt;Problem here, from what i saw is, BSEG is a cluster table in the database.So, it has to be read using SELECT query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try using the follwing code:&lt;/P&gt;&lt;P&gt;SELECT BUKRS BELNR DMBTR SHKZG FROM BSEG &lt;/P&gt;&lt;P&gt;INTO TABLE IT_GROSS FOR ALL ENTRIES IN IT_BKPF&lt;/P&gt;&lt;P&gt;WHERE BELNR = IT_BKPF-BELNR.&lt;/P&gt;&lt;P&gt;check for sy-subrc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this would be of use to you,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please revert for further help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Partha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Mar 2006 05:43:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-bseg/m-p/1215900#M134831</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-20T05:43:17Z</dc:date>
    </item>
  </channel>
</rss>

