‎2008 Mar 24 12:37 PM
Hi all,
How to upload a PDF file into an application server.
Urgent pls help.
rgds
Sarvana
‎2008 Mar 24 12:40 PM
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
‎2008 Mar 24 12:43 PM
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.