Function module to fetch pdf file from App. Server and print/email?

Hi all,
Is there any function module to fetch a PDF file from APPLICATION SERVER and print the PDF file or send it as an attachment in an email?
Please help..
Thanks in advance.
Sandeep.

Hi Sandeep,
Is there any function module to fetch a PDF file from APPLICATION SERVER
1) As far as i know there are no FMs to read a file from App server, you can do the same using *OPEN/READ/CLOSE dataset ABAP statements - There are tons of examples for this on the net.
and print the PDF file or send it as an attachment in an email?
You can send the file read from the app server(by the suggested method above) and use CL_BCS to send it as an attachment.
Again there are many examples on the net on how to use CL_BCS for the same.
Regards,
Chen

Similar Messages

  • Download PDF file from APP server!

    Hi!
    Has anyone tried uplaoding and downloding a PDF table from app server as I tried from a normal method by Open dataset, Transfer but it wont work.
    Please provide any inputs.
    Thanks.

    Hi park,
    1. Using open data set, transfer , close etc,
       also it will work.
       ( it will download / upload any kind of file from app server)
    2. Just make sure the
       FULL PATHNAME and the FILENAME
       are mentioned in EXACT CASE
      (small/CAPITAL).
    3. U can check thru transaction AL11, to see the file and path.
    regards,
    amit m.

  • Convertion pdf file from App. server to Pre.server

    Hi,
      I have file pdf file in application server. i want to convert this PDF file into presention server.
    plese send simple progrme.
    Thank&
    Regards,
    Madhu

    Also try
    FYI
    REPORT ztrans01 .
    *Parameters(files)
    PARAMETERS: ux_dir TYPE epsf-epsdirnam OBLIGATORY
                DEFAULT '/usr/sap/trans',
                filename TYPE epsf-epsfilnam OBLIGATORY DEFAULT 'test1',
                pc_dir TYPE rlgrap-filename OBLIGATORY
                DEFAULT 'c:\tmp'.
    *DATA(Strings)
    DATA itab TYPE TABLE OF string.
    DATA wa TYPE string.
    DATA file TYPE string.
    DATA size TYPE epsf-epsfilsiz.
    DATA ux_file TYPE epsf-epspath.
    DATA mode TYPE epsf-epstxtmod.
    *start-of-selection
    START-OF-SELECTION.
    *1) transfer
      CONCATENATE ux_dir '/' filename INTO ux_file.
      OPEN DATASET ux_file FOR INPUT IN TEXT MODE.
      IF sy-subrc <> 0.
        MESSAGE i502(me) WITH ux_file.
      ENDIF.
      DO.
        READ DATASET ux_file INTO wa.
        IF sy-subrc <> 0. EXIT . ENDIF.
        APPEND wa TO itab.
      ENDDO.
      CLOSE DATASET ux_file.
    *2)download
      CONCATENATE  pc_dir  '\' filename  INTO file.
      CALL FUNCTION 'GUI_DOWNLOAD'
           EXPORTING
                filename = file
           TABLES
                data_tab = itab.
    OR
    *&      Form  f1104_download_to_lofile
          Download to data from internal table to Logical File/application server
    FORM f1104_download_to_lofile.
    Open the file in application server
      OPEN DATASET v_filepht FOR OUTPUT IN TEXT MODE.
      IF sy-subrc <> 0.
        MESSAGE s185 WITH v_filepht.          
        LEAVE LIST-PROCESSING.
      ENDIF.
      LOOP AT i_logfile INTO w_logfile.
        TRANSFER w_logfile TO v_filepht.
        CLEAR w_logfile.
      ENDLOOP.
      IF sy-subrc = 0.
        WRITE:/ text-055, v_filepht, text-056.
      ELSE.
        WRITE:/ text-057, v_filepht.     
      ENDIF.
    Closing the file
      CLOSE DATASET v_filepht.
    and also check link
    http://sap.ittoolbox.com/code/archives.asp?d=2285&a=s
    Hope this’ll give you idea!!
    <b>P.S award the points.</b>
    Good luck
    Thanks
    Saquib Khan
    "Some are wise and some are otherwise"

  • Print PDF file from app.server

    Hello,
    I need to print a PDF file from the application server without any dialog for the user.
    Is it possible? and if so- how?
    Is it also possible to do the same with office file (DOC,XLS)?
    Thanks
    Moshe

    Hi,
    CV150_RPINT_DOC for frontend execution.
    FM SAP_PDF_VIEWER_DEMO- foreground only.
    using fm SXPG_COMMAND_EXECUTE in background.
    thanks & regards.

  • Function module to read xml files from application server

    Hi experts,
            I need to read  xml files from application server to sap. Is the any siutable function moldule for that?

    Hi Cenosure,
    Donno about FM which will upload data directly to SAP, I think you have to do some mapping for it so that it will suit the SAP format. Again it depends on your requirement..
    Please elaborate more about your requirement.
    Please have a look on below FM
    TEXT_CONVERT_XML_TO_SAP
    Also search on SCN there are many threads on the same topic available.
    http://abapreports.blogspot.com/2008/09/upload-xml-file-from-application-server.html
    This is the link which will give you the Code
    http://www.geocities.com/rmtiwari/Resources/MySolutions/Dev/Codes/Report/Z_RMTIWARI_XML_TO_ABAP_46C.html
    Use this XML file to Upload the same, this Program will work for your XML file also,
    http://www.geocities.com/rmtiwari/Resources/MySolutions/Dev/Codes/Report/input_xml.xml
    See the below thread also
    Upload XML to internal table and vice versa in SAP 4.6C
    Hope it will solve your problem..
    Thanks & Regards
    ilesh 24x7
    ilesh Nandaniya

  • Fetch excel file from app. server using open dataset...

    Hello Experts,
    Our functional consultant is asking me if it possible to get an excel file from the
    application server file using OPEN dataset and in background mode? If yes, Please tell me on how to do this.
    Thank you guys and take care!

    Hi Viraylab,
    to download this the procedure:
    you can use the FM 'EXCEL_OLE_STANDARD_DAT ' for this purpose.
    this FM 'EXCEL_OLE_STANDARD_DAT' can be used to start Excel with a new sheet and transfer data from an internal table to the sheet.
    Here are some of the parameters:
    file_name: Name and path of the Excel worksheet file e.g. ?C:TEMPZTEST?
    data_tab: Name of the internal table that should be uploaded to Exvcel
    fieldnames: Internal tabel with column headers
    How to build the field names table:
    data: begin of i_fieldnames occurs 20,
    field(60), end of i_fieldnames.
    i_fieldnames-field = ?This is column 1?. append i_fieldnames-field.
    i_fieldnames-field = ?This is column 2?. append i_fieldnames-field.
    to upload follow this:
    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.
    [/code]Rob
    or Try this function module.
    FILE_READ_AND_CONVERT_SAP_DATA
    pass 'XLS' to I_FILEFORMAT..
    Dont forgot to Reward me points .....All the very best....
    Regards,
    Sreenivasa sarma K.

  • HowTo read file from app. server and store it in binary format (SDOKCNTBIN)

    Hi
    I need to upload Documents to Document Repository by using to function module RSOD_DOC_MAST_CHANGE.
    My question is: How can I fill the "parameter" i_t_file_content_binary from a file which is stored on an application server.
    br, michael

    Hi
    I need to upload Documents to Document Repository by using to function module RSOD_DOC_MAST_CHANGE.
    My question is: How can I fill the "parameter" i_t_file_content_binary from a file which is stored on an application server.
    br, michael

  • How to get text file from app server and process it.

    Hello experts,
    I created a test data based form my recording. Now, I do not know where can I find it.
    Also, I want to create a program that lets users input the file name in the input parameter
    (selection screen) and it would automatically process/split that file. Again, thank you guys
    and take care!

    hi viray,
    im sorry i thought it was reading from presentation server....:-)
    >>I want to create a program that lets users input the file name in the input parameter
    (selection screen)
    at selection-screen on value-request for p_file.
    perform file_help using p_file.
    form file_help  using  p_p_file.
    call function 'RZL_READ_DIR_LOCAL'
    exporting
    name = p_dir
    tables
    file_tbl = t_filetab
    EXCEPTIONS
    ARGUMENT_ERROR = 1
    NOT_FOUND = 2
    OTHERS = 3
    if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    endform.                    " file_help
    Splitting File and path.
    use the FM <b>SO_SPLIT_FILE_AND_PATH</b>
    hope this helps,
    do reward if it helps,
    priya.
    Message was edited by: Priya

  • Generate .PDF file from Oracle Form and print .pdf

    Hello, I am new to oracle form. I need direction on how to create .pdf file on a button click.
    The requirement is when user click a button on a form, I need to write some data to the pdf file and open the .pdf file for print.
    I am using Oracle Form builder 10.1.2.0.2
    Thanks a lot! Please help!

    Dear all,am new to oracle report and oracle forms and i know the
    basics how to generate the report and to create the form, Now my doubt is, like generating report
    from oracle report how to generate the report from oracle from,should i add any command button? and where
    to add the coding and what coding ? when i click that command button the report should be generated like oracle
    report,what should i do?Please help me to learn.
    my table name is 'student' and it has the following columns,
    sid,sname,grade,result.
    Am using oracle from 10.1.2.0.2 version and
    oracle report version is 10.1.2.0.2.
    Please give step by step procss.
    Thank you.

  • Create a PDF file from swing component and print

    Hi,
    Suppose i have a JFrame where in i add a JScrollpane which has a JPanel with some painting on it, suppose i want to create a pdf file of the total JPanel, and not of what i see on screen like taking a screen shot, or print the total JPanel, and not only the screen that is displayed
    how can i do it
    I am attaching the code below, how can i create a pdf for MyPanel and print it
    //start code
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class TestDisplaySize extends JFrame
         JScrollPane scrollPane ;
         public TestDisplaySize()
              super("layered pane");
              this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
              MyPanel panel = new MyPanel();
              scrollPane = new JScrollPane(panel);
              Container contentPane = this.getContentPane();
              contentPane.add(scrollPane, BorderLayout.CENTER);
              setSize(new Dimension(800,600));
              this.setVisible(true);
              JViewport viewPort = scrollPane.getViewport();
         class MyPanel extends JPanel
              public MyPanel()
         setPreferredSize(new Dimension(2000,600) );     
         this.setBackground(Color.white);
         this.setOpaque(true);
         public void paintComponent(Graphics g)
    super.paintComponent(g);
    setBackground(Color.white);
    Rectangle r = scrollPane.getViewport().getViewRect();
    g.setClip((Shape)r);
    g.setColor(Color.blue);
    int x = 0;
    for(int i = 0; i < 60; i++)
         x +=60;
         g.drawLine(x, 0, x, 600);
         g.drawString(String.valueOf(i), x, 50);
         public static void main(String args[])
         new TestDisplaySize();
    //end code

    create a class wich implements printable, redefine the print method of this class with the this you want to print
    and at the end of the constructor...
    PrinterJob printJob = PrinterJob.getPrinterJob();
    PageFormat myFormat = new PageFormat();
    myFormat.setOrientation(PageFormat.LANDSCAPE);
    myFormat.setPaper(ps.getMyPaper());
    printJob.setPrintable(this, myFormat);
    if (printJob.printDialog()) {
    try {
    printJob.print();
    } catch (Exception pe) {
    System.out.println(pe);

  • Is there any  function module to download pdf file

    is there any  function module to download pdf file
    WITH OUT GUI_DOWNLOAD FUNCTION MODULE.
    THANKS IN ADVANCED.

    Dear Laxman,
    Tryout the following Function Modules:
    (1)  CONVERT_ABAPSPOOLJOB_2_PDF --> convert abap spool output to PDF
    (2)  CONVERT_OTF --> Convert SAP documents (SAPScript) to other types.
    Example:
    CALL FUNCTION "CONVERT_OTF"
           EXPORTING    FORMAT                = "PDF"
           IMPORTING    BIN_FILESIZE          = FILE_LEN
           TABLES       OTF                   = OTFDATA
                        LINES                 = PDFDATA
           EXCEPTIONS   ERR_MAX_LINEWIDTH     = 1                  
                        ERR_FORMAT            = 2
                        ERR_CONV_NOT_POSSIBLE = 3
                        OTHERS                = 4.
    Regards,
    Abir
    Don't forget to award Points *

  • Transfer a file from App Server to a FTP site.

    Hi, Abapers.
    I need your help. Probably, this topic has already been posted in a similar way, but we need an answer to solve our problem.
    We have to sent a PDF file from a directory of our app server (AIX) to a FTP directory... which would the FM sequence we should use to goal it?
    Best Regards.

    Hi Santiago,
    create fm to send file from APP server to FTP site.
    if you want to Post file from desktop to Appl use Transaction - CG3Y
    if you want to Post file from Appl to Desktop use Transaction - CG3Z
    copy the code below....
    *  Author: Prabhudas                            Date:  02/21/2006  *
    *  Name: Z_FTP_FILE_TO_SERVER                                          *
    *  Title: FTP File on R/3 Application Server to External Server        *
    *"*"Local Interface:
    *"  IMPORTING
    *"     REFERENCE(DEST_HOST) TYPE  C
    *"     REFERENCE(DEST_USER) TYPE  C
    *"     REFERENCE(DEST_PASSWORD) TYPE  C
    *"     REFERENCE(DEST_PATH) TYPE  C
    *"     REFERENCE(SOURCE_PATH) TYPE  C
    *"     REFERENCE(FILE) TYPE  C
    *"     REFERENCE(BINARY) TYPE  CHAR1 OPTIONAL
    *"     REFERENCE(REMOVE_FILE) TYPE  CHAR1 OPTIONAL
    *"  TABLES
    *"      FTP_SESSION STRUCTURE  ZMSG_TEXT OPTIONAL
    *"  EXCEPTIONS
    *"      CANNOT_CONNECT
    *"      SOURCE_PATH_UNKNOWN
    *"      DEST_PATH_UNKNOWN
    *"      TRANSFER_FAILED
    *"      COMMAND_FAILED
      DATA: w_password     TYPE zftppassword,
            w_length       TYPE i,
            w_key          TYPE i                  VALUE 26101957,
            w_handle       TYPE i,
            w_command(500) TYPE c.
      REFRESH ftp_session.
    * Scramble password (new Unicode-compliant routine)
      w_length = STRLEN( dest_password ).
      CALL FUNCTION 'HTTP_SCRAMBLE'
        EXPORTING
          SOURCE      = dest_password
          sourcelen   = w_length
          key         = w_key
        IMPORTING
          destination = w_password.
    * Connect to FTP destination (DEST_HOST)
      CALL FUNCTION 'FTP_CONNECT'
        EXPORTING
          user            = dest_user
          password        = w_password
          host            = dest_host
          rfc_destination = 'SAPFTPA'
        IMPORTING
          handle          = w_handle
        EXCEPTIONS
          not_connected   = 1
          OTHERS          = 2.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
          WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
          RAISING cannot_connect.
      ENDIF.
    * Optionally, specify binary file transfer
      IF binary = 'X'.
        w_command = 'bin'.
        CALL FUNCTION 'FTP_COMMAND'
          EXPORTING
            handle        = w_handle
            command       = w_command
          TABLES
            data          = ftp_session
          EXCEPTIONS
            command_error = 1
            tcpip_error   = 2.
        IF sy-subrc <> 0.
          CONCATENATE 'FTP command failed:' w_command
            INTO w_command SEPARATED BY space.
          MESSAGE ID 'ZW' TYPE 'E' NUMBER '042'
              WITH w_command
              RAISING command_failed.
        ENDIF.
      ENDIF.
    * Navigate to source directory
      CONCATENATE 'lcd' source_path INTO w_command SEPARATED BY space.
      CALL FUNCTION 'FTP_COMMAND'
        EXPORTING
          handle        = w_handle
          command       = w_command
        TABLES
          data          = ftp_session
        EXCEPTIONS
          command_error = 1
          tcpip_error   = 2.
      IF sy-subrc <> 0.
        CONCATENATE 'FTP command failed:' w_command
          INTO w_command SEPARATED BY space.
        MESSAGE ID 'ZW' TYPE 'E' NUMBER '042'
            WITH w_command
            RAISING source_path_unknown.
      ENDIF.
    * Navigate to destination directory
      CONCATENATE 'cd' dest_path INTO w_command SEPARATED BY space.
      CALL FUNCTION 'FTP_COMMAND'
        EXPORTING
          handle        = w_handle
          command       = w_command
        TABLES
          data          = ftp_session
        EXCEPTIONS
          command_error = 1
          tcpip_error   = 2.
      IF sy-subrc <> 0.
        CONCATENATE 'FTP command failed:' w_command
          INTO w_command SEPARATED BY space.
        MESSAGE ID 'ZW' TYPE 'E' NUMBER '042'
            WITH w_command
            RAISING dest_path_unknown.
      ENDIF.
    * Transfer file
      CONCATENATE 'put' file INTO w_command SEPARATED BY space.
      CALL FUNCTION 'FTP_COMMAND'
        EXPORTING
          handle        = w_handle
          command       = w_command
        TABLES
          data          = ftp_session
        EXCEPTIONS
          command_error = 1
          tcpip_error   = 2.
      IF sy-subrc <> 0.
        CONCATENATE 'FTP command failed:' w_command
          INTO w_command SEPARATED BY space.
        MESSAGE ID 'ZW' TYPE 'E' NUMBER '042'
            WITH w_command
            RAISING transfer_failed.
      ENDIF.
    * Disconnect from destination host
      CALL FUNCTION 'FTP_DISCONNECT'
        EXPORTING
          handle = w_handle.
    * Optionally, remove file from source directory
      IF remove_file = 'X'.
       CONCATENATE source_path '/' file INTO w_command.
      CONCATENATE 'rm' w_command INTO w_command SEPARATED BY space.
       OPEN DATASET '/dev/null' FOR OUTPUT FILTER w_command.
       CLOSE DATASET '/dev/null'.
    ENDIF.
    Regards,
    Prabhudas

  • System exception while deleting the file from app server in background job

    Hi All,
    I have a issue while the deleting the file from application server.
    I am using the statement DELETE DATASET in my program to delete the file from app server.
    I am able to delete the file from the app server when i run the program from app server.
    When i run the same report from background job i am getting the message called System exception.
    Is there any secuirity which i need to get the issue.
    Thank You,
    Taragini

    Hi All,
    I get all the authorization sto delete the file from application serever.
    Thing is i am able to run the program sucessfully in foreground but not in the background .
    It i snot giving any short dump also just JOB is cancelled with the exception 'Job cancelled after system exception ERROR_MESSAGE'.
    Can anybody please give me suggestion
    Thanks,
    Taragini

  • Problem in downloading file from app server using CG3Y in to .XLS fomat

    hi All,
    I have uploaded file in to application server through a program using open data set with the separater as "|" ( pipe ) . Now the user should be able to download the file from apps server to presenataion server in .XLS format using txn CG3Y. but when we download, the format appears wierd and the data is not consistent across columns in excel. i.e the data which is supposed to be in one column in the excel is in the other column. what precautaions should i take  before moving data to apps server so that it will be downloaded in a good format.
    Appreciate your help...
    Regards,
    Sreekanth.

    Separate each values with TAB space present in the application server .
    Currently u r using | pipe character. Instead of that use CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB as delimiter.
    Each value will displayed in separate cells in excel sheet when u download it frm app.server
    Regards,
    Lakshman.

  • How to download a pdf file from the server from an strut application?

    Hi,
    I wan to download a pdf file from the server side to local system. Please help me how i use the down load option.

    Read up on the Struts download action [1].
    And next time, please post in the relevant forum, one of the web-tier ones [2].
    [1] http://wiki.apache.org/struts/StrutsFileDownload
    [2] http://forum.java.sun.com/category.jspa?categoryID=20
    People on the forum help others voluntarily, it's not their job.
    Help them help you.
    Learn how to ask questions first: http://faq.javaranch.com/java/HowToAskQuestionsOnJavaRanch
    ----------------------------------------------------------------

Maybe you are looking for

  • Creating a database link to SQL server

    Hi All, How can I create a database link from Oracle9i Enterprise Edition Release 9.2.0.1.0 DB to MS SQL Server database. Thanking You Regards Lakmal

  • Itunes cannot be updated because it has an invalid signature

    I am trying to update my itunes as well as my icloud on my computer. When I update them, I get an error message that tells me it cannot be updated because of an invalid signature. Since I cannot update either of them, I cannot do the new iso8 update

  • How To Get iWork Apps Free on iPad 4 Purchased in June 2013?

    Since I've got my new 13" MBPr in June 2014, the iWork apps are apparently preinstalled, my question is, can I get the iWork apps free on my iPad 4 purchased in June 2013? On Apple Store on my iPad 4, the iWork apps show a price tag of $9.99 each. An

  • Merging of Prodn Order number and operation number into the unloading point

    Hi, I am creating the production order using the Tcodes Co01 or co10 and my requirement is that after creating the production number and then when I open that one in the change mode using co02 Tcode the unloading point which is present in the Goods R

  • How do I script a 3-up master

    Hi, Hope you can help. I am trying to create a three page masterSpread in indesign cs3. To do this I have used the masterSpreads.jsx script provided by Adobe and then simply added another page, which seems logical to me, but it does not work. If I cr