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

Cannot think of a subject title. Please help!

hye techies,

i want to download the internal table to .csv. But we dont have the FM SAP_CONVERT_TO_CSV_FORMAT or SAP_CONVERT_TO_TEXT_FORMAT. The type-pools TRUXS is not there, hence not able to convert into CSV format with GUI_DOWNLOAD, is there any other alternative. Please help.

Regards,

Imran.

Edited by: Julius Bussche on Aug 27, 2009 11:35 AM

Subject title made more meaningfull, but still useless

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Aug 27, 2009 at 09:10 AM

    Hi Pasha, CSV means Comma separated values. You can write coding yourself. Try this way

    REPORT zvenkat_test2.
    DATA: BEGIN OF it_down OCCURS 0,
            bukrs TYPE t001-bukrs,
            butxt TYPE t001-butxt,
            ort01 TYPE t001-ort01,
          END OF it_down.
    DATA: BEGIN OF it_data OCCURS 0,
            data TYPE string,
          END OF it_data.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text_001.
    PARAMETERS p_file TYPE localfile DEFAULT 'C:\Test.txt'.
    SELECTION-SCREEN END OF BLOCK b1.
    
    START-OF-SELECTION.
      SELECT bukrs
             butxt
             ort01
        FROM t001 INTO TABLE it_down UP TO 10 ROWS .
      LOOP AT it_down.
        CONCATENATE it_down-bukrs it_down-butxt it_down-ort01 INTO it_data-data SEPARATED BY ','.
        APPEND it_data.
      ENDLOOP.
      DATA l_filename TYPE  string.
      l_filename = p_file.
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          filename = l_filename
        TABLES
          data_tab = it_data
        EXCEPTIONS
          OTHERS   = 1.
    Thanks Venkat.O

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 27, 2009 at 08:59 AM

    yes, i would ask an abaper to write a piece of code, writing the data to char/strings and concatenate them.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 27, 2009 at 09:03 AM

    Hi,

    Chk if the following link can b helpful...

    https://wiki.sdn.sap.com/wiki/display/Snippets/SAMPLECODETODOWNLOADBW-HIERARCHYDATATOAPPLICATIONSERVERIN.CSVFORMAT

    Regards.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 27, 2009 at 09:25 AM

    Hi,

    Try with the following code.

    TYPE-POOLS : truxs.

    DATA: t_file TYPE STANDARD TABLE OF type_file.

    data:t_conv_data TYPE truxs_t_text_data.

    CALL FUNCTION 'SAP_CONVERT_TO_TEX_FORMAT'

    EXPORTING

    i_field_seperator = ','

    TABLES

    i_tab_sap_data = t_file

    CHANGING

    i_tab_converted_data = t_conv_data

    EXCEPTIONS

    conversion_failed = 1

    OTHERS = 2.

    CALL FUNCTION 'GUI_DOWNLOAD'

    EXPORTING

    filename = 'C:\TESTCSV.CSV'

    filetype = 'ASC'

    write_field_separator = ' '

    TABLES

    data_tab = t_conv_data

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 27, 2009 at 09:30 AM

    Answered

    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.