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

To print a tab space in a file.

Hi all, I am working on an Interface program. The Output is to be written to a file. The file has a particulat structure and I need to write the data to the file in the TAB DELEMETED format. I 'll be using Open dataset to write to the file.

I would like to know is there any way by which we can write (rather leave) a tab space in ABAP.

Thanks

Amit

Add comment
10|10000 characters needed characters exceeded

3 Answers

  • Posted on Mar 18, 2004 at 08:52 PM

    What release of SAP are you working with? If you have a WebAS 620 or higher you probably want to use class: cl_abap_char_utilities. This is a great little class that has constants such as horizontal_tab, vertical_tab, newline, form_feed, etc. The values for these constants come from the Kernel (I assume) and adjust based upon what code page you are running in (Unicode/Non-Unicode). Before 620 we used to always declare our own hexidecimal constants with the hex code for the character we wanted. Eithor way you just concatenate your data together with these constants into a string and then write out that string. The following is a little example:

    ****Title Line

    concatenate me->user_model->project

    ': '

    proj_name

    cl_abap_char_utilities=>newline

    into r_content.

    ****Blank Line

    concatenate r_content

    cl_abap_char_utilities=>newline

    into r_content.

    ****Header Line

    concatenate r_content

    'CO.'(h01)

    cl_abap_char_utilities=>horizontal_tab

    'COST CTR'(h02)

    cl_abap_char_utilities=>horizontal_tab

    'NAMES'(h03)

    cl_abap_char_utilities=>horizontal_tab

    into r_content.

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 19, 2004 at 12:20 AM

    looks like you have got the answer to your question but here is some additional info regarding uploading and downloading files to/from PC or SAP, along with a few examples, http://www.sapdevelopment.co.uk/file/file_updown.htm

    hope it helps

    Add comment
    10|10000 characters needed characters exceeded

  • Posted on Mar 19, 2004 at 07:46 AM

    For previous releases of SAP, you should insert the hexadecimal code of TAB.

    To do so, concatenate your text with a hex variable (type x) containing '09'.

    Add comment
    10|10000 characters needed characters exceeded