Skip to Content
author's profile photo Former Member
Former Member

GUI_DOWNLOAD

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

6 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jun 21, 2006 at 08:55 AM

    Hi,

    Have a look in this thread..

    pdf-file-download-to-application-server

    Rgds,

    prakash

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 21, 2006 at 08: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>

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 21, 2006 at 08: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:

    download-pdf-file-to-sap-application-server

    Rgds,

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 21, 2006 at 08: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.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 21, 2006 at 08: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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 21, 2006 at 08: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.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.