<?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 a Function Module in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/upload-a-function-module/m-p/1947231#M390331</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;1)download into c drive of ur system.

*&amp;amp;---------------------------------------------------------------------*
*&amp;amp; Report  Z_DOWNLOAD_FM_DATA                                          *
*&amp;amp;                                                                     *
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;                                                                     *
*&amp;amp;                                                                     *
*&amp;amp;---------------------------------------------------------------------*

REPORT  z_download_fm_data                      .

*----------------------------------------------------------------------*
* Tables
*----------------------------------------------------------------------*

*----------------------------------------------------------------------*
* TYPES - Structures
*----------------------------------------------------------------------*
* Structure for Function Module Attributes
TYPES: BEGIN OF s_fm_attributes         ,
        global_flag   LIKE rs38l-global ,
        remote_call   LIKE rs38l-remote ,
        update_task   LIKE rs38l-utask  ,
        short_text    LIKE tftit-stext  ,
        function_pool LIKE rs38l-area   ,
       END   OF s_fm_attributes         .

* Structure for Import Paramters
TYPES: BEGIN OF s_import_parameter .
        INCLUDE STRUCTURE rsimp    .
TYPES: END   OF s_import_parameter .

* Structure for Changing Paramters
TYPES: BEGIN OF s_changing_parameter .
        INCLUDE STRUCTURE rscha      .
TYPES: END   OF s_changing_parameter .

* Structure for Export Paramters
TYPES: BEGIN OF s_export_parameter  .
        INCLUDE STRUCTURE rsexp     .
TYPES: END   OF s_export_parameter  .

* Structure for Table Paramters
TYPES: BEGIN OF s_tables_parameter .
        INCLUDE STRUCTURE rstbl    .
TYPES: END   OF s_tables_parameter .

* Structure for Exception list
TYPES: BEGIN OF s_exception_list  .
        INCLUDE STRUCTURE rsexc.
TYPES: END   OF s_exception_list .

* Structure for Documentation
TYPES: BEGIN OF s_documentation  .
        INCLUDE STRUCTURE rsfdo.
TYPES: END   OF s_documentation .

* Structure for Exception list
TYPES: BEGIN OF s_source           .
        INCLUDE STRUCTURE rssource .
TYPES: END   OF s_source           .


*----------------------------------------------------------------------*
* Internal Tables
*----------------------------------------------------------------------*
DATA:  t_fm_attributes      TYPE s_fm_attributes       OCCURS 0
                            WITH HEADER LINE                     ,
       t_import_parameter   TYPE s_import_parameter    OCCURS 0
                            WITH HEADER LINE                     ,
       t_changing_parameter TYPE s_changing_parameter  OCCURS 0
                            WITH HEADER LINE                     ,
       t_export_parameter   TYPE s_export_parameter    OCCURS 0
                            WITH HEADER LINE                     ,
       t_tables_parameter   TYPE s_tables_parameter    OCCURS 0
                            WITH HEADER LINE                     ,
       t_exception_list     TYPE s_exception_list      OCCURS 0
                            WITH HEADER LINE                     ,
       t_documentation      TYPE s_documentation       OCCURS 0
                            WITH HEADER LINE                     ,
       t_source             TYPE s_source              OCCURS 0
                            WITH HEADER LINE                     .

*----------------------------------------------------------------------*
* Constants
*----------------------------------------------------------------------*
CONSTANTS: c_dir(6)        TYPE c  VALUE 'C:FM'         ,
           c_bslash(1)     TYPE c  VALUE ''              ,
           c_file_attrib   TYPE string        " FM Attributes file
                            VALUE 'FM_ATTRIBUTES.XLS' ,
           c_file_ip       TYPE string        " Import parameters File
                            VALUE 'IMPORT_PARAMTER.XLS' ,
           c_file_cp       TYPE string        " Changing parameters File
                            VALUE 'CHANGING_PARAMTER.XLS' ,
           c_file_ep       TYPE string         " Export parameters File
                            VALUE 'EXPORT_PARAMTER.XLS'   ,
           c_file_tp       TYPE string         " Tables parameters File
                            VALUE 'TABLES_PARAMTER.XLS'   ,
           c_file_el       TYPE string         " Exception list File
                            VALUE 'EXCEPTION_LIST.XLS'    ,
           c_file_docu     TYPE string         " Documentation File
                            VALUE 'DOCUMENTATION.XLS'     ,
           c_file_source   TYPE string         " Code Source File
                            VALUE 'SOURCE.XLS'            .


*----------------------------------------------------------------------*
* Work-fields
*----------------------------------------------------------------------*
DATA: w_functionname  LIKE rs38l-name       ,      " FM Name
      w_file          TYPE string           ,      " File name
      w_global_flag   LIKE rs38l-global     ,
      w_remote_call   LIKE rs38l-remote     ,
      w_update_task   LIKE rs38l-utask      ,
      w_short_text    LIKE tftit-stext      ,
      w_function_pool LIKE rs38l-area       .

*----------------------------------------------------------------------*
* Selection-Screen
*----------------------------------------------------------------------*
SELECT-OPTIONS: s_fm FOR w_functionname OBLIGATORY NO INTERVALS.

*----------------------------------------------------------------------*
* At selection-screen
*----------------------------------------------------------------------*


*----------------------------------------------------------------------*
* Start-of-selection
*----------------------------------------------------------------------*
START-OF-SELECTION.
* Download Function Modules.
  PERFORM sub_download_fm_data.

*----------------------------------------------------------------------*
* End-of-selection
*----------------------------------------------------------------------*
END-OF-SELECTION.


*----------------------------------------------------------------------*
* Subroutines
*----------------------------------------------------------------------

*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  sub_download_fm_data
*&amp;amp;---------------------------------------------------------------------*
*       Download Function Module data
*----------------------------------------------------------------------*
FORM sub_download_fm_data .

  LOOP AT s_fm.

    REFRESH: t_fm_attributes       ,
             t_import_parameter    ,
             t_changing_parameter  ,
             t_export_parameter    ,
             t_tables_parameter    ,
             t_exception_list      ,
             t_documentation       ,
             t_source              .

    CLEAR: w_functionname   ,
           w_global_flag    ,
           w_remote_call    ,
           w_update_task    ,
           w_short_text     ,
           w_function_pool  .

    MOVE s_fm-low TO w_functionname.

*   Get Function Module data
    CALL FUNCTION 'RPY_FUNCTIONMODULE_READ'
      EXPORTING
        functionname       = w_functionname
      IMPORTING
        global_flag        = w_global_flag
        remote_call        = w_remote_call
        update_task        = w_update_task
        short_text         = w_short_text
        function_pool      = w_function_pool
      TABLES
        import_parameter   = t_import_parameter
        changing_parameter = t_changing_parameter
        export_parameter   = t_export_parameter
        tables_parameter   = t_tables_parameter
        exception_list     = t_exception_list
        documentation      = t_documentation
        SOURCE             = t_source
      EXCEPTIONS
        error_message      = 1
        function_not_found = 2
        invalid_name       = 3
        OTHERS             = 4.
    IF sy-subrc NE 0.
      WRITE: / 'Error in Function Module:' ,
               w_functionname              .
      CONTINUE.
    else.
      WRITE: / 'Downloaded Function Module:' ,
               w_functionname              .
    ENDIF.                  " IF sy-subrc NE 0.

