<?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: Can we use insert command with a where clause. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/can-we-use-insert-command-with-a-where-clause/m-p/5581867#M1272939</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Its not correct,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;first loop the internal table which contains the data and move to the work area keep where condition  wa_scarr = 'AA' then append to the internal table ie. append wa_scarr into it_scarr.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 07 May 2009 07:28:35 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-05-07T07:28:35Z</dc:date>
    <item>
      <title>Can we use insert command with a where clause.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/can-we-use-insert-command-with-a-where-clause/m-p/5581865#M1272937</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I am trying to insert data from a work area into an internal table using a where condition.&lt;/P&gt;&lt;P&gt;And facing a error in using this .the error says :&lt;/P&gt;&lt;P&gt; ".", "INDEX numlike-field", "ASSIGNING &amp;lt;fs&amp;gt;", "REFERENCE INTO		&lt;/P&gt;&lt;P&gt;data-reference", or "ASSIGNING &amp;lt;fs&amp;gt; CASTING" expected after "IT_SCARR".		&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my code  is:&lt;/P&gt;&lt;P&gt;insert wa_scarr into table it_scarr where it-scarr-carrid = 'AA'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank u in advance.&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;P&gt;Abhinandan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 May 2009 07:16:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/can-we-use-insert-command-with-a-where-clause/m-p/5581865#M1272937</guid>
      <dc:creator>former_member130219</dc:creator>
      <dc:date>2009-05-07T07:16:20Z</dc:date>
    </item>
    <item>
      <title>Re: Can we use insert command with a where clause.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/can-we-use-insert-command-with-a-where-clause/m-p/5581866#M1272938</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 cannot use Where Clause with INSERT Statement. &lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_46c/helpdata/en/34/8e72c56df74873e10000009b38f9b8/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_46c/helpdata/en/34/8e72c56df74873e10000009b38f9b8/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You need read the internal table and get the index where to insert.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;READ TABLE ITAB WITH KEY carrid = 'AA'.
IF SY-SUBRC EQ 0.
insert wa_scarr into table it_scarr index sy-tabix.
ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 May 2009 07:19:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/can-we-use-insert-command-with-a-where-clause/m-p/5581866#M1272938</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-07T07:19:42Z</dc:date>
    </item>
    <item>
      <title>Re: Can we use insert command with a where clause.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/can-we-use-insert-command-with-a-where-clause/m-p/5581867#M1272939</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Its not correct,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;first loop the internal table which contains the data and move to the work area keep where condition  wa_scarr = 'AA' then append to the internal table ie. append wa_scarr into it_scarr.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 May 2009 07:28:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/can-we-use-insert-command-with-a-where-clause/m-p/5581867#M1272939</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-07T07:28:35Z</dc:date>
    </item>
    <item>
      <title>Re: Can we use insert command with a where clause.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/can-we-use-insert-command-with-a-where-clause/m-p/5581868#M1272940</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;Insert command is to create a new line in the internal table.&lt;/P&gt;&lt;P&gt;If you want to change a line, use update statement.&lt;/P&gt;&lt;P&gt;If you are not sure about changing/inserting, use modify statement.&lt;/P&gt;&lt;P&gt;Use F1 help for syntax.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 May 2009 07:46:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/can-we-use-insert-command-with-a-where-clause/m-p/5581868#M1272940</guid>
      <dc:creator>jayanthi_jayaraman</dc:creator>
      <dc:date>2009-05-07T07:46:13Z</dc:date>
    </item>
    <item>
      <title>Re: Can we use insert command with a where clause.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/can-we-use-insert-command-with-a-where-clause/m-p/5581869#M1272941</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;'Where' Condition cannot be used along with Insert statement .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;instead you can use&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. INSERT (wa INTO|INITIAL LINE INTO) itab (INDEX &lt;/P&gt;&lt;P&gt;idx) (ASSIGNING &amp;lt;fs&amp;gt;|REFERENCE INTO dref). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. INSERT (wa INTO|INITIAL LINE INTO) TABLE itab &lt;/P&gt;&lt;P&gt;(ASSIGNING &amp;lt;fs&amp;gt;|REFERENCE INTO dref). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. INSERT LINES OF itab1 (FROM idx1] [TO idx2)&lt;/P&gt;&lt;P&gt;INTO itab2 (INDEX idx3). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4. INSERT LINES OF itab1 (FROM idx1) (TO idx2) &lt;/P&gt;&lt;P&gt;INTO TABLE itab2. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can also check the keyword help document or if you want to know how they inserted the data with sample codes,&lt;/P&gt;&lt;P&gt;check the tcode - ABAPDOCU. U can find lot of sample codings.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 May 2009 08:42:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/can-we-use-insert-command-with-a-where-clause/m-p/5581869#M1272941</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-07T08:42:34Z</dc:date>
    </item>
    <item>
      <title>Re: Can we use insert command with a where clause.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/can-we-use-insert-command-with-a-where-clause/m-p/5581870#M1272942</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;ur code is not correct..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in place of : insert wa_scarr into table it_scarr where it-scarr-carrid = 'AA'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try Following Code :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But before following code data (single record) must be there in wa_scarr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

if wa_scarr-carrid eq 'AA'.

       append wa_scarr into it_scarr.

endif.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Chintan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 May 2009 08:53:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/can-we-use-insert-command-with-a-where-clause/m-p/5581870#M1272942</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-07T08:53:52Z</dc:date>
    </item>
    <item>
      <title>Re: Can we use insert command with a where clause.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/can-we-use-insert-command-with-a-where-clause/m-p/5581871#M1272943</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for the answers.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Abhinandan Kumar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Jun 2009 12:12:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/can-we-use-insert-command-with-a-where-clause/m-p/5581871#M1272943</guid>
      <dc:creator>former_member130219</dc:creator>
      <dc:date>2009-06-04T12:12:23Z</dc:date>
    </item>
  </channel>
</rss>

