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

Problem while sending spool as mail in Excel

Former Member
0 Likes
896

Hello,

My requirement is to send the spool generated in background as attachment in excel. i am using RSPO_RETURN_SPOOLJOB for converting spool in to internal table and SO_NEW_DOCUMENT_ATT_SEND_API1 for sending mail.

The problem is data is not displayed properly. How to handle the data retreived from RSPO_RETURN_SPOOLJOB .

Thanks.

9 REPLIES 9
Read only

Sandra_Rossi
Active Contributor
0 Likes
796

It depends:

In what format do you want to send the spool? (pdf, text, abap list, rtf, html, ...)

What kind of spool is it, abap list, otf (sapscript, smart form), or something else?

Read only

0 Likes
796

Hello Sandra,

We are trying to send the mail as excel attachement.The spool is generated from abap list. iam using the function module RSPO_RETURN_SPOOLJOB for converting the spool.iam able to send the mail as attachment in excel but junk values are appearing.

Soumya: Here are have mutiliple reports are run in background based on user . We have maintained Ztable for this .Thus picking the spool for the corresponding user.

Edited by: A kumar on Oct 8, 2009 7:36 AM

Read only

0 Likes
796

RSPO_RETURN_SPOOLJOB does not convert the spool, it just reads it.

Could you tell us if you can open the file using notepad?

If yes, then I think you have to convert the text of the spool into UTF-16LE and add the BOM (byte order mark).

Edited by: Sandra Rossi on Oct 8, 2009 4:56 PM

Read only

0 Likes
796

Hello Sandra,

iam able to open the file . iam getting the values in a single cell of the excel and data is concatenated with #.Problem is with the data in the internal table that is returned from the function module .

i dont have a clue regarding this -- then I think you have to convert the text of the spool into UTF-16LE and add the BOM (byte order mark).

Read only

0 Likes
796

Could you give examples, I understand nothing.

About UTF-16LE and BOM. Just search SDN:

- Blog from Thomas Jung "BSP Download to Excel in Unicode Format"

- Note Number: 1151258 "Error when sending Excel attachments" (recent class to help converting)

Read only

0 Likes
796

Hello Sandra,

This is how my data is been displayed in excel

4100000001|1000|1000|304|04/05/1999|00010|ACETAMIDE |3000081 |1000| 6,000 |KG |KG | 58.00| 4100000002|1000|1000|304|04/05/1999|00010|AMMONIA GAS |3000084 |1000| 12,000 |KG |KG | 17.20| 4100000003|1000|1000|304|04/05/1999|00010|LIQUID NITROGEN |3000216 |1000| 140,000 |L |L | 5.05| 4100000004|1000|1000|304|04/05/1999|00010|HYDROGEN PEROXIDE 50 % |3000203 |1000| 10,000 |KG |KG | 10.05|

This is coming in single cell of the excel.

Read only

0 Likes
796

So, it's not a problem of UTF-16LE / BOM

Could you try by replacing | by comma (or semicolon in some countries)

Read only

Former Member
0 Likes
796

please clarify as sandra asked..

by the way,

if it is a custom development and you only want the email functionality.. then why to go for spool even?

check if sy-batch = 'X'.

use

SO_NEW_DOCUMENT_ATT_SEND_API1

and directly pass the final internal table that you are using in output. no need to go for display, then get the spool.. and then retrieve etc.

but as i have already said , depends upon the requirement.. if its your requirement is for both spool and email then please clarify as sandra asked.

Read only

Former Member
0 Likes
796

use function module "convert_otf_2_pdf" and convert the spool request to otf file and use the function module for sending E-Mail