*   Download Function Module attributes
    CLEAR t_fm_attributes.
    MOVE: w_global_flag    TO t_fm_attributes-global_flag    ,
          w_remote_call    TO t_fm_attributes-remote_call    ,
          w_update_task    TO t_fm_attributes-update_task    ,
          w_short_text     TO t_fm_attributes-short_text     ,
          w_function_pool  TO t_fm_attributes-function_pool  .
    APPEND t_fm_attributes.

*   Download FUNCTION MODULE Attributes
    CLEAR w_file.
    CONCATENATE c_dir
                w_functionname
                c_bslash
                c_file_attrib
           INTO w_file.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        filename                = w_file
        filetype                = 'ASC'
        append                  = ' '
        write_field_separator   = 'X'
      TABLES
        data_tab                = t_fm_attributes
      EXCEPTIONS
        file_write_error        = 1
        no_batch                = 2
        gui_refuse_filetransfer = 3
        invalid_type            = 4
        no_authority            = 5
        unknown_error           = 6
        header_not_allowed      = 7
        separator_not_allowed   = 8
        filesize_not_allowed    = 9
        header_too_long         = 10
        dp_error_create         = 11
        dp_error_send           = 12
        dp_error_write          = 13
        unknown_dp_error        = 14
        access_denied           = 15
        dp_out_of_memory        = 16
        disk_full               = 17
        dp_timeout              = 18
        file_not_found          = 19
        dataprovider_exception  = 20
        control_flush_error     = 21
        OTHERS                  = 22.
    IF sy-subrc &amp;lt;&amp;gt; 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.

*   Download IMPORT Parameters
    CLEAR w_file.
    CONCATENATE c_dir
                w_functionname
                c_bslash
                c_file_ip
           INTO w_file.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        filename                = w_file
        filetype                = 'ASC'
        append                  = ' '
        write_field_separator   = 'X'
      TABLES
        data_tab                = t_import_parameter
      EXCEPTIONS
        file_write_error        = 1
        no_batch                = 2
        gui_refuse_filetransfer = 3
        invalid_type            = 4
        no_authority            = 5
        unknown_error           = 6
        header_not_allowed      = 7
        separator_not_allowed   = 8
        filesize_not_allowed    = 9
        header_too_long         = 10
        dp_error_create         = 11
        dp_error_send           = 12
        dp_error_write          = 13
        unknown_dp_error        = 14
        access_denied           = 15
        dp_out_of_memory        = 16
        disk_full               = 17
        dp_timeout              = 18
        file_not_found          = 19
        dataprovider_exception  = 20
        control_flush_error     = 21
        OTHERS                  = 22.
    IF sy-subrc &amp;lt;&amp;gt; 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.

*   Download CHANGING Parameters
    CLEAR w_file.
    CONCATENATE c_dir
                w_functionname
                c_bslash
                c_file_cp
           INTO w_file.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        filename                = w_file
        filetype                = 'ASC'
        append                  = ' '
        write_field_separator   = 'X'
      TABLES
        data_tab                = t_changing_parameter
      EXCEPTIONS
        file_write_error        = 1
        no_batch                = 2
        gui_refuse_filetransfer = 3
        invalid_type            = 4
        no_authority            = 5
        unknown_error           = 6
        header_not_allowed      = 7
        separator_not_allowed   = 8
        filesize_not_allowed    = 9
        header_too_long         = 10
        dp_error_create         = 11
        dp_error_send           = 12
        dp_error_write          = 13
        unknown_dp_error        = 14
        access_denied           = 15
        dp_out_of_memory        = 16
        disk_full               = 17
        dp_timeout              = 18
        file_not_found          = 19
        dataprovider_exception  = 20
        control_flush_error     = 21
        OTHERS                  = 22.
    IF sy-subrc &amp;lt;&amp;gt; 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.

* Download EXPORT Parameters
    CLEAR w_file.
    CONCATENATE c_dir
                w_functionname
                c_bslash
                c_file_ep
           INTO w_file.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        filename                = w_file
        filetype                = 'ASC'
        append                  = ' '
        write_field_separator   = 'X'
      TABLES
        data_tab                = t_export_parameter
      EXCEPTIONS
        file_write_error        = 1
        no_batch                = 2
        gui_refuse_filetransfer = 3
        invalid_type            = 4
        no_authority            = 5
        unknown_error           = 6
        header_not_allowed      = 7
        separator_not_allowed   = 8
        filesize_not_allowed    = 9
        header_too_long         = 10
        dp_error_create         = 11
        dp_error_send           = 12
        dp_error_write          = 13
        unknown_dp_error        = 14
        access_denied           = 15
        dp_out_of_memory        = 16
        disk_full               = 17
        dp_timeout              = 18
        file_not_found          = 19
        dataprovider_exception  = 20
        control_flush_error     = 21
        OTHERS                  = 22.
    IF sy-subrc &amp;lt;&amp;gt; 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.

*   Download TABLES Parameters
    CLEAR w_file.
    CONCATENATE c_dir
                w_functionname
                c_bslash
                c_file_tp
           INTO w_file.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        filename                = w_file
        filetype                = 'ASC'
        append                  = ' '
        write_field_separator   = 'X'
      TABLES
        data_tab                = t_tables_parameter
      EXCEPTIONS
        file_write_error        = 1
        no_batch                = 2
        gui_refuse_filetransfer = 3
        invalid_type            = 4
        no_authority            = 5
        unknown_error           = 6
        header_not_allowed      = 7
        separator_not_allowed   = 8
        filesize_not_allowed    = 9
        header_too_long         = 10
        dp_error_create         = 11
        dp_error_send           = 12
        dp_error_write          = 13
        unknown_dp_error        = 14
        access_denied           = 15
        dp_out_of_memory        = 16
        disk_full               = 17
        dp_timeout              = 18
        file_not_found          = 19
        dataprovider_exception  = 20
        control_flush_error     = 21
        OTHERS                  = 22.
    IF sy-subrc &amp;lt;&amp;gt; 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.

*   Download EXCEPTIONS List
    CLEAR w_file.
    CONCATENATE c_dir
                w_functionname
                c_bslash
                c_file_el
           INTO w_file.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        filename                = w_file
        filetype                = 'ASC'
        append                  = ' '
        write_field_separator   = 'X'
      TABLES
        data_tab                = t_exception_list
      EXCEPTIONS
        file_write_error        = 1
        no_batch                = 2
        gui_refuse_filetransfer = 3
        invalid_type            = 4
        no_authority            = 5
        unknown_error           = 6
        header_not_allowed      = 7
        separator_not_allowed   = 8
        filesize_not_allowed    = 9
        header_too_long         = 10
        dp_error_create         = 11
        dp_error_send           = 12
        dp_error_write          = 13
        unknown_dp_error        = 14
        access_denied           = 15
        dp_out_of_memory        = 16
        disk_full               = 17
        dp_timeout              = 18
        file_not_found          = 19
        dataprovider_exception  = 20
        control_flush_error     = 21
        OTHERS                  = 22.
    IF sy-subrc &amp;lt;&amp;gt; 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.

