Upload a Function Module

Hi all
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..

2)now uplaos from c driv to diffrent server.
*& Report  Z_CREATE_FM                                                 *
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
*&      Form  sub_upload_fm_data
*       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

Similar Messages

  • Problem in creating Function Module

    Hi,
      while creating a function (Z_SPELL_AMOUNT_INDIA) one error is coming . the error  <b>'SPELL not declared</b> ' is coming. already the Function module is running correctly in different client(another client's place) i am just download the Function module from the existing implementation site and upload the function module in new client's place. both the Projects are mySAP ECC 5.0.
      Here first i have created a function group and under the Function group itself i am uploading the FM.
      How can i declare the SPELL?
    is there any rules to be follow while creating the Function Group?
    Thanks,
    Neptune.M

    Before you copy the function module check the following
    1. Check the TOP include copied properly or not
    2. Check any form routine (if existing) copied or not
    3. In the Import, Export & tables if you are pointing to any DDIC structures, check whether they are copied or not.
    While activating the function module CHOOSE ALL THE INCLUDES AND FUNCTION GROUP AT A TIME, AND THEN ACTIVATE ALL.
    I hope this helps you.
    - Raj

  • GUI_DOWNLOAD and UPLOAD Function Modules?

    Hi All,
    What exactly done by GUI_DOWNLOAD and UPLOAD Function Modules?
    Akshitha.

    What you exactly want know?
    Here is the Sap documentation for both FM:
    FU GUI_UPLOAD
    Short Text
    Upload for Data Provider
    Functionality
    The module loads a file from the PC to the server. Data can be transferred binarily or as text. Numbers and date fields can be interpreted according to the user settings.
    Example
    Binary upload: No conversion or interpretation
                begin of itab,
                      raw(255) type x,
                end of itab occurs 0.
               CALL FUNCTION 'GUI_UPLOAD'
               exporting
                  filetype =  'BIN'
                  filename = 'C:\DOWNLOAD.BIN'
               tables
                 data_tab = itab.
    Text upload
               begin of itab,
                     text(255) type c,
               end of itab occurs 0.
               CALL FUNCTION 'GUI_UPLOAD'
               exporting
                  filetype = 'ASC'
                  filename = 'C:\DOWNLOAD.TXT'
               tables
                 data_tab = itab.
    Parameters
    FILENAME
    FILETYPE
    HAS_FIELD_SEPARATOR
    HEADER_LENGTH
    READ_BY_LINE
    DAT_MODE
    CODEPAGE
    IGNORE_CERR
    REPLACEMENT
    CHECK_BOM
    VIRUS_SCAN_PROFILE
    NO_AUTH_CHECK
    FILELENGTH
    HEADER
    DATA_TAB
    Exceptions
    FILE_OPEN_ERROR
    FILE_READ_ERROR
    NO_BATCH
    GUI_REFUSE_FILETRANSFER
    INVALID_TYPE
    NO_AUTHORITY
    UNKNOWN_ERROR
    BAD_DATA_FORMAT
    HEADER_NOT_ALLOWED
    SEPARATOR_NOT_ALLOWED
    HEADER_TOO_LONG
    UNKNOWN_DP_ERROR
    ACCESS_DENIED
    DP_OUT_OF_MEMORY
    DISK_FULL
    DP_TIMEOUT
    Function Group
    SFES
    FU GUI_DOWNLOAD
    Short Text
    Download an Internal Table to the PC
    Functionality
    Data transfer of an internal table form the server to a file on the PC. The Gui_Download module replaces the obsolete modules Ws_Download and Download. The file dialog of the download module is available in the class Cl_Gui_Frontend_Services.
    Further information
    TYPE-POOLS: ABAP.
    Binary download table
    DATA: BEGIN OF line_bin,
             data(1024) TYPE X,
          END OF line_bin.
    DATA: data_tab_bin LIKE STANDARD TABLE OF line_bin.
    Ascii download table
    DATA: BEGIN OF line_asc,
             text(1024) TYPE C,
          END OF line_asc.
    DATA: data_tab_asc LIKE STANDARD TABLE OF line_asc.
    DAT download table
    DATA: BEGIN OF line_dat,
             Packed   TYPE P,
             Text(10) TYPE C,
             Number   TYPE I,
             Date     TYPE D,
             Time     TYPE T,
             Float    TYPE F,
             Hex(3)   TYPE X,
             String   TYPE String,
          END OF line_dat.
    DATA: data_tab_dat LIKE STANDARD TABLE OF line_dat.
    Get filename
    DATA: fullpath      TYPE String,
          filename      TYPE String,
          path          TYPE String,
          user_action   TYPE I,
          encoding      TYPE ABAP_ENCODING.
    CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_SAVE_DIALOG
       EXPORTING
         WINDOW_TITLE         = 'Gui_Download Demo'
         WITH_ENCODING        = 'X'
         INITIAL_DIRECTORY    = 'C:\'
      CHANGING
         FILENAME             = filename
         PATH                 = path
         FULLPATH             = fullpath
         USER_ACTION          = user_action
         FILE_ENCODING        = encoding
      EXCEPTIONS
         CNTL_ERROR           = 1
         ERROR_NO_GUI         = 2
         NOT_SUPPORTED_BY_GUI = 3
         others               = 4.
    IF SY-SUBRC <> 0.
      EXIT.
    ENDIF.
    IF user_action <> CL_GUI_FRONTEND_SERVICES=>ACTION_OK.
      EXIT.
    ENDIF.
    Download variables
    DATA: length TYPE I.
    Binary download
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          FILENAME                         = fullpath
           FILETYPE                         = 'BIN'
        IMPORTING
          FILELENGTH                       = length
        TABLES
          DATA_TAB                         = data_tab_bin
       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.
    Ascii download
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          FILENAME                         = fullpath
           FILETYPE                         = 'ASC'
        IMPORTING
          FILELENGTH                       = length
        TABLES
          DATA_TAB                         = data_tab_asc
       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.
    DAT download
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          FILENAME                         = fullpath
           FILETYPE                         = 'DAT'
        IMPORTING
          FILELENGTH                       = length
        TABLES
          DATA_TAB                         = data_tab_dat
       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.
    Parameters
    BIN_FILESIZE
    FILENAME
    FILETYPE
    APPEND
    WRITE_FIELD_SEPARATOR
    HEADER
    TRUNC_TRAILING_BLANKS
    WRITE_LF
    COL_SELECT
    COL_SELECT_MASK
    DAT_MODE
    CONFIRM_OVERWRITE
    NO_AUTH_CHECK
    CODEPAGE
    IGNORE_CERR
    REPLACEMENT
    WRITE_BOM
    TRUNC_TRAILING_BLANKS_EOL
    WK1_N_FORMAT
    WK1_N_SIZE
    WK1_T_FORMAT
    WK1_T_SIZE
    WRITE_EOL
    FILELENGTH
    DATA_TAB
    FIELDNAMES
    Exceptions
    FILE_WRITE_ERROR
    NO_BATCH
    GUI_REFUSE_FILETRANSFER
    INVALID_TYPE
    NO_AUTHORITY
    UNKNOWN_ERROR
    HEADER_NOT_ALLOWED
    SEPARATOR_NOT_ALLOWED
    FILESIZE_NOT_ALLOWED
    HEADER_TOO_LONG
    DP_ERROR_CREATE
    DP_ERROR_SEND
    DP_ERROR_WRITE
    UNKNOWN_DP_ERROR
    ACCESS_DENIED
    DP_OUT_OF_MEMORY
    DISK_FULL
    DP_TIMEOUT
    FILE_NOT_FOUND
    DATAPROVIDER_EXCEPTION
    CONTROL_FLUSH_ERROR
    Function Group
    SFES

  • Upload data from excel with vba by calling a function module

    Hello all,
    i have a problem with the function module "ALSM_EXCEL_TO_INTERNAL_TABLE". I will call this function module with vba to load data from excel to sap with a Buttonclick. I have copied this function module and set it remotable. But i can´t call it from excel.
    Can you give me some tips how can i
    upload data from excel with vba by click a button.
    The problem seems the function: call method cl_gui_frontend_services=>clipboard_import in the function module, because when i comment this function call the vba-call is true but no results. 
    How can I call the function module correct with vba?
    Thanks a lot for your tips!!!!
    Chris
    Message was edited by:
            Christoph Kirschner

    HI
    Uploading data directly from Excel file format
    * Upload data direct from excel.xls file to SAP
    REPORT ZEXCELUPLOAD.
    PARAMETERS: filename LIKE rlgrap-filename MEMORY ID M01,
                begcol TYPE i DEFAULT 1 NO-DISPLAY,
                begrow TYPE i DEFAULT 1 NO-DISPLAY,
                endcol TYPE i DEFAULT 100 NO-DISPLAY,
                endrow TYPE i DEFAULT 32000 NO-DISPLAY.
    * Tick don't append header
    PARAMETERS: kzheader AS CHECKBOX.
    DATA: BEGIN OF intern OCCURS 0.
            INCLUDE STRUCTURE  alsmex_tabline.
    DATA: END OF intern.
    DATA: BEGIN OF intern1 OCCURS 0.
            INCLUDE STRUCTURE  alsmex_tabline.
    DATA: END OF intern1.
    DATA: BEGIN OF t_col OCCURS 0,
           col LIKE alsmex_tabline-col,
           size TYPE i.
    DATA: END OF t_col.
    DATA: zwlen TYPE i,
          zwlines TYPE i.
    DATA: BEGIN OF fieldnames OCCURS 3,
            title(60),
            table(6),
            field(10),
            kz(1),
          END OF fieldnames.
    * No of columns
    DATA: BEGIN OF data_tab OCCURS 0,
           value_0001(50),
           value_0002(50),
           value_0003(50),
           value_0004(50),
           value_0005(50),
           value_0006(50),
           value_0007(50),
           value_0008(50),
           value_0009(50),
           value_0010(50),
           value_0011(50),
           value_0012(50),
           value_0013(50),
           value_0014(50),
           value_0015(50),
           value_0016(50),
           value_0017(50),
           value_0018(50),
           value_0019(50),
           value_0020(50),
           value_0021(50),
           value_0022(50),
           value_0023(50),
           value_0024(50),
           value_0025(50),
           value_0026(50),
           value_0027(50),
           value_0028(50),
           value_0029(50),
           value_0030(50),
           value_0031(50),
           value_0032(50),
           value_0033(50),
           value_0034(50),
           value_0035(50),
           value_0036(50),
           value_0037(50),
           value_0038(50),
           value_0039(50),
           value_0040(50),
           value_0041(50),
           value_0042(50),
           value_0043(50),
           value_0044(50),
           value_0045(50),
           value_0046(50),
           value_0047(50),
           value_0048(50),
           value_0049(50),
           value_0050(50),
           value_0051(50),
           value_0052(50),
           value_0053(50),
           value_0054(50),
           value_0055(50),
           value_0056(50),
           value_0057(50),
           value_0058(50),
           value_0059(50),
           value_0060(50),
           value_0061(50),
           value_0062(50),
           value_0063(50),
           value_0064(50),
           value_0065(50),
           value_0066(50),
           value_0067(50),
           value_0068(50),
           value_0069(50),
           value_0070(50),
           value_0071(50),
           value_0072(50),
           value_0073(50),
           value_0074(50),
           value_0075(50),
           value_0076(50),
           value_0077(50),
           value_0078(50),
           value_0079(50),
           value_0080(50),
           value_0081(50),
           value_0082(50),
           value_0083(50),
           value_0084(50),
           value_0085(50),
           value_0086(50),
           value_0087(50),
           value_0088(50),
           value_0089(50),
           value_0090(50),
           value_0091(50),
           value_0092(50),
           value_0093(50),
           value_0094(50),
           value_0095(50),
           value_0096(50),
           value_0097(50),
           value_0098(50),
           value_0099(50),
           value_0100(50).
    DATA: END OF data_tab.
    DATA: tind(4) TYPE n.
    DATA: zwfeld(19).
    FIELD-SYMBOLS: <fs1>.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR filename.
      CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
           EXPORTING
                mask      = '*.xls'
                static    = 'X'
           CHANGING
                file_name = filename.
    START-OF-SELECTION.
      CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
           EXPORTING
                filename                = filename
                i_begin_col             = begcol
                i_begin_row             = begrow
                i_end_col               = endcol
                i_end_row               = endrow
           TABLES
                intern                  = intern
           EXCEPTIONS
                inconsistent_parameters = 1
                upload_ole              = 2
                OTHERS                  = 3.
      IF sy-subrc <> 0.
        WRITE:/ 'Upload Error ', SY-SUBRC.
      ENDIF.
    END-OF-SELECTION.
      LOOP AT intern.
        intern1 = intern.
        CLEAR intern1-row.
        APPEND intern1.
      ENDLOOP.
      SORT intern1 BY col.
      LOOP AT intern1.
        AT NEW col.
          t_col-col = intern1-col.
          APPEND t_col.
        ENDAT.
        zwlen = strlen( intern1-value ).
        READ TABLE t_col WITH KEY col = intern1-col.
        IF sy-subrc EQ 0.
          IF zwlen > t_col-size.
            t_col-size = zwlen.
    *                          Internal Table, Current Row Index
            MODIFY t_col INDEX sy-tabix.
          ENDIF.
        ENDIF.
      ENDLOOP.
      DESCRIBE TABLE t_col LINES zwlines.
      SORT intern BY row col.
      IF kzheader = 'X'.
        LOOP AT intern.
          fieldnames-title = intern-value.
          APPEND fieldnames.
          AT END OF row.
            EXIT.
          ENDAT.
        ENDLOOP.
      ELSE.
        DO zwlines TIMES.
          WRITE sy-index TO fieldnames-title.
          APPEND fieldnames.
        ENDDO.
      ENDIF.
      SORT intern BY row col.
      LOOP AT intern.
        IF kzheader = 'X'
        AND intern-row = 1.
          CONTINUE.
        ENDIF.
        tind = intern-col.
        CONCATENATE 'DATA_TAB-VALUE_' tind INTO zwfeld.
        ASSIGN (zwfeld) TO <fs1>.
        <fs1> = intern-value.
        AT END OF row.
          APPEND data_tab.
          CLEAR data_tab.
        ENDAT.
      ENDLOOP.
      CALL FUNCTION 'DISPLAY_BASIC_LIST'
           EXPORTING
                file_name     = filename
           TABLES
                data_tab      = data_tab
                fieldname_tab = fieldnames.
    *-- End of Program
    <b>Excel Upload Alternative - KCD_EXCEL_OLE_TO_INT_CONVERT</b>
    *Title : Excel Uploading
    TYPES:   BEGIN OF t_datatab,
             col1(25)  TYPE c,
             col2(30)  TYPE c,
             col3(30)  TYPE c,
             col4(30)  TYPE c,
             col5(30)  TYPE c,
             col6(30)  TYPE c,
             col7(30) TYPE c,
             col8(30)  TYPE c,
             col9(30)  TYPE c,
             col10(30)  TYPE c,
             col11(30)    TYPE c,
           END OF t_datatab.
    DATA: it_datatab TYPE STANDARD TABLE OF t_datatab INITIAL SIZE 0,
          wa_datatab TYPE t_datatab.
    Data : p_table type t_datatab occurs 0 with header line.
    DATA : gd_scol   TYPE i VALUE '1',
           gd_srow   TYPE i VALUE '1',
           gd_ecol   TYPE i VALUE '256',
           gd_erow   TYPE i VALUE '65536'.
    DATA: it_tab TYPE filetable,
          gd_subrc TYPE i.
    field-symbols : <fs>.
    *Selection screen definition
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETERS:  p_file LIKE rlgrap-filename
                   DEFAULT 'c:test.xls' OBLIGATORY.   " File Name
    SELECTION-SCREEN END OF BLOCK b1.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
      REFRESH: it_tab.
      CALL METHOD cl_gui_frontend_services=>file_open_dialog
        EXPORTING
          window_title     = 'Select File'
          default_filename = '*.xls'
          multiselection   = ' '
        CHANGING
          file_table       = it_tab
          rc               = gd_subrc.
      LOOP AT it_tab INTO p_file.
    *    so_fpath-sign = 'I'.
    *    so_fpath-option = 'EQ'.
    *    append so_fpath.
      ENDLOOP.
    START-OF-SELECTION.
      PERFORM upload_excel_file TABLES   it_datatab
                                 USING   p_file
                                         gd_scol
                                         gd_srow
                                         gd_ecol
                                         gd_erow.
    * END-OF-SELECTION.
    END-OF-SELECTION.
      LOOP AT it_datatab INTO wa_datatab.
        WRITE:/ wa_datatab-col1,
                wa_datatab-col2,
                wa_datatab-col3,
                wa_datatab-col4,
                wa_datatab-col5,
                wa_datatab-col6,
                wa_datatab-col7,
                wa_datatab-col8,
                wa_datatab-col9,
                wa_datatab-col10,
                wa_datatab-col11.
      ENDLOOP.
    *&      Form  UPLOAD_EXCEL_FILE
    *       upload excel spreadsheet into internal table
    *      -->P_TABLE    Table to return excel data into
    *      -->P_FILE     file name and path
    *      -->P_SCOL     start column
    *      -->P_SROW     start row
    *      -->P_ECOL     end column
    *      -->P_EROW     end row
    FORM upload_excel_file TABLES   p_table
                           USING    p_file
                                    p_scol
                                    p_srow
                                    p_ecol
                                    p_erow.
      DATA : lt_intern TYPE  kcde_cells OCCURS 0 WITH HEADER LINE.
    * Has the following format:
    *             Row number   | Colum Number   |   Value
    *      i.e.     1                 1             Name1
    *               2                 1             Joe
      DATA : ld_index TYPE i.
    * Note: Alternative function module - 'ALSM_EXCEL_TO_INTERNAL_TABLE'
      CALL FUNCTION 'KCD_EXCEL_OLE_TO_INT_CONVERT'
        EXPORTING
          filename                = p_file
          i_begin_col             = p_scol
          i_begin_row             = p_srow
          i_end_col               = p_ecol
          i_end_row               = p_erow
        TABLES
          intern                  = LT_INTERN
        EXCEPTIONS
          inconsistent_parameters = 1
          upload_ole              = 2
          OTHERS                  = 3.
      IF sy-subrc <> 0.
        FORMAT COLOR COL_BACKGROUND INTENSIFIED.
        WRITE:/ 'Error Uploading file'.
        EXIT.
      ENDIF.
      IF lt_intern[] IS INITIAL.
        FORMAT COLOR COL_BACKGROUND INTENSIFIED.
        WRITE:/ 'No Data Uploaded'.
        EXIT.
      ELSE.
        SORT lt_intern BY row col.
        LOOP AT lt_intern.
         MOVE lt_intern-col TO ld_index.
         assign component ld_index of structure
         p_table to <fs>.
    move : lt_intern-value to <fs>.
    *     MOVE lt_intern-value TO p_table.
          AT END OF row.
            APPEND p_table.
            CLEAR p_table.
          ENDAT.
        ENDLOOP.
      ENDIF.
    ENDFORM.                    "UPLOAD_EXCEL_FILE
    Regards
    Pavan

  • How to upload Excel file in BI using function module in abap program

    How to upload Excel file in BI using function module in abap program?

    Hi Anuj,
    To upload the file , you can try a standard program "RSEPSFTP" .
    while you execute the program , a selection screen appears in which the inputs should be give as
    RFC destination - The target server name
    FTP command- PUT
    local file - your file name
    local directory - path of your local file
    remote file - your target file name
    remote directory - where it has to be stored
    Hope this is useful for you
    Thanks & regards
    Anju

  • Existing Function modules or Standard upload Programs

    Hi,
    Can any one tell, Are there any Function modules or Standard upload programs exists for following transactions:
    Creating production version(C223)
    Creating Master recipe(C201)
    Creation Apportionment Structure(C202)
    Creation BOM Allocation(CS08)
    (This all tcodes comes under Production planning.)
    Thanks in advance.

    Hi Vanitha,
    Check this
    for C223
    CM_FV_PROD_VERS_MAINTAIN
    CM_FV_PROD_VERS_SAVE
    CM_FV_PROD_VERS_SAVE_ALL
    CY01_ORDER_MODIFY_PROD_VERSION
    For C201
    C2_CU_RECIPE_EXCLUDE_CREATE
    CONTROL_RECIPE_CREATE
    For C202
    APPOINTMENT_GRP_CREATE
    APPOINTMENT_CREATE
    APPOINTMENT_GENERATE
    APPOINTMENT_GENERATE_2
    For CS08
    CSAP_MAT_BOM_ALLOC_CREATE
    Hope it helps...
    Lokesh
    pls. reward appropriate points
    Message was edited by: Lokesh Aggarwal

  • Need Function module to upload an excel file to SAP

    Need Function module to upload more than 100 characters of excel file data into SAP internal table.
    Currently i have two function module
    1. ALSM_EXCEL_TO_INTERNAL_TABLE --32 characters max
    2. KCD_EXCEL_OLE_TO_INT_CONVERT --50 characters max
    Please let me know some pointers.
    Thanks in Advance,
    A.Karthikeyan.

    hi,
    use the FM GUI_UPLOAD
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        FILENAME                      = W_FILENAME
       FILETYPE                      = W_FILETYPE
       HAS_FIELD_SEPARATOR           = 'X'
      HEADER_LENGTH                 = 0
      READ_BY_LINE                  = 'X'
       DAT_MODE                      = 'X'
      CODEPAGE                      = ' '
      IGNORE_CERR                   = ABAP_TRUE
      REPLACEMENT                   = '#'
      CHECK_BOM                     = ' '
      VIRUS_SCAN_PROFILE            =
      NO_AUTH_CHECK                 = ' '
    IMPORTING
      FILELENGTH                    =
      HEADER                        =
      TABLES
        DATA_TAB                      = wp_it_upload
    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.

  • Function module to choose the file for download and upload

    what is the function module to choose the file for download and upload  for presentation server.
    give me with example

    Please search in SCN.
    This has been discussed so many times.

  • Function module "UPLOAD" failed for Unicode

    Hi,
    I have a program that uses the Function module UPLOAD. This function again uses the function ws_upload, which is obsolete. ws_upload and ws_download have been replaced by the new ones in CL_GUI_FRONTEND_SERVICES. But what function / method is replacing the UPLOAD function ?

    Hi!
    I'm using the function module GUI_UPLOAD for unicode files also.
    Regards
    Tamá

  • Function module to upload excel to internal table in SAP 7.0 version system

    <<Question has been asked and answered many times - please search before asking for function modules for common tasks>>
    currently i am using SAP Netweaver7.0 version, i need a Funtion Module to upload an Excel sheet data to an internal table.
    please let me know this ASAP.
    thanks,
    Edited by: Matt on Aug 24, 2009 7:25 AM

    hi,
    the FM you have suggested does not exist in the *version 7.0*
    added the FM "ALSM_....",also does not exist
    pls suggest a FM for SAP7.0 version

  • Best practice to upload data for Appraisals: BDC, LSMW or functional module

    Hi,
    I have heard that BDC and LSMW do not work for data upload in appraisals. Is it true?
    Can we use ECATT or SECATT to upload data in appraisals?
    I somewhere got the information that functional modules
    HRHAP_DOCUMENT_PREPARE
    HRHAP_DOC_UPDATE_BODY_AND_SAVE
    HRHAP_DOCUMENT_CREATE
    are used to upload the data for appraisals?
    Many of my earlier clients found it very hectic to create appraisal templates every year (PHAP_CREATE). They needed something automated for this.  I managed to suggest them manual upload or SECATT, but I am not sure if BDC/LSMW work for this.
    Can somebody throw some light on this?
    Best regards,
    Veera Sasidhar Jangam

    Hi,
    You need to write a code for same and use function modules available as those does direct updates to database.
    If client is not bothered about look and feel during dataload or do not care about display infotypes during data updates then use above method otherwise BDC needs to be written with screen control programming in it.
    Thanks,
    Ameet

  • How to create Business partner from uploaded file by Function module?

    Hi Experts,
    I have uploaded Business partner data from a file to server now from individual records I have to create Business partner and have to update the records in the tables. Means from on record i have to create one business partner in sap system.
    I have uploaded the records in the system and stored in a internal table.Now my task is to create business partner and have to update tables.
    I need a function module which create BP by each records uploaded and update the respective tables of BP and exports business partner ID.
    Please respond soon Its a requirement form the client.
    Prem.

    HI,
       You can use the bapi 'BAPI_BUPA_CREATE_FROM_DATA' to create a business partner .
    call function 'BAPI_BUPA_CREATE_FROM_DATA'
              exporting
                businesspartnerextern              = g_bpartner-partn
                partnercategory                    = partnercategory
                partnergroup                       = partnegroup
                centraldata                        = centraldata
                centraldataperson                  = centraldataperson
                centraldataorganization            = centraldataorganization
    *       CENTRALDATAGROUP                   =
                addressdata                        = addressdata
    *       DUPLICATE_MESSAGE_TYPE             =
    *         IMPORTING
    *            BUSINESSPARTNER                    = G_BPARTNER-BUSINESSPARTNER
             tables
                telefondata                        = telefondata
                faxdata                            = faxdata
                e_maildata                         = e_maildata
                return                             = return
    *       ADDRESSDUPLICATES                  =
                addressnotes                       = addressnotes.

  • Test case upload in solar02 transaction using function module

    I have requirement to upload test case and test case name in transaction solar02,
    i want functional module name which will ask for project name, business scenarious, business processes
    test case type,  test case , test case name

    Hello Vinod, see the following code (I assume you have a item data on columns A and B as from row 4, and header data on row 2)
        Set rfcctl = CreateObject("sap.functions")
        Set conn = rfcctl.Connection
        conn.Client = "<client>"
        conn.hostname = "<server>"
        conn.user = user "<username>"
        conn.Language = "<lang>"
        conn.password = "<password>"
        conn.SystemNumber = "<system number>"
        If conn.Logon(0, True) Then
           Set rfc = rfcctl.Add("PROCESS_MESS_UPLOAD")
           Set data = rfc.Tables("MSHD").Rows.Add
           item("WERK") = Range("A2").Value
           item("MSCLA") = Range("B2").Value
           item("SEDAT") = Range("C2").Value
           'add all necessary table columns
            i = 4
            While Range("A" & i).Value <> ""
                Set item = rfc.Tables("MSEL").Rows.Add
                item("ATNAM") = Range("A" & i).Value
                item("ATWRT") = Range("B" & i).Value
                'add all necessary table columns
                i = i + 1
            Wend
            If rfc.Call Then
              'CHECK FOR SUCCESS OR ERRORS
            Else
                MsgBox "Call error", vbOKOnly
                Exit Sub
            end if
        Else
            MsgBox "Logon error", vbOKOnly
            Exit Sub
        End If
        Set rfcctl = Nothing
        Set conn = Nothing
    Note: I haven't used this FM before, so I'm guessing which table fields may be useful to you
    Cheers
    Michael

  • BDC : Function Module to Upload Unicode text file

    Hi Friends,
               Can anyone tell me how to upload data to internal table by taking it from unicode text file ?
    at present i'm using FM - GUI_UPLOAD which do not support Unicode text file.
    Sonal

    Hi,
    U Have to use CodePage Parameter to upload the data.
    Check the Description
    Character Representation for Output
    Description
    Use parameter CODEPAGE to specify the desired source codepage. If this parameter is not set, the codepage of the SAP GUI is used as the source codepage.
    Value range
    4-digit number of the SAP codepage. The function module SCP_CODEPAGE_BY_EXTERNAL_NAME provides the SAP codepage number for an external character set name, for example, "iso-8859-1". The function module NLS_GET_FRONTEND_CP provides the respective non-Unicode frontend codepage for a language.
    The desired codepage can be determined interactively, if the parameter with_encoding of method file_open_dialog is set by cl_gui_frontend_services.
    If the specified codepage is not suited for the Byte Order Mark of the file, an exception is triggered.
    SPACE: Codepage of the frontend operating system
    Default
    SPACE

  • Function module to upload Excel in version 3.1

    Hi,
           Please can anybody tell me what is the function module to upload Excel sheet in SAP version 3.1.its urgent
        And also the user-command in radio buttons is not working in version 3.1. Please suggest me the right code for radio buttons in 3.1 version.
    please find the following code for radio buttons
    SELECTION-SCREEN BEGIN OF BLOCK blck WITH FRAME TITLE text-001.
    PARAMETERS:  r_local radiobutton group g1 user-command ucomm,
                             r_app radiobutton group g1,
                             p_filename  LIKE  rlgrap-filename.
    SELECTION-SCREEN END OF BLOCK blck.
    Thanks in Advance....
    Regards,
    Swapna
    Edited by: Alvaro Tejada Galindo on Feb 29, 2008 10:22 AM

    Hi,
    Use Ws_upload function module.
    Regards,
    Sunil

Maybe you are looking for

  • Report on "Status updates history"

    Hi, i need to check if resource are updating task from "My Task". Is it possible to estract a report on "Status updates history"? I mean this type of data: Approval Date Action Status Info Task Name Project Type Start Finish Actual Work Remaining Wor

  • IPad2 unusable after upgrade to ios7 because of keyboard lag

    I have a 5-10 second lag after typing any character on my iPad after upgrading to ios7. I've reset it. I've restored it. I've turned off iCloud for data and documents. None of this has solved the problem. Any other ideas? It's impossible to use for a

  • Nokia Lumia 920 Photos/Video are blurry on iPhones...

    Hi. Whenever I send pictures or videos to an iPhone or Computer they're all very blurry. They look perfectly fine on my Nokia but the moment I send them to an iPhone/Computer they look hideous. They literally look like I took them with a cheap flip p

  • Image capture will not recognise my iPhone?

    Image Capture on my iMac with Snow Leopard, does not recognise my iPhone when I attach it. I  have tried the same phone with a MacBook Pro without a problem. The Image Capture software is the same version on both computers. Can anyone help? Chris

  • FM Convert_OTF is converting - ' into #

    Hi experts, Actaully my issue is i'm using the FM Convert_OTF, but this FM return the output correctly expect the charcter lke  ' - are converted to #, what culd be the possible raeson for this, please suggest. The print preview is geneted correclty.