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: 

Email attachement (EXCEL. CVS FILE) greater than 255 bytes

Former Member
0 Kudos

I have read the postings on this topic - Thomas Jung - you appear to be the expert on this topic. My concern is breaking up the file into chunks and then being sure SAP knows how to re-assemble them when transferred. Could anyone give me some sample code on this and the FM's required (I know the FM is SO_NEW_DOCUMENT_ATT_SEND_API1 to send it and it works great except for the 255 limit). I am under the gun to get this resolved ASAP. I know SAP can handle it - I go into SAP Office and have no trouble e-mailing large attachments to external e-mail accounts - actually I have been told to run debug when I do this and see how SAP handles it (a long debug session I am sure). Any help would be most appreciated and get mucho reward points. Thanks!!

3 REPLIES 3

thomas_jung
Developer Advocate
Developer Advocate

I just wrote a huge, long post on this but got a Java Server error when I hit Post Message. Arg!

Let me try and re-summarize. You shouldn't be concerned about how SAP will re-assemble the SOLI structure. If when you convert your data to CVS format you properly insert new line characters, this will be the place that Excel uses to parse the file. You see there is an assumption that the end of the line in an ABAP internal table always means a new line in a downloaded file. This is probably because all the SAP supplied download functions do this for you by default. However what they are doing is adding this new line character for you.

Now how you get to the end point of what you want, depends upon a few things. What release are you on? Do you already have your data in CVS (with newlines) or do you need to get it there from an internal table? Is your data in a string?

If I knew the answers to these questions I might be able to help out. I have code sample for 620 and higher that should dynamically convert your internal table to Tab Delimited string (also good for download to excel or easy to modify to CVS). Once in the string it is quite easy to use the SAP function module SCMS_STRING_TO_FTEXT to get you to the SOLI main structure.

Let me know if you need more details.

0 Kudos

Dude - you are the King! Took a little playing around but I got my huge file (about 1950 bytes per record)in CSV format to attach to an e-mail and be received and opened in Excel correctly. Add the newline feed to the end of each record and call that FM SCMS_STRING_TO_FTEXT to convert the records - and there it was. The data looks weird when you debug it at times but the outcome is right on target. MAX REWARD POINTS TO YOU THOMAS - THANKS AGAIN. Now what do I do to close ensure you get the points? Not sure how to do this - have a great weekend - you sure made mine!

0 Kudos

Scott

Hi, I am working on the similar situation where I need to send email with an attachment where each record exceeding 255 characters. I didn't understant the message you been discusing with Thomas. I would appreciate if you could help me in to understand the steps I need to follow inorder to get this done.

Thanks in Advance

David