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

Upload XL file into an internal table

Hi,

I need to upload one excel file in my program; though the FM 'TEXT_CONVERT_XLS_TO_SAP' does purpose; it is restricted to be executed only in the foreground mode.

My requirement is to run this in background; is there any other FM that can do it?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • Posted on Jan 28, 2008 at 05:33 PM

    have u tried with

    ALSM_EXCEL_TO_INTERNAL_TABLE function module

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 28, 2008 at 05:58 PM

    HI Sanjay, During background processing u cannot upload data from a Frontend ( Desktop) u Have to upload data from an application server.. So these FM will only upload data from a presentation server.. So, Kindly upload the data using Open Dataset.. and Read Dataset..

    Regards,

    Swaroop

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 31, 2008 at 12:51 PM

    Hi,

    Check this link

    http://www.sapdevelopment.co.uk/file/file_updown.htm

    Check this code also

    
    REPORT zztest.
    
    DATA : filename LIKE dxfields-longpath.
    DATA : BEGIN OF itab OCCURS 0,
    a(200) TYPE c,
    END OF itab.
    
    
    CALL FUNCTION 'F4_DXFILENAME_TOPRECURSION'
    EXPORTING
    i_location_flag = 'A'
    
    
    I_SERVER = '?' 
    I_PATH = 
    filemask = '*.xls'
    
    FILEOPERATION = 'R' 
    IMPORTING
    
    O_LOCATION_FLAG = 
    O_SERVER = 
    o_path = filename
    
    ABEND_FLAG = 
    EXCEPTIONS
    rfc_error = 1
    error_with_gui = 2
    OTHERS = 3.
    
    OPEN DATASET filename FOR INPUT IN BINARY MODE.
    WHILE sy-subrc = 0.
    CLEAR itab .
    READ DATASET filename INTO itab.
    APPEND itab.
    ENDWHILE.
    
    CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
    filename = 'd:\abc.xls'
    filetype = 'BIN'
    TABLES
    data_tab = itab. 

    Regards,

    Satish

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 31, 2008 at 12:58 PM

    In the case of back ground schedule programs ur requirement is only possible by using open dataset and close dataset

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 31, 2008 at 02:37 PM

    There is no function module available for reading XLS files in the background. SAP does not really read an excel file, they are steering the excel via OLE, transporting tha data finally through the clipboard into SAP and then doing nothing as interpreting the data as a tab dilimted file.

    In background mode you dont have a running excel, nor OLE nor a clipboard.

    Convert the file to CSV, this is easy to read in and you can split the lines via the split command.

    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.