<?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: open dataset in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/open-dataset/m-p/1471085#M221428</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes.  Again you will need to modify the examples a little.&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>Mon, 04 Sep 2006 16:30:41 GMT</pubDate>
    <dc:creator>RichHeilman</dc:creator>
    <dc:date>2006-09-04T16:30:41Z</dc:date>
    <item>
      <title>open dataset</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/open-dataset/m-p/1471081#M221424</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;I have a directory in the application server .&lt;/P&gt;&lt;P&gt;I have some list of files in that directory.&lt;/P&gt;&lt;P&gt;So i have to read the directory first and i have to process the file one by one and i have to upload the data in the file into SAP.This i have to do in background.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can any body tell me some suggessions on this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Sep 2006 15:52:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/open-dataset/m-p/1471081#M221424</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-04T15:52:09Z</dc:date>
    </item>
    <item>
      <title>Re: open dataset</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/open-dataset/m-p/1471082#M221425</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please take a look at this application server file browser program.  You can use this for your requirement, the only difference here is that it provides a list for the user to choose which file to upload,  you can simply modify it for your needs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

report zrich_0001 .

data: begin of itab occurs 0,
      rec(1000) type c,
      end of itab.
data: wa(1000) type c.

data: p_file type localfile.
data: ifile type table of  salfldir with header line.

parameters: p_path type salfile-longname
                    default '/usr/sap/TST/DVEBMGS01/data/'.


call function 'RZL_READ_DIR_LOCAL'
     exporting
          name           = p_path
     tables
          file_tbl       = ifile
     exceptions
          argument_error = 1
          not_found      = 2
          others         = 3.

loop at ifile.
  format hotspot on.
  write:/ ifile-name.
  hide ifile-name.
  format hotspot off.
endloop.


at line-selection.

  concatenate p_path ifile-name into p_file.

  clear itab.  refresh itab.
  open dataset p_file for input in text mode.
  if sy-subrc = 0.
    do.
      read dataset p_file into wa.
      if sy-subrc &amp;lt;&amp;gt; 0.
        exit.
      endif.
      itab-rec = wa.
      append itab.
    enddo.
  endif.
  close dataset p_file.

  loop at itab.
    write:/ itab.
  endloop.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&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>Mon, 04 Sep 2006 16:08:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/open-dataset/m-p/1471082#M221425</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-09-04T16:08:41Z</dc:date>
    </item>
    <item>
      <title>Re: open dataset</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/open-dataset/m-p/1471083#M221426</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;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;use FM : 'RZL_READ_DIR_LOCAL' to read files on the application server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;check this code :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;PARAMETER: p_fdir            type pfeflnamel DEFAULT '/usr/sap/tmp'.

data: begin of it_filedir occurs 10.
        include structure salfldir.
data: end of it_filedir.



START-OF-SELECTION.
* Get Current Directory Listing for OUT Dir
  call function 'RZL_READ_DIR_LOCAL'
       exporting
            name     = p_fdir
       tables
            file_tbl = it_filedir.

* List of files are contained within table it_filedir
  loop at it_filedir.
   clear :i_xcontent.
   refresh :i_xcontent.
open dataset it_filedir-file for input in text mode.
  do.
    read dataset it_filedir-file into ls_xcontent-line.
    if sy-subrc eq 0.
      append ls_xcontent to i_xcontent.
    endif.
  enddo.
close dataset it_filedir-file.

*Update table with internal table data 
    modify ztable from table i_xcontent.


  endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&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;Appana&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Sep 2006 16:10:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/open-dataset/m-p/1471083#M221426</guid>
      <dc:creator>Laxmana_Appana_</dc:creator>
      <dc:date>2006-09-04T16:10:07Z</dc:date>
    </item>
    <item>
      <title>Re: open dataset</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/open-dataset/m-p/1471084#M221427</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Thanks for reply.But my program will run in back ground.&lt;/P&gt;&lt;P&gt;So there won't be any selection-screen in my pgm.&lt;/P&gt;&lt;P&gt;So in that FM if i hardcode the path will it run background?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Sep 2006 16:22:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/open-dataset/m-p/1471084#M221427</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-04T16:22:33Z</dc:date>
    </item>
    <item>
      <title>Re: open dataset</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/open-dataset/m-p/1471085#M221428</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes.  Again you will need to modify the examples a little.&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>Mon, 04 Sep 2006 16:30:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/open-dataset/m-p/1471085#M221428</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-09-04T16:30:41Z</dc:date>
    </item>
    <item>
      <title>Re: open dataset</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/open-dataset/m-p/1471086#M221429</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just change the parameters statement to this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&amp;lt;b&amp;gt;data:&amp;lt;/b&amp;gt; p_path type salfile-longname
                   &amp;lt;b&amp;gt; value&amp;lt;/b&amp;gt; '/usr/sap/TST/DVEBMGS01/data/'.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&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>Mon, 04 Sep 2006 16:31:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/open-dataset/m-p/1471086#M221429</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-09-04T16:31:37Z</dc:date>
    </item>
  </channel>
</rss>

