<?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: Debugging an background Job in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/debugging-an-background-job/m-p/1391409#M190148</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;enter tcode jdbg in the command box and then continue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 21 Jun 2006 14:33:29 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-06-21T14:33:29Z</dc:date>
    <item>
      <title>Debugging an background Job</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/debugging-an-background-job/m-p/1391404#M190143</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have  a report program which updates material master tales from file on application server or from desktop . This program works fine when run in foreground but when scheduled as an background job this gives n me error . I am posting the stauses messages .&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;&lt;/P&gt;&lt;P&gt;Job log overview for job:    ZFINIR3002 / 12200601                                                                                &lt;/P&gt;&lt;P&gt;Date       Time     Message text                                                                    Message class Message no. Message type                                                                                &lt;/P&gt;&lt;P&gt;06/21/2006 12:20:11 Job started                                                                          00           516          S       &lt;/P&gt;&lt;P&gt; 06/21/2006 12:20:11 Step 001 started (program ZFINIR3002, variant &amp;amp;0000000000077, user name VARUN)      00           550          S       &lt;/P&gt;&lt;P&gt; 06/21/2006 12:20:14 Input file does not exist                                                           ZFIN           55          E       &lt;/P&gt;&lt;P&gt; 06/21/2006 12:20:14 Job cancelled after system exception ERROR_MESSAGE                                   00           564          A       &lt;/P&gt;&lt;P&gt;&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyon advise me on this ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Varun .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jun 2006 14:25:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/debugging-an-background-job/m-p/1391404#M190143</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-21T14:25:50Z</dc:date>
    </item>
    <item>
      <title>Re: Debugging an background Job</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/debugging-an-background-job/m-p/1391405#M190144</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;refer this thread:&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="1651955"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="1738550"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rgds,&lt;/P&gt;&lt;P&gt;latheesh&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Latheesh Kaduthara&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jun 2006 14:28:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/debugging-an-background-job/m-p/1391405#M190144</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-21T14:28:27Z</dc:date>
    </item>
    <item>
      <title>Re: Debugging an background Job</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/debugging-an-background-job/m-p/1391406#M190145</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, first, you do realize that you can not upload from the PC/desktop in the background, right.  So you are seeing this problem when uploading from application server.   Does it work when uploading from application server in the foreground?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regard,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jun 2006 14:28:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/debugging-an-background-job/m-p/1391406#M190145</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-06-21T14:28:30Z</dc:date>
    </item>
    <item>
      <title>Re: Debugging an background Job</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/debugging-an-background-job/m-p/1391407#M190146</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Looks like you are trying to uplaod a presentation server file in background, which is not possible.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;ravi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jun 2006 14:29:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/debugging-an-background-job/m-p/1391407#M190146</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-21T14:29:20Z</dc:date>
    </item>
    <item>
      <title>Re: Debugging an background Job</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/debugging-an-background-job/m-p/1391408#M190147</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To debug in background,  put an endless loop in your program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;while sy-subrc = 0.
check sy-subrc = 0.
endwhile.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Run your program,  go to Sm50,  find your program running in a background task,  select it,  then from the menu,  click program/session,  then program,  then debugging.    Once you are in the debugger, the program will probably be on that endless loop.  Change the value of sy-subrc to 1 and continue stepping thru the program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jun 2006 14:31:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/debugging-an-background-job/m-p/1391408#M190147</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-06-21T14:31:18Z</dc:date>
    </item>
    <item>
      <title>Re: Debugging an background Job</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/debugging-an-background-job/m-p/1391409#M190148</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;enter tcode jdbg in the command box and then continue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jun 2006 14:33:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/debugging-an-background-job/m-p/1391409#M190148</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-21T14:33:29Z</dc:date>
    </item>
    <item>
      <title>Re: Debugging an background Job</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/debugging-an-background-job/m-p/1391410#M190149</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rich,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am uploading data from PC file into internal table .This internal table data is used to update material master data uisng a BAPI .&amp;lt;b&amp;gt;I am not aware of this thing that we cannot upload from PC/Desktop in background . Is it true ?&amp;lt;/b&amp;gt; When I run th program using PC file in foreground it is working fine .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Varun.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jun 2006 14:38:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/debugging-an-background-job/m-p/1391410#M190149</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-21T14:38:46Z</dc:date>
    </item>
    <item>
      <title>Re: Debugging an background Job</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/debugging-an-background-job/m-p/1391411#M190150</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You CAN NOT upload from PC in a background task.  How will the background task know where to get the file,  it has no idea about the machines connected to the frontend.   This is the reason for the failure.  You must upload from the application server using OPEN DATASET and READ DATASET.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a simple example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;report zrich_0001.

Parameters: d1 type localfile default '/usr/sap/TST/SYS/Data1.txt'.
          

data: itab type table of string.
data: wa   type string.

start-of-selection.

  open dataset d1 for input in text mode.
  if sy-subrc = 0.
    do.
      read dataset d1 into wa.
      if sy-subrc &amp;lt;&amp;gt; 0.
        exit.
      endif.
    append wa to itab.
    enddo.
  endif.
  close dataset d1.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jun 2006 14:48:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/debugging-an-background-job/m-p/1391411#M190150</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-06-21T14:48:22Z</dc:date>
    </item>
    <item>
      <title>Re: Debugging an background Job</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/debugging-an-background-job/m-p/1391412#M190151</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You cannot upload files from your desktop when you are running in the background and yes it is true.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You have to move the file to application server and use the constructs OPEN DATASET, READ DATASET, CLOSE DATASET.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you run a program in the background, the processing is done on the application server side where there will be some processes dedicated for background jobs. That is the reason why it will not be able to read from desktop as the contact with the desktop is gone.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jun 2006 14:48:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/debugging-an-background-job/m-p/1391412#M190151</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-21T14:48:30Z</dc:date>
    </item>
    <item>
      <title>Re: Debugging an background Job</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/debugging-an-background-job/m-p/1391413#M190152</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Varun,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can run program in background only if the input file is on application server while in foreground, there is no such limitation. &lt;/P&gt;&lt;P&gt;You can place a check before material master update that if the program is run in background ( sy-batch = 'X' ) then upload the file to application server from desktop and open input file from there. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There a no. of ways to debug the background job as mentioned in above posts. 1 more way is to go to SM50 Txn and find your background job of Type 'BGD'. Check that process and go to Program/Session -&amp;gt;Program -&amp;gt; Debugging.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Vikram&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pls reward for helpful replies!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jun 2006 14:49:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/debugging-an-background-job/m-p/1391413#M190152</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-21T14:49:22Z</dc:date>
    </item>
    <item>
      <title>Re: Debugging an background Job</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/debugging-an-background-job/m-p/1391414#M190153</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you all for your immediate and prompt replies.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and Regards,&lt;/P&gt;&lt;P&gt;Varun.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jun 2006 14:57:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/debugging-an-background-job/m-p/1391414#M190153</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-21T14:57:09Z</dc:date>
    </item>
  </channel>
</rss>

