Checking for Attachments with GOS?
I have sucessfully used GOS to create my own object type, and have used the functionality to add attachments. Is there anyway of checking to see if a particular object has any attachments (i.e. - returning a flag that tells you if the object has documents attached or not?)
Thanks for any suggestions.
1. Check for relation ship table SRGBTBREL
2. pl. check the following code for counting number of attachment in a object
i_object1-typeid = 'YBUS2012'. i_object1-catid = 'BO'. i_object1-instid = i_ybus2012-docno. 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.
Here v_attno1 contains the no of attachment found in the object id