<?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 in selecting records in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-selecting-records/m-p/2826560#M661362</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks very much, Sreejith Ramachandran  .&lt;/P&gt;&lt;P&gt;But I can't understand your solution. Could you give me more examples about RANGES?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And I want to do like this:&lt;/P&gt;&lt;P&gt;  LOOP AT TAB_CDHDR INTO WA_CDHDR.&lt;/P&gt;&lt;P&gt;    SELECT LIFNR&lt;/P&gt;&lt;P&gt;           ERDAT&lt;/P&gt;&lt;P&gt;           LOEVM&lt;/P&gt;&lt;P&gt;    FROM   LFA1&lt;/P&gt;&lt;P&gt;    APPENDING TABLE TAB_LFA1&lt;/P&gt;&lt;P&gt;    WHERE  LIFNR = WA_CDHDR-OBJECTID(10).&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Am I right?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 05 Oct 2007 07:12:13 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-10-05T07:12:13Z</dc:date>
    <item>
      <title>problem in selecting records</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-selecting-records/m-p/2826551#M661353</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, everyone.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a problem in selecting records.  In this case, I want to select records from database&lt;/P&gt;&lt;P&gt;LFA1,and the components of this table are LIFNR,ERDAT,LOEVM ,and so on.The type of LIFNR is char(10).There is a internal table:tab_cdhdr , the elements of tab_cdhdr are: objectid,udate and change_ind.The type of objectid is char(50).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And the select-rule is that: LIFNR = objectid. So I write like this:&lt;/P&gt;&lt;P&gt;select   lifnr&lt;/P&gt;&lt;P&gt;             erdat&lt;/P&gt;&lt;P&gt;             loevm&lt;/P&gt;&lt;P&gt;form     lfa1&lt;/P&gt;&lt;P&gt;into       tab_lfa1&lt;/P&gt;&lt;P&gt;for all entries in tab_cdhdr&lt;/P&gt;&lt;P&gt;where   lfa1 = tab_cdhdr-objectid+0(10).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But there is a warning: When using FOR ALL ENTRIES IN the specifyed length for "OBJECTID" is ignored in this condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you help me to solve this problem?&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Oct 2007 09:46:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-selecting-records/m-p/2826551#M661353</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-04T09:46:27Z</dc:date>
    </item>
    <item>
      <title>Re: problem in selecting records</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-selecting-records/m-p/2826552#M661354</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Feng..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just give like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select lifnr&lt;/P&gt;&lt;P&gt;erdat&lt;/P&gt;&lt;P&gt;loevm&lt;/P&gt;&lt;P&gt;form lfa1&lt;/P&gt;&lt;P&gt;into tab_lfa1&lt;/P&gt;&lt;P&gt;for all entries in tab_cdhdr&lt;/P&gt;&lt;P&gt;where lfa1 = tab_cdhdr-objectid(10).  "It will compare only first 10 characters&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REWARD IF HELPFUL.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Oct 2007 09:52:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-selecting-records/m-p/2826552#M661354</guid>
      <dc:creator>varma_narayana</dc:creator>
      <dc:date>2007-10-04T09:52:05Z</dc:date>
    </item>
    <item>
      <title>Re: problem in selecting records</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-selecting-records/m-p/2826553#M661355</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; Hi Feng..&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; Just give like this:&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; select lifnr&lt;/P&gt;&lt;P&gt;&amp;gt; erdat&lt;/P&gt;&lt;P&gt;&amp;gt; loevm&lt;/P&gt;&lt;P&gt;&amp;gt; form lfa1&lt;/P&gt;&lt;P&gt;&amp;gt; into tab_lfa1&lt;/P&gt;&lt;P&gt;&amp;gt; for all entries in tab_cdhdr&lt;/P&gt;&lt;P&gt;&amp;gt; where lfa1 = tab_cdhdr-objectid(10).  "It will&lt;/P&gt;&lt;P&gt;&amp;gt; compare only first 10 characters&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; REWARD IF HELPFUL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much, Varma@infyTree . I think your code is the same as mine. And I chaned tab_cdhdr-objectid+0(10) to tab_cdhdr-objectid(10) , the result wasn't changed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And I want to only compare the first 10 characters.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Oct 2007 09:57:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-selecting-records/m-p/2826553#M661355</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-04T09:57:45Z</dc:date>
    </item>
    <item>
      <title>Re: problem in selecting records</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-selecting-records/m-p/2826554#M661356</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do one thing - In our internal table &amp;lt;b&amp;gt;tab_cdhdr&amp;lt;/b&amp;gt; add one more field- &lt;/P&gt;&lt;P&gt; LIFNR type LIFNR. &lt;/P&gt;&lt;P&gt;and while populating the Internal table - populate this lifnr with ur syntax &amp;lt;b&amp;gt;tab_cdhdr-objectid+0(10).&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and during the SELECT - FOR ALL ENTRIES use this lifnr field instead of objectid+0(10).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;During FOR ALL ENTRIES SAP checks the data types - thats why u r having the problem. The above mentioned steps will solve ur problem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Oct 2007 10:24:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-selecting-records/m-p/2826554#M661356</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-04T10:24:04Z</dc:date>
    </item>
    <item>
      <title>Re: problem in selecting records</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-selecting-records/m-p/2826555#M661357</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;try like this..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;take a field of type lifnr in the table tab_cdhdr..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now u do like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT TAB_CDHDR.&lt;/P&gt;&lt;P&gt;TAB_CDHDR-LIFNR = tab_cdhdr-objectid+0(10).&lt;/P&gt;&lt;P&gt;MODIFY TAB_CDHDR.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now write ur query..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select lifnr&lt;/P&gt;&lt;P&gt;erdat&lt;/P&gt;&lt;P&gt;loevm&lt;/P&gt;&lt;P&gt;form lfa1&lt;/P&gt;&lt;P&gt;into tab_lfa1&lt;/P&gt;&lt;P&gt;for all entries in tab_cdhdr&lt;/P&gt;&lt;P&gt;where lfa1 = lifnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward if helpful&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nagaraj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Oct 2007 10:29:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-selecting-records/m-p/2826555#M661357</guid>
      <dc:creator>former_member404244</dc:creator>
      <dc:date>2007-10-04T10:29:51Z</dc:date>
    </item>
    <item>
      <title>Re: problem in selecting records</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-selecting-records/m-p/2826556#M661358</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks very much, SKC and nagaraj kumar nishtala .&lt;/P&gt;&lt;P&gt;But I don't want to change tab_cdhdr.&lt;/P&gt;&lt;P&gt;Is there any other methods to solve this problem?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Oct 2007 10:32:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-selecting-records/m-p/2826556#M661358</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-04T10:32:50Z</dc:date>
    </item>
    <item>
      <title>Re: problem in selecting records</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-selecting-records/m-p/2826557#M661359</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Feng..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you dont want to change the Internal table TAB_CDHDR, Then declare another internal table (TEMPTAB_CDHDR.) with the same structure but Objectid with only 10 chars.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF TAB_CDHDR[] IS NOT INITIAL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT TAB_CDHDR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MOVE-CORRESPONDING TAB_CDHDR TO TEMPTAB_CDHDR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;APPEND TEMPTAB_CDHDR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select lifnr&lt;/P&gt;&lt;P&gt;erdat&lt;/P&gt;&lt;P&gt;loevm&lt;/P&gt;&lt;P&gt;form lfa1&lt;/P&gt;&lt;P&gt;into tab_lfa1&lt;/P&gt;&lt;P&gt;for all entries in tab_cdhdr&lt;/P&gt;&lt;P&gt;where lfa1 = TEMPtab_cdhdr-objectid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sure ... this will work for u.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REWARD IF HELPFUL.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Oct 2007 10:41:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-selecting-records/m-p/2826557#M661359</guid>
      <dc:creator>varma_narayana</dc:creator>
      <dc:date>2007-10-04T10:41:20Z</dc:date>
    </item>
    <item>
      <title>Re: problem in selecting records</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-selecting-records/m-p/2826558#M661360</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;the create a local copy of the internal table  tab_cdhdr. say  tab_cdhdr_copy. &lt;/P&gt;&lt;P&gt;In this internal table you can have the additional field LIFNR type LIFNR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do this -  &lt;/P&gt;&lt;P&gt; tab_cdhdr_copy[] = tab_cdhdr[]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then after doing a loop on tab_cdhdr_copy populate the vendor number. you can then do the SELECT on LAF1 performing the FOR ALL ENTRIES on this temporary table tab_cdhdr_copy[]. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I guess this is the only way out if you are not interested in modifying tab_cdhdr.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Oct 2007 13:47:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-selecting-records/m-p/2826558#M661360</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-04T13:47:52Z</dc:date>
    </item>
    <item>
      <title>Re: problem in selecting records</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-selecting-records/m-p/2826559#M661361</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Try the below method.. it is the best one i feel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ranges r_lifnr for lfa1-lifnr.&lt;/P&gt;&lt;P&gt;loop at tab_cdhdr.&lt;/P&gt;&lt;P&gt;r_lifnr-low = tab_cdhdr-objid(10)&lt;/P&gt;&lt;P&gt;r_lifnr-sign = 'I'.&lt;/P&gt;&lt;P&gt;r_lifnr-option = 'EQ'.&lt;/P&gt;&lt;P&gt;append r_lifnr.&lt;/P&gt;&lt;P&gt;clear r_lifnr.&lt;/P&gt;&lt;P&gt;endllop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select lifnr&lt;/P&gt;&lt;P&gt;erdat&lt;/P&gt;&lt;P&gt;loevm&lt;/P&gt;&lt;P&gt;form lfa1&lt;/P&gt;&lt;P&gt;into tab_lfa1&lt;/P&gt;&lt;P&gt;where lfa1 IN r_lifnr.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Oct 2007 13:57:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-selecting-records/m-p/2826559#M661361</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-04T13:57:28Z</dc:date>
    </item>
    <item>
      <title>Re: problem in selecting records</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-selecting-records/m-p/2826560#M661362</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks very much, Sreejith Ramachandran  .&lt;/P&gt;&lt;P&gt;But I can't understand your solution. Could you give me more examples about RANGES?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And I want to do like this:&lt;/P&gt;&lt;P&gt;  LOOP AT TAB_CDHDR INTO WA_CDHDR.&lt;/P&gt;&lt;P&gt;    SELECT LIFNR&lt;/P&gt;&lt;P&gt;           ERDAT&lt;/P&gt;&lt;P&gt;           LOEVM&lt;/P&gt;&lt;P&gt;    FROM   LFA1&lt;/P&gt;&lt;P&gt;    APPENDING TABLE TAB_LFA1&lt;/P&gt;&lt;P&gt;    WHERE  LIFNR = WA_CDHDR-OBJECTID(10).&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Am I right?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Oct 2007 07:12:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-selecting-records/m-p/2826560#M661362</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-05T07:12:13Z</dc:date>
    </item>
  </channel>
</rss>

