‎2009 Oct 06 10:25 AM
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.
‎2009 Oct 07 9:05 PM
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?
‎2009 Oct 08 6:35 AM
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
‎2009 Oct 08 3:55 PM
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
‎2009 Oct 09 8:03 AM
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).
‎2009 Oct 09 10:10 AM
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)
‎2009 Oct 09 11:03 AM
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.
‎2009 Oct 09 11:26 AM
So, it's not a problem of UTF-16LE / BOM
Could you try by replacing | by comma (or semicolon in some countries)
‎2009 Oct 07 9:26 PM
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.
‎2009 Oct 09 8:13 AM
use function module "convert_otf_2_pdf" and convert the spool request to otf file and use the function module for sending E-Mail