cancel
Showing results for 
Search instead for 
Did you mean: 

Email Attachment

Former Member
0 Kudos

Hello

my problem is that i need to send an attachment with an email in a workflow. now i made a new attribut 'Attachment' in my BO-Object with the reference to the sofm-object. I don't know how i can create a pdf file.

That is the code which i have wrote.


GET_PROPERTY ATTACHMENT CHANGING CONTAINER.
data:  begin of sofmt_key,                                              
       foltp type so_fol_tp,                                            
       folyr type so_fol_yr,                                            
       folno type so_fol_no,                                            
       doctp type so_doc_tp,                                            
       docyr type so_doc_yr,                                            
       docno type so_doc_no,                                            
       fortp type so_for_tp,                                            
       foryr type so_for_yr,                                            
       forno type so_for_no,                                            
       end of sofmt_key.                                                
data:  doc_content type standard table of soli-line with header line.   
DATA: result_object type swc_object.                                    
doc_content = 'test' .                                                  
append doc_content.                                                                                
swc_create_object object-attachment 'Attachment' sofmt_key.             
swc_container attachment_container.                                     
swc_set_element attachment_container 'DOCUMENTTITLE' 'TestTitle'.     
swc_set_element attachment_container 'DOCUMENTLANGU' 'DE'.              
swc_set_element attachment_container 'NO_DIALOG' 'X'.                   
swc_set_element attachment_container 'DOCUMNETNAME' 'TestFile.      
swc_set_element attachment_container 'DOCUMENTTYPE' 'PDF'.              
swc_set_element attachment_container 'DocumentContent' doc_content.     
swc_call_method object-attachment 'Create' attachment_container.        
swc_refresh_object object-attachment.                                                                                
*swc_call_method object-attachment '_result' result_object.             
*swc_get_element object-attachment '_Result' result_object.                                                                                
SWC_SET_ELEMENT CONTAINER 'Attachment' OBJECT-ATTACHMENT.             
END_PROPERTY.

can somebody help me

greets

Accepted Solutions (0)

Answers (2)

Answers (2)

surjith_kumar
Active Contributor
0 Kudos

Hi,

Using this FM SO_NEW_DOCUMENT_ATT_SEND_API1. You can send email with attachment.

Regards,

Surjith

bpawanchand
Active Contributor
0 Kudos

[Check this|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/60ff6ad3-729b-2b10-6582-fedc82680a29]