cancel
Showing results for 
Search instead for 
Did you mean: 

Adobe Forms function module - downloading the xstring output in PDF file

Former Member
0 Kudos

Hi Guys,

I'm using Adobe forms and fetching its output in an XSTRING PDF format. How can I download this XSTRING output to a PDF file and store on the local file system?

I'm using the following approach to getting a PDF output:


ls_outputparams-getpdf = 'X'.
CALL FUNCTION 'FP_JOB_OPEN'
  CHANGING
    ie_outputparams = ls_outputparams.

* Get the name of the generated function module
  CALL FUNCTION 'FP_FUNCTION_MODULE_NAME'
    EXPORTING
      i_name     = 'ZADOBEFORM'
    IMPORTING
      e_funcname = lv_fmname.
  IF sy-subrc <> 0.
  ELSE.
*   Call the Adobe Form function module
    CALL FUNCTION lv_fmname
      EXPORTING
        /1bcdwb/docparams  = ls_docparams
      IMPORTING
        /1bcdwb/formoutput = ls_form_output
      EXCEPTIONS
        usage_error        = 1
        system_error       = 2
        internal_error     = 3.
    IF sy-subrc <> 0.
    ENDIF.
  ENDIF.

* Close the spool job
CALL FUNCTION 'FP_JOB_CLOSE'.

Now, the variable LS_FORM_OUTPUT-PDF contains the PDF output in XSTRING. My question is how can I download this as a PDF file to my local machine.

Kind Regards,

Shailesh.

Accepted Solutions (1)

Accepted Solutions (1)

satyajit_mohapatra
Active Contributor
0 Kudos

Convert the xstring to binary using FM SCMS_XSTRING_TO_BINARY and then call GUI_DOWNLOAD with file format as BIN and your filepath on presentation server.

Answers (1)

Answers (1)

Former Member
0 Kudos

hi guys,

im using all FM to download my PDF adobe but in this part :

ls_spfli-carrid = 'AA'.

ls_spfli-connid = '0017'.

APPEND ls_spfli TO it_spfli.

flag                     = 'X'.

is_address_type          = '1'.

is_address_number        = '22515'.

is_person_number         = '22517'.

is_country               = 'IN'.

*&--- Call the generated function module

CALL FUNCTION '/1BCDWB/SM00000200'

   EXPORTING

*   /1BCDWB/DOCPARAMS        =

     it_spfli                 = it_spfli

     flag                     = flag

     is_address_type          = is_address_type

     is_address_number        = is_address_number

     is_person_number         = is_person_number

     is_country               = is_country

  IMPORTING

    /1bcdwb/formoutput       = fp_formoutput

  EXCEPTIONS

    usage_error              = 1

    system_error             = 2

    internal_error           = 3

    OTHERS                   = 4

I have usage_error knowing that the execution of the function module in SE37 pass successfuly and also the execution of the forms .

in your opinion what can be the problem?

Kind Regards,