cancel
Showing results for 
Search instead for 
Did you mean: 

To print a tab space in a file.

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (3)

Answers (3)

franois_henrotte
Active Contributor
0 Kudos

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'.

Former Member
0 Kudos

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

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

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.