<?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/2872947#M674087</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;
READ TABLE t_return INTO wa_return WITH KEY type = 'E'.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you reading the table looking for TYPE "E"...And the table only got 2 rows with TYPE "S"...You will get a line into WA_RETURN...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want records in WA_RETURN, you should write this...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
READ TABLE t_return INTO wa_return WITH KEY type = 'S'.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"E" stands for error...If your BAPI have been well performed...You're not going to get any errors -;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Greetings,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Blag.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 28 Sep 2007 17:32:58 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-09-28T17:32:58Z</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/2872946#M674086</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;my data declarations and code is as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;types:ty_bapi_return     LIKE  bapiret2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: t_return            TYPE  STANDARD TABLE OF ty_bapi_return,&lt;/P&gt;&lt;P&gt;      wa_return           TYPE                    ty_bapi_return.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'&lt;/P&gt;&lt;P&gt;             EXPORTING&lt;/P&gt;&lt;P&gt;                  documentheader = wa_bapi_hdr&lt;/P&gt;&lt;P&gt;             TABLES&lt;/P&gt;&lt;P&gt;                  accountgl      = t_accountgl&lt;/P&gt;&lt;P&gt;                  currencyamount = t_currencyamount&lt;/P&gt;&lt;P&gt;                  return         = t_return.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        READ TABLE t_return INTO wa_return WITH KEY type = 'E'.&lt;/P&gt;&lt;P&gt;          MOVE: wa_return-type       TO wa_msg_table-type,&lt;/P&gt;&lt;P&gt;                wa_return-message    TO wa_msg_table-message,&lt;/P&gt;&lt;P&gt;                wa_return-message_v2 TO wa_msg_table-message_v2,&lt;/P&gt;&lt;P&gt;                wa_bkpf-belnr     TO wa_msg_table-belnr,&lt;/P&gt;&lt;P&gt;                wa_bkpf-gjahr     TO wa_msg_table-gjahr,&lt;/P&gt;&lt;P&gt;                wa_bkpf-bukrs      TO wa_msg_table-bukrs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          APPEND wa_msg_table TO t_msg_table.&lt;/P&gt;&lt;P&gt;          CLEAR wa_msg_table.&lt;/P&gt;&lt;P&gt;          CONTINUE.&lt;/P&gt;&lt;P&gt;ELSEIF wa_return-type = 'S'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;call bapi_transaction_commit&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;          CLEAR   wa_commit_return1.&lt;/P&gt;&lt;P&gt;          REFRESH t_commit_return1.&lt;/P&gt;&lt;P&gt;          CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'&lt;/P&gt;&lt;P&gt;               EXPORTING&lt;/P&gt;&lt;P&gt;                    wait   = 'X'&lt;/P&gt;&lt;P&gt;               IMPORTING&lt;/P&gt;&lt;P&gt;                    return = t_commit_return1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now when i debug and see wa_return , i cant find any values in wa_return.but the table t_return has 2 rows with type 'S'.can anyone tell me what the problem is..thank you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Challa.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Sep 2007 17:29:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-read-statement/m-p/2872946#M674086</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-28T17:29:27Z</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/2872947#M674087</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;
READ TABLE t_return INTO wa_return WITH KEY type = 'E'.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you reading the table looking for TYPE "E"...And the table only got 2 rows with TYPE "S"...You will get a line into WA_RETURN...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want records in WA_RETURN, you should write this...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
READ TABLE t_return INTO wa_return WITH KEY type = 'S'.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"E" stands for error...If your BAPI have been well performed...You're not going to get any errors -;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Greetings,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Blag.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Sep 2007 17:32:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-read-statement/m-p/2872947#M674087</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-28T17:32:58Z</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/2872948#M674088</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thats perfectly right because yor are checking KEY TYPE = 'E' and t_return has value 'S', o the condition fails and return no records in wa_return.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Amit&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;&amp;lt;REMOVED BY MODERATOR&amp;gt;&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Alvaro Tejada Galindo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Sep 2007 17:33:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-read-statement/m-p/2872948#M674088</guid>
      <dc:creator>amit_khare</dc:creator>
      <dc:date>2007-09-28T17:33:25Z</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/2872949#M674089</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;READ doesn't work that way. When you:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;READ TABLE t_return INTO wa_return WITH KEY type = 'E'.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It will only return the first occurrence that exactly matches the key(s) you specify. If none match, you will get nothing even though other records are in the table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You probably want to use a LOOP to read all records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Sep 2007 17:37:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-read-statement/m-p/2872949#M674089</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-28T17:37:17Z</dc:date>
    </item>
  </channel>
</rss>

