<?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: Upload CSV file in background in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/upload-csv-file-in-background/m-p/5262812#M1215383</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if your RFC places the file in Application server.. you can use open dataset statement and get data to internal table by using split at comma.... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;key words to search &lt;STRONG&gt;Open dataset&lt;/STRONG&gt; &lt;STRONG&gt;CSV&lt;/STRONG&gt; &lt;STRONG&gt;application server file&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 04 Mar 2009 04:23:24 GMT</pubDate>
    <dc:creator>former_member156446</dc:creator>
    <dc:date>2009-03-04T04:23:24Z</dc:date>
    <item>
      <title>Upload CSV file in background</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/upload-csv-file-in-background/m-p/5262807#M1215378</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;How 2 upload CSV file in Background, if the Flat file is input .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regrds&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Mar 2009 08:16:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/upload-csv-file-in-background/m-p/5262807#M1215378</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-03T08:16:07Z</dc:date>
    </item>
    <item>
      <title>Re: Upload CSV file in background</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/upload-csv-file-in-background/m-p/5262808#M1215379</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;as GUI_* and WS_* function modules do not work in background&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When scheduling a job in the background the appropriate statement to read in your file is OPEN DATASET, and the file must be on the file system that the SAP server can see.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At anytime, a user can switch of the Personal Computers even though the job is still running in the background. Therefore GUI_* and WS_* function modules are not designed to work in that way, as they need to access your personal computer file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To choose the correct download method to used, you can check the value of SY-BATCH in your code,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if it is 'X' use OPEN DATASET and if it is ' ' use WS_UPLOAD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*-- Open dataset for reading&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA:&lt;/P&gt;&lt;P&gt;dsn(20) VALUE '/usr/test.dat',&lt;/P&gt;&lt;P&gt;rec(80).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OPEN DATASET dsn FOR INPUT IN TEXT MODE.&lt;/P&gt;&lt;P&gt;IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;DO.&lt;/P&gt;&lt;P&gt;READ DATASET dsn INTO rec.&lt;/P&gt;&lt;P&gt;IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;EXIT.&lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;P&gt;WRITE / rec.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;ENDDO.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;CLOSE DATASET dsn.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*-- Open dataset for writing&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA rec(80).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OPEN DATASET dsn FOR OUTPUT IN TEXT MODE.&lt;/P&gt;&lt;P&gt;TRANSFER rec TO '/usr/test.dat'.&lt;/P&gt;&lt;P&gt;CLOSE DATASET dsn.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this will solve your problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;P&gt;Rajnesh&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Rajnesh Dharmat on Mar 3, 2009 1:53 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Mar 2009 08:23:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/upload-csv-file-in-background/m-p/5262808#M1215379</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-03T08:23:38Z</dc:date>
    </item>
    <item>
      <title>Re: Upload CSV file in background</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/upload-csv-file-in-background/m-p/5262809#M1215380</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;you have to call it from Applications server using OPEN DATASET and CLOSE DATASET.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;GUI_UPLOAD in background  wont work. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Mar 2009 08:54:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/upload-csv-file-in-background/m-p/5262809#M1215380</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-03T08:54:27Z</dc:date>
    </item>
    <item>
      <title>Re: Upload CSV file in background</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/upload-csv-file-in-background/m-p/5262810#M1215381</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;PRE&gt;&lt;CODE&gt;

lv_filename = &amp;lt;input file path&amp;gt;

 open dataset lv_filename for input in text mode encoding default.
    if sy-subrc = 0.
      do.
        read dataset lv_filename into gs_input-wa_string.
        if sy-subrc eq 0.
          append gs_input to gt_input.
        else.
          exit.
        endif.
      enddo.
      close dataset lv_filename.
    endif.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Hope its helps&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Mar 2009 09:38:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/upload-csv-file-in-background/m-p/5262810#M1215381</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-03T09:38:30Z</dc:date>
    </item>
    <item>
      <title>Re: Upload CSV file in background</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/upload-csv-file-in-background/m-p/5262811#M1215382</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;Thanks for the reply,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;our system is as follows,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The user logins  to the portal and enters the data to the screen and submits,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The UI people turns it to a csv file and sends it to my RFC&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so can I follow above procedure.... and is it the only procedure....?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Mar 2009 03:56:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/upload-csv-file-in-background/m-p/5262811#M1215382</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-04T03:56:56Z</dc:date>
    </item>
    <item>
      <title>Re: Upload CSV file in background</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/upload-csv-file-in-background/m-p/5262812#M1215383</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if your RFC places the file in Application server.. you can use open dataset statement and get data to internal table by using split at comma.... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;key words to search &lt;STRONG&gt;Open dataset&lt;/STRONG&gt; &lt;STRONG&gt;CSV&lt;/STRONG&gt; &lt;STRONG&gt;application server file&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Mar 2009 04:23:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/upload-csv-file-in-background/m-p/5262812#M1215383</guid>
      <dc:creator>former_member156446</dc:creator>
      <dc:date>2009-03-04T04:23:24Z</dc:date>
    </item>
  </channel>
</rss>

