<?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 ArchiveLink - Problem when storing from program in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/archivelink-problem-when-storing-from-program/m-p/6801167#M1467484</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm encountering a problem with documents stored in IXOS and linked to a SAP object (BUS2105/purchase request in this case).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using FMs ARCHIV_CONNECTDEFINITION_GET, ARCHIVOBJECT_CREATE_FILE and ARCHIV_CONNECTION_INSERT to store the file and create the link with the related SAP Object.&lt;/P&gt;&lt;P&gt;The problem happens when we want to get the archived file from the attachement list of the SAP Object: the file extension (doc) is not recognized and we have to first download the file and rename it appending the correct extension.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If we attach a document using the same document type via SAPGUI / General Object Services, everything goes well, so it seems not to be related to ArchiveLink customizing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;These are some parts of the code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;...
* Get the file content using MIME-UPLOAD macro
  mime-upload 1 wt_data w$_filel.
...
*  Temporarly store the file on server
    OPEN DATASET wl_fname FOR OUTPUT IN BINARY MODE.
    LOOP AT wt_data.
      TRANSFER wt_data TO wl_fname.
    ENDLOOP.
    CLOSE DATASET wl_fname.
...
* Get the ArchiveLink parameters of these object/document types
    CALL FUNCTION 'ARCHIV_CONNECTDEFINITION_GET'
      EXPORTING
        objecttype    = cv_objecttype
        documenttype  = cv_documenttype
        client        = sy-mandt
      IMPORTING
        connection    = lv_connection
        archivid      = lv_archivid.
...
 CALL FUNCTION 'ARCHIVOBJECT_CREATE_FILE'
      EXPORTING
        archiv_id                = lv_archivid
        document_type            = cv_doctype
        path                     = lv_path
      IMPORTING
        archiv_doc_id            = lv_archiv_doc_id.
...
CALL FUNCTION 'ARCHIV_CONNECTION_INSERT'
      EXPORTING
        ARCHIV_ID                   = lv_archivid
        arc_doc_id                  = lv_archiv_doc_id
        AR_DATE                     = sy-datum
        ar_object                   = cv_documenttype
        object_id                   = lv_objectID
        sap_object                  = cv_objecttype
        DOC_TYPE                    = cv_doctype.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Does anyone see where could be the mistake?&lt;/P&gt;&lt;P&gt;Many thanks in advance for any information that could help!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jerome.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 19 Apr 2010 13:07:03 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-04-19T13:07:03Z</dc:date>
    <item>
      <title>ArchiveLink - Problem when storing from program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/archivelink-problem-when-storing-from-program/m-p/6801167#M1467484</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm encountering a problem with documents stored in IXOS and linked to a SAP object (BUS2105/purchase request in this case).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using FMs ARCHIV_CONNECTDEFINITION_GET, ARCHIVOBJECT_CREATE_FILE and ARCHIV_CONNECTION_INSERT to store the file and create the link with the related SAP Object.&lt;/P&gt;&lt;P&gt;The problem happens when we want to get the archived file from the attachement list of the SAP Object: the file extension (doc) is not recognized and we have to first download the file and rename it appending the correct extension.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If we attach a document using the same document type via SAPGUI / General Object Services, everything goes well, so it seems not to be related to ArchiveLink customizing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;These are some parts of the code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;...
* Get the file content using MIME-UPLOAD macro
  mime-upload 1 wt_data w$_filel.
...
*  Temporarly store the file on server
    OPEN DATASET wl_fname FOR OUTPUT IN BINARY MODE.
    LOOP AT wt_data.
      TRANSFER wt_data TO wl_fname.
    ENDLOOP.
    CLOSE DATASET wl_fname.
...
* Get the ArchiveLink parameters of these object/document types
    CALL FUNCTION 'ARCHIV_CONNECTDEFINITION_GET'
      EXPORTING
        objecttype    = cv_objecttype
        documenttype  = cv_documenttype
        client        = sy-mandt
      IMPORTING
        connection    = lv_connection
        archivid      = lv_archivid.
