[SOLVED]Convert email attachment format to file format

Development (ABAP Development WorkBench, ABAP/4 programming)

Moderators: Snowy, thx4allthefish, YuriT, Gothmog

Post Reply
AndyW
Posts: 70
Joined: Wed Jan 02, 2008 10:27 am
Location: North Norfolk, UK

[SOLVED]Convert email attachment format to file format

Post by AndyW » Tue Mar 09, 2010 1:33 am

Hi All

We've got a bespoke program that currently generates tab delimited customer reports that are emailed out to external customers from SAP as an Excel attachment. This is no longer considered secure enough so the file is to be published on a secure area of our website for them to download.

I thought this would be a relatively simple change i.e. write out the file to to the server instead of emailing. Everything was fine until I downloaded the file and opened it and found 'random' LFs in it. On further investigation I believe this is because email attachments have a width limit of 255 so the file consists of multiple rows of 255 characters each with hard-coded tabs and CRLF at the appropriate points. The 'random' LFs happened every 255 characters. These seemed to be ignored/removed during the email process as comparing the files in WinDiff shows that the email version is one continuous string whereas the version from the server consists of multiple rows.

Does anybody have any hot tips on how to prevent this? The problem is the report consists of header, item and summary data so I can't use a table consisting of specific fields (which I guess is partly why its been done as a table consisting of 1 x 255 char field).

Our SAP system is 4.6C and runs on Windows Server. Our PCs are all Windows too so I don't think this is down to UNIX v Windows.

Thanks in advance

Andy
Last edited by AndyW on Tue Mar 09, 2010 7:09 am, edited 1 time in total.

AndyW
Posts: 70
Joined: Wed Jan 02, 2008 10:27 am
Location: North Norfolk, UK

Re: [SOLVED]Convert email attachment format to file format

Post by AndyW » Tue Mar 09, 2010 7:08 am

I was opening the dataset in Text Mode. Changing it to open in Binary Mode appears to have fixed it as it outputs as a stream rather than rows of data. :roll:

Post Reply