Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 8392

CONVERT SAP SCRIPT TO PDF AND SEND MAIL

$
0
0

Hi,

 

I got the requirement to convert a SAP Script to PDF and a Mail to SOST.

 

But for me Mail is going to SOST, And the PDF options came . But when i click On PDF i couldn't open the Form. Its shows some Error.

 

 

  CALL FUNCTION 'CLOSE_FORM'
IMPORTING
RESULT 
= RESULT
tables
otfdata
= lt_otf
EXCEPTIONS
OTHERS  = 1.

************************************************************************************
** Convert the OTF File Obtained in a PDF File
************************************************************************************
data: lv_binstr type XSTRING.

CALL FUNCTION 'CONVERT_OTF'
EXPORTING
FORMAT                      = 'PDF'
MAX_LINEWIDTH              
= 132
PDF_DELETE_OTFTAB          
= ' '
IMPORTING
bin_filesize               
= lv_file_size
bin_file                   
= lv_binstr
TABLES
otf                        
= lt_otf
lines                                                 = lt_pdf
.

************************************************************************************
** Convert the Xstring To BINARY
************************************************************************************
CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
EXPORTING
buffer     = lv_binstr
TABLES
binary_tab
= lt_binary_tab.




CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data                   
= ls_gd_doc_data
PUT_IN_OUTBOX                   
= 'X'
COMMIT_WORK                     
= 'X'
tables
packing_list                    
= lt_packing_list
OBJECT_HEADER                   
= lt_mail_head
CONTENTS_BIN                    
= lt_mail_bin
CONTENTS_TXT                    
= lt_mailtext
contents_hex                    
= lt_binary_tab
receivers                       
= lt_receivers
EXCEPTIONS
TOO_MANY_RECEIVERS              
= 1
DOCUMENT_NOT_SENT               
= 2
DOCUMENT_TYPE_NOT_EXIST         
= 3
OPERATION_NO_AUTHORIZATION      
= 4
PARAMETER_ERROR                 
= 5
X_ERROR                         
= 6
ENQUEUE_ERROR                   
= 7
OTHERS                           = 8
.
ENDFORM.                    " ZSEND_MAIL

 

 

 

 

 

 

Regards,

Sadiq K


Viewing all articles
Browse latest Browse all 8392

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>