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

ws_upload and GUI_upload ....

Hi Everyone,

I got a query, I have tried using ws_upload and gui_upload both in the program...... the codes are below, If I try using .xls it gives only garbage in the internal table. .txt format is working fine. Can anyone help by haveing a look at the code piece where am I going wrong. i trid these piece of codes in both ECC6.0 and 4.6.

**************CODES BELOW*******************

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

FORM UPLOAD_PS_PRICE .

DATA:L_CURR LIKE EKPO-NETPR.

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

filename = p_local

filetype = 'DAT'

  • has_field_separator = 'X'

TABLES

data_tab = t_ps_price

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 <> 0.

ENDIF.

  • CALL FUNCTION 'WS_UPLOAD'

  • EXPORTING

  • FILENAME = P_LOCAL

  • FILETYPE = 'DAT'

  • TABLES

  • DATA_TAB = T_PS_PRICE

  • EXCEPTIONS

  • CONVERSION_ERROR = 1

  • FILE_OPEN_ERROR = 2

  • FILE_READ_ERROR = 3

  • INVALID_TYPE = 4

  • NO_BATCH = 5

  • UNKNOWN_ERROR = 6

  • INVALID_TABLE_WIDTH = 7

  • GUI_REFUSE_FILETRANSFER = 8

  • CUSTOMER_ERROR = 9

  • OTHERS = 10.

  • IF SY-SUBRC <> 0.

  • MESSAGE S002 WITH TEXT-007.

  • ENDIF.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jan 29, 2008 at 01:32 PM

    Hi

    WS_UPLOAD is obselete and is not recommended to use.

    If you want to upload the excel sheet use FM ALSM_EXCEL* or TEXT_CONVERT_TXT_TO_SAP

    Regards

    Shiva

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 29, 2008 at 01:35 PM

    hi anupama,

    use the fm ALSM_EXCEL_TO_INTERNAL_TABLE for uploading from XLS file.

    Regards,

    Priya.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 29, 2008 at 01:35 PM

    hi

    good

    did you debug the code and try to find out where is the exact error is, because it is quite difficult to give you the correct reply with this bit of code.

    thanks

    mrutyun^

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 29, 2008 at 01:37 PM

    CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE' to upload excel file

    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.