<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Archivobject_get_table returns empty table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/archivobject-get-table-returns-empty-table/m-p/417009#M11316</link>
    <description>&lt;P&gt;I solved it myself. &lt;/P&gt;&lt;P&gt;Apparently, when using function 'ARCHIVOBJECT_TABLE_CREATE' and passing the file as binarchivobject, you need to pass the length parameter too, which you can get from the 'SCMS_XSTRING_TO_BIN' function. Doing this I were able to retrieve the file again.&lt;/P&gt;</description>
    <pubDate>Fri, 17 Mar 2017 15:18:27 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2017-03-17T15:18:27Z</dc:date>
    <item>
      <title>Archivobject_get_table returns empty table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/archivobject-get-table-returns-empty-table/m-p/417008#M11315</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I'm having trouble since I changed the archive process of PDFs to binary.&lt;/P&gt;&lt;P&gt;I have one programm which is reading a pdf in binary mode like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;"Step1 read pdf to xstring:
      OPEN DATASET im_filepath FOR INPUT IN BINARY MODE.
      DO.
        READ DATASET im_filepath INTO lf_tempxstr.
        IF sy-subrc &amp;lt;&amp;gt; 0.
          CONCATENATE lf_pdfxstr lf_tempxstr INTO lf_pdfxstr IN BYTE MODE.
          EXIT.
        ENDIF.
        CONCATENATE lf_pdfxstr lf_tempxstr INTO lf_pdfxstr IN BYTE MODE.
      ENDDO.
      CLOSE DATASET im_filepath.

"Step2 xstring to binary table:
 CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
    EXPORTING
      buffer     = lf_pdfxstr
    TABLES
      binary_tab = tb_binfile.

"Step 3 archiving:
CALL FUNCTION 'ARCHIVOBJECT_CREATE_TABLE'
    EXPORTING
      archiv_id                = pa_arcid
      document_type            = 'PDF'
    IMPORTING
      archiv_doc_id            = gs_inv-arcdocid
    TABLES
      binarchivobject          = tb_binfile
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This works without errors and I get an archiv_doc_id to the file.&lt;/P&gt;&lt;P&gt;In another program I try to retrieve the file from the archive again:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CALL FUNCTION 'ARCHIVOBJECT_GET_TABLE'
    EXPORTING
      archiv_id                = co_arc_id
      document_type            = 'PDF'
      archiv_doc_id            = gs_invdata-arcdocid
    TABLES
      binarchivobject          = lt_file_data
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This also works without errors, but the lt_file_data table remains empty. Can anyone help me and say what I am doing wrong here?&lt;/P&gt;&lt;P&gt;Best regards.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Mar 2017 09:41:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/archivobject-get-table-returns-empty-table/m-p/417008#M11315</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2017-03-17T09:41:39Z</dc:date>
    </item>
    <item>
      <title>Re: Archivobject_get_table returns empty table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/archivobject-get-table-returns-empty-table/m-p/417009#M11316</link>
      <description>&lt;P&gt;I solved it myself. &lt;/P&gt;&lt;P&gt;Apparently, when using function 'ARCHIVOBJECT_TABLE_CREATE' and passing the file as binarchivobject, you need to pass the length parameter too, which you can get from the 'SCMS_XSTRING_TO_BIN' function. Doing this I were able to retrieve the file again.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Mar 2017 15:18:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/archivobject-get-table-returns-empty-table/m-p/417009#M11316</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2017-03-17T15:18:27Z</dc:date>
    </item>
    <item>
      <title>Re: Archivobject_get_table returns empty table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/archivobject-get-table-returns-empty-table/m-p/417010#M11317</link>
      <description>&lt;P&gt;It worked for me. Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 07 Mar 2023 21:10:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/archivobject-get-table-returns-empty-table/m-p/417010#M11317</guid>
      <dc:creator>elias_jr</dc:creator>
      <dc:date>2023-03-07T21:10:51Z</dc:date>
    </item>
  </channel>
</rss>

