07-12-2016 2:42 PM
Hi experts,
In a request, I have to enhance the program RFBUEB00 to retrieve the list of all attachments linked to a FI document in order to add 2 columns in the ALV report.
For that, I use the class method CL_BINARY_RELATION->READ_LINKS_OF_BINRELS.
The problem is that method don't take into account all the attachments we can found in FB03>Attachment List. In my case I have 5 attachments in FB03 (1 URL, 1 note, 1 MS Word document, 2 Archived documents):
The method doesn't retrieve the Archived documents. The output table contains only 3 entries:
I noticed, by debugging FB03, that the documents found by the method have a TYPEID_B = CL_MSG_AL_ITEM (Service MSGLINK).
The documents not found by the method have a TYPEID_B = CL_ARL_AL_ITEM (Service ARLLNKSRV).
Do you know why all the attachments are not retrieved? And have you a method, FM or advice to get all these attachments?
Thanks in advance,
Guillaume
07-12-2016 6:29 PM
The SAPoffice documents are linked to business objects via the Object Relationship Service tables (access via the class CL_BINARY_RELATION).
The archived documents are Logical Documents linked to business objects via the connection tables of the Content Management System (access via the class CL_ALINK_CONNECTION).
07-12-2016 4:15 PM
07-12-2016 6:29 PM
The SAPoffice documents are linked to business objects via the Object Relationship Service tables (access via the class CL_BINARY_RELATION).
The archived documents are Logical Documents linked to business objects via the connection tables of the Content Management System (access via the class CL_ALINK_CONNECTION).
07-13-2016 2:13 PM
Thank you! With the method CL_ALINK_CONNECTION->FIND( ), I can retrieve my 2 missing attachments.
But is there a Table or a FM to retrieve the name (or description, or more info) of these archived document based on the ARC_DOC_ID?
07-14-2016 1:15 PM
Hi
All informations you can have are from Document Type (AR_OBJECT):
if a file is stored by SAP archiving, it'll be assigned to a certain document type, so try to get information from table TOADV
Else you can only upload the file
It can use fm ARCHIVOBJECT_DISPLAY in order to display it or ARCHIVOBJECT_GET_URI to get the url of the file....and so on
Max
07-18-2016 4:29 PM
Thank you, this is what I was looking for.
I take this opportunity to precise that I had another problem, resolve with colleagues: some attachments did not still appear. Actually they was attached to the MM document (linked to this FI document). Now with the field AWKEY I can fetch these missing attachments.
04-06-2023 8:24 AM
To get the list of archived attachments for an object, use FM ARCHIV_GET_CONNECTIONS. Importing parameters for fetching archived attachments of FI document will be:
OBJECTTYPE = 'BKPF'
OBJECT_ID = '<BUKRS><FI doc number><Fiscal year>'
If there are attachments in the object linked with the FI document, e.g. vendor invoice, then fetch the linked object number from BKPF-AWKEY. use this as object id. The object type will be BUS2081 for vendor invoice. If the attachment for vendor invoice is stored in GOS/BDS, then you can use the following FMs: BAPI_REL_GETRELATIONS/BDS_PHIOS_GET_RIGHT respecitvely.