Application Development and Automation 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: 
Read only

Issue with HTML code in excel

Former Member
0 Likes
1,306

Hi ,

I am trying to send an internal table as an excel attachment thru an email.

I am converting the internal table into HTML format using the FM 'WWW_ITAB_TO_HTML' and then sending the mail using the BCS classes. I am trying to display the data in the excel sheet as a table.

When i check the excel attachment , i found that some of the values under a column gets misplaced and appears at the top of the excel.

Now i tried to download ( while debugging ) the internal table returned by the WWW_ITAB_TO_HTML and open it as an HTML file. The HTML file does not open properly . The data appears more or less similar to what i see in the excel attachment .

So i think there is some problem with the WWW_ITAB_TO_HTML' . I amy be wrong too on this.

Any pointers towards the issue resolution are welcome.

Thanks,

Avanish Joshi

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,169

Hello,

function module WWW_ITAB_TO_HTML is very correct and you are trying to display HTML code as EXCEL which is causing problem as it is not possible to display it as EXCEL. Instead if you open it as HTML file using internal explorer then it will display the data in proper format.

Hope this helps.

Thanks,

Augustin.

3 REPLIES 3
Read only

Former Member
0 Likes
1,171

Hello,

function module WWW_ITAB_TO_HTML is very correct and you are trying to display HTML code as EXCEL which is causing problem as it is not possible to display it as EXCEL. Instead if you open it as HTML file using internal explorer then it will display the data in proper format.

Hope this helps.

Thanks,

Augustin.

Read only

0 Likes
1,169

Hi ,

I am currently working on a unicode system.

The same set of the data is displayed correctly in EXCEL in non-unicode system . In the non-unicode system, SO_SEND...API1 FM was used to send the email.

However because of the problems with the excel attachment in unicode system, i have replaced the call to the API1 FM with the BCS class and this is where the problem starts.

Let me explain how to do i generate the mail in the BCS class in brief.

I move the records in the internal table returned by the WWW_ITAB_TO_HTML into a string. I then pass this to the CL_BCS_CONVERT=>string_to_solix to get an internal table in binary format which i then use to create attachment

Thanks,

Avanish Joshi

Read only

Former Member
0 Likes
1,169

I used the method CL_BCS_CONVERT=>TXT_TO_SOLIX and it worked.

Thanks.