Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Error retrieving archived object

Former Member
0 Kudos

Scenario: upload any file from desktop, convert to PDF utilizing a web service, archive the object in Documentum via archivelink. Then to display, call function module ARCHIVOBJECT_DISPLAY.

During the conversion to PDF, I convert the uploaded file ( a small .txt file uploaded as binary into table of structure tbl1024) to xstring. I then call the PDF conversion web service and get back a different XSTRING value. I then utilize FM SCMS_XSTRING_TO_BINARY to put the converted XSTRING content back into a table of structure tbl1024. When I call EFG_DISPLAY_PDF using that converted XSTRING, I have a PDF display.

After calling FM ARCHIVOBJECT_CREATE_TABLE, followed by ARCHIV_CONNECTION_INSERT, I see my entry in TOA01 and I have zero return codes in each step. It appears that I successfully archived a file. However, it appears that in Documentum this is creating files with 0 bytes length. This is supported by results from FM ARCHIVOBJECT_DISPLAY, which always responds with corrupted file or unsupported file type. In one instance, it told me that I was missing component DATA1. Can anyone suggest what I might be doing incorrectly in constructing the binary table, or a better way to do this?

Based on what I have seen in other code, I'm doing:

call function 'ARCHIVOBJECT_CREATE_TABLE'
      exporting
        archiv_id                      = 'C3'
        arc_doc_id                   = lv_doc_id        "Short Document No.
        document_type            = 'PDF'
    importing
       archiv_doc_id             = lv_arc_doc_id  "always get back a ID
     tables
      binarchivobject            = lt_arcdata  "structure tbl1024
     exceptions
       error_archiv                   = 1
       error_communicationtable       = 2
       error_kernel                   = 3
       others                         = 4.

call function 'ARCHIV_CONNECTION_INSERT'
      exporting
        archiv_id              = 'C3' 
        arc_doc_id          = lv_arc_doc_id  "created above
        ar_date               = sy-datum
        ar_object            = 'ZEACORRES3'
        object_id             = lv_refr_no2    "longer version of Document No.
        sap_object          = lv_sap_obj     "CLAIM
        doc_type             = 'PDF'
      exceptions
        error_connectiontable = 1
        others                = 2.

4 REPLIES 4

Former Member
0 Kudos

Hi BP ,

can u try to send file length ..rest of the code looks okay .



call function 'ARCHIVOBJECT_CREATE_TABLE'
      exporting
        archiv_id                      = 'C3'
        arc_doc_id                   = lv_doc_id        "Short Document No.
        flength                          = l_length           "Added by Prabhu 
        document_type            = 'PDF'
    importing
       archiv_doc_id             = lv_arc_doc_id  "always get back a ID
     tables
      binarchivobject            = lt_arcdata  "structure tbl1024
     exceptions
       error_archiv                   = 1
       error_communicationtable       = 2
       error_kernel                   = 3
       others                         = 4.


0 Kudos

Yes, will try to add file length. I should add that I have also doubted the PDF conversion step, so I added the PDF display to verify that the converted xstring would display as a PDF, and looked closely at the table created in the xstring to binary step, to be sure the data in that table mirrors the xstring.... I'll update after trying that. What is puzzling is that SAP "sees" a successful end to every step, Documentum is issuing the document id no., but I don't have a good attachment in Documentum at the end. I've asked for any logs that might have been created on the Documentum side...perhaps there's something there.

0 Kudos

Hi BP ,

agree with you , i also doubted that PDF conversion step , to double confirm that assume ..y dont you skip the PDF converstion step and see if the required document is attached to the Arch Object or not ?....

i

regards

Prabhu

0 Kudos

Thanks for the response. As it turns out, Documentum (adminstered by another group) had some problem...Although initial connection tests in SAP development instance were successful (via OAC0), I began getting 500 internal server errors yesterday. After working with the team for a day, Documentum is again connected, and I was able to attach a .txt file from desktop and display as a PDF. So, appears problem was somewhere between SAP and Documentum...