*   Download DOCUMENTATION
    CLEAR w_file.
    CONCATENATE c_dir
                w_functionname
                c_bslash
                c_file_docu
           INTO w_file.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        filename                = w_file
        filetype                = 'ASC'
        append                  = ' '
        write_field_separator   = 'X'
      TABLES
        data_tab                = t_documentation
      EXCEPTIONS
        file_write_error        = 1
        no_batch                = 2
        gui_refuse_filetransfer = 3
        invalid_type            = 4
        no_authority            = 5
        unknown_error           = 6
        header_not_allowed      = 7
        separator_not_allowed   = 8
        filesize_not_allowed    = 9
        header_too_long         = 10
        dp_error_create         = 11
        dp_error_send           = 12
        dp_error_write          = 13
        unknown_dp_error        = 14
        access_denied           = 15
        dp_out_of_memory        = 16
        disk_full               = 17
        dp_timeout              = 18
        file_not_found          = 19
        dataprovider_exception  = 20
        control_flush_error     = 21
        OTHERS                  = 22.
    IF sy-subrc &amp;lt;&amp;gt; 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.

*   Download SOURCE Code
    CLEAR w_file.
    CONCATENATE c_dir
                w_functionname
                c_bslash
                c_file_source
           INTO w_file.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        filename                = w_file
        filetype                = 'ASC'
        append                  = ' '
        write_field_separator   = 'X'
      TABLES
        data_tab                = t_source
      EXCEPTIONS
        file_write_error        = 1
        no_batch                = 2
        gui_refuse_filetransfer = 3
        invalid_type            = 4
        no_authority            = 5
        unknown_error           = 6
        header_not_allowed      = 7
        separator_not_allowed   = 8
        filesize_not_allowed    = 9
        header_too_long         = 10
        dp_error_create         = 11
        dp_error_send           = 12
        dp_error_write          = 13
        unknown_dp_error        = 14
        access_denied           = 15
        dp_out_of_memory        = 16
        disk_full               = 17
        dp_timeout              = 18
        file_not_found          = 19
        dataprovider_exception  = 20
        control_flush_error     = 21
        OTHERS                  = 22.
    IF sy-subrc &amp;lt;&amp;gt; 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.

  ENDLOOP.                  " LOOP AT s_fm.

ENDFORM.                    " sub_download_fm_data
*&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 15 Feb 2007 05:51:55 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-02-15T05:51:55Z</dc:date>
    <item>
      <title>Upload a Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/upload-a-function-module/m-p/1947228#M390328</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 need to upload a Function module from SAP 4.6C to ECC 6.4 version. Can anyone help me on this ? A PROMPT reply will be highly appreciated as I need this urgently..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Feb 2007 05:40:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/upload-a-function-module/m-p/1947228#M390328</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-15T05:40:18Z</dc:date>
    </item>
    <item>
      <title>Re: Upload a Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/upload-a-function-module/m-p/1947229#M390329</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;in your fn source code menu utilities&lt;DEL&gt;-&amp;gt; more utilities&lt;/DEL&gt;&amp;gt; upload/download.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try that&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;shiba dutta&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Feb 2007 05:45:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/upload-a-function-module/m-p/1947229#M390329</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-15T05:45:38Z</dc:date>
    </item>
    <item>
      <title>Re: Upload a Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/upload-a-function-module/m-p/1947230#M390330</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Abhishek,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  You gotto do this manully i.e, copy the code in to a notepad and paste that at the required place i.,e ECC 6.4 FM along with passing importing and exporting parameters ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Santosh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Feb 2007 05:47:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/upload-a-function-module/m-p/1947230#M390330</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-15T05:47:19Z</dc:date>
    </item>
    <item>
      <title>Re: Upload a Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/upload-a-function-module/m-p/1947231#M390331</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;1)download into c drive of ur system.

*&amp;amp;---------------------------------------------------------------------*
*&amp;amp; Report  Z_DOWNLOAD_FM_DATA                                          *
*&amp;amp;                                                                     *
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;                                                                     *
*&amp;amp;                                                                     *
*&amp;amp;---------------------------------------------------------------------*

REPORT  z_download_fm_data                      .

*----------------------------------------------------------------------*
* Tables
*----------------------------------------------------------------------*

*----------------------------------------------------------------------*
* TYPES - Structures
*----------------------------------------------------------------------*
* Structure for Function Module Attributes
TYPES: BEGIN OF s_fm_attributes         ,
        global_flag   LIKE rs38l-global ,
        remote_call   LIKE rs38l-remote ,
        update_task   LIKE rs38l-utask  ,
        short_text    LIKE tftit-stext  ,
        function_pool LIKE rs38l-area   ,
       END   OF s_fm_attributes         .

* Structure for Import Paramters
TYPES: BEGIN OF s_import_parameter .
        INCLUDE STRUCTURE rsimp    .
TYPES: END   OF s_import_parameter .

* Structure for Changing Paramters
TYPES: BEGIN OF s_changing_parameter .
        INCLUDE STRUCTURE rscha      .
TYPES: END   OF s_changing_parameter .

* Structure for Export Paramters
TYPES: BEGIN OF s_export_parameter  .
        INCLUDE STRUCTURE rsexp     .
TYPES: END   OF s_export_parameter  .

* Structure for Table Paramters
TYPES: BEGIN OF s_tables_parameter .
        INCLUDE STRUCTURE rstbl    .
TYPES: END   OF s_tables_parameter .

* Structure for Exception list
TYPES: BEGIN OF s_exception_list  .
        INCLUDE STRUCTURE rsexc.
TYPES: END   OF s_exception_list .

* Structure for Documentation
TYPES: BEGIN OF s_documentation  .
        INCLUDE STRUCTURE rsfdo.
TYPES: END   OF s_documentation .

* Structure for Exception list
TYPES: BEGIN OF s_source           .
        INCLUDE STRUCTURE rssource .
TYPES: END   OF s_source           .


*----------------------------------------------------------------------*
* Internal Tables
*----------------------------------------------------------------------*
DATA:  t_fm_attributes      TYPE s_fm_attributes       OCCURS 0
                            WITH HEADER LINE                     ,
       t_import_parameter   TYPE s_import_parameter    OCCURS 0
                            WITH HEADER LINE                     ,
       t_changing_parameter TYPE s_changing_parameter  OCCURS 0
                            WITH HEADER LINE                     ,
       t_export_parameter   TYPE s_export_parameter    OCCURS 0
                            WITH HEADER LINE                     ,
       t_tables_parameter   TYPE s_tables_parameter    OCCURS 0
                            WITH HEADER LINE                     ,
       t_exception_list     TYPE s_exception_list      OCCURS 0
                            WITH HEADER LINE                     ,
       t_documentation      TYPE s_documentation       OCCURS 0
                            WITH HEADER LINE                     ,
       t_source             TYPE s_source              OCCURS 0
                            WITH HEADER LINE                     .

