<?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: Function Module in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module/m-p/1094244#M101685</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Welcome to SDN,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't think there is a FM for that.&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 28 Nov 2005 17:09:11 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2005-11-28T17:09:11Z</dc:date>
    <item>
      <title>Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module/m-p/1094243#M101684</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have need of a function module that finds a file in directory on file system of BW.&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Nov 2005 16:49:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module/m-p/1094243#M101684</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-11-28T16:49:42Z</dc:date>
    </item>
    <item>
      <title>Re: Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module/m-p/1094244#M101685</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Welcome to SDN,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't think there is a FM for that.&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Nov 2005 17:09:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module/m-p/1094244#M101685</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-11-28T17:09:11Z</dc:date>
    </item>
    <item>
      <title>Re: Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module/m-p/1094245#M101686</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;Welcome...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I guess You have to know where is the file, so use the GUI_UPLOAD to upload it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alexandre Nogueira.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Nov 2005 17:10:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module/m-p/1094245#M101686</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-11-28T17:10:55Z</dc:date>
    </item>
    <item>
      <title>Re: Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module/m-p/1094246#M101687</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Antonio Brudaglio  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   Welcome to SDN !!!!!  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   Take a look at the Class CL_GUI_FRONTEND_SERVICES. &lt;/P&gt;&lt;P&gt;   Some of the methods are useful would be : &lt;/P&gt;&lt;P&gt;      1.  GET_SYSTEM_DIRECTORY&lt;/P&gt;&lt;P&gt;      2.  GUI_UPLOAD&lt;/P&gt;&lt;P&gt;      3.  DIRECTORY_LIST_FILES&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Kam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Nov 2005 17:16:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module/m-p/1094246#M101687</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-11-28T17:16:59Z</dc:date>
    </item>
    <item>
      <title>Re: Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module/m-p/1094247#M101688</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I don't know if exit a standard FM, but you can build one custom that uses external command (un a linux enviorement you could use th command whereis). For external opereting system command you can see the SM69 transaction.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope it can help you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bye&lt;/P&gt;&lt;P&gt;enzo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Nov 2005 17:22:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module/m-p/1094247#M101688</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-11-28T17:22:00Z</dc:date>
    </item>
    <item>
      <title>Re: Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module/m-p/1094248#M101689</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I assume you want a server side directory listing.  I had to write my own class to do this.  It uses Kernel calls (use with caution!) to read the server directory.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;method get_directory_listing.
*@78QImporting@	I_DIR_NAME	TYPE CSEQUENCE	
*@78QImporting@	I_FILE_MASK	TYPE EPSFILNAM  DEFAULT SPACE	File Name
*@79QExporting@	E_DIR_LIST	TYPE T_ZES_EPSFILI	

  data: begin of file,
        dirname(175) type c, "name of directory. (possibly truncated.)
        name(175)    type c, " name of entry. (possibly truncated.)
        type(10)     type c, " type of entry.
        len(16)      type p, " length in bytes.
        owner(8)     type c, " owner of the entry.
        mtime(6)     type p, " last modification date, seconds since 1970
        mode(9)      type c, " like "rwx-r-x--x": protection mode.
        errno(3)     type c,
        errmsg(40)   type c,
      end of file.
  field-symbols: &amp;lt;wa_dir_list&amp;gt; like line of e_dir_list.
  data: error_counter type i.

* get directory listing
  call 'C_DIR_READ_FINISH'                  " just to be sure
        id 'ERRNO'  field file-errno
        id 'ERRMSG' field file-errmsg.

  call 'C_DIR_READ_START'
        id 'DIR'    field i_dir_name
        id 'FILE'   field i_file_mask
        id 'ERRNO'  field file-errno
        id 'ERRMSG' field file-errmsg.
*  if sy-subrc &amp;lt;&amp;gt; 0.
*    raise read_directory_failed.
*  endif.

  do.
    clear file.
    call 'C_DIR_READ_NEXT'
          id 'TYPE'   field file-type
          id 'NAME'   field file-name
          id 'LEN'    field file-len
          id 'OWNER'  field file-owner
          id 'MTIME'  field file-mtime
          id 'MODE'   field file-mode
          id 'ERRNO'  field file-errno
          id 'ERRMSG' field file-errmsg.

    if sy-subrc = 0.
      append initial line to e_dir_list assigning &amp;lt;wa_dir_list&amp;gt;.
      &amp;lt;wa_dir_list&amp;gt;-size = file-len.
      &amp;lt;wa_dir_list&amp;gt;-name = file-name.
      if file-type(1) = 'f' or              " regular file
         file-type(1) = 'F' or
         file-type(1) = 'd'.
*       add 1 to file_counter.
        if file-type(1) = 'f'.
          &amp;lt;wa_dir_list&amp;gt;-rc   = 0.
        else.
          &amp;lt;wa_dir_list&amp;gt;-rc = 1.
        endif.
      endif.
    elseif sy-subrc = 1.
      exit.
    else.
      if error_counter &amp;gt; 1000.
        call 'C_DIR_READ_FINISH'
              id 'ERRNO'  field file-errno
              id 'ERRMSG' field file-errmsg.
*        raise too_many_read_errors.
        exit.
      endif.
      add 1 to error_counter.
    endif.
  enddo.


endmethod.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My exporting parameter is a table type for a structure that I copied from EPSFILI.  I made the filename and filesize parameters larger:&lt;/P&gt;&lt;P&gt;Original:&lt;/P&gt;&lt;P&gt;Filename type CHAR 40&lt;/P&gt;&lt;P&gt;Filesize type INT4&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Copy:&lt;/P&gt;&lt;P&gt;Filename type CHAR 175&lt;/P&gt;&lt;P&gt;Filesize type FLTP Len 16 Decimal 16&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Nov 2005 17:50:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module/m-p/1094248#M101689</guid>
      <dc:creator>thomas_jung</dc:creator>
      <dc:date>2005-11-28T17:50:43Z</dc:date>
    </item>
  </channel>
</rss>

