Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Function module to find the attachment list for an accounting document?

Former Member
0 Kudos

Is there a function module to find the attachment list for an accounting document? Or which table stores such references?

I know I can find this info from the transaction FB03, but is there a function module to find the attachments for an accounting document? So far I only found the attachments are stored in the table SOOD, and archived documents in table TOA03, but I can't find the table that stores the links between the accounting document and its attachments?

<b><REMOVED BY MODERATOR></b>

Thanks,

Ning

Message was edited by:

Alvaro Tejada Galindo

1 ACCEPTED SOLUTION

former_member194669
Active Contributor

Hi,


  i_object1-typeid = 'YARSATTA'.  "<<< Give your Object id name
  i_object1-catid  = 'BO'.
  i_object1-instid = i_yarsitem-docno.    "<<<< Document Number
  call method cl_gos_attachment_query=>count_for_object
    exporting
     is_object = i_object1
     ip_arl    = space
    receiving
     rt_stat   = i_stat1.
  read table i_stat1 into wa_stat1 index 1.
  if sy-subrc eq c_0.
     move wa_stat1-counter to v_attno1.
  endif.

For link you need to check for table SRGBTBREL

and also please check class CL_GOS*

2 REPLIES 2

former_member194669
Active Contributor

Hi,


  i_object1-typeid = 'YARSATTA'.  "<<< Give your Object id name
  i_object1-catid  = 'BO'.
  i_object1-instid = i_yarsitem-docno.    "<<<< Document Number
  call method cl_gos_attachment_query=>count_for_object
    exporting
     is_object = i_object1
     ip_arl    = space
    receiving
     rt_stat   = i_stat1.
  read table i_stat1 into wa_stat1 index 1.
  if sy-subrc eq c_0.
     move wa_stat1-counter to v_attno1.
  endif.

For link you need to check for table SRGBTBREL

and also please check class CL_GOS*

0 Kudos

Thanks ARS! That's the answer I was looking for.