Skip to Content
Author's profile photo Former Member

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

/wp-content/uploads/2014/03/1_405147.png

  • 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.

/wp-content/uploads/2014/03/2_405148.png

·  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.

/wp-content/uploads/2014/03/3_405161.png

   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

/wp-content/uploads/2014/03/4_405163.png

  • 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.

/wp-content/uploads/2014/03/5_405170.png

  • 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.

/wp-content/uploads/2014/03/6_405171.png

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

/wp-content/uploads/2014/03/7_405172.png

Execte(F8). It will give all the PO which contains attachment.

/wp-content/uploads/2014/03/8_405176.png

In similar way you can pass the table name as OBJECTTYPE to this FM. It will give you that total attached documents.

Assigned Tags

      5 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member

      Good document !!! keep sharing your knowledge..

      Author's profile photo Former Member
      Former Member

      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

      Author's profile photo Former Member
      Former Member
      Blog Post Author

      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

      Author's profile photo Former Member
      Former Member

      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

      Author's profile photo A Raghuveer
      A Raghuveer

      Good Document
      Do you have an idea, how can we fetch Notes attached in PO
      In PO, Create---> Create Note