Skip to Content
author's profile photo Former Member
Former Member

Unicode Error in DOWNLOAD function module

Hi ABAPpers,

I am getting the unicode error in using

CALL FUNCTION 'DOWNLOAD'

EXPORTING

bin_filesize = v_bytecount

filename = v_download_filename

filetype = 'WK1'

IMPORTING

act_filename = v_download_filename

TABLES

data_tab = i_download.

If i try to use GUI_DOWNLOAD, it doesn't have importing parameter act_filename.

What alternate function module should i use to rectify this unicode error?

Regards,

Rahul

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on May 22, 2009 at 08:55 AM

    Hi,

    The answer is similar to the one for your previous post. You need to use both CL_GUI_FRONTEND_SERVICES=>FILE_SAVE_DIALOG and GUI_DOWNLOAD

    DATA: PRC_WINDOW_TITLE      TYPE STRING,
          PRC_DEFAULT_FILE_NAME TYPE STRING,
          PRC_INITIAL_DIRECTORY TYPE STRING,
          PRC_FILE_NAME         TYPE STRING,
          PRC_PATH              TYPE STRING,
          PRC_FULL_PATH         TYPE STRING,
          PRC_USER_ACTION       TYPE I.
    
    PRC_INITIAL_DIRECTORY = FILENAME.
    PRC_DEFAULT_FILE_NAME = FILENAME.
    PRC_WINDOW_TITLE      = 'Debitoren-Saldenliste'.
    
    CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_SAVE_DIALOG
      EXPORTING
        WINDOW_TITLE         = PRC_WINDOW_TITLE
        DEFAULT_FILE_NAME    = PRC_DEFAULT_FILE_NAME
        INITIAL_DIRECTORY    = PRC_INITIAL_DIRECTORY
      CHANGING
        FILENAME             = PRC_FILE_NAME
        PATH                 = PRC_PATH
        FULLPATH             = PRC_FULL_PATH
        USER_ACTION          = PRC_USER_ACTION
      EXCEPTIONS
        CNTL_ERROR           = 1
        ERROR_NO_GUI         = 2
        NOT_SUPPORTED_BY_GUI = 3
        OTHERS               = 4
            .
    IF SY-SUBRC = 0 AND PRC_USER_ACTION NE
    CL_GUI_FRONTEND_SERVICES=>ACTION_CANCEL.
    
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
         FILENAME                        = PRC_FILE_NAME
         FILETYPE                        = 'ASC'
         WRITE_FIELD_SEPARATOR           = '#'
        TABLES
          DATA_TAB                        = TAB_EXCEL
       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
                .
    ENDIF.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 22, 2009 at 08:54 AM

    Hi Rahul,

    Use CL_GUI_FRONTEND_SERVICES=> GUI_DOWNLOAD instead of DOWNLOAD function module as this is obsolette.

    Thanks,

    Vinay

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 22, 2009 at 08:55 AM

    Hi Rahul,

    Check the service class: CL_GUI_FRONTEND_SERVICES

    Methods:

    GUI_DOWNLOAD

    GUI_UPLOAD

    and lot more frontend services available.

    Regards

    George

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.