<?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 Table RSEG and EKBE in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-rseg-and-ekbe/m-p/4037267#M964983</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wanna select all invoices of a amount of purchase orders (that I selected before). Now I found out, that I have to use table EKBE to get the link to the invoice with field BWETP = 'Q' OR 'R'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Than I have the data to read table RSEG (the invoices) with the following statement:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

  DATA: lt_ekbe TYPE TABLE OF ekbe
      , lt_rseg TYPE TABLE OF rseg
      .
  SELECT * INTO TABLE lt_ekbe
           FROM  ekbe
           FOR ALL ENTRIES IN it_order_data
           WHERE ebeln = it_order_data-ebeln
             AND ebelp = it_order_data-ebelp.
             
  IF NOT lt_ekbe IS INITIAL.
    DELETE lt_ekbe WHERE bewtp &amp;lt;&amp;gt; 'Q' AND bewtp &amp;lt;&amp;gt; 'R'.

    SELECT * INTO TABLE lt_rseg
             FROM  rseg
             FOR ALL ENTRIES IN lt_ekbe
             WHERE belnr = lt_ekbe-belnr
               AND gjahr = lt_ekbe-gjahr
               AND buzei = lt_ekbe-buzei.
  ENDIF.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But now I can't activate this coding because the field "BUZEI" in RSEG and EKBE has not the same data-element and also no similar domain, that means different lengths... But why is this so? Is the selection wrong or can you give me a hint?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, &lt;/P&gt;&lt;P&gt;Markus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 18 Jun 2008 07:13:54 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-06-18T07:13:54Z</dc:date>
    <item>
      <title>Table RSEG and EKBE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-rseg-and-ekbe/m-p/4037267#M964983</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wanna select all invoices of a amount of purchase orders (that I selected before). Now I found out, that I have to use table EKBE to get the link to the invoice with field BWETP = 'Q' OR 'R'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Than I have the data to read table RSEG (the invoices) with the following statement:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

  DATA: lt_ekbe TYPE TABLE OF ekbe
      , lt_rseg TYPE TABLE OF rseg
      .
  SELECT * INTO TABLE lt_ekbe
           FROM  ekbe
           FOR ALL ENTRIES IN it_order_data
           WHERE ebeln = it_order_data-ebeln
             AND ebelp = it_order_data-ebelp.
             
  IF NOT lt_ekbe IS INITIAL.
    DELETE lt_ekbe WHERE bewtp &amp;lt;&amp;gt; 'Q' AND bewtp &amp;lt;&amp;gt; 'R'.

    SELECT * INTO TABLE lt_rseg
             FROM  rseg
             FOR ALL ENTRIES IN lt_ekbe
             WHERE belnr = lt_ekbe-belnr
               AND gjahr = lt_ekbe-gjahr
               AND buzei = lt_ekbe-buzei.
  ENDIF.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But now I can't activate this coding because the field "BUZEI" in RSEG and EKBE has not the same data-element and also no similar domain, that means different lengths... But why is this so? Is the selection wrong or can you give me a hint?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, &lt;/P&gt;&lt;P&gt;Markus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jun 2008 07:13:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-rseg-and-ekbe/m-p/4037267#M964983</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-18T07:13:54Z</dc:date>
    </item>
    <item>
      <title>Re: Table RSEG and EKBE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-rseg-and-ekbe/m-p/4037268#M964984</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;     Move to the separate internal table and use FOR ALL ENTRIES.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jun 2008 07:15:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-rseg-and-ekbe/m-p/4037268#M964984</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-18T07:15:12Z</dc:date>
    </item>
    <item>
      <title>Re: Table RSEG and EKBE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-rseg-and-ekbe/m-p/4037269#M964985</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Okay, that would solve the problem, but is the selection itself also correct?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FOR ALL ENTRIES I use&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Markus Glubka on Jun 18, 2008 9:18 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jun 2008 07:18:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-rseg-and-ekbe/m-p/4037269#M964985</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-18T07:18:48Z</dc:date>
    </item>
    <item>
      <title>Re: Table RSEG and EKBE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-rseg-and-ekbe/m-p/4037270#M964986</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;In the second select query in the where clause "buzei = it_rseg-buzei" and not the one u mentioned.&lt;/P&gt;&lt;P&gt;I think the error is becoz of that.&lt;/P&gt;&lt;P&gt;and do remove FOR ALL entries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Bhanu.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: nanduri bhanu on Jun 18, 2008 9:19 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jun 2008 07:19:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-rseg-and-ekbe/m-p/4037270#M964986</guid>
      <dc:creator>former_member556412</dc:creator>
      <dc:date>2008-06-18T07:19:01Z</dc:date>
    </item>
    <item>
      <title>Re: Table RSEG and EKBE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-rseg-and-ekbe/m-p/4037271#M964987</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Copy the contents of the first internal table into other internal table in which that field is of diffrent type(as it is required in second select query).&lt;/P&gt;&lt;P&gt;Use new internal table in for all netries in second select query.&lt;/P&gt;&lt;P&gt;It will not affect the program flow.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope ie helps you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jun 2008 07:19:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-rseg-and-ekbe/m-p/4037271#M964987</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-18T07:19:02Z</dc:date>
    </item>
    <item>
      <title>Re: Table RSEG and EKBE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-rseg-and-ekbe/m-p/4037272#M964988</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wanna select all invoices of a amount of purchase orders (that I selected before). Now I found out, that I have to use table EKBE to get the link to the invoice with field BWETP = 'Q' OR 'R'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Than I have the data to read table RSEG (the invoices) with the following statement:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA: lt_ekbe TYPE TABLE OF ekbe&lt;/P&gt;&lt;P&gt;      , lt_rseg TYPE TABLE OF rseg&lt;/P&gt;&lt;P&gt;      .&lt;/P&gt;&lt;P&gt;  SELECT * INTO TABLE lt_ekbe&lt;/P&gt;&lt;P&gt;           FROM  ekbe&lt;/P&gt;&lt;P&gt;           FOR ALL ENTRIES IN it_order_data&lt;/P&gt;&lt;P&gt;           WHERE ebeln = it_order_data-ebeln&lt;/P&gt;&lt;P&gt;             AND ebelp = it_order_data-ebelp.&lt;/P&gt;&lt;P&gt;             &lt;/P&gt;&lt;P&gt;  IF NOT lt_ekbe IS INITIAL.&lt;/P&gt;&lt;P&gt;    DELETE lt_ekbe WHERE bewtp  'Q' AND bewtp  'R'.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;    SELECT * INTO TABLE lt_rseg&lt;/P&gt;&lt;P&gt;             FROM  rseg&lt;/P&gt;&lt;P&gt;             FOR ALL ENTRIES IN lt_ekbe&lt;/P&gt;&lt;P&gt;             WHERE belnr = lt_ekbe-belnr&lt;/P&gt;&lt;P&gt;               AND gjahr = lt_ekbe-gjahr&lt;/P&gt;&lt;P&gt;               AND buzei = lt_ekbe-buzei.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But now I can't activate this coding because the field "BUZEI" in RSEG and EKBE has not the same data-element and also no similar domain, that means different lengths... But why is this so? Is the selection wrong or can you give me a hint?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, &lt;/P&gt;&lt;P&gt;Markus&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hi Markus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. You need to move the internal table lt_ekbe into another table with the same fields in lt_ekbe but with the type of the field for buzei as the one in rseg. &lt;/P&gt;&lt;P&gt;2. Move record by record into the new internal table using move statement for each field not with equal sign(i.e. newfield1 = oldfield1        -&amp;gt; don't use it). &lt;/P&gt;&lt;P&gt;Means now in the new internal table we had all the records of lt_ekbe with the field buzei as of type in rseg.&lt;/P&gt;&lt;P&gt;3. Now in the select query use for all entries with the new internal table which all the records were moved from the lt_ekbe( &amp;amp; also the where condition fields should be with the new fields in the new internal table)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you will not get any error message your problem will be solved to my knowledge.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jun 2008 07:25:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-rseg-and-ekbe/m-p/4037272#M964988</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-18T07:25:02Z</dc:date>
    </item>
    <item>
      <title>Re: Table RSEG and EKBE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-rseg-and-ekbe/m-p/4037273#M964989</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;For all enrties wil not work if the field length is not same use something else instead of For all entries &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward points if helpfull&lt;/P&gt;&lt;P&gt;Snehi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jun 2008 07:26:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-rseg-and-ekbe/m-p/4037273#M964989</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-18T07:26:14Z</dc:date>
    </item>
  </channel>
</rss>

