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: 

GUI_DOWNLOAD

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Have a look in this thread..

Rgds,

prakash

7 REPLIES 7

Former Member
0 Kudos

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.

former_member927251
Active Contributor
0 Kudos

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>

0 Kudos

<b>same thread..</b>

former_member208581
Participant
0 Kudos

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

Former Member
0 Kudos

Hi,

Have a look in this thread..

Rgds,

prakash

Former Member
0 Kudos

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.

Former Member
0 Kudos

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,