<?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: problem with read statement in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-read-statement/m-p/5146977#M1192785</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 with the following i think you will find the problem i think some of you internal table have no pernr..&lt;/P&gt;&lt;P&gt;and you are not Checking sy-subrc so facing such problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;LOOP AT it_trip.
  READ TABLE it_ptrv_head  WITH KEY pernr  = it_trip-pernr.
  IF sy-subrc = 0.
    READ TABLE it_ptrv_srec WITH KEY pernr = it_ptrv_head-pernr.
    IF sy-subrc = 0.
      READ TABLE it_ptrv_sadd WITH KEY pernr = it_ptrv_srec-pernr.
      IF sy-subrc = 0.
      ENDIF.
    ENDIF.
  ENDIF.
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;kind Regards.&lt;/P&gt;&lt;P&gt;Faisal&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Faisal Altaf on Feb 8, 2009 12:17 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 08 Feb 2009 07:16:06 GMT</pubDate>
    <dc:creator>faisalatsap</dc:creator>
    <dc:date>2009-02-08T07:16:06Z</dc:date>
    <item>
      <title>problem with read statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-read-statement/m-p/5146966#M1192774</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          i ahve a problem with read statement. i have put the read statement in the loop but it always reads the 1st record.. please help me guys..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if u need my code..i shall paste it here..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards ,&lt;/P&gt;&lt;P&gt;Sunita.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 08 Feb 2009 06:42:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-read-statement/m-p/5146966#M1192774</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-08T06:42:07Z</dc:date>
    </item>
    <item>
      <title>Re: problem with read statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-read-statement/m-p/5146967#M1192775</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;please paste the code..&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 08 Feb 2009 06:44:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-read-statement/m-p/5146967#M1192775</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-08T06:44:55Z</dc:date>
    </item>
    <item>
      <title>Re: problem with read statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-read-statement/m-p/5146968#M1192776</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;the read statemnet will get the first successful record based on tyeh key.Suppose for the same key 2 0r 3 records are there,then always the first successful record will be returned.in ur case may be the first record itself satisfying the key.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 08 Feb 2009 06:45:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-read-statement/m-p/5146968#M1192776</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-08T06:45:54Z</dc:date>
    </item>
    <item>
      <title>Re: problem with read statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-read-statement/m-p/5146969#M1192777</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;are you using Index or table key ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind Regards,&lt;/P&gt;&lt;P&gt;Faisal&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Faisal Altaf on Feb 8, 2009 11:48 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 08 Feb 2009 06:46:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-read-statement/m-p/5146969#M1192777</guid>
      <dc:creator>faisalatsap</dc:creator>
      <dc:date>2009-02-08T06:46:28Z</dc:date>
    </item>
    <item>
      <title>Re: problem with read statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-read-statement/m-p/5146970#M1192778</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;use this syntax if u are using read statement inside the loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;read table itab index sy-tabix.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if u are using inside loop it will get all records&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 08 Feb 2009 06:47:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-read-statement/m-p/5146970#M1192778</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-08T06:47:37Z</dc:date>
    </item>
    <item>
      <title>Re: problem with read statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-read-statement/m-p/5146971#M1192779</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Sunitha ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loop at itab .&lt;/P&gt;&lt;P&gt;read table  jtab { with key f1 = itab-f1 } OR index sy-tabix .&lt;/P&gt;&lt;P&gt;Endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will fetch as per the access to the JTAB table data .&lt;/P&gt;&lt;P&gt;If u r still facing the problem please paste u r code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regardss&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 08 Feb 2009 06:50:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-read-statement/m-p/5146971#M1192779</guid>
      <dc:creator>shishupalreddy</dc:creator>
      <dc:date>2009-02-08T06:50:28Z</dc:date>
    </item>
    <item>
      <title>Re: problem with read statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-read-statement/m-p/5146972#M1192780</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;mibght be:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at a into wa.&lt;/P&gt;&lt;P&gt;read table b into wb with key (field of b) = wa-field of a&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now problemmight be that in tab a there might be multiple recors containing a..so when you do read on b it will retrieve you first recod of b based on condition ..so always you gettin same record&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 08 Feb 2009 06:51:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-read-statement/m-p/5146972#M1192780</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-08T06:51:47Z</dc:date>
    </item>
    <item>
      <title>Re: problem with read statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-read-statement/m-p/5146973#M1192781</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi experts,&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;loop at it_trip.
    READ TABLE it_ptrv_head  WITH KEY  pernr  = it_trip-pernr.
READ TABLE it_ptrv_srec WITH KEY pernr = it_ptrv_head-pernr.
    READ TABLE it_ptrv_sadd WITH KEY pernr = it_ptrv_srec-pernr.
endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so can u now tell me y it always reads only 1st record .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;sunita.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 08 Feb 2009 07:04:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-read-statement/m-p/5146973#M1192781</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-08T07:04:32Z</dc:date>
    </item>
    <item>
      <title>Re: problem with read statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-read-statement/m-p/5146974#M1192782</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;can you be more elaborate...which read is giving you first record ..what is your expected result?&lt;/P&gt;&lt;P&gt;and after each read where are you passing the value..&lt;/P&gt;&lt;P&gt;if you are using the read data after end loop..then you will get single record only....&lt;/P&gt;&lt;P&gt;and every read..plz dont forget to put sy-subrc check..you might have empty internal table in between&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 08 Feb 2009 07:09:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-read-statement/m-p/5146974#M1192782</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-08T07:09:35Z</dc:date>
    </item>
    <item>
      <title>Re: problem with read statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-read-statement/m-p/5146975#M1192783</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;Use work area to read all of your records,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : wa_trip like line of it_trip .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at it_trip into wa_trip .&lt;/P&gt;&lt;P&gt;    READ TABLE it_ptrv_head  WITH KEY  pernr  = wa_trip-pernr.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;  similarly rread all your records inside the loop.hope this will helps you,if you want more help send all of your code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regds,&lt;/P&gt;&lt;P&gt;Sree.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 08 Feb 2009 07:11:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-read-statement/m-p/5146975#M1192783</guid>
      <dc:creator>former_member125931</dc:creator>
      <dc:date>2009-02-08T07:11:39Z</dc:date>
    </item>
    <item>
      <title>Re: problem with read statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-read-statement/m-p/5146976#M1192784</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;Can you show your full code?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You are using 3 Read statement in this loop. In which read statement you want to capture the data?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 08 Feb 2009 07:13:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-read-statement/m-p/5146976#M1192784</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-08T07:13:12Z</dc:date>
    </item>
    <item>
      <title>Re: problem with read statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-read-statement/m-p/5146977#M1192785</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 with the following i think you will find the problem i think some of you internal table have no pernr..&lt;/P&gt;&lt;P&gt;and you are not Checking sy-subrc so facing such problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;LOOP AT it_trip.
  READ TABLE it_ptrv_head  WITH KEY pernr  = it_trip-pernr.
  IF sy-subrc = 0.
    READ TABLE it_ptrv_srec WITH KEY pernr = it_ptrv_head-pernr.
    IF sy-subrc = 0.
      READ TABLE it_ptrv_sadd WITH KEY pernr = it_ptrv_srec-pernr.
      IF sy-subrc = 0.
      ENDIF.
    ENDIF.
  ENDIF.
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;kind Regards.&lt;/P&gt;&lt;P&gt;Faisal&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Faisal Altaf on Feb 8, 2009 12:17 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 08 Feb 2009 07:16:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-read-statement/m-p/5146977#M1192785</guid>
      <dc:creator>faisalatsap</dc:creator>
      <dc:date>2009-02-08T07:16:06Z</dc:date>
    </item>
    <item>
      <title>Re: problem with read statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-read-statement/m-p/5146978#M1192786</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Sunitha,&lt;/P&gt;&lt;P&gt;Besides checking the return code..&lt;/P&gt;&lt;P&gt;loop at it_trip.&lt;/P&gt;&lt;P&gt;    READ TABLE it_ptrv_head  WITH KEY  pernr  = it_trip-pernr.&lt;/P&gt;&lt;P&gt;READ TABLE it_ptrv_srec WITH KEY pernr = it_ptrv_head-pernr.&lt;/P&gt;&lt;P&gt;    READ TABLE it_ptrv_sadd WITH KEY pernr = it_ptrv_srec-pernr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;write:/  it_ptrv_head-pernr,&lt;/P&gt;&lt;P&gt;          it_ptrv_srec-pernr,&lt;/P&gt;&lt;P&gt;          it_ptrv_sadd-pernr,&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;Mdi.Deeba&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Feb 2009 05:24:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-read-statement/m-p/5146978#M1192786</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-09T05:24:52Z</dc:date>
    </item>
    <item>
      <title>Re: problem with read statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-read-statement/m-p/5146979#M1192787</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sunita,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please check the table entries of it_trip, if the pernr field in that table has the same value for every record, if so then it will always show you the first record, or check if the last record of it_trip  pernr field matches the first record in that case as the loop ends it will show you the first record.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Siddarth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Feb 2009 05:30:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-read-statement/m-p/5146979#M1192787</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-09T05:30:06Z</dc:date>
    </item>
  </channel>
</rss>

