<?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 Read table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table/m-p/5024144#M1168907</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Team,&lt;/P&gt;&lt;P&gt;I have a requirment where I need to read entries with *&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For Exa : &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My Internal table contains Rec1 with SORTL = AB1234 .&lt;/P&gt;&lt;P&gt;And table key contains value lv_sortl = 1234.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to retrive the Rec1 though it has AB1234. Normally we can do the similar thing on DB table &lt;/P&gt;&lt;P&gt;(i.e) In select Options for field SORTL if we give *1234, then a Record is displayed. Now I need to do the similar thing through Program. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Currently I am using the below which is helpless.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ TABLE i_kna1 INTO wa_kna1 WITH KEY sortl = lv_sortl.                  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a solution I need to loop the Internal table and use String Operators(Contains any or Contains Pattern), but I cant do this because its a huge table and I have to loop it everytime inside a loop. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any alternate way to do this ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;SPAN __default_attr="red" __jive_macro_name="color"&gt;&lt;STRONG&gt;use proper subject line for your posts&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Vijay Babu Dudla on Jan 20, 2009 8:18 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 20 Jan 2009 06:18:23 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-01-20T06:18:23Z</dc:date>
    <item>
      <title>Read table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table/m-p/5024144#M1168907</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Team,&lt;/P&gt;&lt;P&gt;I have a requirment where I need to read entries with *&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For Exa : &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My Internal table contains Rec1 with SORTL = AB1234 .&lt;/P&gt;&lt;P&gt;And table key contains value lv_sortl = 1234.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to retrive the Rec1 though it has AB1234. Normally we can do the similar thing on DB table &lt;/P&gt;&lt;P&gt;(i.e) In select Options for field SORTL if we give *1234, then a Record is displayed. Now I need to do the similar thing through Program. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Currently I am using the below which is helpless.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ TABLE i_kna1 INTO wa_kna1 WITH KEY sortl = lv_sortl.                  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a solution I need to loop the Internal table and use String Operators(Contains any or Contains Pattern), but I cant do this because its a huge table and I have to loop it everytime inside a loop. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any alternate way to do this ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;SPAN __default_attr="red" __jive_macro_name="color"&gt;&lt;STRONG&gt;use proper subject line for your posts&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Vijay Babu Dudla on Jan 20, 2009 8:18 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Jan 2009 06:18:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table/m-p/5024144#M1168907</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-20T06:18:23Z</dc:date>
    </item>
    <item>
      <title>Re: Read table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table/m-p/5024145#M1168908</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;u can use...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at it_kna1 into wa_kna1 where sortl cp lvsortl.&lt;/P&gt;&lt;P&gt; "value..&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but i dunno how u can assign the correct one if KNA1 has records with sortl = AB1234 , sortl = BC1234 etc?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Jan 2009 06:25:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table/m-p/5024145#M1168908</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-20T06:25:35Z</dc:date>
    </item>
    <item>
      <title>Re: Read table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table/m-p/5024146#M1168909</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ravinder,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I dont think there is a way of using string comparision when we use READ statement. &lt;/P&gt;&lt;P&gt;I feel, LOOP should be ok. As we are looking for only one record, Once the record is found you can use &lt;STRONG&gt;EXIT&lt;/STRONG&gt; statement to terminate the loop. In this way, performance is not affected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Ram.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Jan 2009 06:25:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table/m-p/5024146#M1168909</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-20T06:25:59Z</dc:date>
    </item>
    <item>
      <title>Re: Read table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table/m-p/5024147#M1168910</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;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; 
data : begin of itab occurs 0 ,
       sortl(6) type c,
       end of itab.

data : begin of jtab occurs 0 ,
sortl(6) type c,
end of jtab.

itab-sortl = 'AB1234'. APPEND ITAB.
JTAB-SORTL = '1234'.  APPEND JTAB.

case1. 
*LOOP AT ITAB.
*LOOP AT JTAB WHERE SORTL EQ ITAB-SORTL+2(4).
*
*IF SY-SUBRC EQ 0.
*WRITE :/ 'THROUGH'.
*EXIT.
*ENDIF.
*ENDLOOP.

LOOP AT ITAB.
READ TABLE JTAB WITH KEY SORTL = ITAB-SORTL+2(4). " read with the offset

IF SY-SUBRC EQ 0.
WRITE :/ 'THROUGH'.
ENDIF.
ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if you can check the offset u want to compare then this can be done . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Br, &lt;/P&gt;&lt;P&gt;Vijay.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Jan 2009 06:47:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table/m-p/5024147#M1168910</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-20T06:47:21Z</dc:date>
    </item>
    <item>
      <title>Re: Read table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table/m-p/5024148#M1168911</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ravindar,&lt;/P&gt;&lt;P&gt;You can achieve this with the following read statement,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;READ TABLE i_kna1 INTO wa_kna1 WITH KEY sortl = lv_sortl+2(4).&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Manoj Kumar P&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Manoj Kumar on Jan 20, 2009 7:55 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Jan 2009 06:54:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table/m-p/5024148#M1168911</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-20T06:54:51Z</dc:date>
    </item>
    <item>
      <title>Re: Read table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table/m-p/5024149#M1168912</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Answered&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Jun 2009 07:15:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table/m-p/5024149#M1168912</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-08T07:15:28Z</dc:date>
    </item>
  </channel>
</rss>

