I'm implementing my function to send Sapscript/smartform via mail.
I need to do it because when a message needs to be sent, I have to insert the message as attachment but also to add a text in the body mail.
So I've just created a simple sapscript having a logo (as graphic) and a little text.
I use the fm CONVERT_OTF to convert the OTF to PDF format and the following code to increase the pdf string from 132 to 255 char:
LOOP AT t_pdf. TRANSLATE t_pdf USING ' ~'. CONCATENATE l_buffer t_pdf INTO l_buffer. ENDLOOP. TRANSLATE l_buffer USING '~ '. DO. MOVE l_buffer TO l_attachment. APPEND l_attachment TO x_attachment. SHIFT l_buffer LEFT BY 255 PLACES. IF l_buffer IS INITIAL. EXIT. ENDIF. ENDDO.
All seem to work fine, but as soon as I open the pdf file attached to the mail I can't see the logo
So after calling fm CONVERT_OTF, I've created a pdf file by method GUI_DOWNLOAD, and then upload this file (by GUI_UPLOAD) into internal table for attachment and send the mail.
Now really all work very fine, becaus I can see the logo
Of course I don't want to dowload the file before sending a mail, but I need to send my print directly as pdf attachment
The two ways seem to be equal, they use the same print and the same functions, only the way to upload the internal table for attachment is different:
1) tha abap code above to expand the line from 132 to 255
2) the method GUI_UPLOAD
So something seems to be wrong in the first way because ithe logo is missing in the pdf attachment generated for the mail