06-21-2006 9:38 AM
How Do Everyone
I am writing a version of the program RSTXPDFT4 which
converts a spool file into a PDF file. The original
program uses the fm GUI_DOWNLOAD to download the file
onto the presentation server. I need the file downloading
onto the application server.
Does anybody know of any problem(s) downloading such a PDF
file onto the application server. Also, which is the best
fm to use for this?
Cheers
Andy
06-21-2006 9:55 AM
06-21-2006 9:45 AM
Hi andy,
1. for downloading to application server,
we have to use OPEN DATASET, TRANSFER, CLOSE DATASET
commands (please see F1 help on this commands)
2. Also we have to open the file in binary mode.
(bcos its a pdf file)
regards,
amit m.
06-21-2006 9:45 AM
Hi Andy,
Refer the following Tcodes and FMs for Application Server and Presentation Server transfers.
TCODE : CG3Y and CG3Z
Function Modules :
ARCHIVFILE_CLIENT_TO_CLIENT
ARCHIVFILE_CLIENT_TO_SERVER
ARCHIVFILE_CLIENT_TO_TABLE
ARCHIVFILE_SERVER_TO_CLIENT
ARCHIVFILE_TABLE_TO_CLIENT
C13Z_FRONT_END_TO_APPL
C13Z_APPL_TO_FRONT_END
<b>Reward points if it helps.</b>
06-21-2006 9:48 AM
06-21-2006 9:48 AM
Hi Andy,
To upload a file from presentation to application server you should use method CL_GUI_FRONTEND_SERVICES=>GUI_UPLOAD. It's a SAP recommendation to use CL_GUI_FRONTEND_SERVICES instead of use the function modules.
There are also a lot of other useful methods.
Regards,
Axel
06-21-2006 9:55 AM
06-21-2006 9:57 AM
Hi Andy,
Jucs check the code.
DATA: BEGIN OF IT_PDF_OUTPUT OCCURS 0.
pdf(256),
DATA: END OF IT_PDF_OUTPUT.
gfile = 'D:\SALEXECUTIVE\MAIL\'.
wa_filename = test.pdf.
concatenate gfile wa_filename into g_file.
open dataset g_file for output in binary mode.
if sy-subrc = 0.
loop at it_pdf_output.
transfer it_pdf_output to g_file.
endloop.
endif.
close dataset.
06-21-2006 9:59 AM
Hi,
Refer to the following code:
Assuming the PDF file resides on the PC:
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:temptest.pdf'
filetype = 'BIN'
TABLES
data_tab = itab.
<b>OPEN DATASET dsn FOR OUTPUT IN BINARY MODE.</b>
LOOP AT itab.
TRANSFER itab-field TO dsn.
ENDLOOP.
To know more you can refer to below thread:
Rgds,