cancel
Showing results for 
Search instead for 
Did you mean: 

Facing the Error while opening the PDF Document generated by Adobe Forms

sushil_rathi
Explorer
0 Kudos

Hi,

I have created an Custom Adobe Form and calling this form through a Custom Program and generating the PDF and could able to download on to my desktop but when i am tyring to open it i m facing the below Error.

"There was an error opening this document. The file is damaged and could not be repaired" .

Please help me in this regard ASAP.

Please do find the attached error screen shot.

Thanks

Sushil

Accepted Solutions (0)

Answers (1)

Answers (1)

navip
Active Participant
0 Kudos
sushil_rathi
Explorer
0 Kudos

Hi Naveen ,

Have done as per the link but still not opening

same error.

I have created a print program and from there want to generate pdf. But it is not working.

please find the below code : In this i am passing some tables to function module and output is formoutput of type fpformoutput.


Where do i need to do any changes if required.

data: lst_opparam     type sfpoutputparams.

   data: lst_docparam    type sfpdocparams.

   data: lfd_fname type funcname.

   data: lrf_cx_root     type ref to cx_root.

   clear: lst_opparam, lst_docparam.

   lst_opparam-getpdf   = 'X'.

   lst_opparam-preview = 'X'.

*  lst_opparam-nodialog   = 'X'.

   call function 'FP_JOB_OPEN'

     changing

       ie_outputparams       = lst_opparam

  exceptions

    cancel                = 1

    usage_error           = 2

    system_error          = 3

    internal_error        = 4

    others                = 5

             .

   if sy-subrc <> 0.

* Implement suitable error handling here

   endif.

   try.

       call function 'FP_FUNCTION_MODULE_NAME'

         exporting

           i_name     = 'ZAFGLERC001'

         importing

           e_funcname = lfd_fname.

*   E_INTERFACE_TYPE           =

*   EV_FUNCNAME_INBOUND        =

     catch cx_root into lrf_cx_root.

   endtry.

   lst_docparam-langu = 'EN'.

   lst_docparam-country = 'IN'.

call function lfd_fname      "   '/1BCDWB/SM00000213'

  exporting

    /1bcdwb/docparams        = lst_docparam

    appl                     = 'EREC_ONBRD'

    wa_ztbglerc049           = wa_ztbglerc049

    wa_ztbglerc050           = wa_ztbglerc050

    it_51                    = it_51

    wa_41                    = wa_41

    it_42                    = it_42

    wa_43                    = wa_43

    it_44                    = it_44

    it_45                    = it_45

    it_46                    = it_46

    it_47                    = it_47

    it_48                    = it_48

  importing

    /1bcdwb/formoutput       = formoutput

  exceptions

    usage_error              = 1

    system_error             = 2

    internal_error           = 3

    others                   = 4

           .

if sy-subrc <> 0.

* Implement suitable error handling here

endif.

   call function 'FP_JOB_CLOSE'

* IMPORTING

*   E_RESULT             =

exceptions

  usage_error          = 1

  system_error         = 2

  internal_error       = 3

  others               = 4

             .

   if sy-subrc <> 0.

* Implement suitable error handling here

   endif.

navip
Active Participant
sushil_rathi
Explorer
0 Kudos

Dear Navneen,

As you see, in above code.

I am getting some value in  formoutput-pdf .

What should i do to get it displayed when the program is executed.

Please let me know is there any other value which i need to specify.

I have seen the above links which you have send. I am currently not using any browser for generating pdf.

Thanks and Regards

Sushil Rathi

Former Member
0 Kudos

Hi,

Please try as below.

Data:lt_pdf type solix_tab.

lt_pdf = cl_document_bcs=>xstring_to_solix(

  ip_xstring = formoutput-pdf ).

Then call GUI_DOWNLOAD with file_type as 'BIN' passing lt_pdf as data_tab.

It would work.