<?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: coding  problem in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/coding-problem/m-p/3349095#M803245</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;friend! u need to change the code to this. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from zvr_st_inv_forms where vbeln = it_itab-vbeln.&lt;/P&gt;&lt;P&gt;endselect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if sy-subrc eq 0.&lt;/P&gt;&lt;P&gt;modify zvr_st_inv_forms from it_itab2.&lt;/P&gt;&lt;P&gt;CLEAR ZVR_ST_INV_FORMS.&lt;/P&gt;&lt;P&gt;clear it_itab2.&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;INSERT ZVR_ST_INV_FORMS from it_itab2.&lt;/P&gt;&lt;P&gt;CLEAR ZVR_ST_INV_FORMS.&lt;/P&gt;&lt;P&gt;clear it_itab2.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but if zvr_st_inv_forms has multiple entries for it_tab-vbeln ..then u might be in a soup..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Nivin Joseph Varkey on Jan 22, 2008 10:22 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 22 Jan 2008 09:22:32 GMT</pubDate>
    <dc:creator>nivin_varkey</dc:creator>
    <dc:date>2008-01-22T09:22:32Z</dc:date>
    <item>
      <title>coding  problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/coding-problem/m-p/3349090#M803240</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gurus , in this code , when sy-subrc = 4 , still the Insert code is not running.&lt;/P&gt;&lt;P&gt;i.e. if sy-subrc ne 0. is not getting called.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from zvr_st_inv_forms where vbeln = it_itab-vbeln.&lt;/P&gt;&lt;P&gt;      if sy-subrc eq 0.&lt;/P&gt;&lt;P&gt;        modify zvr_st_inv_forms from it_itab2.&lt;/P&gt;&lt;P&gt;        CLEAR ZVR_ST_INV_FORMS.&lt;/P&gt;&lt;P&gt;        clear it_itab2.&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;      if sy-subrc ne 0.&lt;/P&gt;&lt;P&gt;        INSERT ZVR_ST_INV_FORMS from it_itab2.&lt;/P&gt;&lt;P&gt;        CLEAR ZVR_ST_INV_FORMS.&lt;/P&gt;&lt;P&gt;        clear it_itab2.&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;    endselect.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jan 2008 09:12:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/coding-problem/m-p/3349090#M803240</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-22T09:12:09Z</dc:date>
    </item>
    <item>
      <title>Re: coding  problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/coding-problem/m-p/3349091#M803241</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 your code in select statemnet it_tab is there ,i think that  is  it_itab2&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jan 2008 09:14:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/coding-problem/m-p/3349091#M803241</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-22T09:14:31Z</dc:date>
    </item>
    <item>
      <title>Re: coding  problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/coding-problem/m-p/3349092#M803242</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;Try like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from zvr_st_inv_forms where vbeln = it_itab-vbeln.&lt;/P&gt;&lt;P&gt;if sy-subrc eq 0.&lt;/P&gt;&lt;P&gt;modify zvr_st_inv_forms from it_itab2.&lt;/P&gt;&lt;P&gt;CLEAR ZVR_ST_INV_FORMS.&lt;/P&gt;&lt;P&gt;clear it_itab2.&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;INSERT ZVR_ST_INV_FORMS from it_itab2.&lt;/P&gt;&lt;P&gt;CLEAR ZVR_ST_INV_FORMS.&lt;/P&gt;&lt;P&gt;clear it_itab2.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endselect.&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;Nagaraj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jan 2008 09:18:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/coding-problem/m-p/3349092#M803242</guid>
      <dc:creator>former_member404244</dc:creator>
      <dc:date>2008-01-22T09:18:00Z</dc:date>
    </item>
    <item>
      <title>Re: coding  problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/coding-problem/m-p/3349093#M803243</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi rahul,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Command is &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INSERT dbtab [CLIENT SPECIFIED] FROM TABLE itab. or INSERT (dbtabname) [CLIENT SPECIFIED] FROM TABLE itab. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INSERT ZVR_ST_INV_FORMS from it_itab2.&lt;/P&gt;&lt;P&gt;Change it to&lt;/P&gt;&lt;P&gt;INSERT ZVR_ST_INV_FORMS from TABLE it_itab2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check your table after the whole execution of the code or Use COMMIT WORK after the insert command if you are checkin in the debugging mode&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jan 2008 09:19:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/coding-problem/m-p/3349093#M803243</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-22T09:19:30Z</dc:date>
    </item>
    <item>
      <title>Re: coding  problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/coding-problem/m-p/3349094#M803244</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rahul,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;1. From where you are getting the it_Itab2&lt;/P&gt;&lt;P&gt;    values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2.it_Itab2 must have same structure like your &lt;/P&gt;&lt;P&gt;  database table (zvr_st_inv_forms).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Don't forget to reward if useful...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jan 2008 09:21:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/coding-problem/m-p/3349094#M803244</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-22T09:21:14Z</dc:date>
    </item>
    <item>
      <title>Re: coding  problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/coding-problem/m-p/3349095#M803245</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;friend! u need to change the code to this. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from zvr_st_inv_forms where vbeln = it_itab-vbeln.&lt;/P&gt;&lt;P&gt;endselect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if sy-subrc eq 0.&lt;/P&gt;&lt;P&gt;modify zvr_st_inv_forms from it_itab2.&lt;/P&gt;&lt;P&gt;CLEAR ZVR_ST_INV_FORMS.&lt;/P&gt;&lt;P&gt;clear it_itab2.&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;INSERT ZVR_ST_INV_FORMS from it_itab2.&lt;/P&gt;&lt;P&gt;CLEAR ZVR_ST_INV_FORMS.&lt;/P&gt;&lt;P&gt;clear it_itab2.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but if zvr_st_inv_forms has multiple entries for it_tab-vbeln ..then u might be in a soup..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Nivin Joseph Varkey on Jan 22, 2008 10:22 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jan 2008 09:22:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/coding-problem/m-p/3349095#M803245</guid>
      <dc:creator>nivin_varkey</dc:creator>
      <dc:date>2008-01-22T09:22:32Z</dc:date>
    </item>
    <item>
      <title>Re: coding  problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/coding-problem/m-p/3349096#M803246</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hii friends , it_itab and ii_itab are same , so that will not matter . &lt;/P&gt;&lt;P&gt;tell me we can if &amp;amp; else in select - endselect?&lt;/P&gt;&lt;P&gt;its running only first if , not the second if.&lt;/P&gt;&lt;P&gt; i tried IF - ELSE also. &lt;/P&gt;&lt;P&gt;but it didnt worked.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jan 2008 11:56:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/coding-problem/m-p/3349096#M803246</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-22T11:56:08Z</dc:date>
    </item>
    <item>
      <title>Re: coding  problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/coding-problem/m-p/3349097#M803247</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Within a SELECT... ENDSELECT it makes NO sense to check the value of sy-subrc immediately after the SELECT statement.  Also, sy-subrc can change value within your first IF, so you could end up with the second running also clauses running.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It looks like you're checking whether a record exists in your Z table.  If it doesn't, then you want to insert the records, otherwise, you want to change them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a look at the keywords UPDATE, MODIFY and INSERT.  The MODIFY statement inserts one or several lines specified in source in the database table specified in target, or overwrites existing lines. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So you could possibly, simply:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MODIFY zvr_st_inv_forms FROM it_itab2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Otherwise use:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select &lt;STRONG&gt;SINGLE&lt;/STRONG&gt; * from zvr_st_inv_forms where vbeln = it_itab-vbeln.&lt;/P&gt;&lt;P&gt;if sy-subrc eq 0.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;UPDATE&lt;/STRONG&gt; zvr_st_inv_forms from it_itab2.&lt;/P&gt;&lt;P&gt;CLEAR ZVR_ST_INV_FORMS.&lt;/P&gt;&lt;P&gt;clear it_itab2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ELSE.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INSERT ZVR_ST_INV_FORMS from it_itab2.&lt;/P&gt;&lt;P&gt;CLEAR ZVR_ST_INV_FORMS.&lt;/P&gt;&lt;P&gt;clear it_itab2.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;matt&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jan 2008 12:04:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/coding-problem/m-p/3349097#M803247</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2008-01-22T12:04:34Z</dc:date>
    </item>
    <item>
      <title>Re: coding  problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/coding-problem/m-p/3349098#M803248</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi rahul,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;we can write the if else in between the select endselect statement.&lt;/P&gt;&lt;P&gt;but the condition you are having in your code is related with that select statement.&lt;/P&gt;&lt;P&gt;means when the data is selected then sy-subrc =0 right,and not selected then it is 4.&lt;/P&gt;&lt;P&gt;But the data not select form the select query the the execution will not goes into the select statements body so the else part of your code is not get executed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so according to me try the sy-subrc = 4 code out of the select endselect body.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;Dharmishta&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jan 2008 12:06:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/coding-problem/m-p/3349098#M803248</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-22T12:06:48Z</dc:date>
    </item>
    <item>
      <title>Re: coding  problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/coding-problem/m-p/3349099#M803249</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Matthew and Dharmishta for answer..points r given...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jan 2008 12:34:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/coding-problem/m-p/3349099#M803249</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-22T12:34:06Z</dc:date>
    </item>
  </channel>
</rss>

