Skip to Content

Excel upload Error!!!!!!!!!!!

Hi Friends,

I am uploading Excel to Internal Table Using F4_FILENAME and TEXT_CONVERT_XLS_TO_SAP!!!!!!

Sometime It getting uploaded and sometime is not.

I have searched lot in SCN not able to find the solution.

My file path : C:\Users\Sony\Desktop\Go Colors\Upload1.xls

Upload program for FB60.

Program:

CALL FUNCTION 'F4_FILENAME'

EXPORTING

FIELD_NAME = 'PA_FILE'

IMPORTING

FILE_NAME = pa_file

.

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 function 'TEXT_CONVERT_XLS_TO_SAP'

exporting

* I_FIELD_SEPERATOR =

i_line_header = 'X'

i_tab_raw_data = it_raw

i_filename = v_file

tables

i_tab_converted_data = it_data1[]

exceptions

conversion_failed = 1

others = 2.

if sy-subrc <> 0.

message id sy-msgid type sy-msgty number sy-msgno

with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

endif.

clear v_file.


Please guide I don't know why is not working!!!!!!!



Regards,

Sudarshan D

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

6 Answers

  • Best Answer
    Posted on Aug 16, 2016 at 11:40 AM

    hi sudharshan,

    try below code, i have tested it , it works fine...

    DATA: IT_RAW TYPE TRUXS_T_TEXT_DATA,
    IT_FNAM TYPE FILETABLE. *sel screen declaration *****************************
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.

    PARAMETERS : FILE LIKE RLGRAP-FILENAME OBLIGATORY.

    SELECTION-SCREEN skip 1.

    SELECTION-SCREEN END OF BLOCK b1.
    *****************************************************

    AT SELECTION-SCREEN ON VALUE-REQUEST FOR FILE.
    CALL FUNCTION 'F4_FILENAME'
    IMPORTING
    FILE_NAME = FILE.

    start-of-selection.

    CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
    EXPORTING
    I_FIELD_SEPERATOR = 'X' "is an .xls file
    I_LINE_HEADER = 'X' "has a header line
    I_TAB_RAW_DATA = IT_RAW
    I_FILENAME = FILE
    TABLES
    I_TAB_CONVERTED_DATA = it_itab.

    here it_itab i s your internal table that holds data of uploaded excel file...

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 16, 2016 at 01:23 PM

    Thanks a lot vinay!!!!!!!!!!!!😊

    Regards,

    Sudarshan D

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 16, 2016 at 07:46 AM

    May i know what is the error message.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 16, 2016 at 07:50 AM

    Any Error like File conversion failed, please check the file.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 16, 2016 at 07:54 AM

    Hi bro,

    While executing the file first getting executed successfully.

    But if executing again for testing purpose, its not getting uploaded.

    Regards,

    Sudarshan D

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 16, 2016 at 08:46 AM

    What is the error you are getting ? Did you debug ? If yes, At which step it is going wrong ?

    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.