Skip to Content
avatar image
-4
Former Member

GUI_UPLOAD gives no error

Hi All,

I am using class cl_gui_frontend_services=>gui_upload, to upload an excel file for ASCII as well as for CSV format.

There gives no any errors.
Even the file is opening on excel by other someone.
Can anyone please help me,
how to get a error return code.

I am using
GUI:740 LEVEL:8
SAPBASIS:701 LEVEL:12
Excel2010

Add comment
10|10000 characters needed characters exceeded

  • I never heard of such a problem, so I think you misinterpret the issue, but you didn't say what you did before getting to the conclusion "there's no error return code". Please give more details.

  • Former Member

    thank you for your reply

    I am sorry for the inconvenience.

    I only do 2 steps

    1.open the file 'test.csv' on excel

    2.action SM37: GUI_UPLOAD

    then the file was uploaded into the exporting parameter.

    what I expeced result is
    file was cloud not upload
    because the file is using by the others.

  • I still don't understand what your problem is. You now use SE37 (SM37 you said?) to execute function module GUI_UPLOAD? (you don't use anymore the class?) I guess you should get a non-null return code (SY-SUBRC) if the file is locked. That's the normal behavior.

  • Get RSS Feed

5 Answers

  • Jan 13, 2017 at 07:40 AM

    Maybe your system has several application servers, and the target directory is not seen from all application servers (missing symbolic link, for instance)

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 16, 2017 at 06:37 AM

    I am sorry It is my misstake.

    function code is SE37.

    Next is my logic source.

    *************************************************************************************************

    CALL METHOD CL_GUI_FRONTEND_SERVICES=>GUI_UPLOAD
    EXPORTING
    FILENAME = L_FILENAME
    FILETYPE = 'ASC'
    CHANGING
    DATA_TAB = L_OTAB_CSV
    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 E201 WITH 'THE FILE IS USING'.
    ENDIF.

    *************************************************************************************************

    When the file L_FILENAME is still opening on excel.

    I think
    The logic's should be return sy-subrc <> 0.
    and output the error message.

    But I recived sy-subrc is '0'.

    I would like to know
    If my source have any mistake or
    the function 'GUI_UPLOAD' is depend on GUI version and BASIS LEVEL

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Jürgen Lins

      Thank you.

      I was relieved that there was the same result.
      At least it seems that there is no problem with my program.
      However, I wanted to issue an error message as a specification.

  • Jan 16, 2017 at 09:46 PM

    do a second test case: create a standard Excel file, save it as CSV but do not leave Excel. Now try your program. Is the result different than in the test where you opened an existing CSV file with Excel?

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Thank you for your idea.

      I did just like you said.

      But, There is a same result be return. SY-SUBRC = 0.

      I try my program on the other PC

      SAP GUI710 here is worked,the return code SY-SUBRC = 12

  • avatar image
    Former Member
    Jan 23, 2017 at 05:24 AM

    Instead of that Use CALL FUNCTION 'GUI_UPLOAD'.

    ************************************************************************

    • Start-of-selection

    ************************************************************************

    START-OF-SELECTION.

    IF p_ppath IS NOT INITIAL.

    l_filenm = p_ppath.

    CALL FUNCTION 'GUI_UPLOAD'

    EXPORTING

    filename = l_filenm

    filetype = 'ASC'

    has_field_separator = 'X'

    TABLES

    data_tab = itab_item

    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.

    ENDIF.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Thank you for your advice.

      But, nothing be changed.

      There is a same result be returned ~SY-SUBRC = 0.

  • avatar image
    Former Member
    Jan 25, 2017 at 07:51 AM

    I recived an answer from sap surport.

    Explaning is

    [This is an improvement for higher GUI version]

    Check note 2419199

    Add comment
    10|10000 characters needed characters exceeded