Skip to Content
avatar image
Former Member

Reading EXCEL file from al11

Hi Friends,

                  As i have a requirement of reading excel file from application level and need to update a standard table. So when we tried to read using open data set syntax, we are getting a junk data like #############@####(@@ instead of the actual data we entered in excel before uploading to al11. Any kinda of suggestions or ideas are always welcome and also appreciable.

Thanks in advance.

Regards,

Sai...

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    Mar 22, 2012 at 07:43 AM

    Hi

    What additions are you using with OPEN DATASET, Try below

    OPEN DATASET filepath FOR INPUT IN TEXT MODE ENCODING DEFAULT.

    Or else

    Convert XLS to CSV file and try

    Thanks,

    Chandra

    Add comment
    10|10000 characters needed characters exceeded

    • Excel internal data were stored in a proprietary format til recent version which use a xml format (.xlsx) Open dataset wont be able to convert the data flow into an internal table.

      - For old version : call an Excel application via OLE to read the data (you need a GUI connexion) /or/ export from Excel to a flat format (csv) or convertible (html) before uploading to application server (AL11)
      - For recent version : you could look at abap2xlsx

      Regards,
      Raymond

  • avatar image
    Former Member
    Mar 22, 2012 at 09:35 AM

    Hi Sai,

    You can try in below manner.

    CALL METHOD zclxx_file_services=>app_directory_list_files  to get the file from App server.

    after that  CALL METHOD zclxx_file_services=>gui_upload   

    It works perfectly as i have used in some of my earlier requiremtn.

    Thanks,

    Deb

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      I don't think Debdas realizes that 1: he is suggesting use of foreground techniques for background jobs, that he is promoting use of code developed in his customer site that has no relevance to the original post, and that his claims to have done this are, as a result, suspect. 😉

  • avatar image
    Former Member
    Mar 22, 2012 at 12:36 PM

    Hi,

    exist the function module 'TEXT_CONVERT_XLS_TO_SAP'  but i think that this function module takes file from a local folder. In any case you can try it. If not run, check the code implemented in this function module and apply it in your program. This FM is using interfaces i_oi_document_proxy and i_oi_spreadsheet to substract data from excel file and append this data to an internal table. I have used these interfaces to open a file from al11 and runs good.

    Regards,

    Marc.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Thank you very much David, Marc and all for your valuable suggestions. As they need immediate solution, we done the things in little lengthy way. We downloaded the file from AL11 to Presentation level using FM(we can do it using CG3Y also). And done the process and then deleted that file.

      But i am not satisfied with what i have done..I don't think that this is apt solution for this problem. So definitely follow the suggested ways in thread and also welcome any other suggestions.

      Thanks & Regards,

      Sai Kiran Rao.