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

PDF file into application server

Former Member
0 Likes
540

Hi all,

How to upload a PDF file into an application server.

Urgent pls help.

rgds

Sarvana

2 REPLIES 2
Read only

Former Member
0 Likes
495

Hello,

1. CG3Z

2. U can use the above tcode to upload file

on application server.

3. If u want to write your own z program,

then u can use

GUI_UPLOAD (for uploading from front-end)

OPEN DATASET, TRANSFER , CLOSE DATASET (to write to app server)

REPORT ztest.

DATA: BEGIN OF itab OCCURS 0,

field(256),

END OF itab.

DATA: dsn(100) VALUE '/usr/sap/xfr/FIS/testpdf'.

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

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

filetype = 'BIN'

TABLES

data_tab = itab.

OPEN DATASET dsn FOR OUTPUT IN BINARY MODE.

LOOP AT itab.

TRANSFER itab-field TO dsn.

ENDLOOP

**********Reward points ,if found useful

Edited by: BVS on Mar 24, 2008 1:42 PM

Read only

Former Member
0 Likes
495

hi use this...,

REPORT ZMN_PDF_UPLOAD.

data: begin of itab occurs 0,

field(256),

end of itab.

data: dsn(100) value '\usr\sap\DEV\DVEBMGS00\work\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.

regards,

venkat.