<?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: JOB and INSERT in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/job-and-insert/m-p/6153128#M1368898</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If the primary key set already exist, there is not way u can insert another entry with the same key(set). Modify would look if the key exist, if not it will add a new row else.. it will modify the data releavent to that data (primary key)&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;modify ztabla_vuelos FROM TABLE ti_vuelos.
IF sy-subrc EQ 0.
COMMIT WORK.
WRITE :/ 'OK '.
ELSE.
WRITE: / 'failed'.
ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 04 Oct 2009 18:16:39 GMT</pubDate>
    <dc:creator>former_member156446</dc:creator>
    <dc:date>2009-10-04T18:16:39Z</dc:date>
    <item>
      <title>JOB and INSERT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/job-and-insert/m-p/6153124#M1368894</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm practicing JOBS, and I have a program that insert 3 records in a Z table What I do is:&lt;/P&gt;&lt;P&gt;1. Loop to my internal table and then record by record I user the clause INSERT, if sy-subrc eq 0, then COMMIT and write:/ Record added, ELSE. rollback work and write:/ Record not added.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. When i execute the job via SUBMIT clause, and then I go to the SM37 trx, I can't see the spool list. This happens when I try to add records which were added previously, but if there are new records, I can see the spool list and I don't have problems.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Whys is this happening? I assume that the insert is not possible when the record exist in the Z Table, but I have the rollback and the write, why I can't see the writes?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can someone explain to me, and let me know how I can solve it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Gaby&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 04 Oct 2009 15:05:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/job-and-insert/m-p/6153124#M1368894</guid>
      <dc:creator>former_member204025</dc:creator>
      <dc:date>2009-10-04T15:05:43Z</dc:date>
    </item>
    <item>
      <title>Re: JOB and INSERT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/job-and-insert/m-p/6153125#M1368895</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;The insert statement fails if the table already contains a row with the same primary key as that you define in the condition of the insert statement. Since you have written the else part as 'Records not added' , it should have been executed if you were trying to insert the already existing records. Try executing the report in foreground and check the sy-subrc value when you try to insert already available records. Also i dont see the use of rollback here since in the else part no record will be inserted. Remove that also and check&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vikranth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 04 Oct 2009 15:56:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/job-and-insert/m-p/6153125#M1368895</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-10-04T15:56:15Z</dc:date>
    </item>
    <item>
      <title>Re: JOB and INSERT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/job-and-insert/m-p/6153126#M1368896</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;inspite you want the new values to be updated in the Ztable u can use MODIFY statement. Hit an F1 on modify and look for the help on how to use it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 04 Oct 2009 16:01:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/job-and-insert/m-p/6153126#M1368896</guid>
      <dc:creator>former_member156446</dc:creator>
      <dc:date>2009-10-04T16:01:28Z</dc:date>
    </item>
    <item>
      <title>Re: JOB and INSERT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/job-and-insert/m-p/6153127#M1368897</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vikranth,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried deleting the rollback line. And when I use that in a loop works fine, but when I use this line:&lt;/P&gt;&lt;P&gt;INSERT ztabla_vuelos FROM TABLE ti_vuelos.&lt;/P&gt;&lt;P&gt;if there is a duplicate record so then  I see the dump, I debugged  the code, and when the point is on the INSERT line, after pressing F5 I see the dump error, and tells me that I',m triying to add a duplicate record -which is true- but i don't know how can avoid that, I would like to show a line like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INSERT ztabla_vuelos FROM TABLE ti_vuelos.&lt;/P&gt;&lt;P&gt;IF sy-subrc EQ 0.&lt;/P&gt;&lt;P&gt;  COMMIT WORK.&lt;/P&gt;&lt;P&gt;  WRITE &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt; 'OK '.&lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;P&gt;  WRITE: / 'failed'.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;But i can't get it. How can I solve that?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 04 Oct 2009 17:47:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/job-and-insert/m-p/6153127#M1368897</guid>
      <dc:creator>former_member204025</dc:creator>
      <dc:date>2009-10-04T17:47:28Z</dc:date>
    </item>
    <item>
      <title>Re: JOB and INSERT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/job-and-insert/m-p/6153128#M1368898</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If the primary key set already exist, there is not way u can insert another entry with the same key(set). Modify would look if the key exist, if not it will add a new row else.. it will modify the data releavent to that data (primary key)&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;modify ztabla_vuelos FROM TABLE ti_vuelos.
IF sy-subrc EQ 0.
COMMIT WORK.
WRITE :/ 'OK '.
ELSE.
WRITE: / 'failed'.
ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 04 Oct 2009 18:16:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/job-and-insert/m-p/6153128#M1368898</guid>
      <dc:creator>former_member156446</dc:creator>
      <dc:date>2009-10-04T18:16:39Z</dc:date>
    </item>
    <item>
      <title>Re: JOB and INSERT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/job-and-insert/m-p/6153129#M1368899</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I see that. So, I only can use the INSERT clause, when I'm sure that there are no duplicates rows, right? If I'm not sure, I should use Modify clause ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 04 Oct 2009 19:18:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/job-and-insert/m-p/6153129#M1368899</guid>
      <dc:creator>former_member204025</dc:creator>
      <dc:date>2009-10-04T19:18:42Z</dc:date>
    </item>
    <item>
      <title>Re: JOB and INSERT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/job-and-insert/m-p/6153130#M1368900</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt;insert: checks duplicate key entry : if duplicate present : fails&lt;/P&gt;&lt;P&gt;&amp;gt;modify: checks duplicate key entry : if duplicate present : modifies, else: inserts.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps to clarify&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 04 Oct 2009 23:51:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/job-and-insert/m-p/6153130#M1368900</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-10-04T23:51:44Z</dc:date>
    </item>
    <item>
      <title>Re: JOB and INSERT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/job-and-insert/m-p/6153131#M1368901</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your help!! It's really helpful &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Oct 2009 01:33:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/job-and-insert/m-p/6153131#M1368901</guid>
      <dc:creator>former_member204025</dc:creator>
      <dc:date>2009-10-05T01:33:59Z</dc:date>
    </item>
  </channel>
</rss>

