‎2009 May 13 12:58 PM
Hi Experts,
We are going to send the PDF format of Purchase Orders to other Non-SAP System through RFC Function Module.
Please suggest, is there any RFC function module to send PDF file as the attachment.
Or is there any other way to send the PDF files on regular basis from SAP to Non-SAP system.
Regards,
Nrusingha
‎2009 May 13 1:56 PM
These are the FM for sending external email :-
SO_DOCUMENT_SEND_API1
SAPoffice: Send new document with attachments via RFC
SO_NEW_DOCUMENT_ATT_SEND_API1
(In 4.6C only, You can go to SE37 and click the documentation on how to use it. A sample program is provided there.)
SAPoffice: Send new document with attachments via RFC
Note : If you are using FM SO_NEW_DOCUMENT_ATT_SEND_API1 then Export Parameter DOCUMENT_DATA-OBJ_DESCR contains the Subject.
SO_NEW_DOCUMENT_SEND_API1
SAPoffice: Send new document
‎2009 May 13 7:43 PM
Hi ,
follwo the belwo steps..
* Work Area for Print Parameters
Data : wa_pri_params TYPE pri_params,
* Work Area for Converted PDF file
Data : wa_pdf TYPE tline,
if t_ouputdata[] is not initial.
* WAIT UP TO 1 SECONDS.
CONCATENATE 'E'
w_tabix
sy-datum+4(4)
sy-uzeit INTO
wa_pri_params-plist.
ENDIF.
NEW-PAGE PRINT ON NO DIALOG PARAMETERS wa_pri_params. "creating spool request
WRITE : / text-s32.
ULINE.
LOOP AT t_error INTO wa_error.
WRITE : / wa_error-text.
ENDLOOP.
WRITE : / text-s33.
NEW-PAGE PRINT OFF. "closing spool request
* To fetch the spool number from TSP01 table
SELECT rqident
FROM tsp01
INTO w_rqident
UP TO 1 ROWS
WHERE rq2name = wa_pri_params-plist.
ENDSELECT.
* Subroutine to convert ABAP spool to PDF file
PERFORM abapspoll_to_pdf.
* Now t_pdf table contains the PDF data...
" now call the function module in backgrond task destination and push the PDF format dat to external system...
FORM abapspoll_to_pdf.
* Function Module to Convert Spool to PDF file
CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = w_rqident
no_dialog = 'X'
dst_device = 'LP01'
pdf_destination = 'X'
TABLES
pdf = t_pdf.
CLEAR wa_mail_receivers.
ENDFORM. " ABAPSPOLL_TO_PDF
Regards,
Prabhudas