<?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: Program in background mode failed in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-in-background-mode-failed/m-p/1559032#M252932</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;    OPEN DATASET ZFNAME IN TEXT MODE.
    IF SY-SUBRC = 0.
      DO.
        READ DATASET ZFNAME INTO ZLINE LENGTH LEN.
        IF SY-SUBRC &amp;lt;&amp;gt; 0.
          EXIT.
        ENDIF.
        ITAB-LINE = ZLINE.
        APPEND ITAB. CLEAR ITAB.
      ENDDO.
    ENDIF.
    CLOSE DATASET ZFNAME.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Its a simple code, and i have checked that file existed during the scheduled time.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 08 Sep 2006 03:08:33 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-09-08T03:08:33Z</dc:date>
    <item>
      <title>Program in background mode failed</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-in-background-mode-failed/m-p/1559030#M252930</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have developed an customized report which basically uploads a file from server and perform computation against the data in SAP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tested ok when executed normally. But it fails to upload file when its set to background job.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Used 'Open Dataset'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please advice.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Sep 2006 01:51:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-in-background-mode-failed/m-p/1559030#M252930</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-08T01:51:14Z</dc:date>
    </item>
    <item>
      <title>Re: Program in background mode failed</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-in-background-mode-failed/m-p/1559031#M252931</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Duxton&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   Can you post your code? Also can you check if the &lt;/P&gt;&lt;P&gt;file still exists on server by the time you are &lt;/P&gt;&lt;P&gt;executing in background.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind Regards&lt;/P&gt;&lt;P&gt;Eswar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Sep 2006 02:46:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-in-background-mode-failed/m-p/1559031#M252931</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-08T02:46:26Z</dc:date>
    </item>
    <item>
      <title>Re: Program in background mode failed</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-in-background-mode-failed/m-p/1559032#M252932</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;    OPEN DATASET ZFNAME IN TEXT MODE.
    IF SY-SUBRC = 0.
      DO.
        READ DATASET ZFNAME INTO ZLINE LENGTH LEN.
        IF SY-SUBRC &amp;lt;&amp;gt; 0.
          EXIT.
        ENDIF.
        ITAB-LINE = ZLINE.
        APPEND ITAB. CLEAR ITAB.
      ENDDO.
    ENDIF.
    CLOSE DATASET ZFNAME.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Its a simple code, and i have checked that file existed during the scheduled time.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Sep 2006 03:08:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-in-background-mode-failed/m-p/1559032#M252932</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-08T03:08:33Z</dc:date>
    </item>
    <item>
      <title>Re: Program in background mode failed</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-in-background-mode-failed/m-p/1559033#M252933</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;Couldnt find anything  wrong with your code, for it to fail in background...can u post your complete code?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Raj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Sep 2006 03:24:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-in-background-mode-failed/m-p/1559033#M252933</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-08T03:24:37Z</dc:date>
    </item>
    <item>
      <title>Re: Program in background mode failed</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-in-background-mode-failed/m-p/1559034#M252934</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;Only work in the case of BDC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please add this condition also.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF sy-binpt IS NOT INITIAL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sy-binpt = 1 when its a back ground job,&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;anver&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Sep 2006 04:43:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-in-background-mode-failed/m-p/1559034#M252934</guid>
      <dc:creator>anversha_s</dc:creator>
      <dc:date>2006-09-08T04:43:26Z</dc:date>
    </item>
    <item>
      <title>Re: Program in background mode failed</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-in-background-mode-failed/m-p/1559035#M252935</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;CALL FUNCTION 'WS_UPLOAD'
       EXPORTING
            FILENAME        = ZFNAME
            FILETYPE        = 'ASC'
       IMPORTING
            FILELENGTH      = RC
       TABLES
            DATA_TAB        = ITAB
       EXCEPTIONS
            FILE_OPEN_ERROR = 1
            OTHERS          = 2.

  IF SY-SUBRC &amp;lt;&amp;gt; 0 .
    DATA: LEN TYPE I.
    CLEAR ZLINE.
    OPEN DATASET ZFNAME IN TEXT MODE.
    IF SY-SUBRC = 0.
      DO.
        READ DATASET ZFNAME INTO ZLINE LENGTH LEN.
        IF SY-SUBRC &amp;lt;&amp;gt; 0.
          EXIT.
        ENDIF.
        ITAB-LINE = ZLINE.
        APPEND ITAB. CLEAR ITAB.
      ENDDO.
    ENDIF.
    CLOSE DATASET ZFNAME.
  ENDIF.

  IF ITAB[] IS INITIAL .
    ERR-FDATE = SDATE.
    ERR-REMARKS = "unable to find file".
    APPEND ERR.
  ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the portion for uploading the file.&lt;/P&gt;&lt;P&gt;Anyway to debug when in backgroud?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Sep 2006 05:26:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-in-background-mode-failed/m-p/1559035#M252935</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-08T05:26:23Z</dc:date>
    </item>
    <item>
      <title>Re: Program in background mode failed</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-in-background-mode-failed/m-p/1559036#M252936</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;there is no BDC involved in the program&lt;/P&gt;&lt;P&gt;It merely compares the amount from the file against the amount in SAP table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Sep 2006 05:28:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-in-background-mode-failed/m-p/1559036#M252936</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-08T05:28:34Z</dc:date>
    </item>
    <item>
      <title>Re: Program in background mode failed</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-in-background-mode-failed/m-p/1559037#M252937</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Duxton,&lt;/P&gt;&lt;P&gt;The only simplest answer to this is that maybe 'ZFNAME' has no value in it. Can you please hardcode the value and then try and let me know if still it fails.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Nishant&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Sep 2006 05:33:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-in-background-mode-failed/m-p/1559037#M252937</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-08T05:33:11Z</dc:date>
    </item>
    <item>
      <title>Re: Program in background mode failed</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-in-background-mode-failed/m-p/1559038#M252938</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;Hi Duxton

  While opening the file to read the data, use as
  OPEN DATASET ZFNAME &amp;lt;b&amp;gt;FOR INPUT&amp;lt;/b&amp;gt; IN TEXT MODE.  
  I guess the default mode will be FOR OUTPUT.

  For debugging a background job, there are two options
  1. When the job is finished, go to SM37. Select the 
job, execute command JDBG in command field. A series of 
F7 need to be done until you reach your program. From 
then you can debug to see how the commands are executed.

  2. Place an infinite loop in the program, execute in 
background. Go to SM50, select the process. Go to menu
Program/Mode -&amp;gt; Program -&amp;gt; Debugging. Which will open 
your program in debugging mode, change the value to exit 
the infinite loop and proceed with other steps.

  Btb, can you check if you are using the same filename
for both foreground and background processing as the 
naming convention will be different for presentation 
server filename and application server filename.
Eg: 
Presentation Server: 'C:Eswar.txt'.
Application Server: '/usr/sap/Eswar.txt'.
     
  Hope your problem gets resolved.

Kind Regards
Eswar&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Sep 2006 10:32:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-in-background-mode-failed/m-p/1559038#M252938</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-08T10:32:48Z</dc:date>
    </item>
    <item>
      <title>Re: Program in background mode failed</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-in-background-mode-failed/m-p/1559039#M252939</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good Your problem is already resolved. Am slow to respond.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind Regards&lt;/P&gt;&lt;P&gt;Eswar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Sep 2006 10:35:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-in-background-mode-failed/m-p/1559039#M252939</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-08T10:35:28Z</dc:date>
    </item>
  </channel>
</rss>

