How to Find attachments in SAP documents…..!!!
* To check if the document contains any attachments. *
In many scenario we need to check if the document contains any attachments and I have also explored and found one function module which works for all documents types.
The name of function module is ARCHIV_GET_CONNECTIONS
1. To check if Purchase order contains any attachment.
- Execute Function module ARCHIV_GET_CONNECTIONS in transaction code SE37
- Pass Purchase order number 2454358315 as OBJECT_ID
- Press Execute (F8)
- You can see as shown in below snap shot marked in yellow color count is 1. It means that the document contains an attachment.
· If you click on CONNECTIONS internal Table It will gives you the details about attached document type here it is word doc in purchase order as shown in below snap shot.
2. To check if Purchase Requisition contains any attachment.
- Execute Function module ARCHIV_GET_CONNECTIONS in transaction code SE37
- Pass Purchase Req number 2080014745 as OBJECT_ID
- Press Execute (F8)
- You can see as shown in below snap shot marked in yellow color count is 3. It means that the document contains three attachments.
- If you click on CONNECTIONS internal Table It gives the details about attached document type here it is word doc,xls and PDF in purchase requisition as shown in below snap shot.
If you want to find all the Purchase orders which have attachments then you can use the FM as shown in below snap shot.
Pass EKKO table name as OBJECTTYPE
Execte(F8). It will give all the PO which contains attachment.
In similar way you can pass the table name as OBJECTTYPE to this FM. It will give you that total attached documents.
Good document !!! keep sharing your knowledge..
Hi,
Although this is perfect FM, this is "Not Released". 🙁
This has a performance problem at this place when it calls 'APPEND_CONDITION' (CLASS - 'CL_ALINK_CONNECTION' ) it does query using 'LIKE' by appending wild card char "*" at the end of Object id.
Are you aware of alternative Method / FM that can be used which does not have this kind of performance problem?
I tried to look on SCN etc. didnt find anything yet.
Appreciate your help.
Thanks,
Nilay
HI Nilay,
Can you please tell where are you using this FM and your system's version?
I do not know other menthod or FM. Let me know your scope/requirement , will explore according.
Regards,
PrAvIn
Hey Pravin,
Sure. I am trying to use this FM, to find how many attachments my Business Object has in my report. If it has just one, I display it using params connections-arc_doc_id & connections-archiv_id received from 'ARCHIV_GET_CONNECTIONS' and call FM 'ARCHIVOBJECT_DISPLAY' to display it. Even this FM is "Not Released".
The requirement is to use only "Released" FMs/Methods to perform this operation.
The system's version that I need to support is ECC6.0 and above.
Please let me know if you need any additional info. Hope this helps.
Thanks,
Nilay
Good Document
Do you have an idea, how can we fetch Notes attached in PO
In PO, Create---> Create Note