<?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: Selecting Two tables in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/selecting-two-tables/m-p/3184864#M758346</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;If the data is selected twice then use the statement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Delete adjacent duplicates from itab&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and delete all the repeated data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you use Read statement then it performs to read only single line of data&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Pavan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 07 Dec 2007 07:55:01 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-12-07T07:55:01Z</dc:date>
    <item>
      <title>Selecting Two tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/selecting-two-tables/m-p/3184860#M758342</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everybody...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need selet data from 2 tables VBAP and VBAK.which am doing succesfully into internal table it_vbak and it_vbap.But i need to give both the tables data into it_final which am doing like below.But the problem is all the data is selected twice.Please help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM populate_it_final .&lt;/P&gt;&lt;P&gt;LOOP at it_vbak.&lt;/P&gt;&lt;P&gt;LOOP at it_vbap.&lt;/P&gt;&lt;P&gt;clear it_final.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it_final-vbeln = it_vbak-vbeln.&lt;/P&gt;&lt;P&gt;it_final-netwr = it_vbak-netwr.&lt;/P&gt;&lt;P&gt;it_final-ernam  = it_vbak-ernam.&lt;/P&gt;&lt;P&gt;it_final-audat =  it_vbak-audat.&lt;/P&gt;&lt;P&gt;it_final-bstnk = it_vbak-bstnk.&lt;/P&gt;&lt;P&gt;it_final-auart = it_vbak-auart.&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;&lt;/P&gt;&lt;P&gt;it_final-matnr = it_vbap-matnr.&lt;/P&gt;&lt;P&gt;it_final-posnr = it_vbap-posnr.&lt;/P&gt;&lt;P&gt;it_final-werks = it_vbap-werks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;APPEND it_final.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With Regadrs&lt;/P&gt;&lt;P&gt;Vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Dec 2007 07:49:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/selecting-two-tables/m-p/3184860#M758342</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-07T07:49:04Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting Two tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/selecting-two-tables/m-p/3184861#M758343</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use read statement on VBAP table inside the loop of VBAK and pass data to final internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM populate_it_final .&lt;/P&gt;&lt;P&gt;SORT IT_VBAP BY VBELN.&lt;/P&gt;&lt;P&gt;LOOP at it_vbak.&lt;/P&gt;&lt;P&gt;Read table it_vbap into wa with key vbeln = it_final-vbap binary search.&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;it_final-vbeln = it_vbak-vbeln.&lt;/P&gt;&lt;P&gt;it_final-netwr = it_vbak-netwr.&lt;/P&gt;&lt;P&gt;it_final-ernam = it_vbak-ernam.&lt;/P&gt;&lt;P&gt;it_final-audat = it_vbak-audat.&lt;/P&gt;&lt;P&gt;it_final-bstnk = it_vbak-bstnk.&lt;/P&gt;&lt;P&gt;it_final-auart = it_vbak-auart.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it_final-matnr = wa_vbap-matnr.&lt;/P&gt;&lt;P&gt;it_final-posnr = wa_vbap-posnr.&lt;/P&gt;&lt;P&gt;it_final-werks = wa_vbap-werks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;APPEND it_final.&lt;/P&gt;&lt;P&gt;clear it_final.&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;endform.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Satish&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Satish Panakala&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Dec 2007 07:52:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/selecting-two-tables/m-p/3184861#M758343</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-07T07:52:00Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting Two tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/selecting-two-tables/m-p/3184862#M758344</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi satish &lt;/P&gt;&lt;P&gt;Thanks for the inpuit but can u give dat piece of code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Dec 2007 07:53:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/selecting-two-tables/m-p/3184862#M758344</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-07T07:53:28Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting Two tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/selecting-two-tables/m-p/3184863#M758345</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;check the code below:&lt;/P&gt;&lt;P&gt;wa_vbap same as it_vbap.&lt;/P&gt;&lt;P&gt;wa_vbak same as it_vbak.&lt;/P&gt;&lt;P&gt;wa_final same as it_final.&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 eq 0.&lt;/P&gt;&lt;P&gt;wa_final-vbeln =wa_vbak-vbeln.&lt;/P&gt;&lt;P&gt;wa_final-netwr = wa_vbak-netwr.&lt;/P&gt;&lt;P&gt;wa_final-ernam = wa_vbak-ernam.&lt;/P&gt;&lt;P&gt;wa_final-audat =wa_vbak-audat.&lt;/P&gt;&lt;P&gt;wa_final-bstnk = wa_vbak-bstnk.&lt;/P&gt;&lt;P&gt;wa_final-auart = wa_vbak-auart.&lt;/P&gt;&lt;P&gt;wafinal-matnr =wa_vbap-matnr.&lt;/P&gt;&lt;P&gt;wa_final-posnr =wa_vbap-posnr.&lt;/P&gt;&lt;P&gt;wa_final-werks = wa_vbap-werks.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;append wa_final to it_final.&lt;/P&gt;&lt;P&gt;clear wa_final,wa_vbak, wa_vbap.&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;&lt;/P&gt;&lt;P&gt;Kannaiah&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Dec 2007 07:53:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/selecting-two-tables/m-p/3184863#M758345</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-07T07:53:58Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting Two tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/selecting-two-tables/m-p/3184864#M758346</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;If the data is selected twice then use the statement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Delete adjacent duplicates from itab&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and delete all the repeated data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you use Read statement then it performs to read only single line of data&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Pavan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Dec 2007 07:55:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/selecting-two-tables/m-p/3184864#M758346</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-07T07:55:01Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting Two tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/selecting-two-tables/m-p/3184865#M758347</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;FORM populate_it_final .&lt;/P&gt;&lt;P&gt;LOOP at it_vbak.&lt;/P&gt;&lt;P&gt;LOOP at it_vbap where vbeln = it_vbak-vbeln. ( Vbeln must be available in VBAK).&lt;/P&gt;&lt;P&gt;clear it_final.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it_final-vbeln = it_vbak-vbeln.&lt;/P&gt;&lt;P&gt;it_final-netwr = it_vbak-netwr.&lt;/P&gt;&lt;P&gt;it_final-ernam = it_vbak-ernam.&lt;/P&gt;&lt;P&gt;it_final-audat = it_vbak-audat.&lt;/P&gt;&lt;P&gt;it_final-bstnk = it_vbak-bstnk.&lt;/P&gt;&lt;P&gt;it_final-auart = it_vbak-auart.&lt;/P&gt;&lt;P&gt;it_final-matnr = it_vbap-matnr.&lt;/P&gt;&lt;P&gt;it_final-posnr = it_vbap-posnr.&lt;/P&gt;&lt;P&gt;it_final-werks = it_vbap-werks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;APPEND it_final.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;endform.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For Performance basis Use Read Statement as suggested .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it Helps.&lt;/P&gt;&lt;P&gt;Praveen&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With Regadrs&lt;/P&gt;&lt;P&gt;Vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Dec 2007 07:56:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/selecting-two-tables/m-p/3184865#M758347</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-07T07:56:17Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting Two tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/selecting-two-tables/m-p/3184866#M758348</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vijay&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead of Looping twice use only one loop and read other internal table in that loop using key field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at i_vbap&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read table i_vbak with key vbeln = i_vbap-vbeln&lt;/P&gt;&lt;P&gt;if sy-subrc = 0&lt;/P&gt;&lt;P&gt;   i_output-vbeln = i_vbak-vbeln.&lt;/P&gt;&lt;P&gt;   ....&lt;/P&gt;&lt;P&gt;  ....&lt;/P&gt;&lt;P&gt;  append i_output.&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;regards,&lt;/P&gt;&lt;P&gt;vikas&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;plz reward if helpful&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Dec 2007 07:56:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/selecting-two-tables/m-p/3184866#M758348</guid>
      <dc:creator>VikasB</dc:creator>
      <dc:date>2007-12-07T07:56:19Z</dc:date>
    </item>
  </channel>
</rss>

