cancel
Showing results for 
Search instead for 
Did you mean: 

Auto Download of ADOBE form to client

Former Member
0 Kudos

Hello,

i need to create a function module for the following scenario:

If one of our sales managers leaves the office to visit a customer he wants to have all the customer information as a PDF on his laptop.

I have created such a pdf form with all the desired information.

And i already created the function module which gives me the filled form for the CRM businesspartner from type:

fpformoutput.

Now in my function module i need to create the PDF from this and download it to C:\temp on the client.

How can this be acchieved? Especially the creation of the PDF - is there a standard FM?

Thank you

Best regards

Manfred

Edited by: ManniF on Jan 14, 2010 8:02 AM

Accepted Solutions (1)

Accepted Solutions (1)

chintan_virani
Active Contributor
0 Kudos

Check this help [here|http://help.sap.com/saphelp_nw2004s/helpdata/en/60/f8123e9c6c498084f9f2bafab32671/frameset.htm].

Chintan

Former Member
0 Kudos

Hello Chintan,

that´s exactly what i already have.

And from the function module for my ADOBE form i´m getting back:

IMPORTING

/1BCDWB/FORMOUTPUT --> This is from type fpformoutput

But what i need now is the next steps:

- Creating a real PDF out of this fpformoutput

- Downloading this PDF to the client on C:/temp

Thank you

Best regards

Manfred

NoJo
Active Participant
0 Kudos

if you have set getpdf -->

* convert
    CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
      EXPORTING
        buffer                = gs_formoutput-pdf
*      APPEND_TO_TABLE       = ' '
    IMPORTING
        output_length         = g_length
      TABLES
        binary_tab            = gt_data
              .

    CALL METHOD cl_gui_frontend_services=>gui_download
      EXPORTING
        bin_filesize              = g_length
        filename                  = g_file
        filetype                  = 'BIN'
      CHANGING
        data_tab                  = gt_data
      EXCEPTIONS
        file_write_error          = 1
        no_batch                  = 2
        gui_refuse_filetransfer   = 3
        invalid_type              = 4
        no_authority              = 5
        unknown_error             = 6
        header_not_allowed        = 7
        separator_not_allowed     = 8
        filesize_not_allowed      = 9
        header_too_long           = 10
        dp_error_create           = 11
        dp_error_send             = 12
        dp_error_write            = 13
        unknown_dp_error          = 14
        access_denied             = 15
        dp_out_of_memory          = 16
        disk_full                 = 17
        dp_timeout                = 18
        file_not_found            = 19
        dataprovider_exception    = 20
        control_flush_error       = 21
        not_supported_by_gui      = 22
        error_no_gui              = 23
        OTHERS                    = 24
            .
    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                 WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ELSE.
* whatever you want
    ENDIF.

Answers (2)

Answers (2)

OttoGold
Active Contributor
0 Kudos

With Norberts help you have the complete solution:)) Otto

OttoGold
Active Contributor
0 Kudos

Hello,

use param GETPDF = 'X', so you´ll get the PDF filled with the binary data of the generated form what you can easily save using something like GUI_DOWNLOAD. But this will open the dialog. I don´t know how to do the silent save.

Regards, Otto