06-15-2022 2:52 PM
Hello together,
I try to download an attachment for an invoice from the Archive (Archivelink).
I tried it with FM SCMS_DOC_READ but without success.
I tried it also with other Function Modules (a.o. ARCHIV_GET_TABLE), also without success.
My coding is as following:
CONCATENATE gs_invoices-vbeln '%' INTO gv_vergleich.
SELECT SINGLE object_id arc_doc_id archiv_id reserve
FROM toa01
INTO ( lv_object_id, lw_connections-arc_doc_id, lw_connections-archiv_id, lv_document_type )
WHERE object_id LIKE gv_vergleich.
CALL FUNCTION 'SCMS_DOC_READ'
EXPORTING
mandt = sy-mandt
stor_cat = ' '
crep_id = lw_connections-archiv_id
doc_id = lw_connections-arc_doc_id
TABLES
access_info = lt_info
content_txt = lt_content_txt_1022
content_bin = lt_content_bin_1022
EXCEPTIONS
bad_storage_type = 1
bad_request = 2
unauthorized = 3
comp_not_found = 4
not_found = 5
forbidden = 6
conflict = 7
internal_server_error = 8
error_http = 9
error_signature = 10
error_config = 11
error_format = 12
error_parameter = 13
error = 14
OTHERS = 15.
If you can help with with any hint I would be lucky!
Kind regards
Udo
06-15-2022 6:41 PM
When you use the SAP ERP programs to get the archive and you trace the URL, is it the same URL that you access?
Trace using ICF recording – a possibility for analysing | SAP Blogs
Here's excerpt from blog post:
NB: personally, I don't use SICFRECORDER, but it's the same: Tr. SICF -> Client -> Recorder -> Display Recording -> button ‘Client request’
06-16-2022 7:32 AM
It's no problem of the URL anymore.
I debugged the program and the part with the URL worked correct.
06-16-2022 7:36 AM
Alternatively I tried also function module ARCHIVOBJECT_GET_TABLE.
There is written an output-dataset (parameter binarchivobject), but in the end I cannot open the sent mail-attachment.
Here for your reference also the coding:
CALL FUNCTION 'ARCHIVOBJECT_GET_TABLE'
EXPORTINGKind regards
Udo
06-16-2022 7:40 AM
So, you're saying that SCMS_DOC_READ accesses the same URL as in real situation, so the parameters you pass are mostly correct, SAP gets the document successfully, but after that you are saying that it fails.
What exception do you get? Also provide the values of SY-MSGID, SY-MSGNO, and all SY-MSGV*.
06-17-2022 10:00 AM
Hi Sandra,
I don't get any exception from SCMS_DOC_READ.
Also the variables SY-MSGID, SY-MSGNO, and all SY-MSGV* are empty. 😞
Kind regards
Udo