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

Dowdload text file to the desktop with separator semicolon(;)

Hi fnds,

I have one requirment as follows:

I need to write a conversion program which have to use in different systems like with version 5.0 and bellow 4.6c.

the file format is like this:

Each column should separated with semicolon (😉 and the blank field should be replaced with '/'.

Let me knwo if u have any clus.

thanks in advance,

Sunil 😊

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    Posted on Jan 07, 2008 at 03:32 PM

    Hello.

    Check this example:

    DATA: BEGIN OF itab OCCURS 0,

    field1(10) TYPE c,

    field2(10) TYPE c,

    END OF itab.

    DATA: wa_line(20) TYPE c.

    DATA: out_tab LIKE wa_line OCCURS 0 WITH HEADER LINE.

    itab-field1 = ' test '.

    itab-field2 = ' ok?'.

    DO.

    REPLACE space WITH '/' INTO itab-field1.

    IF sy-subrc <> 0.

    EXIT.

    ENDIF.

    ENDDO.

    DO.

    REPLACE space WITH '/' INTO itab-field2.

    IF sy-subrc <> 0.

    EXIT.

    ENDIF.

    ENDDO.

    CONCATENATE itab-field1 itab-field2 INTO wa_line SEPARATED BY ';'.

    APPEND wa_line TO out_tab.

    CALL FUNCTION 'GUI_DOWNLOAD'

    EXPORTING

    filename = 'c:\temp\out.txt'

    filetype = 'ASC'

    TABLES

    data_tab = out_tab.

    Reward if it helps,

    Regards,

    George

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 07, 2008 at 04:25 PM

    LOOP AT p_final_table ASSIGNING <fs_record>.

    DO.

    ASSIGN COMPONENT sy-index OF STRUCTURE <fs_record> TO <fs_comp>.

    IF sy-subrc <> 0.

    EXIT.

    ENDIF.

    lv_line = <fs_comp>

    here replace ' ' by '/' ..........<<

    CONCATENATE lf_line lf_buf INTO lf_line SEPARATED BY ';'.

    ENDIF.

    CLEAR lf_buf.

    ENDDO.

    CONCATENATE lf_line INTO lf_line.

    APPEND lf_line TO p_output_file.

    CLEAR lf_line.

    ENDLOOP.

    award points if helpful

    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.