<?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 with key syntax in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement-with-key-syntax/m-p/4992262#M1162792</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;In Read Statement you cannot use like statement, you can use only =.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sriram POnna.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 02 Jan 2009 06:23:38 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-01-02T06:23:38Z</dc:date>
    <item>
      <title>read statement with key syntax</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement-with-key-syntax/m-p/4992257#M1162787</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;In read statement, is there a possibility to use 'contains string (CS)' instead of '=' in with key?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a requirement to fetch from an internal table, the record whose field1 value contains a particular string. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;David.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Jan 2009 06:15:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement-with-key-syntax/m-p/4992257#M1162787</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-02T06:15:16Z</dc:date>
    </item>
    <item>
      <title>Re: read statement with key syntax</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement-with-key-syntax/m-p/4992258#M1162788</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi David,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The contain string operations cannot be used in the read statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;instead you use it in the select clause.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for eg.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;data: l_srch_str type string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;l_srch_str = 'ABC%'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  select * &lt;/P&gt;&lt;P&gt;            from &amp;lt;table&amp;gt;&lt;/P&gt;&lt;P&gt;            into table itab&lt;/P&gt;&lt;P&gt;            where  &amp;lt;fieldname&amp;gt; like l_srch_str.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Santosh Thorat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Jan 2009 06:18:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement-with-key-syntax/m-p/4992258#M1162788</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-02T06:18:17Z</dc:date>
    </item>
    <item>
      <title>Re: read statement with key syntax</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement-with-key-syntax/m-p/4992259#M1162789</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi David,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT &amp;lt;ITAB&amp;gt; where &amp;lt;Field&amp;gt; CS &amp;lt;VALUE&amp;gt;.&lt;/P&gt;&lt;P&gt;**********Do your work here.&lt;/P&gt;&lt;P&gt;EXIT.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it wors for you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Jan 2009 06:19:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement-with-key-syntax/m-p/4992259#M1162789</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-02T06:19:07Z</dc:date>
    </item>
    <item>
      <title>Re: read statement with key syntax</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement-with-key-syntax/m-p/4992260#M1162790</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;There is no way u can use any operator other than = with read statement.&lt;/P&gt;&lt;P&gt;Instead u can use loop statement.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;CLEAR wa.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;LOOP AT itab INTO wa WHERE field CS ur value.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;EXIT.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now ur wa contains required data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Vinod.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Jan 2009 06:20:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement-with-key-syntax/m-p/4992260#M1162790</guid>
      <dc:creator>vinod_vemuru2</dc:creator>
      <dc:date>2009-01-02T06:20:54Z</dc:date>
    </item>
    <item>
      <title>Re: read statement with key syntax</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement-with-key-syntax/m-p/4992261#M1162791</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 have the String operation in READ statement. Instead you need to use the Loop ..Endloop statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;LOOP AT itab WHERE field CS l_field.
