Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Need to upload PDF files

Former Member
0 Kudos

Hi All,

I have a requirement

There are some PDF files which are to be send along with the goods sent to the customer, As these PDF documents are on Non sap system .

Requirment :

SAP need to trigger an interface toan external system and pull this pdf files into SAP and send a mail from SAP attaching these documents

How do i store these PDF files in SAP

How do i attach these files as attachement in the workflow. ( pdf format).

Can any one help me to resolve this issue,

thanks

Reddy

4 REPLIES 4

Former Member
0 Kudos

Hi,

what about uploading it binary (ftp connection or from application server) and then sending it using class cl_bcs?

Best regards,

Oliver

0 Kudos

Hi ,

Thanks for the input,

But the issues it a PDF file which are impported from another system may have upto 24 pages and has a details instruction about the safety measures to be taken with material .

Thanks

Reddy

Former Member
0 Kudos

Hi Reddy,

Step1. Import Other System PDF files to SAP server Files using FTP. ( Ref Program RSFTP002)

* Connect to FTP (xxx) using CALL FUNCTION 'HTTP_SCRAMBLE' then CALL FUNCTION 'FTP_CONNECT'

PERFORM FTP_CONNECT USING P_FTPUSR P_FTPPWD P_FTPHST P_RDEST.

* Establish local directory(SAP) using CALL FUNCTION 'FTP_COMMAND'.

CONCATENATE 'lcd' P_LCLDIR INTO LF_COMMAND SEPARATED BY SPACE.

* Establish remote directory(DHL) using CALL FUNCTION 'FTP_COMMAND'.

CONCATENATE 'cd' P_RMTDIR  INTO LF_COMMAND SEPARATED BY SPACE.

* Get file from remote system(xxx) to local system (SAP) using CALL FUNCTION 'FTP_COMMAND'.

CONCATENATE 'get' WF_UXFILE  INTO LF_COMMAND SEPARATED BY SPACE.

* DisConnect FTP using CALL FUNCTION 'FTP_DISCONNECT'.

PERFORM FTP_DISCONNECT.

Step2. Then Attach the file to workflow.

Please let me if need any.

former_member186052
Active Participant
0 Kudos

Hi,

use GUI_UPLOAD Function module to pickup the PDF file by giving the file path in "filename" field of the GUI_UPLOAD and file type as 'BIN'. and store all the data coming in "data_tab" that data_tab should be of type standard table of solix.

Then use function module 'CONVERT_OTF' here give format as 'PDF' and capture the bin_filesize, bin_file from importing and also

otf and lines from tables of the function module.

Then you can send the email to the user either using SO_NEW_DOCUMENT_ATT_SEND_API1 Function module

or using cl_document_bcs.

The way to do it using cl_document_bcs is well explained in the standard program BCS_EXAMPLE_6.

Use this!

<< Moderator message - Point begging removed >>

Regards,

-Sandeep

Edited by: Rob Burbank on Nov 9, 2011 1:29 PM