*----------------------------------------------------------------------*
* Constants
*----------------------------------------------------------------------*
CONSTANTS: c_dir(6)        TYPE c  VALUE 'C:FM'         ,
           c_bslash(1)     TYPE c  VALUE ''              ,
           c_file_attrib   TYPE string        " FM Attributes file
                            VALUE 'FM_ATTRIBUTES.XLS' ,
           c_file_ip       TYPE string        " Import parameters File
                            VALUE 'IMPORT_PARAMTER.XLS' ,
           c_file_cp       TYPE string        " Changing parameters File
                            VALUE 'CHANGING_PARAMTER.XLS' ,
           c_file_ep       TYPE string         " Export parameters File
                            VALUE 'EXPORT_PARAMTER.XLS'   ,
           c_file_tp       TYPE string         " Tables parameters File
                            VALUE 'TABLES_PARAMTER.XLS'   ,
           c_file_el       TYPE string         " Exception list File
                            VALUE 'EXCEPTION_LIST.XLS'    ,
           c_file_docu     TYPE string         " Documentation File
                            VALUE 'DOCUMENTATION.XLS'     ,
           c_file_source   TYPE string         " Code Source File
                            VALUE 'SOURCE.XLS'            .


*----------------------------------------------------------------------*
* Work-fields
*----------------------------------------------------------------------*
DATA: w_functionname  LIKE rs38l-name       ,      " FM Name
      w_file          TYPE string           ,      " File name
      w_global_flag   LIKE rs38l-global     ,
      w_remote_call   LIKE rs38l-remote     ,
      w_update_task   LIKE rs38l-utask      ,
      w_short_text    LIKE tftit-stext      ,
      w_function_pool LIKE rs38l-area       .

*----------------------------------------------------------------------*
* Selection-Screen
*----------------------------------------------------------------------*
SELECT-OPTIONS: s_fm FOR w_functionname OBLIGATORY NO INTERVALS.

*----------------------------------------------------------------------*
* At selection-screen
*----------------------------------------------------------------------*


*----------------------------------------------------------------------*
* Start-of-selection
*----------------------------------------------------------------------*
START-OF-SELECTION.
* Download Function Modules.
  PERFORM sub_download_fm_data.

*----------------------------------------------------------------------*
* End-of-selection
*----------------------------------------------------------------------*
END-OF-SELECTION.


*----------------------------------------------------------------------*
* Subroutines
*----------------------------------------------------------------------

*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  sub_download_fm_data
*&amp;amp;---------------------------------------------------------------------*
*       Download Function Module data
*----------------------------------------------------------------------*
FORM sub_download_fm_data .

  LOOP AT s_fm.

    REFRESH: t_fm_attributes       ,
             t_import_parameter    ,
             t_changing_parameter  ,
             t_export_parameter    ,
             t_tables_parameter    ,
             t_exception_list      ,
             t_documentation       ,
             t_source              .

    CLEAR: w_functionname   ,
           w_global_flag    ,
           w_remote_call    ,
           w_update_task    ,
           w_short_text     ,
           w_function_pool  .

    MOVE s_fm-low TO w_functionname.

*   Get Function Module data
    CALL FUNCTION 'RPY_FUNCTIONMODULE_READ'
      EXPORTING
        functionname       = w_functionname
      IMPORTING
        global_flag        = w_global_flag
        remote_call        = w_remote_call
        update_task        = w_update_task
        short_text         = w_short_text
        function_pool      = w_function_pool
      TABLES
        import_parameter   = t_import_parameter
        changing_parameter = t_changing_parameter
        export_parameter   = t_export_parameter
        tables_parameter   = t_tables_parameter
        exception_list     = t_exception_list
        documentation      = t_documentation
        SOURCE             = t_source
      EXCEPTIONS
        error_message      = 1
        function_not_found = 2
        invalid_name       = 3
        OTHERS             = 4.
    IF sy-subrc NE 0.
      WRITE: / 'Error in Function Module:' ,
               w_functionname              .
      CONTINUE.
    else.
      WRITE: / 'Downloaded Function Module:' ,
               w_functionname              .
    ENDIF.                  " IF sy-subrc NE 0.

*   Download Function Module attributes
    CLEAR t_fm_attributes.
    MOVE: w_global_flag    TO t_fm_attributes-global_flag    ,
          w_remote_call    TO t_fm_attributes-remote_call    ,
          w_update_task    TO t_fm_attributes-update_task    ,
          w_short_text     TO t_fm_attributes-short_text     ,
          w_function_pool  TO t_fm_attributes-function_pool  .
    APPEND t_fm_attributes.

*   Download FUNCTION MODULE Attributes
    CLEAR w_file.
    CONCATENATE c_dir
                w_functionname
                c_bslash
                c_file_attrib
           INTO w_file.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        filename                = w_file
        filetype                = 'ASC'
        append                  = ' '
        write_field_separator   = 'X'
      TABLES
        data_tab                = t_fm_attributes
      EXCEPTIONS
        file_write_error        = 1
        no_batch                = 2
        gui_refuse_filetransfer = 3
        invalid_type            = 4
        no_authority            = 5
        unknown_error           = 6
        header_not_allowed      = 7
        separator_not_allowed   = 8
        filesize_not_allowed    = 9
        header_too_long         = 10
        dp_error_create         = 11
        dp_error_send           = 12
        dp_error_write          = 13
        unknown_dp_error        = 14
        access_denied           = 15
        dp_out_of_memory        = 16
        disk_full               = 17
        dp_timeout              = 18
        file_not_found          = 19
        dataprovider_exception  = 20
        control_flush_error     = 21
        OTHERS                  = 22.
    IF sy-subrc &amp;lt;&amp;gt; 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.

*   Download IMPORT Parameters
    CLEAR w_file.
    CONCATENATE c_dir
                w_functionname
                c_bslash
                c_file_ip
           INTO w_file.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        filename                = w_file
        filetype                = 'ASC'
        append                  = ' '
        write_field_separator   = 'X'
      TABLES
        data_tab                = t_import_parameter
      EXCEPTIONS
        file_write_error        = 1
        no_batch                = 2
        gui_refuse_filetransfer = 3
        invalid_type            = 4
        no_authority            = 5
        unknown_error           = 6
        header_not_allowed      = 7
        separator_not_allowed   = 8
        filesize_not_allowed    = 9
        header_too_long         = 10
        dp_error_create         = 11
        dp_error_send           = 12
        dp_error_write          = 13
        unknown_dp_error        = 14
        access_denied           = 15
        dp_out_of_memory        = 16
        disk_full               = 17
        dp_timeout              = 18
        file_not_found          = 19
        dataprovider_exception  = 20
        control_flush_error     = 21
        OTHERS                  = 22.
    IF sy-subrc &amp;lt;&amp;gt; 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.

