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

Issues with emailing HTML attachment.

Former Member
0 Likes
779

Hi All.

We are having few issues here:

1.

HTML files (actualy any type of files) created OK on a UNIX Application-server, but when we try to read them(into an Internal-table) we get them with out the line-breaks which cause 1 record of the Internal-table to hold X amount of lines or part of them (according to number of charcters in line/record).

2.

I tried to fix it by looping through the Internal-table and re-shaped it so each record will contain 1 line of the HTML file, but when I send it as attachment (using "SO_NEW_DOCUMENT_ATT_SEND_API1") it is messed up and looses the line-breaks again (so if you watch it through editor you see 1 gigantic line containing all lines).

Any ideas will be appreciated.

thanx

ayal.

Hi All.

We are having few issues here:

1.

HTML files (actualy any type of files) created OK on a UNIX Application-server, but when we try to read them(into an Internal-table) we get them with out the line-breaks which cause 1 record of the Internal-table to hold X amount of lines or part of them (according to number of charcters in line/record).

2.

I tried to fix it by looping through the Internal-table and re-shaped it so each record will contain 1 line of the HTML file, but when I send it as attachment (using "SO_NEW_DOCUMENT_ATT_SEND_API1") it is messed up and looses the line-breaks again (so if you watch it through editor you see 1 gigantic line containing all lines).

Any ideas will be appreciated.

thanx

ayal.

4 REPLIES 4
Read only

gabriel_pill-kahan
Active Participant
0 Likes
623

Ayal,

Are you using "OPEN DATASET dsn IN TEXT MODE"? By default, the file is opened "IN BINARY MODE". In this case the lines are read as one long stream. When you use "IN TEXT MODE" the file is read line by line.

Gabriel

Read only

Former Member
0 Likes
623

Did you try using GUI_UPLOAD? You should use this for files on your local machine.

Regards,

Pranav

Read only

0 Likes
623

Hi to all,

I think I had this problem already. You should take the binary content option and concatenate your ASCII line content with the hex '0D0A' for the line break. Then it will work.

Regards

Horst

Read only

Former Member
0 Likes
623

I solved it with SAP OSS help.

There is function ("SO_RAW_TO_RTF") that adds a line-break at the end of each line.

What I do is I read the file into an internal-table and than send this internal-table to this function which fix it for me and everything is OK.

enjoy

ayal.