Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Making Upload/Ws_Upload and Download/Ws_Download unicode compliant.

Hi Guys/Dolls

We're in the process of making our SAP ERP2005 system unicode compliant and when I run the uccheck transaction on a program I'm getting the following message:-

Upload/Ws_Upload and Download/Ws_Download are obsolete, since they are not Unicode-enabled; use the class cl_gui_frontend_services.

Can somebody give me the correct unicode translation for the following code:-

* Download Column Headings interactively
MOVE ' ' TO V_CANCEL.
CALL FUNCTION 'DOWNLOAD'
    EXPORTING
         CODEPAGE            = 'IBM'
*         FILENAME            = ' '
        FILETYPE            = 'DAT'
*         ITEM                = ' '
*         MODE                = ' '
*         WK1_N_FORMAT        = ' '
*         WK1_N_SIZE          = ' '
*         WK1_T_FORMAT        = ' '
*         WK1_T_SIZE          = ' '
*         FILEMASK_MASK       = ' '
*         FILEMASK_TEXT       = ' '
         FILETYPE_NO_CHANGE  = 'X'
*         FILEMASK_ALL        = ' '
*         FILETYPE_NO_SHOW    = ' '
*         SILENT              = 'S'
         COL_SELECT          = 'X'
         COL_SELECTMASK      = V_MASK
     IMPORTING
         ACT_FILENAME        = V_FILENAME
*         ACT_FILETYPE        =
*         FILESIZE            =
         CANCEL              = V_CANCEL
     TABLES
          DATA_TAB            = I_H1
*         FIELDNAMES          =
     EXCEPTIONS
          INVALID_FILESIZE    = 1
          INVALID_TABLE_WIDTH = 2
          INVALID_TYPE        = 3
          NO_BATCH            = 4
          UNKNOWN_ERROR       = 5
          OTHERS              = 6.

I have had a look at CALL METHOD cl_gui_frontend_services=>gui_download

but there doesn't seem to be a match for match on the fields - can any of you guru's assist.

Above code translation would be most appreciative.

Many thanks in advance.

Raj

Tags:
Former Member
Former Member replied

Hi Raj,

Replacement Method and FM: CL_GUI_FRONTEND_SERVICES=>FILE_SAVE_DIALOG and GUI_DOWNLOAD.

Example:

*CALL FUNCTION 'DOWNLOAD'

  • EXPORTING

  • FILENAME = SPACE

  • FILETYPE = u2018DATu2019

  • TABLES

  • DATA_TAB = T_DOWNL

  • EXCEPTIONS

  • INVALID_FILESIZE = 1

  • INVALID_TABLE_WIDTH = 2

  • INVALID_TYPE = 3

  • NO_BATCH = 4

  • UNKNOWN_ERROR = 5

  • OTHERS = 6.

*End of deletion CH01-

Replacement Method for above code:

DATA: l_filename TYPE string,

l_filen TYPE string,

l_path TYPE string,

l_fullpath TYPE string,

l_usr_act TYPE I.

l_filename = SPACE.

CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_SAVE_DIALOG

EXPORTING

DEFAULT_FILE_NAME = l_filename

CHANGING

FILENAME = l_filen

PATH = l_path

FULLPATH = l_fullpath

USER_ACTION = l_usr_act

EXCEPTIONS

CNTL_ERROR = 1

ERROR_NO_GUI = 2

NOT_SUPPORTED_BY_GUI = 3

others = 4.

IF sy-subrc = 0

AND l_usr_act <>

CL_GUI_FRONTEND_SERVICES=>ACTION_CANCEL.

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

FILENAME = l_fullpath

FILETYPE = 'DAT'

TABLES

DATA_TAB = T_DOWNL

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.

Thanks

Sudharshan

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question