Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

String splitting at double hyphen while exporting from Spool to excel

Former Member
0 Kudos
449

Hi All,

My report output contains a string with double hyphen in one of the column of ALV. When i run the report in background and try to export the result from Spool to excel, the string is splitting into two separate columns.

eg: if the value is 123456--7 then, it will split into 1232456 in one column and 7 in another

Any idea to prevent this? please suggest a solution for this.

Regards

Sarath

4 REPLIES 4

Former Member
0 Kudos
110

Try to save the o/p in a notepad or in *.rtf format.

Copy and paste the data from notepad to xls sheet, ensure the columns in the xls sheet are Text formatted.

Regards

Vinayak

former_member222860
Active Contributor
0 Kudos
110

Hi,

Give a sigle quote ( ' ) in front of the string.

Just try if it works.

data: v_str type string.

v_str = '123456--7'.

if v_str CA '--'.

  CONCATENATE '''' v_str  into v_str.

endif.

write:/ v_str.

Mahesh

0 Kudos
110

Thanks mahesh for the reply,

i tried this, it wont work

regards

Sarath

Former Member
0 Kudos
110

This might happen if you have already issued a "text to columns" in one of the excel sheets with delimiter option '-'.

Close all the excel documents and open a new excel sheet and try to copy the data.

Thanks,

Mahesh