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

UPLOAD and DOWNLOAD

Hi All,

I am in Upgrade project. I have to replace the following Obsolete FM with Cl_GUI_FRONTEND_SERVICES.

How to do that? Any code would be highly appriciated.

CALL FUNCTION 'UPLOAD'

EXPORTING

codepage = 'IBM'

filetype = 'BIN'

filetype_no_change = 'X'

filetype_no_show = 'X'

IMPORTING

cancel = return

TABLES

data_tab = pool

EXCEPTIONS

conversion_error = 1

invalid_table_width = 2

invalid_type = 3

no_batch = 4

unknown_error = 5

gui_refuse_filetransfer = 6

OTHERS = 7.

-


CALL FUNCTION 'DOWNLOAD'

EXPORTING

bin_filesize = len

codepage = 'IBM'

filetype = 'BIN'

filetype_no_change = 'X'

filetype_no_show = 'X'

IMPORTING

act_filename = act_fn

TABLES

data_tab = pool

EXCEPTIONS

invalid_filesize = 1

invalid_table_width = 2

invalid_type = 3

no_batch = 4

unknown_error = 5

gui_refuse_filetransfer = 6

OTHERS = 7.

For teh above TWo FM what could be the solution ??

Thanks in advance

RK

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Nov 21, 2007 at 11:35 AM

    Hi,

    Use GUI_DOWNLOAD & GUI_UPLOAD Methods.

    Regards,

    Satish

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 21, 2007 at 11:35 AM

    clguifrontendservices

    clguifrontendservices

    call-method-clguifrontendservicesguidownload

    See this links. it might be helpful

    regards,

    abhishek

    reward if useful

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 21, 2007 at 11:50 AM

    Hi RK,

    Use FM GUI_DOWNLOAD & GUI_UPLOAD instead of that.

    If it is usefull pls reward.

    Regards

    Srimanta

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 21, 2007 at 11:50 AM
    CALL METHOD cl_gui_frontend_services=>gui_upload
      EXPORTING
        filename                = p_filname
        filetype                = 'BIN'
        codepage                = 'IBM'
      CHANGING
        data_tab                = pool
      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
        not_supported_by_gui    = 17
        error_no_gui            = 18
        OTHERS                  = 19.
    
    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                 WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    
    CALL METHOD cl_gui_frontend_services=>gui_download
      EXPORTING
        bin_filesize            = len
        filename                = p_filename
        filetype                = 'BIN'
      CHANGING
        data_tab                = pool
      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
        not_supported_by_gui    = 22
        error_no_gui            = 23
        OTHERS                  = 24.
    
    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                 WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    
    
    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 21, 2007 at 11:50 AM

    Hi...

    You have to call the Static methods of the Class: Cl_GUI_FRONTEND_SERVICES.

    for UPLOAD:

    call Method Cl_GUI_FRONTEND_SERVICES=>GUI_UPLOAD

    for DOWNLOAD:

    call Method Cl_GUI_FRONTEND_SERVICES=>GUI_DOWNLOAD

    You can open this Class Cl_GUI_FRONTEND_SERVICES in Class builder SE24 and find these methods.

    <b>REWARD IF HELPFUL.</b>

    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.