*   Download CHANGING Parameters
    CLEAR w_file.
    CONCATENATE c_dir
                w_functionname
                c_bslash
                c_file_cp
           INTO w_file.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        filename                = w_file
        filetype                = 'ASC'
        append                  = ' '
        write_field_separator   = 'X'
      TABLES
        data_tab                = t_changing_parameter
      EXCEPTIONS
        file_write_error        = 1
        no_batch                = 2
        gui_refuse_filetransfer = 3
        invalid_type            = 4
        no_authority            = 5
        unknown_error           = 6
        header_not_allowed      = 7
        separator_not_allowed   = 8
        filesize_not_allowed    = 9
        header_too_long         = 10
        dp_error_create         = 11
        dp_error_send           = 12
        dp_error_write          = 13
        unknown_dp_error        = 14
        access_denied           = 15
        dp_out_of_memory        = 16
        disk_full               = 17
        dp_timeout              = 18
        file_not_found          = 19
        dataprovider_exception  = 20
        control_flush_error     = 21
        OTHERS                  = 22.
    IF sy-subrc &amp;lt;&amp;gt; 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.

* Download EXPORT Parameters
    CLEAR w_file.
    CONCATENATE c_dir
                w_functionname
                c_bslash
                c_file_ep
           INTO w_file.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        filename                = w_file
        filetype                = 'ASC'
        append                  = ' '
        write_field_separator   = 'X'
      TABLES
        data_tab                = t_export_parameter
      EXCEPTIONS
        file_write_error        = 1
        no_batch                = 2
        gui_refuse_filetransfer = 3
        invalid_type            = 4
        no_authority            = 5
        unknown_error           = 6
        header_not_allowed      = 7
        separator_not_allowed   = 8
        filesize_not_allowed    = 9
        header_too_long         = 10
        dp_error_create         = 11
        dp_error_send           = 12
        dp_error_write          = 13
        unknown_dp_error        = 14
        access_denied           = 15
        dp_out_of_memory        = 16
        disk_full               = 17
        dp_timeout              = 18
        file_not_found          = 19
        dataprovider_exception  = 20
        control_flush_error     = 21
        OTHERS                  = 22.
    IF sy-subrc &amp;lt;&amp;gt; 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.

*   Download TABLES Parameters
    CLEAR w_file.
    CONCATENATE c_dir
                w_functionname
                c_bslash
                c_file_tp
           INTO w_file.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        filename                = w_file
        filetype                = 'ASC'
        append                  = ' '
        write_field_separator   = 'X'
      TABLES
        data_tab                = t_tables_parameter
      EXCEPTIONS
        file_write_error        = 1
        no_batch                = 2
        gui_refuse_filetransfer = 3
        invalid_type            = 4
        no_authority            = 5
        unknown_error           = 6
        header_not_allowed      = 7
        separator_not_allowed   = 8
        filesize_not_allowed    = 9
        header_too_long         = 10
        dp_error_create         = 11
        dp_error_send           = 12
        dp_error_write          = 13
        unknown_dp_error        = 14
        access_denied           = 15
        dp_out_of_memory        = 16
        disk_full               = 17
        dp_timeout              = 18
        file_not_found          = 19
        dataprovider_exception  = 20
        control_flush_error     = 21
        OTHERS                  = 22.
    IF sy-subrc &amp;lt;&amp;gt; 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.

*   Download EXCEPTIONS List
    CLEAR w_file.
    CONCATENATE c_dir
                w_functionname
                c_bslash
                c_file_el
           INTO w_file.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        filename                = w_file
        filetype                = 'ASC'
        append                  = ' '
        write_field_separator   = 'X'
      TABLES
        data_tab                = t_exception_list
      EXCEPTIONS
        file_write_error        = 1
        no_batch                = 2
        gui_refuse_filetransfer = 3
        invalid_type            = 4
        no_authority            = 5
        unknown_error           = 6
        header_not_allowed      = 7
        separator_not_allowed   = 8
        filesize_not_allowed    = 9
        header_too_long         = 10
        dp_error_create         = 11
        dp_error_send           = 12
        dp_error_write          = 13
        unknown_dp_error        = 14
        access_denied           = 15
        dp_out_of_memory        = 16
        disk_full               = 17
        dp_timeout              = 18
        file_not_found          = 19
        dataprovider_exception  = 20
        control_flush_error     = 21
        OTHERS                  = 22.
    IF sy-subrc &amp;lt;&amp;gt; 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.

*   Download DOCUMENTATION
    CLEAR w_file.
    CONCATENATE c_dir
                w_functionname
                c_bslash
                c_file_docu
           INTO w_file.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        filename                = w_file
        filetype                = 'ASC'
        append                  = ' '
        write_field_separator   = 'X'
      TABLES
        data_tab                = t_documentation
      EXCEPTIONS
        file_write_error        = 1
        no_batch                = 2
        gui_refuse_filetransfer = 3
        invalid_type            = 4
        no_authority            = 5
        unknown_error           = 6
        header_not_allowed      = 7
        separator_not_allowed   = 8
        filesize_not_allowed    = 9
        header_too_long         = 10
        dp_error_create         = 11
        dp_error_send           = 12
        dp_error_write          = 13
        unknown_dp_error        = 14
        access_denied           = 15
        dp_out_of_memory        = 16
        disk_full               = 17
        dp_timeout              = 18
        file_not_found          = 19
        dataprovider_exception  = 20
        control_flush_error     = 21
        OTHERS                  = 22.
    IF sy-subrc &amp;lt;&amp;gt; 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.

*   Download SOURCE Code
    CLEAR w_file.
    CONCATENATE c_dir
                w_functionname
                c_bslash
                c_file_source
           INTO w_file.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        filename                = w_file
        filetype                = 'ASC'
        append                  = ' '
        write_field_separator   = 'X'
      TABLES
        data_tab                = t_source
      EXCEPTIONS
        file_write_error        = 1
        no_batch                = 2
        gui_refuse_filetransfer = 3
        invalid_type            = 4
        no_authority            = 5
        unknown_error           = 6
        header_not_allowed      = 7
        separator_not_allowed   = 8
        filesize_not_allowed    = 9
        header_too_long         = 10
        dp_error_create         = 11
        dp_error_send           = 12
        dp_error_write          = 13
        unknown_dp_error        = 14
        access_denied           = 15
        dp_out_of_memory        = 16
        disk_full               = 17
        dp_timeout              = 18
        file_not_found          = 19
        dataprovider_exception  = 20
        control_flush_error     = 21
        OTHERS                  = 22.
    IF sy-subrc &amp;lt;&amp;gt; 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.

  ENDLOOP.                  " LOOP AT s_fm.

ENDFORM.                    " sub_download_fm_data
*&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Feb 2007 05:51:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/upload-a-function-module/m-p/1947231#M390331</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-15T05:51:55Z</dc:date>
    </item>
    <item>
      <title>Re: Upload a Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/upload-a-function-module/m-p/1947232#M390332</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;2)now uplaos from c driv to diffrent server.

*&amp;amp;---------------------------------------------------------------------*
*&amp;amp; Report  Z_CREATE_FM                                                 *
*&amp;amp;                                                                     *
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;                                                                     *
*&amp;amp;                                                                     *
*&amp;amp;---------------------------------------------------------------------*

