Skip to Content
1
Apr 16, 2010 at 08:42 AM

Archived PDF could not be opened after downloaded to PC

258 Views

Hi

I am using FM ARCHIVOBJECT_GET_TABLE to get archived PDF into internal table and then using METHOD CL_GUI_FRONTEND_SERVICES=>GUI_DOWNLOAD to download this to PC.

Now when I try to open this PDF, it gives some error. Error reads

Adobe reader could not open "file.pdf" because it is either not a supported file type or because the file has been damaged (for example, it was sent as an email attachment and wasn't correctly decoded)

This was working fine in non unicode 4.7 system, but is not working after upgrade to unicode ECC 6.0 system.

The code is as follows,

*   Get document from archive
    CALL FUNCTION 'ARCHIVOBJECT_GET_TABLE'
      EXPORTING
        ARCHIV_ID                      = l_archiv_id
        DOCUMENT_TYPE                  = l_document_type
        ARCHIV_DOC_ID                  = l_archiv_doc_id
      IMPORTING
        LENGTH                         = l_sapb_length
      TABLES
        ARCHIVOBJECT                   = lt_tab
      EXCEPTIONS
        ERROR_ARCHIV                   = 1
        ERROR_COMMUNICATIONTABLE       = 2
        ERROR_KERNEL                   = 3
        OTHERS                         = 4.

   CALL METHOD CL_GUI_FRONTEND_SERVICES=>GUI_DOWNLOAD
      EXPORTING
        BIN_FILESIZE              = l_length
        FILENAME                  = l_filename
        FILETYPE                  = l_filetype
      CHANGING
        DATA_TAB                  = lt_tab
      EXCEPTIONS
        FILE_WRITE_ERROR          = 1
        NO_BATCH                  = 2
        GUI_REFUSE_FILETRANSFER   = 3
.....
 

Do we have to change any parameters or anything for unicode system?