<?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: Read statement not working in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement-not-working/m-p/3591720#M864803</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;If your requirement is to read the itab gt_mara1 bsed on the loop count, use sy-tabix instead of sy-index. Sy-tabix gives the loop count.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 25 Mar 2008 07:18:36 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-03-25T07:18:36Z</dc:date>
    <item>
      <title>Read statement not working</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement-not-working/m-p/3591713#M864796</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 am using Read statement with sy-index as follows but it is not working, please help and let me know where i am going wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT gt_zrb_tb_x_plnt_st INTO wa_zrb_tb_x_plnt_st.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      READ TABLE gt_mara1 INDEX sy-index INTO wa_mara.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      IF wa_mara-mstae NE wa_zrb_tb_x_plnt_st-mstae.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        CALL FUNCTION 'MARA_SINGLE_READ'&lt;/P&gt;&lt;P&gt;          EXPORTING&lt;/P&gt;&lt;P&gt;            matnr                   = wa_mara-matnr&lt;/P&gt;&lt;P&gt;            sperrmodus              = 'E'&lt;/P&gt;&lt;P&gt;     IMPORTING&lt;/P&gt;&lt;P&gt;       wmara                    = gt1_mara&lt;/P&gt;&lt;P&gt;                  .&lt;/P&gt;&lt;P&gt;        IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt; MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;P&gt;         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;P&gt;        ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Mar 2008 07:05:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement-not-working/m-p/3591713#M864796</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-25T07:05:57Z</dc:date>
    </item>
    <item>
      <title>Re: Read statement not working</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement-not-working/m-p/3591714#M864797</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;write it as&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ TABLE gt_mara1 INTO wa_mara INDEX sy-index .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Aditya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Mar 2008 07:08:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement-not-working/m-p/3591714#M864797</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-25T07:08:25Z</dc:date>
    </item>
    <item>
      <title>Re: Read statement not working</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement-not-working/m-p/3591715#M864798</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN __default_attr="blue" __jive_macro_name="color"&gt;&lt;SPAN __default_attr="sylfaen" __jive_macro_name="font"&gt;&lt;SPAN __default_attr="15" __jive_macro_name="size"&gt;
Are you sure both have the same number of records and in the same order???

Alternatively you might try using key fields something like MATNR in your case.
&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN __default_attr="maroon" __jive_macro_name="color"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Mar 2008 07:09:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement-not-working/m-p/3591715#M864798</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-25T07:09:04Z</dc:date>
    </item>
    <item>
      <title>Re: Read statement not working</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement-not-working/m-p/3591716#M864799</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 &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;READ TABLE gt_mara1 INDEX sy-tabix INTO wa_mara.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;instead of using sy-index.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rgds,&lt;/P&gt;&lt;P&gt;bharat.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Mar 2008 07:10:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement-not-working/m-p/3591716#M864799</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-25T07:10:56Z</dc:date>
    </item>
    <item>
      <title>Re: Read statement not working</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement-not-working/m-p/3591717#M864800</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Change your read statement and check.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ TABLE gt_mara1  INTO wa_mara INDEX sy-tabix.&lt;/P&gt;&lt;P&gt;IF SY-SUBRC = 0.&lt;/P&gt;&lt;P&gt;WRITE:/ 'success'.&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;WRITE:/ 'unable to read'.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sy-tabix is related to internal tables(default value 1),&lt;/P&gt;&lt;P&gt;sy-index is related to loop at itab-endloop statements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Chandu.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Mar 2008 07:13:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement-not-working/m-p/3591717#M864800</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-25T07:13:03Z</dc:date>
    </item>
    <item>
      <title>Re: Read statement not working</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement-not-working/m-p/3591718#M864801</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;You can use&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ TABLE gt_mara1 INTO wa_mara index sy-index.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but this sequence must same as the your main itab&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or you can with key  &lt;/P&gt;&lt;P&gt;READ TABLE gt_mara1 INTO wa_mara with key matnr =  wa_zrb_tb_x_plnt_st-matnr&lt;/P&gt;&lt;P&gt;                                                                                binary search.'&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;shiva&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Mar 2008 07:14:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement-not-working/m-p/3591718#M864801</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-25T07:14:11Z</dc:date>
    </item>
    <item>
      <title>Re: Read statement not working</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement-not-working/m-p/3591719#M864802</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi sunanda,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1.Wht is the error it is showing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2.If the sy subrc is failing then the the table gt_mara1 might   not be having any data .If it has data then please check the sy-index in debugging check how many records the table is having and compare them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;jyo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Mar 2008 07:15:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement-not-working/m-p/3591719#M864802</guid>
      <dc:creator>jyotheswar_p2</dc:creator>
      <dc:date>2008-03-25T07:15:16Z</dc:date>
    </item>
    <item>
      <title>Re: Read statement not working</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement-not-working/m-p/3591720#M864803</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;If your requirement is to read the itab gt_mara1 bsed on the loop count, use sy-tabix instead of sy-index. Sy-tabix gives the loop count.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Mar 2008 07:18:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement-not-working/m-p/3591720#M864803</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-25T07:18:36Z</dc:date>
    </item>
    <item>
      <title>Re: Read statement not working</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement-not-working/m-p/3591721#M864804</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Bharat,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your answer has solved my problem but can you please explain me the difference between sy-index and sy-tabix. How it works?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;Sunanda.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Mar 2008 07:32:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement-not-working/m-p/3591721#M864804</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-25T07:32:43Z</dc:date>
    </item>
    <item>
      <title>Re: Read statement not working</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement-not-working/m-p/3591722#M864805</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;sy-index will give u current iteration number in do...enddo,while...endwhile,...&lt;/P&gt;&lt;P&gt;sy-tabix will give u the table index number(i.e,the number of record u r currently working with)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rgds,&lt;/P&gt;&lt;P&gt;bharat.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Mar 2008 07:35:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement-not-working/m-p/3591722#M864805</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-25T07:35:35Z</dc:date>
    </item>
  </channel>
</rss>

