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

Convertion of SAP data into Excel format (without file)

Hello,

I'm looking for a FM to convert a SAP internal table into Excel format. Instead of an Excel file I need the binary Excel data in a SAP internal table again.

The FM SAP_CONVERT_TO_XLS_FORMAT is not usable because it stores the converted data into a given file.

Has anybody an idea how I can solve my problem?

Thanks in advance, Kay

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    Posted on Aug 17, 2005 at 01:19 PM

    Welcome to SDN.

    in the function module you have mentioned the following lines of code makes it to save it to a file.

    <b>call method l_iref_document->save_document_to_url</b>

    instead copy the FM to your custom name space and modify that portion to call method

    <b>call method l_iref_document->SAVE_DOCUMENT_TO_TABLE</b>

    Hope this helps.

    Regards

    Raja

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Kay,

      Concatenate the individual fields, separated by the tab character, into a variable. Then write the variable field to the application server.

      • >>Code <<

      data: w_output(100) value '/home/ftp400/test_output'.

      DATA: wa_string(255).

      data: field1(10) value '1111111111',

      field2(10) value '2222222222'.

      open dataset w_output for output in text mode ENCODING DEFAULT.

      *CONSTANTS: w_tab TYPE x VALUE '09'.

      *If you have Unicode check active in program attributes then you will

      *need to declare constants as follows:

      *class cl_abap_char_utilities definition load.

      constants:

      w_tab type c value cl_abap_char_utilities=>HORIZONTAL_TAB.

      CONCATENATE field1

      w_tab

      field2

      into wa_string.

      transfer wa_string to w_output.

  • author's profile photo Former Member
    Former Member
    Posted on Aug 17, 2005 at 01:16 PM

    Hi Kay,

    Can u be more specific in ur requirement? Do you mean that the data should be stored again in itab but no excel file should be generated?? If so, what is the purpose of doing this. Mebbe we can think of a different workaround if you could tell the exact need for it.

    Cheers,

    Sam

    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.