Application Development and Automation 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: 
Read only

FUNCTION MODULE

Former Member
0 Likes
696

HI,

pls tell me which function module is used in program to upload PDF file . *it very urgent.......................*

pls help me .......................

thanks

sudarsan

6 REPLIES 6
Read only

Former Member
0 Likes
650

Hi,

report ztest.

data: begin of itab occurs 0,

field(256),

end of itab.

data: dsn(100) value '/usr/sap/xfr/FIS/testpdf',

length like sy-tabix,

lengthn like sy-tabix.

call function 'GUI_UPLOAD'

exporting

filename = 'c:\temp\test.pdf'

filetype = 'BIN'

importing

filelength = length

tables

data_tab = itab.

open dataset dsn for output in binary mode.

loop at itab.

transfer itab-field to dsn.

endloop.

close dataset dsn.

clear itab.

refresh itab.

To crosscheck if it went well

open dataset dsn for input in binary mode.

do.

read dataset dsn into itab-field.

if sy-subrc = 0.

append itab.

else.

exit.

endif.

enddo.

call function 'GUI_DOWNLOAD'

exporting

filename = 'c:\temp\testn.pdf'

filetype = 'BIN'

bin_filesize = length

importing

filelength = lengthn

tables

data_tab = itab.

*****************************************

Or

Use the TCode

CG3Z or CG3Y

for downloading to Application Server.

[;

Pls. reward if useful...

Read only

Former Member
0 Likes
650

Hello,

try these FMs

ECP_PDF

ECP_PDF_DISPLAY

HR_IT_DISPLAY_WITH_PDF

ISH_DALE_PDF_DISPLAY

QC07_BATCH_CERT_DISPLAY_PDF

SCWB_NOTE_DISPLAY_PDF

SCWB_NOTE_DISPLAY_TPDF

Reward if helpful.

Regards,

pankaj

Read only

Former Member
0 Likes
650

Hi,

Use the following FM :

GUI_UPLOAD

Sample Code :

call function 'GUI_UPLOAD'

exporting

filename = 'c:\temp\test.pdf'

filetype = 'BIN'

importing

filelength = length

tables

data_tab = itab.

Regards,

Raghu

Read only

Former Member
0 Likes
650

Hi Sudarshan,

It depends on what do you want to do with the PDF uploaded.

if you just want to store it in SAP and view it later using PDF viewer then you can do that.

use GUI_UPLOAD with file type as BIN

this will upload the PDF and you can store the binary content in a custom table.

the data is in binary format. after uploading just download it again using gui_download with BIN option to desktop with extention.pdf .

Try out this...

GUI_UPLOAD

GUI_EXEC

GUI_RUN

Pls have a look on below threads...

Hope it will solve your problem

Reward points if useful...

Thanks & Regards

ilesh 24x7

Read only

venkat_o
Active Contributor
0 Likes
650

Hi,

Click on the link below and check it out. it might be useful.

[Upload Files into SAP Office|http://www.jt77.com/development1/programming-27038.html]

Thanks,

Venkat.O

Read only

Former Member
0 Likes
650

Hi,

you can use the function module for uploading

GUI_UPLOAD

and for downloading it in to the presentation server

use the function module GUI_DOWNLOAD.

Regards,

vineela