<?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: using table types for internal tables in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-table-types-for-internal-tables/m-p/2647161#M609891</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;Change your code as below for the last loops.&lt;/P&gt;&lt;P&gt;This will work as per the req with better performance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;CLEAR: WA_VBAP,&lt;/P&gt;&lt;P&gt;             WA_VBAK.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;SORT IT_VBAK BY VBELN.&lt;/P&gt;&lt;P&gt;Loop at it_vbap into wa_vbap.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        move-corresponding wa_vbap to wa_final.&lt;/P&gt;&lt;P&gt;      &lt;/P&gt;&lt;P&gt;        ON CHANGE OF WA_VBAP-VBELN.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;        Read table it_vbak into wa_vbak&lt;/P&gt;&lt;P&gt;              with key vbeln = wa_vbap-vbeln&lt;/P&gt;&lt;P&gt;              binary search.&lt;/P&gt;&lt;P&gt;        IF SY-SUBRC = 0.&lt;/P&gt;&lt;P&gt;           move-corresponding wa_vbak to wa_final.&lt;/P&gt;&lt;P&gt;        ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        ENDON. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       Append wa_final to it_final.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at it_final into wa_final.&lt;/P&gt;&lt;P&gt;write:/ wa_final-vbeln,&lt;/P&gt;&lt;P&gt;wa_final-vkorg,&lt;/P&gt;&lt;P&gt;wa_final-vtweg,&lt;/P&gt;&lt;P&gt;wa_final-posnr,&lt;/P&gt;&lt;P&gt;wa_final-matnr.&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;Reward if Helpful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 09 Aug 2007 04:20:52 GMT</pubDate>
    <dc:creator>varma_narayana</dc:creator>
    <dc:date>2007-08-09T04:20:52Z</dc:date>
    <item>
      <title>using table types for internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-table-types-for-internal-tables/m-p/2647157#M609887</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;    I have doubt in displaying the final table using types.in the following code,&lt;/P&gt;&lt;P&gt;when i enter the vbeln value it has to show all the values  present.&lt;/P&gt;&lt;P&gt;but it is giving only one value.&lt;/P&gt;&lt;P&gt;for eg if for vbeln there are 4 records it is showng only one record.&lt;/P&gt;&lt;P&gt;i think i made mistake in looping to final table.lpz help me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;((i m getting using joins.but iwant in this manner))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;types:begin of st_vbak,&lt;/P&gt;&lt;P&gt;      vbeln type vbeln_va,&lt;/P&gt;&lt;P&gt;      vkorg type vkorg,&lt;/P&gt;&lt;P&gt;      vtweg type vtweg,&lt;/P&gt;&lt;P&gt;      end of st_vbak.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;types:begin of st_vbap,&lt;/P&gt;&lt;P&gt;       vbeln type vbeln_va,&lt;/P&gt;&lt;P&gt;       posnr type posnr_va,&lt;/P&gt;&lt;P&gt;       matnr type matnr,&lt;/P&gt;&lt;P&gt;end of st_vbap.&lt;/P&gt;&lt;P&gt;types:begin of st_final,&lt;/P&gt;&lt;P&gt;      vbeln type vbeln_va,&lt;/P&gt;&lt;P&gt;      vkorg type vkorg,&lt;/P&gt;&lt;P&gt;      vtweg type vtweg,&lt;/P&gt;&lt;P&gt;      posnr type posnr_va,&lt;/P&gt;&lt;P&gt;      matnr type matnr,&lt;/P&gt;&lt;P&gt; end of st_final.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; data:it_vbak type table of st_vbak,&lt;/P&gt;&lt;P&gt;      it_vbap type table of st_vbap,&lt;/P&gt;&lt;P&gt;      it_final type table of st_final,&lt;/P&gt;&lt;P&gt;      wa_vbak type st_vbak,&lt;/P&gt;&lt;P&gt;      wa_vbap type st_vbap,&lt;/P&gt;&lt;P&gt;      wa_final type st_final.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;parameters:p_vbeln type vbeln_va.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select vbeln&lt;/P&gt;&lt;P&gt;       vkorg&lt;/P&gt;&lt;P&gt;       vtweg&lt;/P&gt;&lt;P&gt;       from&lt;/P&gt;&lt;P&gt;       vbak&lt;/P&gt;&lt;P&gt;       into&lt;/P&gt;&lt;P&gt;       table it_vbak where vbeln = p_vbeln.&lt;/P&gt;&lt;P&gt;if not it_vbak is initial .&lt;/P&gt;&lt;P&gt;select vbeln&lt;/P&gt;&lt;P&gt;       posnr&lt;/P&gt;&lt;P&gt;       matnr&lt;/P&gt;&lt;P&gt;       from vbap&lt;/P&gt;&lt;P&gt;       into table it_vbap&lt;/P&gt;&lt;P&gt;       for all entries in it_vbak where vbeln = it_vbak-vbeln.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at it_vbak into wa_vbak.&lt;/P&gt;&lt;P&gt;read table it_vbap into wa_vbap with key vbeln = wa_vbak-vbeln.&lt;/P&gt;&lt;P&gt;move-corresponding wa_vbak to wa_final.&lt;/P&gt;&lt;P&gt;move-corresponding wa_vbap to wa_final.&lt;/P&gt;&lt;P&gt;append wa_final to it_final.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;loop at it_final into wa_final.&lt;/P&gt;&lt;P&gt;write:/ wa_final-vbeln,&lt;/P&gt;&lt;P&gt;        wa_final-vkorg,&lt;/P&gt;&lt;P&gt;        wa_final-vtweg,&lt;/P&gt;&lt;P&gt;        wa_final-posnr,&lt;/P&gt;&lt;P&gt;        wa_final-matnr.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Aug 2007 03:45:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-table-types-for-internal-tables/m-p/2647157#M609887</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-09T03:45:50Z</dc:date>
    </item>
    <item>
      <title>Re: using table types for internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-table-types-for-internal-tables/m-p/2647158#M609888</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;both the record move into same finial internal table .so it can display all records.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Aug 2007 03:54:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-table-types-for-internal-tables/m-p/2647158#M609888</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-09T03:54:17Z</dc:date>
    </item>
    <item>
      <title>Re: using table types for internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-table-types-for-internal-tables/m-p/2647159#M609889</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;this is because of read table it only fetch one record just change the entire loop like this...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at it_vbap into wa_vbap.&lt;/P&gt;&lt;P&gt;read table it_vbak into wa_vbak with key vbeln = wa_vbap-vbeln.&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;move-corresponding wa_vbak to wa_final.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;move-corresponding wa_vbap to wa_final.&lt;/P&gt;&lt;P&gt;append wa_final to it_final.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at it_vbap and read it_vbak because each line item of same  vbelnin in it_vbap the header data must be same in it_vbak.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and chek if not it_vbak[] is initial .&lt;/P&gt;&lt;P&gt;i.e. the body of the table not the header.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;shiba dutta&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Aug 2007 03:55:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-table-types-for-internal-tables/m-p/2647159#M609889</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-09T03:55:45Z</dc:date>
    </item>
    <item>
      <title>Re: using table types for internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-table-types-for-internal-tables/m-p/2647160#M609890</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Pavan ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Change the last loop ad follows:&lt;/P&gt;&lt;P&gt;loop at it_vbap into wa_vbap.&lt;/P&gt;&lt;P&gt;read table it_vbak into wa_vbak with key vbeln = wa_vbap-vbeln.&lt;/P&gt;&lt;P&gt;move-corresponding wa_vbak to wa_final.&lt;/P&gt;&lt;P&gt;move-corresponding wa_vbap to wa_final.&lt;/P&gt;&lt;P&gt;append wa_final to it_final.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;loop at it_final into wa_final.&lt;/P&gt;&lt;P&gt;write:/ wa_final-vbeln,&lt;/P&gt;&lt;P&gt;wa_final-vkorg,&lt;/P&gt;&lt;P&gt;wa_final-vtweg,&lt;/P&gt;&lt;P&gt;wa_final-posnr,&lt;/P&gt;&lt;P&gt;wa_final-matnr.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Navneeth K&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Aug 2007 03:57:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-table-types-for-internal-tables/m-p/2647160#M609890</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-09T03:57:06Z</dc:date>
    </item>
    <item>
      <title>Re: using table types for internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-table-types-for-internal-tables/m-p/2647161#M609891</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;Change your code as below for the last loops.&lt;/P&gt;&lt;P&gt;This will work as per the req with better performance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;CLEAR: WA_VBAP,&lt;/P&gt;&lt;P&gt;             WA_VBAK.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;SORT IT_VBAK BY VBELN.&lt;/P&gt;&lt;P&gt;Loop at it_vbap into wa_vbap.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        move-corresponding wa_vbap to wa_final.&lt;/P&gt;&lt;P&gt;      &lt;/P&gt;&lt;P&gt;        ON CHANGE OF WA_VBAP-VBELN.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;        Read table it_vbak into wa_vbak&lt;/P&gt;&lt;P&gt;              with key vbeln = wa_vbap-vbeln&lt;/P&gt;&lt;P&gt;              binary search.&lt;/P&gt;&lt;P&gt;        IF SY-SUBRC = 0.&lt;/P&gt;&lt;P&gt;           move-corresponding wa_vbak to wa_final.&lt;/P&gt;&lt;P&gt;        ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        ENDON. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       Append wa_final to it_final.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at it_final into wa_final.&lt;/P&gt;&lt;P&gt;write:/ wa_final-vbeln,&lt;/P&gt;&lt;P&gt;wa_final-vkorg,&lt;/P&gt;&lt;P&gt;wa_final-vtweg,&lt;/P&gt;&lt;P&gt;wa_final-posnr,&lt;/P&gt;&lt;P&gt;wa_final-matnr.&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;Reward if Helpful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Aug 2007 04:20:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-table-types-for-internal-tables/m-p/2647161#M609891</guid>
      <dc:creator>varma_narayana</dc:creator>
      <dc:date>2007-08-09T04:20:52Z</dc:date>
    </item>
  </channel>
</rss>

