Skip to Content
avatar image
Former Member

Download PDF File from Archiv to SAP Application Server

Hi,

I need to download the PDF file from an NAST-Dataset (how is stored from the message via SAP ArchivLink) to the SAP Application Server.

1) At first i read the Archiv-Link data via function module WFMC_GET_ARCHIVE_OBJECT_TYPE

2) Then i get the Connection-Infos via function module ARCHIV_GET_CONNECTIONS_INT

3) Now i read the file from archiv as table via function module ARCHIVOBJECT_GET_BYTES

4) Save to the SAP Appl.Server via:

- OPEN DATASET ld_dpfad FOR OUTPUT IN BINARY MODE

- LOOP and TRANSFER lf_archivobject TO ld_dpfad.

- CLOSE DATASET ld_dpfad.

In the dialog of NAST-Dataset (Messages) i can open the PDF-File without any errors (display originals). But after the filetransfer to the SAP Appl.Server i get the following errors during the file opening dialog from Adobe Acrobat Reader:

- the embedded font u201CArialu201D cant to be extract

- not enough data for the picture

The reader can display the PDF-File but only without the picture (Logo) and with alternative font.

The same transfer from archiv and sending as an attachement to the BOR-Object via function module SO_DOCUMENT_INSERT_API1 works very fine and without any errors.

Can any one please help me to solve this Issue?

Thanks in Advance,

Thomas

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Apr 21, 2010 at 10:24 PM

    Hello Thomas

    In a previous project we used:

    1) FUNCTION 'ARCHIVOBJECT_GET_TABLE' - receiving the data as RAW in TABLES parameter binarchivobject, and also importing LENGTH

    2) then we used FUNCTION 'SCMS_BINARY_TO_XSTRING' - exporting the RAW variable in TABLES param binary_tab and LENGTH in parameter input_length -- receiving xstring data back in parameter BUFFER.

    BUFFER was fed to a Web Dynpro UI Adobe UI element and it displayed fine. I hope this might help you.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hello Keith,

      Many thanks for your answer.

      In the past i didnu2019t need the BINARCHIVOBJECT-Parameter and so i overlook this option.

      Now, the File looks a little bit different, but only in the STREAM-section.

      During the Fileopen-Dialog i get only one message now - "not enough data for image" and the image will not displayed. The rest seems to be correct.

      The relevant coding is now:

      ld_doc_typ = pf_connections-reserve.

      CALL FUNCTION 'ARCHIVOBJECT_GET_BYTES'

      EXPORTING

      archiv_id = pf_connections-archiv_id

      archiv_doc_id = pf_connections-arc_doc_id

      document_type = ld_doc_typ

      length = ld_length1

      offset = ld_offset

      IMPORTING

      binlength = ld_length

      offset = ld_offset

      TABLES

      binarchivobject = lt_binarchivobj

      EXCEPTIONS

      error_archiv = 1

      error_communicationtable = 2

      error_kernel = 3

      OTHERS = 4.

      • Zieldatei zum Schreiben öffnen

      OPEN DATASET ld_dpfad FOR OUTPUT IN BINARY MODE.

      • Inhalte in Zieldatei schreiben

      LOOP AT lt_binarchivobj INTO lf_binarchivobj.

      TRANSFER lf_binarchivobj TO ld_dpfad NO END OF LINE.

      ENDLOOP.

      • Zieldatei schließen

      CLOSE DATASET ld_dpfad.

      Where is the error for the image data?

      Ciao Thomas

      Push up by: Thomas Engler on May 3, 2010 4:54 PM