REPORT  z_create_fm                             .

*----------------------------------------------------------------------*
* Tables
*----------------------------------------------------------------------*

*----------------------------------------------------------------------*
* TYPES - Structures
*----------------------------------------------------------------------*
* Structure for Function Module Attributes
TYPES: BEGIN OF s_fm_attributes         ,
        global_flag   LIKE rs38l-global ,
        remote_call   LIKE rs38l-remote ,
        update_task   LIKE rs38l-utask  ,
        short_text    LIKE tftit-stext  ,
        function_pool LIKE rs38l-area   ,
       END   OF s_fm_attributes         .

* Structure for Import Paramters
TYPES: BEGIN OF s_import_parameter .
        INCLUDE STRUCTURE rsimp    .
TYPES: END   OF s_import_parameter .

* Structure for Changing Paramters
TYPES: BEGIN OF s_changing_parameter .
        INCLUDE STRUCTURE rscha      .
TYPES: END   OF s_changing_parameter .

* Structure for Export Paramters
TYPES: BEGIN OF s_export_parameter  .
        INCLUDE STRUCTURE rsexp     .
TYPES: END   OF s_export_parameter  .

* Structure for Table Paramters
TYPES: BEGIN OF s_tables_parameter .
        INCLUDE STRUCTURE rstbl    .
TYPES: END   OF s_tables_parameter .

* Structure for Exception list
TYPES: BEGIN OF s_exception_list  .
        INCLUDE STRUCTURE rsexc.
TYPES: END   OF s_exception_list .

* Structure for Documentation
TYPES: BEGIN OF s_documentation  .
        INCLUDE STRUCTURE rsfdo.
TYPES: END   OF s_documentation .

* Structure for Exception list
TYPES: BEGIN OF s_source           .
        INCLUDE STRUCTURE rssource .
TYPES: END   OF s_source           .


*----------------------------------------------------------------------*
* Internal Tables
*----------------------------------------------------------------------*
DATA:  t_fm_attributes      TYPE s_fm_attributes       OCCURS 0
                            WITH HEADER LINE                     ,
       t_import_parameter   TYPE s_import_parameter    OCCURS 0
                            WITH HEADER LINE                     ,
       t_changing_parameter TYPE s_changing_parameter  OCCURS 0
                            WITH HEADER LINE                     ,
       t_export_parameter   TYPE s_export_parameter    OCCURS 0
                            WITH HEADER LINE                     ,
       t_tables_parameter   TYPE s_tables_parameter    OCCURS 0
                            WITH HEADER LINE                     ,
       t_exception_list     TYPE s_exception_list      OCCURS 0
                            WITH HEADER LINE                     ,
       t_documentation      TYPE s_documentation       OCCURS 0
                            WITH HEADER LINE                     ,
       t_source             TYPE s_source              OCCURS 0
                            WITH HEADER LINE                     .

*----------------------------------------------------------------------*
* Constants
*----------------------------------------------------------------------*
CONSTANTS: c_dir(6)        TYPE c  VALUE 'C:FM'         ,
           c_bslash(1)     TYPE c  VALUE ''              ,
           c_file_attrib   TYPE string        " FM Attributes file
                            VALUE 'FM_ATTRIBUTES.XLS' ,
           c_file_ip       TYPE string        " Import parameters File
                            VALUE 'IMPORT_PARAMTER.XLS' ,
           c_file_cp       TYPE string        " Changing parameters File
                            VALUE 'CHANGING_PARAMTER.XLS' ,
           c_file_ep       TYPE string         " Export parameters File
                            VALUE 'EXPORT_PARAMTER.XLS'   ,
           c_file_tp       TYPE string         " Tables parameters File
                            VALUE 'TABLES_PARAMTER.XLS'   ,
           c_file_el       TYPE string         " Exception list File
                            VALUE 'EXCEPTION_LIST.XLS'    ,
           c_file_docu     TYPE string         " Documentation File
                            VALUE 'DOCUMENTATION.XLS'     ,
           c_file_source   TYPE string         " Code Source File
                            VALUE 'SOURCE.XLS'            .


*----------------------------------------------------------------------*
* Work-fields
*----------------------------------------------------------------------*
DATA: w_functionname      LIKE rs38l-name       , " FM Name
      w_file              TYPE string           , " File name
      w_global_flag       LIKE rs38l-global     , " Global flag for FM
      w_remote_call       LIKE rs38l-remote     , " RFC flag
      w_update_task       LIKE rs38l-utask      , " Update task flag
      w_short_text        LIKE tftit-stext      , " Short text
      w_function_pool     LIKE rs38l-area       , " Function Group
      w_function_include  LIKE rs38l-include    , " FM Include file
      w_corrnum_e         LIKE e071-trkorr      .

*----------------------------------------------------------------------*
* Selection-Screen
*----------------------------------------------------------------------*
SELECT-OPTIONS: s_fm FOR w_functionname OBLIGATORY NO INTERVALS.

*----------------------------------------------------------------------*
* At selection-screen
*----------------------------------------------------------------------*


*----------------------------------------------------------------------*
* Start-of-selection
*----------------------------------------------------------------------*
START-OF-SELECTION.
* Upload Function Modules.
  PERFORM sub_upload_fm_data.

*----------------------------------------------------------------------*
* End-of-selection
*----------------------------------------------------------------------*
END-OF-SELECTION.


*----------------------------------------------------------------------*
* Subroutines
*----------------------------------------------------------------------

*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  sub_upload_fm_data
*&amp;amp;---------------------------------------------------------------------*
*       Create Function Module by uploading their data from local file
*----------------------------------------------------------------------*
FORM sub_upload_fm_data .

  LOOP AT s_fm.

    REFRESH: t_fm_attributes       ,
             t_import_parameter    ,
             t_changing_parameter  ,
             t_export_parameter    ,
             t_tables_parameter    ,
             t_exception_list      ,
             t_documentation       ,
             t_source              .

    CLEAR: w_functionname   ,
           w_global_flag    ,
           w_remote_call    ,
           w_update_task    ,
           w_short_text     ,
           w_function_pool  .

    MOVE s_fm-low TO w_functionname.

*   Upload FUNCTION MODULE Attributes
    CLEAR w_file.
    CONCATENATE c_dir
                w_functionname
                c_bslash
                c_file_attrib
           INTO w_file.
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        filename                      = w_file
        filetype                      = 'ASC'
        has_field_separator           = 'X'
