<?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 Problem Retrieving data in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-retrieving-data/m-p/5312278#M1224775</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have got two tables zdata_sec and zdata_hold ... I need to get the field zsec from the first table and zhold from the second and need to insert in an internal table ztest_sec_hold... Now I have got another internal table called ztest_final (which has got all the records). Now I need to get all the valid records from table ztest_final that should have the valid combination of zsec and zhold. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So can you please tell me how can I do that. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks, &lt;/P&gt;&lt;P&gt;Rajeev&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 19 Mar 2009 12:12:19 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-03-19T12:12:19Z</dc:date>
    <item>
      <title>Problem Retrieving data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-retrieving-data/m-p/5312278#M1224775</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have got two tables zdata_sec and zdata_hold ... I need to get the field zsec from the first table and zhold from the second and need to insert in an internal table ztest_sec_hold... Now I have got another internal table called ztest_final (which has got all the records). Now I need to get all the valid records from table ztest_final that should have the valid combination of zsec and zhold. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So can you please tell me how can I do that. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks, &lt;/P&gt;&lt;P&gt;Rajeev&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Mar 2009 12:12:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-retrieving-data/m-p/5312278#M1224775</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-19T12:12:19Z</dc:date>
    </item>
    <item>
      <title>Re: Problem Retrieving data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-retrieving-data/m-p/5312279#M1224776</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Put ineer join on zdata_sec and zdata_hold and stors it in ztest_sec_hold.&lt;/P&gt;&lt;P&gt;Now put loop on ztest_sec_hold.table inside that loop read table ztest_final.&lt;/P&gt;&lt;P&gt;Hope this will solve your problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Anagha Deshmukh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Mar 2009 12:16:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-retrieving-data/m-p/5312279#M1224776</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-19T12:16:57Z</dc:date>
    </item>
    <item>
      <title>Re: Problem Retrieving data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-retrieving-data/m-p/5312280#M1224777</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rajeev,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try using FOR ALL ENTRIES in select query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Lakshman.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Mar 2009 12:18:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-retrieving-data/m-p/5312280#M1224777</guid>
      <dc:creator>former_member209217</dc:creator>
      <dc:date>2009-03-19T12:18:22Z</dc:date>
    </item>
    <item>
      <title>Re: Problem Retrieving data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-retrieving-data/m-p/5312281#M1224778</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;Try this way..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Loop the zdata_sec.
Read or loop the zdata_hold on the common field 
 if found then 
  append the sec and hold in internal table ztest_sec_hold 
else d
onot append to  ztest_sec_hold table.
endif.
EnDloop.

Loop AT ztest_final .
Check the entry in ztest_sec_hold for sec and hold combination key.
if found then 
  keep the record in  ztest_final 
 else 
 Delete from  ztest_final 
endif.endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Mar 2009 12:19:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-retrieving-data/m-p/5312281#M1224778</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-19T12:19:32Z</dc:date>
    </item>
    <item>
      <title>Re: Problem Retrieving data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-retrieving-data/m-p/5312282#M1224779</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is the relation between zdata_sec and zdata_hold  table?&lt;/P&gt;&lt;P&gt;I assume zdata_sec  is master &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. select data including ZSEC field from 1st table into itab1.&lt;/P&gt;&lt;P&gt;2. select data from 2nd table including ZHOLD into itab2 where fieldn = key field from 1st table. You need to use FOR ALL ENTRIES IN ...&lt;/P&gt;&lt;P&gt;3.&lt;/P&gt;&lt;P&gt; loop at itab1 &lt;/P&gt;&lt;P&gt;  read itab2 with key fieldn  = itab1-field1.&lt;/P&gt;&lt;P&gt;  check sy-subrc  = 0.&lt;/P&gt;&lt;P&gt;  append the details into ztest_sec_hold.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4. &lt;/P&gt;&lt;P&gt;LOOP AT ztest_final .&lt;/P&gt;&lt;P&gt;READ TABLE  ( ztest_sec_hold) with required keys. ( zsec &amp;amp; zhold ).&lt;/P&gt;&lt;P&gt;check sy-subrc  = 0.&lt;/P&gt;&lt;P&gt; append  ztest_final  with required fields of ztest_final  &amp;amp; ztest_sec_hold&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;You need to refine the logic as per your data declaration.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Mar 2009 12:20:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-retrieving-data/m-p/5312282#M1224779</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-19T12:20:06Z</dc:date>
    </item>
    <item>
      <title>Re: Problem Retrieving data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-retrieving-data/m-p/5312283#M1224780</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Would you please provide some sample data for both the Itab and what output you are looking for, from that?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Mar 2009 12:21:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-retrieving-data/m-p/5312283#M1224780</guid>
      <dc:creator>sarbajitm</dc:creator>
      <dc:date>2009-03-19T12:21:25Z</dc:date>
    </item>
    <item>
      <title>Re: Problem Retrieving data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-retrieving-data/m-p/5312284#M1224781</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this code : assuming key1 is a primary field in all tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
select key1 zsec 
from zdata_sec
into table itab_sec.

select key1 zhold 
from zdata_hold
into table itab_hold.

loop at itab_sec.
 read table itab_hold with key key1 = itab_sec-key1.
 if sy-subrc eq 0.
   itab_sec_hold-key1 = itab_sec-key1.
   itab_sec_hold-sec   = itab_sec-sec.
   itab_sec_hold-hold  = itab_hold-hold.
   append itab_sec_hold.
   clear: itab_sec_hold.
endif.
endloop.

loop itab_sec_hold.
  read table itab_final with key key1 = itab_sec_hold-key1
                                            sec  =  itab_sec_hold-sec
                                            hold =  itab_sec_hold-hold.
 if sy-subrc = 0.
  delete table itab_final from itab_final.
 endif.
endloop.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Mar 2009 12:24:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-retrieving-data/m-p/5312284#M1224781</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-19T12:24:29Z</dc:date>
    </item>
  </channel>
</rss>