* Do your Process.
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Jan 2009 06:22:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement-with-key-syntax/m-p/4992261#M1162791</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-02T06:22:37Z</dc:date>
    </item>
    <item>
      <title>Re: read statement with key syntax</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement-with-key-syntax/m-p/4992262#M1162792</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;In Read Statement you cannot use like statement, you can use only =.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sriram POnna.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Jan 2009 06:23:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement-with-key-syntax/m-p/4992262#M1162792</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-02T06:23:38Z</dc:date>
    </item>
    <item>
      <title>Re: read statement with key syntax</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement-with-key-syntax/m-p/4992263#M1162793</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;First try to read table with some other key field...&lt;/P&gt;&lt;P&gt;And then use if to check ur condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;loop at itab.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;read table itab1 with key f1 = itab-f1.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if sy-subrc = 0.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if itab1-f2 CS 'abc'.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;move data.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;endif.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;endif.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;endloop.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mr.A&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Jan 2009 06:24:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement-with-key-syntax/m-p/4992263#M1162793</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-02T06:24:01Z</dc:date>
    </item>
    <item>
      <title>Re: read statement with key syntax</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement-with-key-syntax/m-p/4992264#M1162794</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sanket and Vinod,&lt;/P&gt;&lt;P&gt;Thanks for the reply.&lt;/P&gt;&lt;P&gt;Can you tell me the impact on performance when using loop with where condition instead of a read?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The scenario is:&lt;/P&gt;&lt;P&gt;I have a loop which will have thousands of record.&lt;/P&gt;&lt;P&gt;In this loop, I have to use my requirement of fetching from an internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;David.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Jan 2009 06:25:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement-with-key-syntax/m-p/4992264#M1162794</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-02T06:25:00Z</dc:date>
    </item>
    <item>
      <title>Re: read statement with key syntax</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement-with-key-syntax/m-p/4992265#M1162795</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;it won't accept CS in read table clause. syntax error will be displayed.&lt;/P&gt;&lt;P&gt;for more clarity just execute the falloing code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF ITAB OCCURS 0,&lt;/P&gt;&lt;P&gt;        MATNR LIKE MARA-MATNR,&lt;/P&gt;&lt;P&gt;        ERSDA LIKE MARA-ERSDA,&lt;/P&gt;&lt;P&gt;        ERNAM LIKE MARA-ERNAM,&lt;/P&gt;&lt;P&gt;      END OF ITAB.&lt;/P&gt;&lt;P&gt;      &lt;/P&gt;&lt;P&gt;   SELECT MATNR&lt;/P&gt;&lt;P&gt;          ERSDA&lt;/P&gt;&lt;P&gt;          ERNAM&lt;/P&gt;&lt;P&gt;          FROM MARA&lt;/P&gt;&lt;P&gt;          INTO TABLE ITAB&lt;/P&gt;&lt;P&gt;          WHERE ERNAM = 'BOHNSTEDT'.&lt;/P&gt;&lt;P&gt;          &lt;/P&gt;&lt;P&gt;   IF SY-SUBRC EQ 0.&lt;/P&gt;&lt;P&gt;     SORT ITAB BY MATNR ASCENDING.&lt;/P&gt;&lt;P&gt;     READ TABLE ITAB WITH KEY MATNR CS '3'.&lt;/P&gt;&lt;P&gt;     IF SY-SUBRC EQ 0.&lt;/P&gt;&lt;P&gt;      WRITE: ITAB.&lt;/P&gt;&lt;P&gt;     ENDIF.&lt;/P&gt;&lt;P&gt;   ENDIF.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Jan 2009 06:26:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement-with-key-syntax/m-p/4992265#M1162795</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-02T06:26:56Z</dc:date>
    </item>
    <item>
      <title>Re: read statement with key syntax</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement-with-key-syntax/m-p/4992266#M1162796</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi David,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As per the performence if u having a lot of record u will follow the &lt;STRONG&gt;Phani Krishna&lt;/STRONG&gt;  suggestion. Loop logic will fine with small no. of  recocords.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Jan 2009 06:41:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement-with-key-syntax/m-p/4992266#M1162796</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-02T06:41:28Z</dc:date>
    </item>
    <item>
      <title>Re: read statement with key syntax</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement-with-key-syntax/m-p/4992267#M1162797</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you cant use other than = in Read statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you requirement is to find a singe record from a internal table, try these ways&lt;/P&gt;&lt;P&gt;1.   Read the table with some other index and try using LOOP at where FROM INDEX&lt;/P&gt;&lt;P&gt;2.  Make the table as SORTED with the column as key and then  LOOP AT WHERE F1 CS 'XXX'.&lt;/P&gt;&lt;P&gt;for better performance only...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Sumanth Nag Kristam on Jan 2, 2009 7:43 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Jan 2009 06:43:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement-with-key-syntax/m-p/4992267#M1162797</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-02T06:43:21Z</dc:date>
    </item>
    <item>
      <title>Re: read statement with key syntax</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement-with-key-syntax/m-p/4992268#M1162798</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi David,&lt;/P&gt;&lt;P&gt;LOOP will definitely have impact on performance. But if there is no other way then we have to compromise.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;SORT the table based on the field u want to check will help a lot when using LOOP with Where clause.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Vinod.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Jan 2009 10:16:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement-with-key-syntax/m-p/4992268#M1162798</guid>
      <dc:creator>vinod_vemuru2</dc:creator>
      <dc:date>2009-01-02T10:16:34Z</dc:date>
    </item>
    <item>
      <title>Re: read statement with key syntax</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement-with-key-syntax/m-p/4992269#M1162799</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi David..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try using Wild card character % in READ to check for Contains string..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ex&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

read table t_vbak into wa_vbak with key vbeln = '%53%'.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check whether something like the above is givin any error............ i am trying to read the internal table where VBELN contains the string 53&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Jan 2009 10:25:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement-with-key-syntax/m-p/4992269#M1162799</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-02T10:25:25Z</dc:date>
    </item>
    <item>
      <title>Re: read statement with key syntax</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement-with-key-syntax/m-p/4992270#M1162800</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;fatching recordds with read statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ TABLE &amp;lt;ITAB&amp;gt; INTO &amp;lt;WA&amp;gt; INDEX 1.&lt;/P&gt;&lt;P&gt;READ TABLE &amp;lt;ITAB&amp;gt; INTO &amp;lt;WA&amp;gt; WITH KEY &amp;lt;FIELD NAME&amp;gt; = 'VALUE'.&lt;/P&gt;&lt;P&gt;READ TABLE &amp;lt;ITAB&amp;gt; INTO &amp;lt;WA&amp;gt; INDEX 1 TRANSPORTING NO FIELDS.&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;Md.MahaboobKhan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Jan 2009 10:33:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-statement-with-key-syntax/m-p/4992270#M1162800</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-02T10:33:02Z</dc:date>
    </item>
  </channel>
</rss>

