cancel
Showing results for 
Search instead for 
Did you mean: 

Download file from OPEN Text system

Former Member

Hi guys,

I had a query which i will require you to help me with.

The requirement is to download the attached document from the open text server.

Currently i am using the following function modules to get the URL of the file and display it to the user (which is happening correctly) :

1. CALL FUNCTION 'ARCHIVELINK_URL_GENERATE'
2. CALL FUNCTION '/IXOS/DC46_V_URL_DISPLAY'

As per the new requirements, I need to download the file to a specific path. Can someone please help me?

Thanks in advance,

Devrath Sampat

Accepted Solutions (1)

Accepted Solutions (1)

benedikt_wagner_mdt
Active Participant

Hi Devrath,

Use SCMS_DOC_INFO (CREP_ID = archive id, DOC_ID ) to get the component name of a document and then SCMS_HTTP_GET_FILE (CREP_ID, DOC_ID, COMP_ID, PATH, FRONTEND) to save it on frontend or server.

Regards,

Benedikt

Former Member
0 Kudos

Hi Benedikt,

Thank you for the quick response. I will try it out and let you know.

Regards,

Devrath

Former Member
0 Kudos

Hi Benedikt,

I am trying to pass archive ID (TOA01-ARCHIV_ID) to SCMS_DOC_INFO (crep id) but I am getting error document not found even though it exists in the table. Can you please help me with any standard T Codes where i can check its data . Open text is kind of new to me.

Thanks and Regards

Devrath

benedikt_wagner_mdt
Active Participant
0 Kudos

Hi Devrath,

what table do you mean? Normally ArchiveLink information is stored in "connection tables" TOA01, TOA02, TOA03. For SCMS_DOC_INFO you have to provide TOA01-ARCHIV_ID for CREP_ID and TOA01-ARC_DOC_ID for DOC_ID. If you test this in transaction SE37, please check the Uppercase/Lowercase flag if you have docids with lower-case characters.

Regards,

Benedikt

Former Member
0 Kudos

Hi Benedikt ,

Using the function modules I am able to download a file. Will implement the same as per the requirements in the ABAP program. Thanks a lot for your response and it looks correct as of now. Will get back to you if am stuck.

Thanks

Devrath

Former Member
0 Kudos

Hi Benedikt,

Your method is correct and i am reciving two components for each document. One is data1 and one is note and data1 contains the attachment.

Is there any way I can identify the exact file name for data1??

Regards

Devrath

benedikt_wagner_mdt
Active Participant
0 Kudos

Hi Devrath,

ArchiveLink documents do not have a name in the archiving system. The main component is always called "data" or "data1". And then there are additional components like "note" or "anno.ixos" etc.

Using note 1451769 the filenames of uploaded documents (object services, create..., store business document) are stored in table TOAAT.

Names are stored in archiving system only for KPro scenario e. g. using SAP DMS (CV00).

Regards,

Benedikt

Former Member
0 Kudos

Thank you for the usefule information.

Have a nice day.

Answers (1)

Answers (1)

SandySingh
Active Contributor
0 Kudos

Hello Devrath,

You can make use of following Func Modules

SCMS_DOC_READ

SCMS_DOC_INFO

SCMS_DOC_UPDATE

SCMS_DOC_URL_READ

SCMS_HTTP_DOC_GET_FILES – download archived document

SCMS_HTTP_CREATE_FILES   – upload new document

ARCHIV_CONNECTION_INSERT – create new ArchiveLink connection

ARCHIV_DELETE_META – delete ArchiveLink connection

ARCHIV_GET_CONNECTIONS – list ArchiveLink connections

Sample code


call function 'ALINK_RFC_DOCUMENTS_GET' - Read Archive link Document

        exporting

          im_botype        = rmpsd_const_objtype_post

          im_boid          = l_objkey_post

*   IM_X_URLS        =

* IMPORTING

*   EX_MESSAGE       =

       tables

         ex_results       = lt_related_objects .

*   EX_URLS          =

      loop at lt_related_objects into wa_related_objects .

* No multiple links supported!

        exit .

      endloop .

* Get file extension

      call method cl_rmps_general_functions=>get_extension_from_mime

        exporting

          im_mime_type      = wa_related_objects -mimetype

        receiving

          re_file_extension = wa_content -doc_type

        exceptions

          nothing_found     = 1

          others            = 2.

      if sy-subrc <> 0.

* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

*            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

      endif .

* Get linked objects

      call function 'ALINK_RFC_TABLE_GET'

        exporting

          im_docid          = wa_related_objects- docid

          im_crepid         = wa_related_objects -crepid

*         IM_COMPID         =

        importing

          ex_length         = wa_content -docsize

*         EX_MESSAGE        =

        tables

          ex_document       = lt_content_1024 .

      call method cl_rmps_general_functions=>convert_1024_to_255

        exporting

          im_tab_1024 = lt_content_1024

        receiving

          re_tab_255  = wa_content -cont_hex.

      wa_content- binary = if_srm =>true.

      append wa_content to re_tab_content .

Regards

Sandy

Former Member
0 Kudos

Hi Sandy,

Thank you for the quick response. I will try it out and let you know.

Regards,

Devrath

janosdezsi
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Devrath,

please be aware of that in ArchiveLink environment the content repository names can be only 2 characters long, so you might face a problem. Use the more generic KPro CMS function modules instead. (And anyways ArchiveLink also uses the KPro CMS.)

Best regards,

Janos

Former Member
0 Kudos

Thank you for your response. My problem got solved using SCMS FM's. will try your suggestion too tho.