...
 CALL FUNCTION 'ARCHIVOBJECT_CREATE_FILE'
      EXPORTING
        archiv_id                = lv_archivid
        document_type            = cv_doctype
        path                     = lv_path
      IMPORTING
        archiv_doc_id            = lv_archiv_doc_id.
...
CALL FUNCTION 'ARCHIV_CONNECTION_INSERT'
      EXPORTING
        ARCHIV_ID                   = lv_archivid
        arc_doc_id                  = lv_archiv_doc_id
        AR_DATE                     = sy-datum
        ar_object                   = cv_documenttype
        object_id                   = lv_objectID
        sap_object                  = cv_objecttype
        DOC_TYPE                    = cv_doctype.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Does anyone see where could be the mistake?&lt;/P&gt;&lt;P&gt;Many thanks in advance for any information that could help!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jerome.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Apr 2010 13:07:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/archivelink-problem-when-storing-from-program/m-p/6801167#M1467484</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-19T13:07:03Z</dc:date>
    </item>
    <item>
      <title>Re: ArchiveLink - Problem when storing from program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/archivelink-problem-when-storing-from-program/m-p/6801168#M1467485</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello , &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;y u need to save file contents in appserver ? , what u can do if you are uploading files from PC&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;  
1*---Get File Name &amp;amp; contents......

    clear l_lines.
*--- File Size.

2.determine file size...

    describe table lt_content lines l_lines.
    l_supposed_length = l_lines * 1022.
*---Convert into RAW1024 format.
    refresh : lt_docs.

3....Convert into RAW

    call function 'SLVC_X1022_TO_X1024'
      exporting
        i_file_length = l_supposed_length
      tables
        et_x1024      = lt_docs[]
        it_x1022      = lt_content[].

4...
*---Create ALink
    call function 'ARCHIV_CREATE_TABLE'
      exporting
        ar_object       = p_link-ar_object "'ZGLACCR'
        object_id       = p_link-object_id "'B72890000001522009'
        sap_object      = p_link-sap_object"'YFIE_00007'
        flength         = l_length
        doc_type        = l_doc_type
      importing
        outdoc          = l_outdoc
      tables
        binarchivobject = lt_docs.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;try this and let me know if you have any Q's.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Prabhu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Apr 2010 05:44:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/archivelink-problem-when-storing-from-program/m-p/6801168#M1467485</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-20T05:44:47Z</dc:date>
    </item>
    <item>
      <title>Re: ArchiveLink - Problem when storing from program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/archivelink-problem-when-storing-from-program/m-p/6801169#M1467486</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Prabhu,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I forgot to mention that the program is running in an ITS context. The file content is retreived  using the mime-upload macro.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nethertheless I've tryied your solution but it's getting worse. Now I'm not able to open the file anymore.&lt;/P&gt;&lt;P&gt;The File extension is still missing and now word cannot open the file even by adding the file extension.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any idee?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Jerome.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Support TAS SC-TAS on Apr 20, 2010 1:47 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Apr 2010 09:17:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/archivelink-problem-when-storing-from-program/m-p/6801169#M1467486</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-20T09:17:51Z</dc:date>
    </item>
    <item>
      <title>Re: ArchiveLink - Problem when storing from program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/archivelink-problem-when-storing-from-program/m-p/6801170#M1467487</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I permit to up this thread as we didn't find any solution yet.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance for any help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jerome.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Apr 2010 09:15:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/archivelink-problem-when-storing-from-program/m-p/6801170#M1467487</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-26T09:15:16Z</dc:date>
    </item>
    <item>
      <title>Re: ArchiveLink - Problem when storing from program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/archivelink-problem-when-storing-from-program/m-p/6801171#M1467488</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem could be solved by following the note 987267.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jerome.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 May 2010 08:29:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/archivelink-problem-when-storing-from-program/m-p/6801171#M1467488</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-05-03T08:29:06Z</dc:date>
    </item>
  </channel>
</rss>