*       HEADER_LENGTH                 = 0
*       READ_BY_LINE                  = 'X'
*       DAT_MODE                      = ' '
*       CODEPAGE                      = ' '
*       IGNORE_CERR                   = ABAP_TRUE
*       REPLACEMENT                   = '#'
*       CHECK_BOM                     = ' '
*     IMPORTING
*       FILELENGTH                    =
*       HEADER                        =
      TABLES
        data_tab                      = t_fm_attributes
      EXCEPTIONS
        file_open_error               = 1
        file_read_error               = 2
        no_batch                      = 3
        gui_refuse_filetransfer       = 4
        invalid_type                  = 5
        no_authority                  = 6
        unknown_error                 = 7
        bad_data_format               = 8
        header_not_allowed            = 9
        separator_not_allowed         = 10
        header_too_long               = 11
        unknown_dp_error              = 12
        access_denied                 = 13
        dp_out_of_memory              = 14
        disk_full                     = 15
        dp_timeout                    = 16
        OTHERS                        = 17 .
    IF sy-subrc NE 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.

    READ TABLE t_fm_attributes INDEX 1.
    MOVE: t_fm_attributes-global_flag    TO w_global_flag    ,
          t_fm_attributes-remote_call    TO w_remote_call    ,
          t_fm_attributes-update_task    TO w_update_task    ,
          t_fm_attributes-short_text     TO w_short_text     ,
          t_fm_attributes-function_pool  TO w_function_pool  .

*   Upload IMPORT Parameters
    CLEAR w_file.
    CONCATENATE c_dir
                w_functionname
                c_bslash
                c_file_ip
           INTO w_file.
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        filename                      = w_file
        filetype                      = 'ASC'
        has_field_separator           = 'X'
*       HEADER_LENGTH                 = 0
*       READ_BY_LINE                  = 'X'
*       DAT_MODE                      = ' '
*       CODEPAGE                      = ' '
*       IGNORE_CERR                   = ABAP_TRUE
*       REPLACEMENT                   = '#'
*       CHECK_BOM                     = ' '
*     IMPORTING
*       FILELENGTH                    =
*       HEADER                        =
      TABLES
        data_tab                      = t_import_parameter
      EXCEPTIONS
        file_open_error               = 1
        file_read_error               = 2
        no_batch                      = 3
        gui_refuse_filetransfer       = 4
        invalid_type                  = 5
        no_authority                  = 6
        unknown_error                 = 7
        bad_data_format               = 8
        header_not_allowed            = 9
        separator_not_allowed         = 10
        header_too_long               = 11
        unknown_dp_error              = 12
        access_denied                 = 13
        dp_out_of_memory              = 14
        disk_full                     = 15
        dp_timeout                    = 16
        OTHERS                        = 17 .
    IF sy-subrc NE 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.

*   Upload CHANGING Parameters
    CLEAR w_file.
    CONCATENATE c_dir
                w_functionname
                c_bslash
                c_file_cp
           INTO w_file.
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        filename                      = w_file
        filetype                      = 'ASC'
        has_field_separator           = 'X'
*       HEADER_LENGTH                 = 0
*       READ_BY_LINE                  = 'X'
*       DAT_MODE                      = ' '
*       CODEPAGE                      = ' '
*       IGNORE_CERR                   = ABAP_TRUE
*       REPLACEMENT                   = '#'
*       CHECK_BOM                     = ' '
*     IMPORTING
*       FILELENGTH                    =
*       HEADER                        =
      TABLES
        data_tab                      = t_changing_parameter
      EXCEPTIONS
        file_open_error               = 1
        file_read_error               = 2
        no_batch                      = 3
        gui_refuse_filetransfer       = 4
        invalid_type                  = 5
        no_authority                  = 6
        unknown_error                 = 7
        bad_data_format               = 8
        header_not_allowed            = 9
        separator_not_allowed         = 10
        header_too_long               = 11
        unknown_dp_error              = 12
        access_denied                 = 13
        dp_out_of_memory              = 14
        disk_full                     = 15
        dp_timeout                    = 16
        OTHERS                        = 17 .
    IF sy-subrc NE 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.

*   Upload EXPORT Parameters
    CLEAR w_file.
    CONCATENATE c_dir
                w_functionname
                c_bslash
                c_file_ep
           INTO w_file.
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        filename                      = w_file
        filetype                      = 'ASC'
        has_field_separator           = 'X'
*       HEADER_LENGTH                 = 0
*       READ_BY_LINE                  = 'X'
*       DAT_MODE                      = ' '
*       CODEPAGE                      = ' '
*       IGNORE_CERR                   = ABAP_TRUE
*       REPLACEMENT                   = '#'
*       CHECK_BOM                     = ' '
*     IMPORTING
*       FILELENGTH                    =
*       HEADER                        =
      TABLES
        data_tab                      = t_export_parameter
      EXCEPTIONS
        file_open_error               = 1
        file_read_error               = 2
        no_batch                      = 3
        gui_refuse_filetransfer       = 4
        invalid_type                  = 5
        no_authority                  = 6
        unknown_error                 = 7
        bad_data_format               = 8
        header_not_allowed            = 9
        separator_not_allowed         = 10
        header_too_long               = 11
        unknown_dp_error              = 12
        access_denied                 = 13
        dp_out_of_memory              = 14
        disk_full                     = 15
        dp_timeout                    = 16
        OTHERS                        = 17 .
    IF sy-subrc NE 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.

*   Upload TABLES Parameters
    CLEAR w_file.
    CONCATENATE c_dir
                w_functionname
                c_bslash
                c_file_tp
           INTO w_file.
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        filename                      = w_file
        filetype                      = 'ASC'
        has_field_separator           = 'X'
*       HEADER_LENGTH                 = 0
*       READ_BY_LINE                  = 'X'
*       DAT_MODE                      = ' '
*       CODEPAGE                      = ' '
*       IGNORE_CERR                   = ABAP_TRUE
*       REPLACEMENT                   = '#'
*       CHECK_BOM                     = ' '
*     IMPORTING
*       FILELENGTH                    =
*       HEADER                        =
      TABLES
        data_tab                      = t_tables_parameter
      EXCEPTIONS
        file_open_error               = 1
        file_read_error               = 2
        no_batch                      = 3
        gui_refuse_filetransfer       = 4
        invalid_type                  = 5
        no_authority                  = 6
        unknown_error                 = 7
        bad_data_format               = 8
        header_not_allowed            = 9
        separator_not_allowed         = 10
        header_too_long               = 11
        unknown_dp_error              = 12
        access_denied                 = 13
        dp_out_of_memory              = 14
        disk_full                     = 15
        dp_timeout                    = 16
        OTHERS                        = 17 .
    IF sy-subrc NE 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.

*   Upload EXCEPTIONS List
    CLEAR w_file.
    CONCATENATE c_dir
                w_functionname
                c_bslash
                c_file_el
           INTO w_file.
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        filename                      = w_file
        filetype                      = 'ASC'
        has_field_separator           = 'X'
*       HEADER_LENGTH                 = 0
*       READ_BY_LINE                  = 'X'
*       DAT_MODE                      = ' '
*       CODEPAGE                      = ' '
*       IGNORE_CERR                   = ABAP_TRUE
*       REPLACEMENT                   = '#'
*       CHECK_BOM                     = ' '
*     IMPORTING
*       FILELENGTH                    =
*       HEADER                        =
      TABLES
        data_tab                      = t_exception_list
      EXCEPTIONS
        file_open_error               = 1
        file_read_error               = 2
        no_batch                      = 3
        gui_refuse_filetransfer       = 4
        invalid_type                  = 5
        no_authority                  = 6
        unknown_error                 = 7
        bad_data_format               = 8
        header_not_allowed            = 9
        separator_not_allowed         = 10
        header_too_long               = 11
        unknown_dp_error              = 12
        access_denied                 = 13
        dp_out_of_memory              = 14
        disk_full                     = 15
        dp_timeout                    = 16
        OTHERS                        = 17 .
    IF sy-subrc NE 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.

*   Upload DOCUMENTATION
    CLEAR w_file.
    CONCATENATE c_dir
                w_functionname
                c_bslash
                c_file_docu
           INTO w_file.
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        filename                      = w_file
        filetype                      = 'ASC'
        has_field_separator           = 'X'
*       HEADER_LENGTH                 = 0
*       READ_BY_LINE                  = 'X'
*       DAT_MODE                      = ' '
*       CODEPAGE                      = ' '
*       IGNORE_CERR                   = ABAP_TRUE
*       REPLACEMENT                   = '#'
*       CHECK_BOM                     = ' '
*     IMPORTING
*       FILELENGTH                    =
*       HEADER                        =
      TABLES
        data_tab                      = t_documentation
      EXCEPTIONS
        file_open_error               = 1
        file_read_error               = 2
        no_batch                      = 3
        gui_refuse_filetransfer       = 4
        invalid_type                  = 5
        no_authority                  = 6
        unknown_error                 = 7
        bad_data_format               = 8
        header_not_allowed            = 9
        separator_not_allowed         = 10
        header_too_long               = 11
        unknown_dp_error              = 12
        access_denied                 = 13
        dp_out_of_memory              = 14
        disk_full                     = 15
        dp_timeout                    = 16
        OTHERS                        = 17 .
    IF sy-subrc NE 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.

*   Upload SOURCE Code
    CLEAR w_file.
    CONCATENATE c_dir
                w_functionname
                c_bslash
                c_file_source
           INTO w_file.
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        filename                      = w_file
        filetype                      = 'ASC'
        has_field_separator           = 'X'
*       HEADER_LENGTH                 = 0
*       READ_BY_LINE                  = 'X'
*       DAT_MODE                      = ' '
*       CODEPAGE                      = ' '
*       IGNORE_CERR                   = ABAP_TRUE
*       REPLACEMENT                   = '#'
*       CHECK_BOM                     = ' '
*     IMPORTING
*       FILELENGTH                    =
*       HEADER                        =
      TABLES
        data_tab                      = t_source
      EXCEPTIONS
        file_open_error               = 1
        file_read_error               = 2
        no_batch                      = 3
        gui_refuse_filetransfer       = 4
        invalid_type                  = 5
        no_authority                  = 6
        unknown_error                 = 7
        bad_data_format               = 8
        header_not_allowed            = 9
        separator_not_allowed         = 10
        header_too_long               = 11
        unknown_dp_error              = 12
        access_denied                 = 13
        dp_out_of_memory              = 14
        disk_full                     = 15
        dp_timeout                    = 16
        OTHERS                        = 17 .
    IF sy-subrc NE 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.

*   Create Function Module
    CALL FUNCTION 'RS_FUNCTIONMODULE_INSERT'
      EXPORTING
        funcname                      = w_functionname
        function_pool                 = w_function_pool
        interface_global              = w_global_flag
        remote_call                   = w_remote_call
        short_text                    = w_short_text
*       SUPPRESS_CORR_CHECK           = 'X'
        update_task                   = w_update_task
*       CORRNUM                       = ' '
*       NAMESPACE                     = ' '
*       SUPPRESS_LANGUAGE_CHECK       = 'X'
*       AUTHORITY_CHECK               = 'X'
*       SAVE_ACTIVE                   = 'X'
*       NEW_SOURCE                    =
*       EXCEPTION_CLASS               = ' '
*       SUPPRESS_UPGRADE_CHECK        = ' '
      IMPORTING
        function_include              = w_function_include
        corrnum_e                     = w_corrnum_e
      TABLES
        import_parameter              = t_import_parameter
        export_parameter              = t_export_parameter
        tables_parameter              = t_tables_parameter
        changing_parameter            = t_changing_parameter
        exception_list                = t_exception_list
        parameter_docu                = t_documentation
        SOURCE                        = t_source
      EXCEPTIONS
        double_task                   = 1
        error_message                 = 2
        function_already_exists       = 3
        invalid_function_pool         = 4
        invalid_name                  = 5
        too_many_functions            = 6
        no_modify_permission          = 7
        no_show_permission            = 8
        enqueue_system_failure        = 9
        canceled_in_corr              = 10
        OTHERS                        = 11 .
    IF sy-subrc NE 0.
      WRITE: / 'Error occured while creating FM: '  ,
               w_functionname .
    ELSE.
      WRITE: / 'FM Created: '  ,
               w_functionname  .
*      CALL FUNCTION 'RS_FUNCTION_ACTIVATE'
*        EXPORTING
**         ACTION                       = ' '
**         CORR_INSERT                  = ' '
*          funcname                     = w_functionname
**         WITH_POPUP                   = 'X'
**         SUPPRESS_WORKING_AREA        = ' '
**         OBJECT_SAVED                 =
*        EXCEPTIONS
*          CANCELLED                    = 1
*          CANCELED_IN_CORR             = 2
*          EDITOR_NAVIGATION_FLAG       = 3
*          MESSAGE_SEND                 = 4
*          NOT_FOUND                    = 5
*          NO_ACTION                    = 6
*          PERMISSION_FAILURE           = 7
*          OTHERS                       = 8 .
*      IF sy-subrc NE 0.
*        WRITE: / 'Error occured while activating FM: '  ,
*                 w_functionname .
*      ELSE.
*        WRITE: / 'Activated FM: '  ,
*                 w_functionname .
*      ENDIF.                " IF sy-subrc NE 0.(RS_FUNCTION_ACTIVATE)
    ENDIF.                  " IF sy-subrc NE 0.

  ENDLOOP.                  " LOOP AT s_fm.

ENDFORM.                    " sub_upload_fm_data&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Feb 2007 05:52:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/upload-a-function-module/m-p/1947232#M390332</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-15T05:52:54Z</dc:date>
    </item>
    <item>
      <title>Re: Upload a Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/upload-a-function-module/m-p/1947233#M390333</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;Thanks but I have tried that already but it only uploads the source code, I want an end to end upload of a Function Module.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There was a program on SDN, but that did not work for version 4.6C.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Abhishek Sahi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Feb 2007 05:57:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/upload-a-function-module/m-p/1947233#M390333</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-15T05:57:44Z</dc:date>
    </item>
    <item>
      <title>Re: Upload a Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/upload-a-function-module/m-p/1947234#M390334</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;check my program it upload all element  of fm like export ,import and changing parameter.&lt;/P&gt;&lt;P&gt; &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Feb 2007 05:59:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/upload-a-function-module/m-p/1947234#M390334</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-15T05:59:42Z</dc:date>
    </item>
  </channel>
</rss>

